diff --git a/.changeset/subagent-routing-provenance.md b/.changeset/subagent-routing-provenance.md new file mode 100644 index 000000000..337b1e3ed --- /dev/null +++ b/.changeset/subagent-routing-provenance.md @@ -0,0 +1,5 @@ +--- +"@pymodel/pythinker-code": minor +--- + +Subagent tasks and Dynamic Workflow results now record the profile, model, and routing source of each subagent, and a resumed subagent keeps the binding it was created with. diff --git a/apps/pythinker-code/dist-web/.web-bundle-manifest.json b/apps/pythinker-code/dist-web/.web-bundle-manifest.json index e551a095e..c4f251164 100644 --- a/apps/pythinker-code/dist-web/.web-bundle-manifest.json +++ b/apps/pythinker-code/dist-web/.web-bundle-manifest.json @@ -1,4 +1,4 @@ { - "sourceHash": "c3559f1b350b84cd73183ecca48c451946874033acb7af4738de205fdd4e4f7d", + "sourceHash": "e6fc28927badd164b21beb1a6062a6469618d97c34e823eaea23cbbb24594b6d", "sourceFileCount": 405 } diff --git a/apps/pythinker-code/dist-web/assets/CodeBlockNode-DRvGmu0B.js b/apps/pythinker-code/dist-web/assets/CodeBlockNode-BWayTGpE.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/CodeBlockNode-DRvGmu0B.js rename to apps/pythinker-code/dist-web/assets/CodeBlockNode-BWayTGpE.js index 590eed36d..b3443a24d 100644 --- a/apps/pythinker-code/dist-web/assets/CodeBlockNode-DRvGmu0B.js +++ b/apps/pythinker-code/dist-web/assets/CodeBlockNode-BWayTGpE.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-8mfmLWxL.js","assets/index-BK-wRR5p.js","assets/index-Hz7Ro1k-.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as zo,M as vl,bl as Ci,af as dl,bY as Mi,cc as Bi,b$ as ml,aU as O,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Co,aD as Ho,bE as ae,az as Li,cd as hn,c8 as vt,aI as No,aL as G,s as bn,aw as It,au as mt,bk as V,ce as Mo,u as oe,I as To,A as Oi,bJ as Ut,aY as pt,bL as cl,v as b,t as ye,bB as fl,bb as Me,q as k,b7 as $i,cf as zi,cg as gn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as j,cl as Bo,cm as Di,cn as Ai,co as jt,cp as Eo,bO as Ro,T as ji,G as qi,F as Fo,g as Wi,c7 as _i,b_ as Ii}from"./index-BK-wRR5p.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Po=!1,qt=null,Wt=null,_t=null;function Ui(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield xi(()=>import("./index-8mfmLWxL.js"),__vite__mapDeps([0,1,2]))),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Po?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Po=!0}).finally(()=>{qt=null}),qt)})})(Wt),Si(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Oo=(x,M,w)=>M in x?Vi(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,I=(x,M)=>{for(var w in M||(M={}))Yi.call(M,w)&&Oo(x,w,M[w]);if(Lo)for(var w of Lo(M))Qi.call(M,w)&&Oo(x,w,M[w]);return x},Ce=(x,M)=>Gi(x,Ji(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=vl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=O(!1),we=O(null),be=O(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(Y){var f,$;const yt=Y.target;(f=we.value)!=null&&f.contains(yt)||($=be.value)!=null&&$.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=ml(),ht=k(()=>w.showTooltips!==!1);function Ge(Y,f){ht.value&&_i(Y.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(Y){Ge(Y,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const pl=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Gt=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)>=((f=w.codeFontMax)!=null?f:100)});return(Y,f)=>(G(),oe(Fo,null,[w.showHeader?(G(),oe("div",Xi,[pt(Y.$slots,"header-left"),pt(Y.$slots,"header-right",{},()=>[b("div",Ki,[x.diffStats?(G(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",er,"-"+Me(x.diffStats.removed),1),b("span",tr,"+"+Me(x.diffStats.added),1)],8,Zi)):ye("",!0),w.showCopyButton?(G(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=$=>te("copy")),onMouseenter:f[1]||(f[1]=$=>gt($)),onFocus:f[2]||(f[2]=$=>gt($)),onMouseleave:Be,onBlur:Be},[x.copyText?(G(),oe("svg",or,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(G(),oe("svg",lr,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):ye("",!0),w.showCollapseButton?(G(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=$=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(G(),oe("svg",{style:It({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):ye("",!0),ie.value?(G(),oe("div",rr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Ro(r,["stop"]),onMouseenter:f[6]||(f[6]=$=>Ge($,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=$=>Ge($,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[qi('',1)])],40,ar),To(Wi,{name:"code-menu"},{default:Ut(()=>[ne.value?(G(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(G(),oe(Fo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:pl.value,onClick:f[8]||(f[8]=$=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ur),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=$=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,sr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Gt.value,onClick:f[10]||(f[10]=$=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):ye("",!0),w.showExpandButton?(G(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=$=>{E(),te("toggleExpand")})},[x.isExpanded?(G(),oe("svg",cr,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(G(),oe("svg",fr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(G(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=$=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),cl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(Y.$slots,"default")],2),[[fl,!!x.stream||!x.loading]]),cl(b("div",vr,[pt(Y.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[fl,!x.stream&&x.loading]]),b("span",mr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=zo(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=ml(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dpc5cBbQ.js","assets/index-C0iEUKAq.js","assets/index-Hz7Ro1k-.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as zo,M as vl,bl as Ci,af as dl,bY as Mi,cc as Bi,b$ as ml,aU as O,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Co,aD as Ho,bE as ae,az as Li,cd as hn,c8 as vt,aI as No,aL as G,s as bn,aw as It,au as mt,bk as V,ce as Mo,u as oe,I as To,A as Oi,bJ as Ut,aY as pt,bL as cl,v as b,t as ye,bB as fl,bb as Me,q as k,b7 as $i,cf as zi,cg as gn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as j,cl as Bo,cm as Di,cn as Ai,co as jt,cp as Eo,bO as Ro,T as ji,G as qi,F as Fo,g as Wi,c7 as _i,b_ as Ii}from"./index-C0iEUKAq.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Po=!1,qt=null,Wt=null,_t=null;function Ui(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield xi(()=>import("./index-Dpc5cBbQ.js"),__vite__mapDeps([0,1,2]))),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Po?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Po=!0}).finally(()=>{qt=null}),qt)})})(Wt),Si(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Oo=(x,M,w)=>M in x?Vi(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,I=(x,M)=>{for(var w in M||(M={}))Yi.call(M,w)&&Oo(x,w,M[w]);if(Lo)for(var w of Lo(M))Qi.call(M,w)&&Oo(x,w,M[w]);return x},Ce=(x,M)=>Gi(x,Ji(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=vl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=O(!1),we=O(null),be=O(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(Y){var f,$;const yt=Y.target;(f=we.value)!=null&&f.contains(yt)||($=be.value)!=null&&$.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=ml(),ht=k(()=>w.showTooltips!==!1);function Ge(Y,f){ht.value&&_i(Y.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(Y){Ge(Y,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const pl=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Gt=k(()=>{var Y,f;return!!Number.isFinite(w.codeFontSize)&&((Y=w.codeFontSize)!=null?Y:0)>=((f=w.codeFontMax)!=null?f:100)});return(Y,f)=>(G(),oe(Fo,null,[w.showHeader?(G(),oe("div",Xi,[pt(Y.$slots,"header-left"),pt(Y.$slots,"header-right",{},()=>[b("div",Ki,[x.diffStats?(G(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",er,"-"+Me(x.diffStats.removed),1),b("span",tr,"+"+Me(x.diffStats.added),1)],8,Zi)):ye("",!0),w.showCopyButton?(G(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=$=>te("copy")),onMouseenter:f[1]||(f[1]=$=>gt($)),onFocus:f[2]||(f[2]=$=>gt($)),onMouseleave:Be,onBlur:Be},[x.copyText?(G(),oe("svg",or,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(G(),oe("svg",lr,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):ye("",!0),w.showCollapseButton?(G(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=$=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=$=>Ge($,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(G(),oe("svg",{style:It({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):ye("",!0),ie.value?(G(),oe("div",rr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Ro(r,["stop"]),onMouseenter:f[6]||(f[6]=$=>Ge($,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=$=>Ge($,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[qi('',1)])],40,ar),To(Wi,{name:"code-menu"},{default:Ut(()=>[ne.value?(G(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(G(),oe(Fo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:pl.value,onClick:f[8]||(f[8]=$=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ur),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=$=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,sr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Gt.value,onClick:f[10]||(f[10]=$=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):ye("",!0),w.showExpandButton?(G(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=$=>{E(),te("toggleExpand")})},[x.isExpanded?(G(),oe("svg",cr,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(G(),oe("svg",fr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(G(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=$=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),cl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(Y.$slots,"default")],2),[[fl,!!x.stream||!x.loading]]),cl(b("div",vr,[pt(Y.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[fl,!x.stream&&x.loading]]),b("span",mr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=zo(vl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=ml(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith(" diff --git a/apps/pythinker-code/dist-web/assets/DesignSystemView-CVU88etb.js b/apps/pythinker-code/dist-web/assets/DesignSystemView-U5edWnzl.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/DesignSystemView-CVU88etb.js rename to apps/pythinker-code/dist-web/assets/DesignSystemView-U5edWnzl.js index 991ad2c89..0c4a79df9 100644 --- a/apps/pythinker-code/dist-web/assets/DesignSystemView-CVU88etb.js +++ b/apps/pythinker-code/dist-web/assets/DesignSystemView-U5edWnzl.js @@ -1,4 +1,4 @@ -import{M as x,aD as k,aI as C,aL as d,u as s,v as t,G as e,H as o,F as f,aX as g,bb as m,I as r,cx as z,bk as T,cy as S,cz as b,cA as B}from"./index-BK-wRR5p.js";const q={class:"ds-page"},I={class:"layout"},A={class:"content"},M={class:"content-inner"},H={id:"tokens"},L={class:"icon-sizes"},V={class:"sz"},D={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},P={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},W={class:"sz"},R={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},N={class:"icon-grid"},O={class:"icon-group-label"},E={class:"ic-name"},j={id:"primitives"},F={class:"stage-wrap"},K={class:"stage p col"},_={class:"demo-row"},G={class:"p-btn primary disabled"},J={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},Q={class:"stage-wrap"},Y={class:"stage p col"},X={class:"demo-row",style:{"font-size":"22px","line-height":"1"}},Z={class:"demo-row"},$={class:"p-thinking"},aa={class:"p-thinking"},ta={class:"stage-wrap"},da={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},sa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},ea={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},oa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},ia={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},la={id:"chat"},na={class:"stage-wrap"},ca={class:"stage p col",style:{"align-items":"center",background:"#fff"}},va={class:"demo-chat"},ra={class:"p-thinking"},ba={class:"p-action"},fa={class:"p-action-head"},pa={class:"p-ic",style:{color:"var(--p-accent)"},viewBox:"0 0 24 24",fill:"currentColor"},ha={class:"p-action warn"},ua={class:"p-action-head"},ga={class:"p-ic",style:{color:"var(--p-warning)"},viewBox:"0 0 24 24",fill:"currentColor"},ma=x({__name:"DesignSystemView",emits:["close"],setup(wa,{emit:w}){const y=w;function p(){y("close")}let v=null;function h(c){c.key==="Escape"&&p()}return k(()=>{document.addEventListener("keydown",h);const c=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;c.forEach(n=>{const i=n.getAttribute("href");if(!i)return;const u=document.getElementById(i.slice(1));u&&a.set(u,n)});let l=null;v=new IntersectionObserver(n=>{n.forEach(i=>{i.isIntersecting&&(l&&l.classList.remove("active"),l=a.get(i.target)??null,l&&l.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((n,i)=>v.observe(i)),c.length&&c[0].classList.add("active")}),C(()=>{document.removeEventListener("keydown",h),v&&(v.disconnect(),v=null)}),(c,a)=>(d(),s("div",q,[t("div",{class:"ds-topbar"},[t("button",{class:"ds-back",type:"button",onClick:p},"← Back"),a[0]||(a[0]=t("span",{class:"ds-topbar-title"},"Design system",-1))]),t("div",I,[a[46]||(a[46]=e('',1)),t("main",A,[t("div",M,[a[44]||(a[44]=e('
● Design System · v1.0

Pythinker Web Design System

This document defines the visual language and component specification for Pythinker Web — design tokens, component primitives, the chat interface, theming, and style rules. All UI work is grounded in it: unified, restrained, token-driven, and themeable.

Scope apps/pythinker-webComponent primitivesTheme 1 set · 4 customizable colorsLight / dark mode
i
This spec is the single reference when changing the web UI. Before adding or modifying a component, style, layout, or theme, read this document first; color, font, radius, spacing, shadow, z-index, and motion always use the §02 tokens, components reuse the §03 primitives, and the §06 style rules are followed.
01

Design Principles

Every UI decision traces back to the following principles. Pythinker Web is a local Agent tool for developers: quick scanning, long stretches of staring, often in the dark — the design serves the task, and is restrained, clinical, and density-first.

Brand tone (the do-not list): calm, clinical, never exaggerated. Reject purple gradients, glassmorphism, glowing shadows, AI purple / blue glows, endlessly looping fussy micro-animations, "Boost your productivity"-style marketing copy, and using emoji as icons. These are all common tells of AI-generated interfaces (an "AI tell"), deliberately avoided.
i
Declare design intent first (Design Read): before adding a component / page, write one sentence describing its scenario, audience, and tone (for example, "a lightweight tool card embedded in a conversation, for developers, calm and restrained"), then build. If the intent isn't clear, ask one question first rather than defaulting to the nearest existing style.
',2)),t("section",H,[a[7]||(a[7]=e(`
02

Design Tokens

Collapse every visual decision into tokens. Color tokens keep the existing short names and fill out the semantics (lowering migration cost), while spacing, z-index, motion, and font-weight fill in the scales that are currently missing. Every token has: name, light value, dark value, and usage.

i
Naming convention: --<category>-<role>-<state>. For example --color-text-muted, --radius-md, --space-4. To reduce churn, the existing short names (--bg / --ink / --line / --blue …) are kept as compatibility aliases for one release cycle.

Color

Semantic-first, in three layers: background / text / border + accent + status colors. All colors are defined in light / dark pairs, with contrast ≥ 4.5:1.

i
The table below shows the derived semantic tokens. The neutrals and the accent are derived from the 4 color seeds in §05 — for example --color-accent comes from --accent-primary, and --color-bg comes from the current light / dark surface. The semantic status colors (success / warning / danger / info) are independent palettes paired with the seeds, one set each for light / dark; they are not auto-derived from the seeds. Day-to-day reskinning usually only needs the 4 seeds, with the status colors fine-tuned as needed.
bg
#ffffff / #121212
surface
#fafbfc / #1f1f1f
surface-sunken
#f3f5f8 / #121212
selected
#eceff3 / #2d333b
fg
#14171c / #e8eaed
fg-muted
#6b7280 / #9aa0a8
line
#e7eaee / #2d333b
accent (KMBlue)
#1783ff / #58a6ff
accent-soft
#e8f3ff / rgba(88,166,255,.14)
TokenLightDarkUsage
--color-bg#ffffff#121212Page background
--color-surface#fafbfc#1f1f1fPanel / sidebar / card head
--color-surface-raised#ffffff#292929Raised card / dialog / input
--color-text#14171c#e8eaedBody text / headings
--color-text-muted#6b7280#9aa0a8Secondary text / placeholder
--color-line#e7eaee#2d333bDivider / card border
--color-selected#00000014#ffffff14Neutral selected fill (sidebar rows, list pickers) — translucent, never accent-tinted
--color-hover#0000000d#ffffff0dRow hover wash — lighter than the selected fill (hover < selected); translucent, sits on any surface
--color-media-alpha-bg-1≈#858585≈#676b72Checkerboard square A of the <img> alpha canvas — color-mix of --color-bg/--color-text (52/48); applied via --media-alpha-canvas (16px period)
--color-media-alpha-bg-2≈#6b6b6b≈#7a7e85Checkerboard square B (42/58) — both squares stay ≥3:1 against white and black; opaque images cover the canvas
--color-sidebar-bg#e9eaf2#2c343aSidebar solid composite (row masks / overlays). The visible sidebar surface is the frost pair --color-sidebar-glass + --sidebar-wash blurred by --p-sidebar-backdrop
--color-accent#1783ff#58a6ffPrimary action / link / focus
--color-success#0e7a38#3fb950Success / pass
--color-warning#a9610a#d29922Warning / pending
--color-danger#c0392b#f85149Danger / error / abort

Surface usage

The four surface layers each have a role — choose by "raised layer / default flat layer / sunken layer / page background", and avoid treating --p-surface-raised as a universal background.

TokenLightDarkUsage
--p-surface-raised#ffffff#292929Raised card / dialog / input (raised layer)
--p-surface#fafbfc#1f1f1fPanel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#121212Code block / inline input / recessed area (sunken layer)
--p-bg#ffffff#121212Page background

Focus ring

All focusable controls (button, input, link, menu item, switch, checkbox) use the focus-ring token uniformly; do not hand-write a box-shadow focus ring.

TokenValueUsage
--p-focus-ring0 0 0 3px var(--p-accent-soft)Default focus ring (link, menu item, switch, checkbox)
--p-focus-ring-strong0 0 0 3px var(--p-accent-soft), 0 0 0 1px var(--p-accent)Strong focus ring (button, primary action)

Text selection

The text-selection color uses --p-selection uniformly (light rgba(23,131,255,.18) / dark rgba(88,166,255,.32)), applied by the global ::selection rule; do not set a separate highlight background.

Disabled state

All disabled controls use opacity:.5 + cursor:not-allowed uniformly; do not separately grey out or recolor.

Font families

Pythinker Web uses two font families: --font-ui (UI and body, Inter first) and --font-mono (code and monospace). Components always reference the variables; do not hard-code font names.

--font-ui · UI & body (Inter first)

Body and UI use self-hosted Inter as the primary face. CJK and platform system UI fonts sit late in the fallback chain so Latin glyphs resolve to Inter while Chinese text can fall through to native CJK fonts:

--font-ui
--font-ui: "Inter Variable", "Inter", "Helvetica Neue", Arial,
+import{M as x,aD as k,aI as C,aL as d,u as s,v as t,G as e,H as o,F as f,aX as g,bb as m,I as r,cx as z,bk as T,cy as S,cz as b,cA as B}from"./index-C0iEUKAq.js";const q={class:"ds-page"},I={class:"layout"},A={class:"content"},M={class:"content-inner"},H={id:"tokens"},L={class:"icon-sizes"},V={class:"sz"},D={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},P={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},W={class:"sz"},R={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},N={class:"icon-grid"},O={class:"icon-group-label"},E={class:"ic-name"},j={id:"primitives"},F={class:"stage-wrap"},K={class:"stage p col"},_={class:"demo-row"},G={class:"p-btn primary disabled"},J={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},Q={class:"stage-wrap"},Y={class:"stage p col"},X={class:"demo-row",style:{"font-size":"22px","line-height":"1"}},Z={class:"demo-row"},$={class:"p-thinking"},aa={class:"p-thinking"},ta={class:"stage-wrap"},da={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},sa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},ea={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},oa={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},ia={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},la={id:"chat"},na={class:"stage-wrap"},ca={class:"stage p col",style:{"align-items":"center",background:"#fff"}},va={class:"demo-chat"},ra={class:"p-thinking"},ba={class:"p-action"},fa={class:"p-action-head"},pa={class:"p-ic",style:{color:"var(--p-accent)"},viewBox:"0 0 24 24",fill:"currentColor"},ha={class:"p-action warn"},ua={class:"p-action-head"},ga={class:"p-ic",style:{color:"var(--p-warning)"},viewBox:"0 0 24 24",fill:"currentColor"},ma=x({__name:"DesignSystemView",emits:["close"],setup(wa,{emit:w}){const y=w;function p(){y("close")}let v=null;function h(c){c.key==="Escape"&&p()}return k(()=>{document.addEventListener("keydown",h);const c=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;c.forEach(n=>{const i=n.getAttribute("href");if(!i)return;const u=document.getElementById(i.slice(1));u&&a.set(u,n)});let l=null;v=new IntersectionObserver(n=>{n.forEach(i=>{i.isIntersecting&&(l&&l.classList.remove("active"),l=a.get(i.target)??null,l&&l.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((n,i)=>v.observe(i)),c.length&&c[0].classList.add("active")}),C(()=>{document.removeEventListener("keydown",h),v&&(v.disconnect(),v=null)}),(c,a)=>(d(),s("div",q,[t("div",{class:"ds-topbar"},[t("button",{class:"ds-back",type:"button",onClick:p},"← Back"),a[0]||(a[0]=t("span",{class:"ds-topbar-title"},"Design system",-1))]),t("div",I,[a[46]||(a[46]=e('',1)),t("main",A,[t("div",M,[a[44]||(a[44]=e('
● Design System · v1.0

Pythinker Web Design System

This document defines the visual language and component specification for Pythinker Web — design tokens, component primitives, the chat interface, theming, and style rules. All UI work is grounded in it: unified, restrained, token-driven, and themeable.

Scope apps/pythinker-webComponent primitivesTheme 1 set · 4 customizable colorsLight / dark mode
i
This spec is the single reference when changing the web UI. Before adding or modifying a component, style, layout, or theme, read this document first; color, font, radius, spacing, shadow, z-index, and motion always use the §02 tokens, components reuse the §03 primitives, and the §06 style rules are followed.
01

Design Principles

Every UI decision traces back to the following principles. Pythinker Web is a local Agent tool for developers: quick scanning, long stretches of staring, often in the dark — the design serves the task, and is restrained, clinical, and density-first.

  • Consistency —— The same semantics use the same component. The primary button, dialog, input, and badge should each have exactly "one" correct way to be written across the entire site.
  • Hierarchy —— Build a clear hierarchy through size, weight, color, and whitespace; emphasize through "restraint" rather than "bolder and bigger".
  • Proximity —— Group related elements, leave whitespace between unrelated ones. A card's padding, line spacing, and group spacing all come from the same spacing scale.
  • Feedback —— hover / active / focus / loading / success / error all have visible states, and the state language is unified.
  • Breathing room —— Control density with the spacing scale rather than arbitrary pixels; prefer restrained whitespace over cramming controls together.
  • Accessibility (A11y) —— Text contrast ≥ 4.5:1, visible focus rings, touch targets ≥ 32px, and states that don't rely on color alone.
  • Reduction —— The number of colors, radii, shadow levels, and type sizes all converge to a finite set of tokens; delete stray values.
Brand tone (the do-not list): calm, clinical, never exaggerated. Reject purple gradients, glassmorphism, glowing shadows, AI purple / blue glows, endlessly looping fussy micro-animations, "Boost your productivity"-style marketing copy, and using emoji as icons. These are all common tells of AI-generated interfaces (an "AI tell"), deliberately avoided.
i
Declare design intent first (Design Read): before adding a component / page, write one sentence describing its scenario, audience, and tone (for example, "a lightweight tool card embedded in a conversation, for developers, calm and restrained"), then build. If the intent isn't clear, ask one question first rather than defaulting to the nearest existing style.
',2)),t("section",H,[a[7]||(a[7]=e(`
02

Design Tokens

Collapse every visual decision into tokens. Color tokens keep the existing short names and fill out the semantics (lowering migration cost), while spacing, z-index, motion, and font-weight fill in the scales that are currently missing. Every token has: name, light value, dark value, and usage.

i
Naming convention: --<category>-<role>-<state>. For example --color-text-muted, --radius-md, --space-4. To reduce churn, the existing short names (--bg / --ink / --line / --blue …) are kept as compatibility aliases for one release cycle.

Color

Semantic-first, in three layers: background / text / border + accent + status colors. All colors are defined in light / dark pairs, with contrast ≥ 4.5:1.

i
The table below shows the derived semantic tokens. The neutrals and the accent are derived from the 4 color seeds in §05 — for example --color-accent comes from --accent-primary, and --color-bg comes from the current light / dark surface. The semantic status colors (success / warning / danger / info) are independent palettes paired with the seeds, one set each for light / dark; they are not auto-derived from the seeds. Day-to-day reskinning usually only needs the 4 seeds, with the status colors fine-tuned as needed.
bg
#ffffff / #121212
surface
#fafbfc / #1f1f1f
surface-sunken
#f3f5f8 / #121212
selected
#eceff3 / #2d333b
fg
#14171c / #e8eaed
fg-muted
#6b7280 / #9aa0a8
line
#e7eaee / #2d333b
accent (KMBlue)
#1783ff / #58a6ff
accent-soft
#e8f3ff / rgba(88,166,255,.14)
TokenLightDarkUsage
--color-bg#ffffff#121212Page background
--color-surface#fafbfc#1f1f1fPanel / sidebar / card head
--color-surface-raised#ffffff#292929Raised card / dialog / input
--color-text#14171c#e8eaedBody text / headings
--color-text-muted#6b7280#9aa0a8Secondary text / placeholder
--color-line#e7eaee#2d333bDivider / card border
--color-selected#00000014#ffffff14Neutral selected fill (sidebar rows, list pickers) — translucent, never accent-tinted
--color-hover#0000000d#ffffff0dRow hover wash — lighter than the selected fill (hover < selected); translucent, sits on any surface
--color-media-alpha-bg-1≈#858585≈#676b72Checkerboard square A of the <img> alpha canvas — color-mix of --color-bg/--color-text (52/48); applied via --media-alpha-canvas (16px period)
--color-media-alpha-bg-2≈#6b6b6b≈#7a7e85Checkerboard square B (42/58) — both squares stay ≥3:1 against white and black; opaque images cover the canvas
--color-sidebar-bg#e9eaf2#2c343aSidebar solid composite (row masks / overlays). The visible sidebar surface is the frost pair --color-sidebar-glass + --sidebar-wash blurred by --p-sidebar-backdrop
--color-accent#1783ff#58a6ffPrimary action / link / focus
--color-success#0e7a38#3fb950Success / pass
--color-warning#a9610a#d29922Warning / pending
--color-danger#c0392b#f85149Danger / error / abort

Surface usage

The four surface layers each have a role — choose by "raised layer / default flat layer / sunken layer / page background", and avoid treating --p-surface-raised as a universal background.

TokenLightDarkUsage
--p-surface-raised#ffffff#292929Raised card / dialog / input (raised layer)
--p-surface#fafbfc#1f1f1fPanel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#121212Code block / inline input / recessed area (sunken layer)
--p-bg#ffffff#121212Page background

Focus ring

All focusable controls (button, input, link, menu item, switch, checkbox) use the focus-ring token uniformly; do not hand-write a box-shadow focus ring.

TokenValueUsage
--p-focus-ring0 0 0 3px var(--p-accent-soft)Default focus ring (link, menu item, switch, checkbox)
--p-focus-ring-strong0 0 0 3px var(--p-accent-soft), 0 0 0 1px var(--p-accent)Strong focus ring (button, primary action)

Text selection

The text-selection color uses --p-selection uniformly (light rgba(23,131,255,.18) / dark rgba(88,166,255,.32)), applied by the global ::selection rule; do not set a separate highlight background.

Disabled state

All disabled controls use opacity:.5 + cursor:not-allowed uniformly; do not separately grey out or recolor.

Font families

Pythinker Web uses two font families: --font-ui (UI and body, Inter first) and --font-mono (code and monospace). Components always reference the variables; do not hard-code font names.

--font-ui · UI & body (Inter first)

Body and UI use self-hosted Inter as the primary face. CJK and platform system UI fonts sit late in the fallback chain so Latin glyphs resolve to Inter while Chinese text can fall through to native CJK fonts:

--font-ui
--font-ui: "Inter Variable", "Inter", "Helvetica Neue", Arial,
       "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
       -apple-system, BlinkMacSystemFont, "Segoe UI",
       Roboto, Ubuntu, sans-serif,
diff --git a/apps/pythinker-code/dist-web/assets/Tooltip-Dwp18XKI.js b/apps/pythinker-code/dist-web/assets/Tooltip-D-x_6nZf.js
similarity index 98%
rename from apps/pythinker-code/dist-web/assets/Tooltip-Dwp18XKI.js
rename to apps/pythinker-code/dist-web/assets/Tooltip-D-x_6nZf.js
index 888dc5d06..f6a29a8ad 100644
--- a/apps/pythinker-code/dist-web/assets/Tooltip-Dwp18XKI.js
+++ b/apps/pythinker-code/dist-web/assets/Tooltip-D-x_6nZf.js
@@ -1 +1 @@
-import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-BK-wRR5p.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
+import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-C0iEUKAq.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default};
diff --git a/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-CpEdlyYv.js b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-B5EIRmLW.js
similarity index 86%
rename from apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-CpEdlyYv.js
rename to apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-B5EIRmLW.js
index c90fb78fe..3b8109e49 100644
--- a/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-CpEdlyYv.js
+++ b/apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-B5EIRmLW.js
@@ -1 +1 @@
-import{g as p,r as u,d as a}from"./chunk-SVP7TREG-XNRd51cY.js";import{p as f}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as n,l as o}from"./mermaid.core-Pmnag6hS.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
+import{g as p,r as u,d as a}from"./chunk-SVP7TREG-C1yhxvNc.js";import{p as f}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as n,l as o}from"./mermaid.core-4ur3W-UG.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/arc-C__I0s6O.js b/apps/pythinker-code/dist-web/assets/arc-ChDdl02F.js
similarity index 98%
rename from apps/pythinker-code/dist-web/assets/arc-C__I0s6O.js
rename to apps/pythinker-code/dist-web/assets/arc-ChDdl02F.js
index 39898f9c4..5f137edf5 100644
--- a/apps/pythinker-code/dist-web/assets/arc-C__I0s6O.js
+++ b/apps/pythinker-code/dist-web/assets/arc-ChDdl02F.js
@@ -1 +1 @@
-import{H as ln,I as un,J as y,K as tn,L as Q,M as I,N as _,O as an,P as rn,Q as j,R as o,S as K,T as sn,V as on,W as fn}from"./mermaid.core-Pmnag6hS.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,L,u){var D=q-l,i=O-h,n=L-v,d=u-R,a=d*D-n*i;if(!(a*ar*r+N*N&&(H=w,J=p),{cx:H,cy:J,x01:-n,y01:-d,x11:H*(v/T-1),y11:J*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),O=null,v=gn,R=dn,L=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,M=an(c-f),t=c>f;if(u||(u=n=D()),sy))u.moveTo(0,0);else if(M>tn-y)u.moveTo(s*Q(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*Q(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=M,E=M,H=L.apply(this,arguments)/2,J=H>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(an(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(J>y){var N=sn(J/a*I(H)),z=sn(J/s*I(H));(P-=N*2)>y?(N*=t?1:-1,A+=N,T-=N):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var V=s*Q(m),W=s*I(m),B=a*Q(T),C=a*I(T);if(w>y){var F=s*Q(g),G=s*I(g),X=a*Q(A),Y=a*I(A),S;if(My?x>y?(e=U(X,Y,V,W,s,x,t),r=U(F,G,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?u.lineTo(B,C):p>y?(e=U(B,C,F,G,a,-p,t),r=U(V,W,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+N*N&&(H=w,J=p),{cx:H,cy:J,x01:-n,y01:-d,x11:H*(v/T-1),y11:J*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),O=null,v=gn,R=dn,L=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,M=an(c-f),t=c>f;if(u||(u=n=D()),sy))u.moveTo(0,0);else if(M>tn-y)u.moveTo(s*Q(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*Q(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=M,E=M,H=L.apply(this,arguments)/2,J=H>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(an(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(J>y){var N=sn(J/a*I(H)),z=sn(J/s*I(H));(P-=N*2)>y?(N*=t?1:-1,A+=N,T-=N):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var V=s*Q(m),W=s*I(m),B=a*Q(T),C=a*I(T);if(w>y){var F=s*Q(g),G=s*I(g),X=a*Q(A),Y=a*I(A),S;if(My?x>y?(e=U(X,Y,V,W,s,x,t),r=U(F,G,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?u.lineTo(B,C):p>y?(e=U(B,C,F,G,a,-p,t),r=U(V,W,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},M.exports=r}),(function(M,P,N){var v=N(0);function h(){}for(var a in v)h[a]=v[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=h}),(function(M,P,N){function v(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},M.exports=v}),(function(M,P,N){var v=N(2),h=N(10),a=N(0),e=N(7),i=N(3),f=N(1),r=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(G,1);var R=g.source.owner.getEdges().indexOf(g);if(R==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(R,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,L=this.getNodes(),R=L.length,C=0;CT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,L,R,C,G,V,Y=this.nodes,$=Y.length,A=0;A<$;A++){var _=Y[A];c&&_.child!=null&&_.updateBounds(),L=_.getLeft(),R=_.getRight(),C=_.getTop(),G=_.getBottom(),l>L&&(l=L),TC&&(g=C),dL&&(l=L),TC&&(g=C),d=this.nodes.length){var $=0;T.forEach(function(A){A.owner==c&&$++}),$==this.nodes.length&&(this.isConnected=!0)}},M.exports=s}),(function(M,P,N){var v,h=N(1);function a(e){v=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,u){if(f==null&&r==null&&u==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{u=f,r=i,f=e;var t=r.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,u);if(f.isInterGraph=!0,f.source=r,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof v){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,u=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*i[0],s=i[1]/u;i[0]t)return i[0]=f,i[1]=o,i[2]=u,i[3]=Y,!1;if(ru)return i[0]=s,i[1]=r,i[2]=G,i[3]=t,!1;if(fu?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>u?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-m===y?u>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=C,E=!0):m===y&&(u>f?(i[2]=R,i[3]=C,E=!0):(i[2]=$,i[3]=Y,E=!0)),n&&E)return!1;if(f>u?r>t?(I=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,S=f+-L/y,i[0]=S,i[1]=W;break;case 2:S=g,W=r+d*y,i[0]=S,i[1]=W;break;case 3:W=T,S=f+L/y,i[0]=S,i[1]=W;break;case 4:S=l,W=r+-d*y,i[0]=S,i[1]=W;break}if(!E)switch(D){case 1:Q=C,x=u+-_/y,i[2]=x,i[3]=Q;break;case 2:x=$,Q=t+A*y,i[2]=x,i[3]=Q;break;case 3:Q=Y,x=u+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-A*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,u=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,L=void 0,R=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,$=void 0;return L=s-u,C=r-t,V=t*u-r*s,R=T-c,G=o-l,Y=l*c-o*T,$=L*G-R*C,$===0?null:(g=(C*Y-G*V)/$,d=(R*V-L*Y)/$,new v(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,M.exports=h}),(function(M,P,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},M.exports=v}),(function(M,P,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,M.exports=v}),(function(M,P,N){var v=(function(){function r(u,t){for(var s=0;s"u"?"undefined":v(a);return a==null||e!="object"&&e!="function"},M.exports=h}),(function(M,P,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),g=0;g-1&&C.splice(_,1)}d=new Set,R=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(Y,1);var $=R.getNeighborsList();$.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&G.push(n),T.set(n,p)}})}l=l.concat(G),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},M.exports=s}),(function(M,P,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},M.exports=v}),(function(M,P,N){var v=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new v(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},M.exports=h}),(function(M,P,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var R=0;Rr}}]),i})();M.exports=e}),(function(M,P,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,r=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,wt){return Tt&&wt})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*e[ut-1],e[ut-1]=Ct*e[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},M.exports=v}),(function(M,P,N){var v=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var P={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var u in f)r[u]=f[u];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),u=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,R=i(551).Layout,C=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,$=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var D=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=O[tt],O[tt]=O[H],O[H]=k;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:O.gap})}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new $,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var S;for(S=0;Sm&&(m=Math.floor(D.y)),I=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),I=new Y;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var D=0;D1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),B--,X--}E!=null?O=(z.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[S]=[]),E[S]=E[S].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;By?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,D=m.labelMarginLeft,S=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,D,S)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),D;return IS&&(S=B.getWidth())});var W=I/y,x=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return S>rt&&(rt=S),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(O){return O.rect.width*O.rect.height},W=function(O,H){return S(H)-S(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=I,H(B.id,O.id)):H(B,O)});for(var x=0,Q=0,z=0;z0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var D=n.rowWidth[I];if(D+n.horizontalPadding+E<=n.width)return!0;var S=0;n.rowHeight[I]0&&(S=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+S)/(D+E+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,S=0;SD&&(D=m[S].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(I0)for(var rt=D;rt<=S;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,k=0;k{var f=i(551).FDLayoutNode,r=i(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var Z=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(b,U){m[U]=[b.position.x,b.position.y],y[U]=[d[g.get(b.nodeId)],L[g.get(b.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var b=0;if(l.alignmentConstraint.vertical){for(var U=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;dt.size>0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).x,U[et].forEach(function(pt){m[b]=[Mt,L[g.get(pt)]],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},K=0;K0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).y,q[et].forEach(function(pt){m[b]=[d[g.get(pt)],Mt],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(b,U){var Z={x:d[g.get(b.nodeId)],y:L[g.get(b.nodeId)]},K=b.position,q=Y(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(b,U){d[U]+=mt.x}),L.forEach(function(b,U){L[U]+=mt.y}),l.fixedNodeConstraint.forEach(function(b){d[g.get(b.nodeId)]=b.position.x,L[g.get(b.nodeId)]=b.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ot=l.alignmentConstraint.vertical,Rt=function(U){var Z=new Set;Ot[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return S.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=$(Z).x,Z.forEach(function(at){S.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=L[g.get(K.values().next().value)]:q=$(Z).y,Z.forEach(function(at){S.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(45);return h})()})})(he)),he.exports}var yr=se.exports,Oe;function mr(){return Oe||(Oe=1,(function(w,F){(function(P,N){w.exports=N(pr())})(yr,function(M){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),L;!(l=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));l=!0);}catch(R){T=!0,g=R}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var D=0;D1){L=g[0],R=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,R=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=C.next()).done);d=!0){var V=G.value,Y=f(V,2),$=Y[0],A=Y[1],_=o.cy.getElementById($);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){L=!0,R=x}finally{try{!d&&C.return&&C.return()}finally{if(L)throw R}}var I=t.x-(l+c)/2,D=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+D})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=B)});var S=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+S,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,R=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,$=0;$L&&(l=L),TC&&(g=C),d{var f=i(548),r=i(140).CoSELayout,u=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,L){var R=d.cy,C=d.eles,G=C.nodes(),V=C.edges(),Y=void 0,$=void 0,A=void 0,_={};d.randomize&&(Y=L.nodeIndexes,$=L.xCoords,A=L.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(R,C),m=function W(x,Q,z,X){for(var rt=Q.length,B=0;B0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,B=0;B0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,S=D.newGraphManager();return m(S.addRoot(),f.getTopMostNodes(G),D,d),y(D,S,V),I(D,d),D.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(L,R){for(var C=0;C0)if(p){var I=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,I),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=G.collection();if(C.tile){var S=new Map,W=[],x=[],Q=0,z={nodeIndexes:S,xCoords:W,yCoords:x},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,$.push(l(C,Y[it])),t.relocateComponent(_[it],$[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],k=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(k).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else $[it][Dt.id()]&&Et.nodes.push({x:$[it][Dt.id()].getLeft(),y:$[it][Dt.id()].getTop(),width:$[it][Dt.id()].getWidth(),height:$[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Gt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Gt.push(Yt.topLeftX+Yt.width/2),Gt.push(Yt.topLeftY+Yt.height/2)}else Gt.push(Y[it].xCoords[Ht]),Gt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Gt[0],endY:Gt[1]})}else $[it][mt.id()]&&$[it][Ot.id()]&&Et.edges.push({startX:$[it][mt.id()].getCenterX(),startY:$[it][mt.id()].getCenterY(),endX:$[it][Ot.id()].getCenterX(),endY:$[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys($[vt]).forEach(function(it){var ut=$[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?($.push(l(C,Y[0])),t.relocateComponent(_[0],$[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return $.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(R,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,u=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,L=new Map,R=new Map,C=[],G=[],V=[],Y=[],$=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,D=o.nodeSeparation,S=void 0,W=function(){for(var U=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=C[nt],lt=0;ltdt&&(dt=$[Lt],Mt=Lt)}return Mt},Q=function(U){var Z=void 0;if(U){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?C[U].push(R.get(Z.id())):C[U].push(Z.id()))})});var Nt=function(U){var Z=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=R.get(q):K=q,C[Z].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(b){it=!0,ut=b}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){S=E{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(579);return h})()})})(se)),se.exports}var Er=mr();const Tr=qe(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:ct(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:ct(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:ct(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},oe={L:ct((w,F)=>w-F+2,"L"),R:ct((w,F)=>w-2,"R"),T:ct((w,F)=>w-F+2,"T"),B:ct((w,F)=>w-2,"B")},Nr=ct(function(w){return Wt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(w){const F=w;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),Wt=ct(function(w){const F=w;return F==="L"||F==="R"},"isArchitectureDirectionX"),qt=ct(function(w){const F=w;return F==="T"||F==="B"},"isArchitectureDirectionY"),Te=ct(function(w,F){const M=Wt(w)&&qt(F),P=qt(w)&&Wt(F);return M||P},"isArchitectureDirectionXY"),Lr=ct(function(w){const F=w[0],M=w[1],P=Wt(F)&&qt(M),N=qt(F)&&Wt(M);return P||N},"isArchitecturePairXY"),wr=ct(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(w,F){const M=`${w}${F}`;return wr(M)?M:void 0},"getArchitectureDirectionPair"),Cr=ct(function([w,F],M){const P=M[0],N=M[1];return Wt(P)?qt(N)?[w+(P==="L"?-1:1),F+(N==="T"?1:-1)]:[w+(P==="L"?-1:1),F]:Wt(N)?[w+(N==="L"?1:-1),F+(P==="T"?1:-1)]:[w,F+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mr=ct(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=ct(function(w,F){return Te(w,F)?"bend":Wt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Dr=ct(function(w){return w.type==="service"},"isArchitectureService"),Or=ct(function(w){return w.type==="junction"},"isArchitectureJunction"),be=ct((w,F)=>{const[M,P]=[w,F].sort();return`${JSON.stringify(M)}-${JSON.stringify(P)}`},"architectureGroupAlignmentKey"),Ge=ct(w=>w.data(),"edgeData"),ie=ct(w=>w.data(),"nodeData"),xr=or.architecture,Pe=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}static{ct(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:w,icon:F,in:M,title:P,iconText:N}){if(this.registeredIds.has(w))throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:F,iconText:N,title:P,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(Dr)}addJunction({id:w,in:F}){if(this.registeredIds.has(w))throw new Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(F!==void 0){if(w===F)throw new Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw new Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw new Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(Or)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:F,in:M,title:P}){if(this.registeredIds.has(w))throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:F,title:P,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:F,lhsDir:M,rhsDir:P,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:a,title:e}){if(!Re(M))throw new Error(`Invalid direction given for left hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(M)}`);if(!Re(P))throw new Error(`Invalid direction given for right hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(P)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw new Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes.get(w).in,f=this.nodes.get(F).in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:w,lhsDir:M,lhsInto:N,lhsGroup:h,rhsId:F,rhsDir:P,rhsInto:v,rhsGroup:a,title:e};this.edges.push(r);const u=this.nodes.get(w),t=this.nodes.get(F);u&&t&&(u.edges.push(this.edges[this.edges.length-1]),t.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw new Error(`An align directive requires at least two members; got ${w.members.length}`);const F=new Set;w.members.forEach(M=>{if(this.registeredIds.get(M)!=="node")throw new Error(`align ${w.direction} references [${M}], which is not a service or junction`);if(F.has(M))throw new Error(`align ${w.direction} lists [${M}] more than once`);F.add(M)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const w=new Map,F=new Map;for(const[h,a]of this.nodes.entries()){const e=new Map;for(const i of a.edges){const f=this.getNode(i.lhsId)?.in,r=this.getNode(i.rhsId)?.in;if(f&&r&&f!==r){const u=Ar(i.lhsDir,i.rhsDir);u!=="bend"&&w.set(be(f,r),u)}if(i.lhsId===h){const u=pe(i.lhsDir,i.rhsDir);u&&e.set(u,i.rhsId)}else{const u=pe(i.rhsDir,i.lhsDir);u&&e.set(u,i.lhsId)}}F.set(h,e)}const M=new Set,P=new Set(F.keys()),N=ct(h=>{const a=new Map([[h,[0,0]]]),e=[h];for(;e.length>0;){const i=e.shift();if(i){M.add(i),P.delete(i);const f=F.get(i);if(!f)throw new Error(`BFS error: adjacency list for id ${i} not found. Please report this as a bug.`);const r=a.get(i);if(!r)throw new Error(`BFS error: position for id ${i} not found in spatial map. Please report this as a bug.`);const[u,t]=r;f.forEach((s,o)=>{M.has(s)||(a.set(s,Cr([u,t],o)),e.push(s))})}}return a},"BFS"),v=[];for(;P.size>0;){const h=P.values().next().value;v.push(N(h))}this.dataStructures={adjList:F,spatialMaps:v,groupAlignments:w}}return this.dataStructures}setElementForId(w,F){this.elements.set(w,F)}getElementById(w){return this.elements.get(w)}getConfig(){return ar({...xr,...nr().architecture})}getConfigField(w){return this.getConfig()[w]}},Ir=ct((w,F)=>{Ze(w,F),w.groups.map(M=>F.addGroup(M)),w.services.map(M=>F.addService({...M,type:"service"})),w.junctions.map(M=>F.addJunction({...M,type:"junction"})),w.edges.map(M=>F.addEdge(M)),w.alignments?.map(M=>F.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Ue={parser:{yy:void 0},parse:ct(async w=>{const F=await gr("architecture",w);Se.debug(F);const M=Ue.parser?.yy;if(!(M instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ir(F,M)},"parse")},Rr=ct(w=>`
+import{p as Ze}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{b4 as qe,_ as ct,G as Qe,ae as Je,l as Se,b as Ke,a as je,p as _e,q as tr,g as er,s as rr,r as ir,D as ar,A as nr,E as or,c as me,b5 as Ee,aj as ve,i as sr,j as hr,t as lr,ak as fr,b6 as cr}from"./mermaid.core-4ur3W-UG.js";import{p as gr}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import{c as Fe}from"./cytoscape.esm-CNiYdHpY.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var se={exports:{}},he={exports:{}},le={exports:{}},ur=le.exports,Ae;function dr(){return Ae||(Ae=1,(function(w,F){(function(P,N){w.exports=N()})(ur,function(){return(function(M){var P={};function N(v){if(P[v])return P[v].exports;var h=P[v]={i:v,l:!1,exports:{}};return M[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=M,N.c=P,N.i=function(v){return v},N.d=function(v,h,a){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:a})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(M,P,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,M.exports=v}),(function(M,P,N){var v=N(2),h=N(8),a=N(9);function e(f,r,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=r}e.prototype=Object.create(v.prototype);for(var i in v)e[i]=v[i];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(f,r){for(var u=this.getOtherEnd(f),t=r.getGraphManager().getRoot();;){if(u.getOwner()==r)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},e.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},M.exports=e}),(function(M,P,N){function v(h){this.vGraphObject=h}M.exports=v}),(function(M,P,N){var v=N(2),h=N(10),a=N(13),e=N(0),i=N(16),f=N(5);function r(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}r.prototype=Object.create(v.prototype);for(var u in v)r[u]=v[u];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var o=this.rect.y;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},M.exports=r}),(function(M,P,N){var v=N(0);function h(){}for(var a in v)h[a]=v[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=h}),(function(M,P,N){function v(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},M.exports=v}),(function(M,P,N){var v=N(2),h=N(10),a=N(0),e=N(7),i=N(3),f=N(1),r=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof i){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(G,1);var R=g.source.owner.getEdges().indexOf(g);if(R==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(R,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,L=this.getNodes(),R=L.length,C=0;CT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,L,R,C,G,V,Y=this.nodes,$=Y.length,A=0;A<$;A++){var _=Y[A];c&&_.child!=null&&_.updateBounds(),L=_.getLeft(),R=_.getRight(),C=_.getTop(),G=_.getBottom(),l>L&&(l=L),TC&&(g=C),dL&&(l=L),TC&&(g=C),d=this.nodes.length){var $=0;T.forEach(function(A){A.owner==c&&$++}),$==this.nodes.length&&(this.isConnected=!0)}},M.exports=s}),(function(M,P,N){var v,h=N(1);function a(e){v=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(e,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(e,i,f,r,u){if(f==null&&r==null&&u==null){if(e==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return e.parent=i,i.child=e,e}else{u=f,r=i,f=e;var t=r.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,r,u);if(f.isInterGraph=!0,f.source=r,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(e){if(e instanceof v){var i=e;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var r,u=f.length,t=0;t=e.getRight()?i[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var u=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(u=1);var t=u*i[0],s=i[1]/u;i[0]t)return i[0]=f,i[1]=o,i[2]=u,i[3]=Y,!1;if(ru)return i[0]=s,i[1]=r,i[2]=G,i[3]=t,!1;if(fu?(i[0]=l,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>u?(i[0]=s,i[1]=o,n=!0):(i[0]=g,i[1]=T,n=!0)),-m===y?u>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=C,E=!0):m===y&&(u>f?(i[2]=R,i[3]=C,E=!0):(i[2]=$,i[3]=Y,E=!0)),n&&E)return!1;if(f>u?r>t?(I=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):r>t?(I=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,S=f+-L/y,i[0]=S,i[1]=W;break;case 2:S=g,W=r+d*y,i[0]=S,i[1]=W;break;case 3:W=T,S=f+L/y,i[0]=S,i[1]=W;break;case 4:S=l,W=r+-d*y,i[0]=S,i[1]=W;break}if(!E)switch(D){case 1:Q=C,x=u+-_/y,i[2]=x,i[3]=Q;break;case 2:x=$,Q=t+A*y,i[2]=x,i[3]=Q;break;case 3:Q=Y,x=u+_/y,i[2]=x,i[3]=Q;break;case 4:x=V,Q=t+-A*y,i[2]=x,i[3]=Q;break}}return!1},h.getCardinalDirection=function(a,e,i){return a>e?i:1+i%4},h.getIntersection=function(a,e,i,f){if(f==null)return this.getIntersection2(a,e,i);var r=a.x,u=a.y,t=e.x,s=e.y,o=i.x,c=i.y,l=f.x,T=f.y,g=void 0,d=void 0,L=void 0,R=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,$=void 0;return L=s-u,C=r-t,V=t*u-r*s,R=T-c,G=o-l,Y=l*c-o*T,$=L*G-R*C,$===0?null:(g=(C*Y-G*V)/$,d=(R*V-L*Y)/$,new v(g,d))},h.angleOfVector=function(a,e,i,f){var r=void 0;return a!==i?(r=Math.atan((f-e)/(i-a)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,M.exports=h}),(function(M,P,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},M.exports=v}),(function(M,P,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,M.exports=v}),(function(M,P,N){var v=(function(){function r(u,t){for(var s=0;s"u"?"undefined":v(a);return a==null||e!="object"&&e!="function"},M.exports=h}),(function(M,P,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),g=0;g-1&&C.splice(_,1)}d=new Set,R=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(Y,1);var $=R.getNeighborsList();$.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&G.push(n),T.set(n,p)}})}l=l.concat(G),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},M.exports=s}),(function(M,P,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},M.exports=v}),(function(M,P,N){var v=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,i=this.lworldExtX;return i!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),e},h.prototype.transformY=function(a){var e=0,i=this.lworldExtY;return i!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),e},h.prototype.inverseTransformX=function(a){var e=0,i=this.ldeviceExtX;return i!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),e},h.prototype.inverseTransformY=function(a){var e=0,i=this.ldeviceExtY;return i!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),e},h.prototype.inverseTransformPoint=function(a){var e=new v(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},M.exports=h}),(function(M,P,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||L>=g[0].length)){for(var R=0;Rr}}]),i})();M.exports=e}),(function(M,P,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,r=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,wt){return Tt&&wt})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(e[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){e[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==J+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=e[n-2];e[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*e[ut-1],e[ut-1]=Ct*e[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},M.exports=v}),(function(M,P,N){var v=(function(){function e(i,f){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=i,this.sequence2=f,this.match_score=r,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===a&&f.callback===e&&this.listeners.splice(i,1)}},h.emit=function(a,e){for(var i=0;i{var P={45:((a,e,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,e,i)=>{var f=i(551).FDLayoutConstants;function r(){}for(var u in f)r[u]=f[u];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,a.exports=r}),767:((a,e,i)=>{var f=i(551).FDLayoutEdge;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),880:((a,e,i)=>{var f=i(551).LGraph;function r(t,s,o){f.call(this,t,s,o)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),578:((a,e,i)=>{var f=i(551).LGraphManager;function r(t){f.call(this,t)}r.prototype=Object.create(f.prototype);for(var u in f)r[u]=f[u];a.exports=r}),765:((a,e,i)=>{var f=i(551).FDLayout,r=i(578),u=i(880),t=i(991),s=i(767),o=i(806),c=i(902),l=i(551).FDLayoutConstants,T=i(551).LayoutConstants,g=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,R=i(551).Layout,C=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,$=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var D=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=O[tt],O[tt]=O[H],O[H]=k;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:O.gap})}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,k=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=S.has(O.top)?S.get(O.top):O.top,ht=S.has(O.bottom)?S.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new $,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var S;for(S=0;Sm&&(m=Math.floor(D.y)),I=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),I=new Y;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var D=0;D1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),B--,X--}E!=null?O=(z.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[S]=[]),E[S]=E[S].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;By?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,D=m.labelMarginLeft,S=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,D,S)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),D;return IS&&(S=B.getWidth())});var W=I/y,x=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return S>rt&&(rt=S),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(O){return O.rect.width*O.rect.height},W=function(O,H){return S(H)-S(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=I,H(B.id,O.id)):H(B,O)});for(var x=0,Q=0,z=0;z0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var D=n.rowWidth[I];if(D+n.horizontalPadding+E<=n.width)return!0;var S=0;n.rowHeight[I]0&&(S=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+S)/(D+E+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,S=0;SD&&(D=m[S].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(I0)for(var rt=D;rt<=S;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,k=0;k{var f=i(551).FDLayoutNode,r=i(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var Z=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(b,U){m[U]=[b.position.x,b.position.y],y[U]=[d[g.get(b.nodeId)],L[g.get(b.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var b=0;if(l.alignmentConstraint.vertical){for(var U=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;dt.size>0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).x,U[et].forEach(function(pt){m[b]=[Mt,L[g.get(pt)]],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},K=0;K0?Mt=d[g.get(dt.values().next().value)]:Mt=$(j).y,q[et].forEach(function(pt){m[b]=[d[g.get(pt)],Mt],y[b]=[d[g.get(pt)],L[g.get(pt)]],b++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(b,U){var Z={x:d[g.get(b.nodeId)],y:L[g.get(b.nodeId)]},K=b.position,q=Y(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(b,U){d[U]+=mt.x}),L.forEach(function(b,U){L[U]+=mt.y}),l.fixedNodeConstraint.forEach(function(b){d[g.get(b.nodeId)]=b.position.x,L[g.get(b.nodeId)]=b.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ot=l.alignmentConstraint.vertical,Rt=function(U){var Z=new Set;Ot[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return S.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=$(Z).x,Z.forEach(function(at){S.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=L[g.get(K.values().next().value)]:q=$(Z).y,Z.forEach(function(at){S.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(45);return h})()})})(he)),he.exports}var yr=se.exports,Oe;function mr(){return Oe||(Oe=1,(function(w,F){(function(P,N){w.exports=N(pr())})(yr,function(M){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var i=arguments.length,f=Array(i>1?i-1:0),r=1;r{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),L;!(l=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));l=!0);}catch(R){T=!0,g=R}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=i(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var D=0;D1){L=g[0],R=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,R=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=C.next()).done);d=!0){var V=G.value,Y=f(V,2),$=Y[0],A=Y[1],_=o.cy.getElementById($);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){L=!0,R=x}finally{try{!d&&C.return&&C.return()}finally{if(L)throw R}}var I=t.x-(l+c)/2,D=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+D})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=B)});var S=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+S,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,R=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,$=0;$L&&(l=L),TC&&(g=C),d{var f=i(548),r=i(140).CoSELayout,u=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,l=i(140).CoSEConstants,T=function(d,L){var R=d.cy,C=d.eles,G=C.nodes(),V=C.edges(),Y=void 0,$=void 0,A=void 0,_={};d.randomize&&(Y=L.nodeIndexes,$=L.xCoords,A=L.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(R,C),m=function W(x,Q,z,X){for(var rt=Q.length,B=0;B0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,B=0;B0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,S=D.newGraphManager();return m(S.addRoot(),f.getTopMostNodes(G),D,d),y(D,S,V),I(D,d),D.runLayout(),_};a.exports={coseLayout:T}}),212:((a,e,i)=>{var f=(function(){function d(L,R){for(var C=0;C0)if(p){var I=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,I),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=G.collection();if(C.tile){var S=new Map,W=[],x=[],Q=0,z={nodeIndexes:S,xCoords:W,yCoords:x},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,$.push(l(C,Y[it])),t.relocateComponent(_[it],$[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],k=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(k).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else $[it][Dt.id()]&&Et.nodes.push({x:$[it][Dt.id()].getLeft(),y:$[it][Dt.id()].getTop(),width:$[it][Dt.id()].getWidth(),height:$[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Gt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Gt.push(Yt.topLeftX+Yt.width/2),Gt.push(Yt.topLeftY+Yt.height/2)}else Gt.push(Y[it].xCoords[Ht]),Gt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Gt[0],endY:Gt[1]})}else $[it][mt.id()]&&$[it][Ot.id()]&&Et.edges.push({startX:$[it][mt.id()].getCenterX(),startY:$[it][mt.id()].getCenterY(),endX:$[it][Ot.id()].getCenterX(),endY:$[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys($[vt]).forEach(function(it){var ut=$[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?($.push(l(C,Y[0])),t.relocateComponent(_[0],$[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return $.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(R,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();a.exports=g}),657:((a,e,i)=>{var f=i(548),r=i(140).layoutBase.Matrix,u=i(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,L=new Map,R=new Map,C=[],G=[],V=[],Y=[],$=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,D=o.nodeSeparation,S=void 0,W=function(){for(var U=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=C[nt],lt=0;ltdt&&(dt=$[Lt],Mt=Lt)}return Mt},Q=function(U){var Z=void 0;if(U){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?C[U].push(R.get(Z.id())):C[U].push(Z.id()))})});var Nt=function(U){var Z=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=R.get(q):K=q,C[Z].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(b){it=!0,ut=b}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){S=E{var f=i(212),r=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&r(cytoscape),a.exports=r}),140:(a=>{a.exports=M})},N={};function v(a){var e=N[a];if(e!==void 0)return e.exports;var i=N[a]={exports:{}};return P[a](i,i.exports,v),i.exports}var h=v(579);return h})()})})(se)),se.exports}var Er=mr();const Tr=qe(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:ct(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:ct(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:ct(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},oe={L:ct((w,F)=>w-F+2,"L"),R:ct((w,F)=>w-2,"R"),T:ct((w,F)=>w-F+2,"T"),B:ct((w,F)=>w-2,"B")},Nr=ct(function(w){return Wt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(w){const F=w;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),Wt=ct(function(w){const F=w;return F==="L"||F==="R"},"isArchitectureDirectionX"),qt=ct(function(w){const F=w;return F==="T"||F==="B"},"isArchitectureDirectionY"),Te=ct(function(w,F){const M=Wt(w)&&qt(F),P=qt(w)&&Wt(F);return M||P},"isArchitectureDirectionXY"),Lr=ct(function(w){const F=w[0],M=w[1],P=Wt(F)&&qt(M),N=qt(F)&&Wt(M);return P||N},"isArchitecturePairXY"),wr=ct(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(w,F){const M=`${w}${F}`;return wr(M)?M:void 0},"getArchitectureDirectionPair"),Cr=ct(function([w,F],M){const P=M[0],N=M[1];return Wt(P)?qt(N)?[w+(P==="L"?-1:1),F+(N==="T"?1:-1)]:[w+(P==="L"?-1:1),F]:Wt(N)?[w+(N==="L"?1:-1),F+(P==="T"?1:-1)]:[w,F+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mr=ct(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=ct(function(w,F){return Te(w,F)?"bend":Wt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Dr=ct(function(w){return w.type==="service"},"isArchitectureService"),Or=ct(function(w){return w.type==="junction"},"isArchitectureJunction"),be=ct((w,F)=>{const[M,P]=[w,F].sort();return`${JSON.stringify(M)}-${JSON.stringify(P)}`},"architectureGroupAlignmentKey"),Ge=ct(w=>w.data(),"edgeData"),ie=ct(w=>w.data(),"nodeData"),xr=or.architecture,Pe=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}static{ct(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:w,icon:F,in:M,title:P,iconText:N}){if(this.registeredIds.has(w))throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:F,iconText:N,title:P,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(Dr)}addJunction({id:w,in:F}){if(this.registeredIds.has(w))throw new Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(F!==void 0){if(w===F)throw new Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw new Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw new Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(Or)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:F,in:M,title:P}){if(this.registeredIds.has(w))throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(M!==void 0){if(w===M)throw new Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:F,title:P,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:F,lhsDir:M,rhsDir:P,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:a,title:e}){if(!Re(M))throw new Error(`Invalid direction given for left hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(M)}`);if(!Re(P))throw new Error(`Invalid direction given for right hand side of edge ${w}--${F}. Expected (L,R,T,B) got ${String(P)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw new Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);const i=this.nodes.get(w).in,f=this.nodes.get(F).in;if(h&&i&&f&&i==f)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&i&&f&&i==f)throw new Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const r={lhsId:w,lhsDir:M,lhsInto:N,lhsGroup:h,rhsId:F,rhsDir:P,rhsInto:v,rhsGroup:a,title:e};this.edges.push(r);const u=this.nodes.get(w),t=this.nodes.get(F);u&&t&&(u.edges.push(this.edges[this.edges.length-1]),t.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw new Error(`An align directive requires at least two members; got ${w.members.length}`);const F=new Set;w.members.forEach(M=>{if(this.registeredIds.get(M)!=="node")throw new Error(`align ${w.direction} references [${M}], which is not a service or junction`);if(F.has(M))throw new Error(`align ${w.direction} lists [${M}] more than once`);F.add(M)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const w=new Map,F=new Map;for(const[h,a]of this.nodes.entries()){const e=new Map;for(const i of a.edges){const f=this.getNode(i.lhsId)?.in,r=this.getNode(i.rhsId)?.in;if(f&&r&&f!==r){const u=Ar(i.lhsDir,i.rhsDir);u!=="bend"&&w.set(be(f,r),u)}if(i.lhsId===h){const u=pe(i.lhsDir,i.rhsDir);u&&e.set(u,i.rhsId)}else{const u=pe(i.rhsDir,i.lhsDir);u&&e.set(u,i.lhsId)}}F.set(h,e)}const M=new Set,P=new Set(F.keys()),N=ct(h=>{const a=new Map([[h,[0,0]]]),e=[h];for(;e.length>0;){const i=e.shift();if(i){M.add(i),P.delete(i);const f=F.get(i);if(!f)throw new Error(`BFS error: adjacency list for id ${i} not found. Please report this as a bug.`);const r=a.get(i);if(!r)throw new Error(`BFS error: position for id ${i} not found in spatial map. Please report this as a bug.`);const[u,t]=r;f.forEach((s,o)=>{M.has(s)||(a.set(s,Cr([u,t],o)),e.push(s))})}}return a},"BFS"),v=[];for(;P.size>0;){const h=P.values().next().value;v.push(N(h))}this.dataStructures={adjList:F,spatialMaps:v,groupAlignments:w}}return this.dataStructures}setElementForId(w,F){this.elements.set(w,F)}getElementById(w){return this.elements.get(w)}getConfig(){return ar({...xr,...nr().architecture})}getConfigField(w){return this.getConfig()[w]}},Ir=ct((w,F)=>{Ze(w,F),w.groups.map(M=>F.addGroup(M)),w.services.map(M=>F.addService({...M,type:"service"})),w.junctions.map(M=>F.addJunction({...M,type:"junction"})),w.edges.map(M=>F.addEdge(M)),w.alignments?.map(M=>F.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Ue={parser:{yy:void 0},parse:ct(async w=>{const F=await gr("architecture",w);Se.debug(F);const M=Ue.parser?.yy;if(!(M instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ir(F,M)},"parse")},Rr=ct(w=>`
   .edge {
     stroke-width: ${w.archEdgeWidth};
     stroke: ${w.archEdgeColor};
diff --git a/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DOMoQR_0.js b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DquLxvSM.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DOMoQR_0.js
rename to apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DquLxvSM.js
index ce9d803fe..8de7f3c22 100644
--- a/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DOMoQR_0.js
+++ b/apps/pythinker-code/dist-web/assets/blockDiagram-NRAW4CY4-DquLxvSM.js
@@ -1,4 +1,4 @@
-import{g as Pe}from"./chunk-5VM5RSS4-BhXMeeD7.js";import{aC as Fe,aD as xe,aE as Me,aF as Ke,aG as Ye,aH as We,aI as Ve,aJ as Ue,aK as He,aL as Xe,aM as je,aN as Ge,aO as qe,aP as Je,aQ as Ze,aR as Qe,aS as $e,aT as et,aU as tt,aV as st,aW as rt,aX as it,aY as at,aZ as nt,a_ as ot,_ as u,A as Y,j as X,a$ as ct,d as lt,l as y,r as ut,u as gt,c as Le,a7 as ht,ay as dt,ax as pt,az as ft,k as bt,b0 as St,ah as me,ai as xt}from"./mermaid.core-Pmnag6hS.js";import{c as Lt}from"./channel-DILt7hqb.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";function mt(e){return Array.isArray(e)}function yt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(mt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],m=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",t[n],g),this.$={edgeTypeStr:t[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",t[n-3],t[n-1],t[n]),this.$={edgeTypeStr:t[n],label:t[n-1]};break;case 18:const P=parseInt(t[n]),W=p.generateId();this.$={id:W,type:"space",label:"",width:P,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",t[n-2],t[n-1],t[n]," typestr: ",t[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(t[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(t[n-1].edgeTypeStr),Z=p.edgeStrToThickness(t[n-1].edgeTypeStr),D=p.edgeStrToPattern(t[n-1].edgeTypeStr);this.$=[{id:t[n-2].id,label:t[n-2].label,type:t[n-2].type,directions:t[n-2].directions},{id:t[n-2].id+"-"+t[n].id,start:t[n-2].id,end:t[n].id,label:t[n-1].label,type:"edge",thickness:Z,pattern:D,directions:t[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[n-1],t[n]),this.$={id:t[n-1].id,label:t[n-1].label,type:p.typeStr2Type(t[n-1].typeStr),directions:t[n-1].directions,widthInColumns:parseInt(t[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",t[n]),this.$={id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",t[n]),this.$={type:"column-setting",columns:t[n]==="auto"?-1:parseInt(t[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",t[n-2],t[n-1]),p.generateId(),this.$={...t[n-2],type:"composite",children:t[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",t[n-2],t[n-1],t[n]);const A=p.generateId();this.$={id:A,type:"composite",label:"",children:t[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",t[n]),this.$={id:t[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[n-1],t[n]),this.$={id:t[n-1],label:t[n].label,typeStr:t[n].typeStr,directions:t[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",t[n]),this.$=[t[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",t[n-1],t[n]),this.$=[t[n-1]].concat(t[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",t[n-2],t[n-1],t[n]),this.$={typeStr:t[n-2]+t[n],label:t[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[n-3],t[n-2]," #3:",t[n-1],t[n]),this.$={typeStr:t[n-3]+t[n],label:t[n-2],directions:t[n-1]};break;case 35:case 36:this.$={type:"classDef",id:t[n-1].trim(),css:t[n].trim()};break;case 37:this.$={type:"applyClass",id:t[n-1].trim(),styleClass:t[n].trim()};break;case 38:this.$={type:"applyStyles",id:t[n-1].trim(),stylesStr:t[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{8:[1,20]},e(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:r,29:l,31:d,39:s,43:h,46:x}),e(S,[2,16],{14:22,15:f,16:L}),e(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(w,[2,25],{27:[1,25]}),e(S,[2,26]),{19:26,26:12,31:d},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(m,[2,13]),{26:35,31:d},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:L,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(S,[2,28]),e(S,[2,35]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),{36:[1,47]},{33:48,34:k},{15:[1,50]},e(S,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:k,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(g,i){if(i.recoverable)this.trace(g);else{var c=new Error(g);throw c.hash=i,c}},"parseError"),parse:u(function(g){var i=this,c=[0],p=[],E=[null],t=[],M=this.table,n="",P=0,W=0,J=2,V=1,Z=t.slice.call(arguments,1),D=Object.create(this.lexer),A={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(A.yy[Q]=this.yy[Q]);D.setInput(g,A.yy),A.yy.lexer=D,A.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;t.push($);var Be=D.options&&D.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(I){c.length=c.length-2*I,E.length=E.length-I,t.length=t.length-I}u(Re,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,C,ee,F={},U,B,pe,H;;){if(R=c[c.length-1],this.defaultActions[R]?C=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),C=M[R]&&M[R][N]),typeof C>"u"||!C.length||!C[0]){var te="";H=[];for(U in M[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(P+1)+`:
+import{g as Pe}from"./chunk-5VM5RSS4-BjJ31Xiv.js";import{aC as Fe,aD as xe,aE as Me,aF as Ke,aG as Ye,aH as We,aI as Ve,aJ as Ue,aK as He,aL as Xe,aM as je,aN as Ge,aO as qe,aP as Je,aQ as Ze,aR as Qe,aS as $e,aT as et,aU as tt,aV as st,aW as rt,aX as it,aY as at,aZ as nt,a_ as ot,_ as u,A as Y,j as X,a$ as ct,d as lt,l as y,r as ut,u as gt,c as Le,a7 as ht,ay as dt,ax as pt,az as ft,k as bt,b0 as St,ah as me,ai as xt}from"./mermaid.core-4ur3W-UG.js";import{c as Lt}from"./channel-Ce13qtYp.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";function mt(e){return Array.isArray(e)}function yt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(mt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],m=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",t[n],g),this.$={edgeTypeStr:t[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",t[n-3],t[n-1],t[n]),this.$={edgeTypeStr:t[n],label:t[n-1]};break;case 18:const P=parseInt(t[n]),W=p.generateId();this.$={id:W,type:"space",label:"",width:P,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",t[n-2],t[n-1],t[n]," typestr: ",t[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(t[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(t[n-1].edgeTypeStr),Z=p.edgeStrToThickness(t[n-1].edgeTypeStr),D=p.edgeStrToPattern(t[n-1].edgeTypeStr);this.$=[{id:t[n-2].id,label:t[n-2].label,type:t[n-2].type,directions:t[n-2].directions},{id:t[n-2].id+"-"+t[n].id,start:t[n-2].id,end:t[n].id,label:t[n-1].label,type:"edge",thickness:Z,pattern:D,directions:t[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[n-1],t[n]),this.$={id:t[n-1].id,label:t[n-1].label,type:p.typeStr2Type(t[n-1].typeStr),directions:t[n-1].directions,widthInColumns:parseInt(t[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",t[n]),this.$={id:t[n].id,label:t[n].label,type:p.typeStr2Type(t[n].typeStr),directions:t[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",t[n]),this.$={type:"column-setting",columns:t[n]==="auto"?-1:parseInt(t[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",t[n-2],t[n-1]),p.generateId(),this.$={...t[n-2],type:"composite",children:t[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",t[n-2],t[n-1],t[n]);const A=p.generateId();this.$={id:A,type:"composite",label:"",children:t[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",t[n]),this.$={id:t[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[n-1],t[n]),this.$={id:t[n-1],label:t[n].label,typeStr:t[n].typeStr,directions:t[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",t[n]),this.$=[t[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",t[n-1],t[n]),this.$=[t[n-1]].concat(t[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",t[n-2],t[n-1],t[n]),this.$={typeStr:t[n-2]+t[n],label:t[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[n-3],t[n-2]," #3:",t[n-1],t[n]),this.$={typeStr:t[n-3]+t[n],label:t[n-2],directions:t[n-1]};break;case 35:case 36:this.$={type:"classDef",id:t[n-1].trim(),css:t[n].trim()};break;case 37:this.$={type:"applyClass",id:t[n-1].trim(),styleClass:t[n].trim()};break;case 38:this.$={type:"applyStyles",id:t[n-1].trim(),stylesStr:t[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{8:[1,20]},e(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:r,29:l,31:d,39:s,43:h,46:x}),e(S,[2,16],{14:22,15:f,16:L}),e(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(w,[2,25],{27:[1,25]}),e(S,[2,26]),{19:26,26:12,31:d},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(m,[2,13]),{26:35,31:d},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:L,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:d,39:s,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(S,[2,28]),e(S,[2,35]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),{36:[1,47]},{33:48,34:k},{15:[1,50]},e(S,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:k,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(g,i){if(i.recoverable)this.trace(g);else{var c=new Error(g);throw c.hash=i,c}},"parseError"),parse:u(function(g){var i=this,c=[0],p=[],E=[null],t=[],M=this.table,n="",P=0,W=0,J=2,V=1,Z=t.slice.call(arguments,1),D=Object.create(this.lexer),A={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(A.yy[Q]=this.yy[Q]);D.setInput(g,A.yy),A.yy.lexer=D,A.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;t.push($);var Be=D.options&&D.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(I){c.length=c.length-2*I,E.length=E.length-I,t.length=t.length-I}u(Re,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,C,ee,F={},U,B,pe,H;;){if(R=c[c.length-1],this.defaultActions[R]?C=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),C=M[R]&&M[R][N]),typeof C>"u"||!C.length||!C[0]){var te="";H=[];for(U in M[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(P+1)+`:
 `+D.showPosition()+`
 Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(P+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(C[0]){case 1:c.push(N),E.push(D.yytext),t.push(D.yylloc),c.push(C[1]),N=null,W=D.yyleng,n=D.yytext,P=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[C[1]][1],F.$=E[E.length-B],F._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},Be&&(F._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),ee=this.performAction.apply(F,[n,W,P,A.yy,C[1],E,t].concat(Z)),typeof ee<"u")return ee;B&&(c=c.slice(0,-1*B*2),E=E.slice(0,-1*B),t=t.slice(0,-1*B)),c.push(this.productions_[C[1]][0]),E.push(F.$),t.push(F._$),pe=M[c[c.length-2]][c[c.length-1]],c.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(i,c){if(this.yy.parser)this.yy.parser.parseError(i,c);else throw new Error(i)},"parseError"),setInput:u(function(g,i){return this.yy=i||this.yy||{},this._input=g,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var i=g.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:u(function(g){var i=g.length,c=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
 `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(g){this.unput(this.match.slice(g))},"less"),pastInput:u(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var g=this.pastInput(),i=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
diff --git a/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-D3l3THs_.js b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-DWiNeOGo.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-D3l3THs_.js
rename to apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-DWiNeOGo.js
index 2b4d9a9b2..c5cd4bfc3 100644
--- a/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-D3l3THs_.js
+++ b/apps/pythinker-code/dist-web/assets/c4Diagram-UCG6FXSJ-DWiNeOGo.js
@@ -1,4 +1,4 @@
-import{d as Ne}from"./chunk-F27PBJKO-CENksy_e.js";import{s as Ae,g as Le,a as Ie,b as Me,_ as d,c as Ct,l as ce,d as Be,e as Ve,f as Ot,h as Ye,i as ye,j as Kt,w as Fe,k as Jt,m as ue}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var Yt=(function(){var t=d(function(yt,m,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=m);return x},"o"),e=[1,24],r=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],jt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Rt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],re=[12,14,33,42],Lt=[12,14,33,42,76,77,79,80],gt=[12,33],zt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,wt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...o[p]),this.$=o[p];break;case 33:_.addDeploymentNode("nodeL",...o[p]),this.$=o[p];break;case 34:_.addDeploymentNode("nodeR",...o[p]),this.$=o[p];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[p]),this.$=o[p];break;case 40:_.addPersonOrSystem("external_person",...o[p]),this.$=o[p];break;case 41:_.addPersonOrSystem("system",...o[p]),this.$=o[p];break;case 42:_.addPersonOrSystem("system_db",...o[p]),this.$=o[p];break;case 43:_.addPersonOrSystem("system_queue",...o[p]),this.$=o[p];break;case 44:_.addPersonOrSystem("external_system",...o[p]),this.$=o[p];break;case 45:_.addPersonOrSystem("external_system_db",...o[p]),this.$=o[p];break;case 46:_.addPersonOrSystem("external_system_queue",...o[p]),this.$=o[p];break;case 47:_.addContainer("container",...o[p]),this.$=o[p];break;case 48:_.addContainer("container_db",...o[p]),this.$=o[p];break;case 49:_.addContainer("container_queue",...o[p]),this.$=o[p];break;case 50:_.addContainer("external_container",...o[p]),this.$=o[p];break;case 51:_.addContainer("external_container_db",...o[p]),this.$=o[p];break;case 52:_.addContainer("external_container_queue",...o[p]),this.$=o[p];break;case 53:_.addComponent("component",...o[p]),this.$=o[p];break;case 54:_.addComponent("component_db",...o[p]),this.$=o[p];break;case 55:_.addComponent("component_queue",...o[p]),this.$=o[p];break;case 56:_.addComponent("external_component",...o[p]),this.$=o[p];break;case 57:_.addComponent("external_component_db",...o[p]),this.$=o[p];break;case 58:_.addComponent("external_component_queue",...o[p]),this.$=o[p];break;case 60:_.addRel("rel",...o[p]),this.$=o[p];break;case 61:_.addRel("birel",...o[p]),this.$=o[p];break;case 62:_.addRel("rel_u",...o[p]),this.$=o[p];break;case 63:_.addRel("rel_d",...o[p]),this.$=o[p];break;case 64:_.addRel("rel_l",...o[p]),this.$=o[p];break;case 65:_.addRel("rel_r",...o[p]),this.$=o[p];break;case 66:_.addRel("rel_b",...o[p]),this.$=o[p];break;case 67:o[p].splice(0,1),_.addRel("rel",...o[p]),this.$=o[p];break;case 68:_.updateElStyle("update_el_style",...o[p]),this.$=o[p];break;case 69:_.updateRelStyle("update_rel_style",...o[p]),this.$=o[p];break;case 70:_.updateLayoutConfig("update_layout_config",...o[p]),this.$=o[p];break;case 71:this.$=[o[p]];break;case 72:o[p].unshift(o[p-1]),this.$=o[p];break;case 73:case 75:this.$=o[p].trim();break;case 74:let xt={};xt[o[p-1].trim()]=o[p].trim(),this.$=xt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:70,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:71,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:72,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:73,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(kt,[2,14]),t(jt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Rt,[2,19]),t(Rt,[2,20]),{25:[1,78]},{27:[1,79]},t(Rt,[2,23]),{35:80,75:81,76:S,77:k,79:T,80:C},{35:86,75:81,76:S,77:k,79:T,80:C},{35:87,75:81,76:S,77:k,79:T,80:C},{35:88,75:81,76:S,77:k,79:T,80:C},{35:89,75:81,76:S,77:k,79:T,80:C},{35:90,75:81,76:S,77:k,79:T,80:C},{35:91,75:81,76:S,77:k,79:T,80:C},{35:92,75:81,76:S,77:k,79:T,80:C},{35:93,75:81,76:S,77:k,79:T,80:C},{35:94,75:81,76:S,77:k,79:T,80:C},{35:95,75:81,76:S,77:k,79:T,80:C},{35:96,75:81,76:S,77:k,79:T,80:C},{35:97,75:81,76:S,77:k,79:T,80:C},{35:98,75:81,76:S,77:k,79:T,80:C},{35:99,75:81,76:S,77:k,79:T,80:C},{35:100,75:81,76:S,77:k,79:T,80:C},{35:101,75:81,76:S,77:k,79:T,80:C},{35:102,75:81,76:S,77:k,79:T,80:C},{35:103,75:81,76:S,77:k,79:T,80:C},{35:104,75:81,76:S,77:k,79:T,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:k,79:T,80:C},{35:106,75:81,76:S,77:k,79:T,80:C},{35:107,75:81,76:S,77:k,79:T,80:C},{35:108,75:81,76:S,77:k,79:T,80:C},{35:109,75:81,76:S,77:k,79:T,80:C},{35:110,75:81,76:S,77:k,79:T,80:C},{35:111,75:81,76:S,77:k,79:T,80:C},{35:112,75:81,76:S,77:k,79:T,80:C},{35:113,75:81,76:S,77:k,79:T,80:C},{35:114,75:81,76:S,77:k,79:T,80:C},{35:115,75:81,76:S,77:k,79:T,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:k,79:T,80:C},{35:120,75:81,76:S,77:k,79:T,80:C},{35:121,75:81,76:S,77:k,79:T,80:C},{35:122,75:81,76:S,77:k,79:T,80:C},{35:123,75:81,76:S,77:k,79:T,80:C},{35:124,75:81,76:S,77:k,79:T,80:C},{35:125,75:81,76:S,77:k,79:T,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(jt,[2,17],{21:22,19:130,22:e,23:r,24:a,26:u,28:i}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:a,26:u,28:i,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(Rt,[2,21]),t(Rt,[2,22]),t(R,[2,39]),t(re,[2,71],{75:81,35:132,76:S,77:k,79:T,80:C}),t(Lt,[2,73]),{78:[1,133]},t(Lt,[2,75]),t(Lt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(gt,[2,28]),t(gt,[2,29]),t(gt,[2,30]),t(gt,[2,31]),t(gt,[2,32]),t(gt,[2,33]),t(gt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(jt,[2,18]),t(kt,[2,38]),t(re,[2,72]),t(Lt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(zt,[2,25]),t(zt,[2,26],{12:[1,138]}),t(zt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],wt=this.table,p="",xt=0,ae=0,we=2,ie=1,Oe=o.slice.call(arguments,1),A=Object.create(this.lexer),vt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(vt.yy[Xt]=this.yy[Xt]);A.setInput(m,vt.yy),vt.yy.lexer=A,vt.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var qt=A.yylloc;o.push(qt);var Pe=A.options&&A.options.ranges;typeof vt.yy.parseError=="function"?this.parseError=vt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(De,"popStack");function oe(){var B;return B=_.pop()||A.lex()||ie,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(oe,"lex");for(var M,Et,V,Ht,Tt={},Mt,j,le,Bt;;){if(Et=E[E.length-1],this.defaultActions[Et]?V=this.defaultActions[Et]:((M===null||typeof M>"u")&&(M=oe()),V=wt[Et]&&wt[Et][M]),typeof V>"u"||!V.length||!V[0]){var Qt="";Bt=[];for(Mt in wt[Et])this.terminals_[Mt]&&Mt>we&&Bt.push("'"+this.terminals_[Mt]+"'");A.showPosition?Qt="Parse error on line "+(xt+1)+`:
+import{d as Ne}from"./chunk-F27PBJKO-d2g57_ei.js";import{s as Ae,g as Le,a as Ie,b as Me,_ as d,c as Ct,l as ce,d as Be,e as Ve,f as Ot,h as Ye,i as ye,j as Kt,w as Fe,k as Jt,m as ue}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var Yt=(function(){var t=d(function(yt,m,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=m);return x},"o"),e=[1,24],r=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],jt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Rt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],re=[12,14,33,42],Lt=[12,14,33,42,76,77,79,80],gt=[12,33],zt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Wt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,wt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...o[p]),this.$=o[p];break;case 33:_.addDeploymentNode("nodeL",...o[p]),this.$=o[p];break;case 34:_.addDeploymentNode("nodeR",...o[p]),this.$=o[p];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[p]),this.$=o[p];break;case 40:_.addPersonOrSystem("external_person",...o[p]),this.$=o[p];break;case 41:_.addPersonOrSystem("system",...o[p]),this.$=o[p];break;case 42:_.addPersonOrSystem("system_db",...o[p]),this.$=o[p];break;case 43:_.addPersonOrSystem("system_queue",...o[p]),this.$=o[p];break;case 44:_.addPersonOrSystem("external_system",...o[p]),this.$=o[p];break;case 45:_.addPersonOrSystem("external_system_db",...o[p]),this.$=o[p];break;case 46:_.addPersonOrSystem("external_system_queue",...o[p]),this.$=o[p];break;case 47:_.addContainer("container",...o[p]),this.$=o[p];break;case 48:_.addContainer("container_db",...o[p]),this.$=o[p];break;case 49:_.addContainer("container_queue",...o[p]),this.$=o[p];break;case 50:_.addContainer("external_container",...o[p]),this.$=o[p];break;case 51:_.addContainer("external_container_db",...o[p]),this.$=o[p];break;case 52:_.addContainer("external_container_queue",...o[p]),this.$=o[p];break;case 53:_.addComponent("component",...o[p]),this.$=o[p];break;case 54:_.addComponent("component_db",...o[p]),this.$=o[p];break;case 55:_.addComponent("component_queue",...o[p]),this.$=o[p];break;case 56:_.addComponent("external_component",...o[p]),this.$=o[p];break;case 57:_.addComponent("external_component_db",...o[p]),this.$=o[p];break;case 58:_.addComponent("external_component_queue",...o[p]),this.$=o[p];break;case 60:_.addRel("rel",...o[p]),this.$=o[p];break;case 61:_.addRel("birel",...o[p]),this.$=o[p];break;case 62:_.addRel("rel_u",...o[p]),this.$=o[p];break;case 63:_.addRel("rel_d",...o[p]),this.$=o[p];break;case 64:_.addRel("rel_l",...o[p]),this.$=o[p];break;case 65:_.addRel("rel_r",...o[p]),this.$=o[p];break;case 66:_.addRel("rel_b",...o[p]),this.$=o[p];break;case 67:o[p].splice(0,1),_.addRel("rel",...o[p]),this.$=o[p];break;case 68:_.updateElStyle("update_el_style",...o[p]),this.$=o[p];break;case 69:_.updateRelStyle("update_rel_style",...o[p]),this.$=o[p];break;case 70:_.updateLayoutConfig("update_layout_config",...o[p]),this.$=o[p];break;case 71:this.$=[o[p]];break;case 72:o[p].unshift(o[p-1]),this.$=o[p];break;case 73:case 75:this.$=o[p].trim();break;case 74:let xt={};xt[o[p-1].trim()]=o[p].trim(),this.$=xt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:70,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:71,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:72,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{13:73,19:20,20:21,21:22,22:e,23:r,24:a,26:u,28:i,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(kt,[2,14]),t(jt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Rt,[2,19]),t(Rt,[2,20]),{25:[1,78]},{27:[1,79]},t(Rt,[2,23]),{35:80,75:81,76:S,77:k,79:T,80:C},{35:86,75:81,76:S,77:k,79:T,80:C},{35:87,75:81,76:S,77:k,79:T,80:C},{35:88,75:81,76:S,77:k,79:T,80:C},{35:89,75:81,76:S,77:k,79:T,80:C},{35:90,75:81,76:S,77:k,79:T,80:C},{35:91,75:81,76:S,77:k,79:T,80:C},{35:92,75:81,76:S,77:k,79:T,80:C},{35:93,75:81,76:S,77:k,79:T,80:C},{35:94,75:81,76:S,77:k,79:T,80:C},{35:95,75:81,76:S,77:k,79:T,80:C},{35:96,75:81,76:S,77:k,79:T,80:C},{35:97,75:81,76:S,77:k,79:T,80:C},{35:98,75:81,76:S,77:k,79:T,80:C},{35:99,75:81,76:S,77:k,79:T,80:C},{35:100,75:81,76:S,77:k,79:T,80:C},{35:101,75:81,76:S,77:k,79:T,80:C},{35:102,75:81,76:S,77:k,79:T,80:C},{35:103,75:81,76:S,77:k,79:T,80:C},{35:104,75:81,76:S,77:k,79:T,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:k,79:T,80:C},{35:106,75:81,76:S,77:k,79:T,80:C},{35:107,75:81,76:S,77:k,79:T,80:C},{35:108,75:81,76:S,77:k,79:T,80:C},{35:109,75:81,76:S,77:k,79:T,80:C},{35:110,75:81,76:S,77:k,79:T,80:C},{35:111,75:81,76:S,77:k,79:T,80:C},{35:112,75:81,76:S,77:k,79:T,80:C},{35:113,75:81,76:S,77:k,79:T,80:C},{35:114,75:81,76:S,77:k,79:T,80:C},{35:115,75:81,76:S,77:k,79:T,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:f,41:b,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:k,79:T,80:C},{35:120,75:81,76:S,77:k,79:T,80:C},{35:121,75:81,76:S,77:k,79:T,80:C},{35:122,75:81,76:S,77:k,79:T,80:C},{35:123,75:81,76:S,77:k,79:T,80:C},{35:124,75:81,76:S,77:k,79:T,80:C},{35:125,75:81,76:S,77:k,79:T,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(jt,[2,17],{21:22,19:130,22:e,23:r,24:a,26:u,28:i}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:a,26:u,28:i,34:n,36:l,37:s,38:h,39:y,40:f,41:b,44:v,45:w,46:N,47:O,48:P,49:I,50:W,51:X,52:q,53:H,54:Q,55:K,56:G,57:J,58:Z,59:$,60:tt,61:et,62:nt,63:st,64:rt,65:at,66:it,67:ot,68:lt,69:ct,70:ut,71:ht,72:dt,73:pt,74:ft}),t(Rt,[2,21]),t(Rt,[2,22]),t(R,[2,39]),t(re,[2,71],{75:81,35:132,76:S,77:k,79:T,80:C}),t(Lt,[2,73]),{78:[1,133]},t(Lt,[2,75]),t(Lt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(gt,[2,28]),t(gt,[2,29]),t(gt,[2,30]),t(gt,[2,31]),t(gt,[2,32]),t(gt,[2,33]),t(gt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(jt,[2,18]),t(kt,[2,38]),t(re,[2,72]),t(Lt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(zt,[2,25]),t(zt,[2,26],{12:[1,138]}),t(zt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],wt=this.table,p="",xt=0,ae=0,we=2,ie=1,Oe=o.slice.call(arguments,1),A=Object.create(this.lexer),vt={yy:{}};for(var Xt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Xt)&&(vt.yy[Xt]=this.yy[Xt]);A.setInput(m,vt.yy),vt.yy.lexer=A,vt.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var qt=A.yylloc;o.push(qt);var Pe=A.options&&A.options.ranges;typeof vt.yy.parseError=="function"?this.parseError=vt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function De(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(De,"popStack");function oe(){var B;return B=_.pop()||A.lex()||ie,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(oe,"lex");for(var M,Et,V,Ht,Tt={},Mt,j,le,Bt;;){if(Et=E[E.length-1],this.defaultActions[Et]?V=this.defaultActions[Et]:((M===null||typeof M>"u")&&(M=oe()),V=wt[Et]&&wt[Et][M]),typeof V>"u"||!V.length||!V[0]){var Qt="";Bt=[];for(Mt in wt[Et])this.terminals_[Mt]&&Mt>we&&Bt.push("'"+this.terminals_[Mt]+"'");A.showPosition?Qt="Parse error on line "+(xt+1)+`:
 `+A.showPosition()+`
 Expecting `+Bt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Qt="Parse error on line "+(xt+1)+": Unexpected "+(M==ie?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Qt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:qt,expected:Bt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,ae=A.yyleng,p=A.yytext,xt=A.yylineno,qt=A.yylloc;break;case 2:if(j=this.productions_[V[1]][1],Tt.$=D[D.length-j],Tt._$={first_line:o[o.length-(j||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(j||1)].first_column,last_column:o[o.length-1].last_column},Pe&&(Tt._$.range=[o[o.length-(j||1)].range[0],o[o.length-1].range[1]]),Ht=this.performAction.apply(Tt,[p,ae,xt,vt.yy,V[1],D,o].concat(Oe)),typeof Ht<"u")return Ht;j&&(E=E.slice(0,-1*j*2),D=D.slice(0,-1*j),o=o.slice(0,-1*j)),E.push(this.productions_[V[1]][0]),D.push(Tt.$),o.push(Tt._$),le=wt[E[E.length-2]][E[E.length-1]],E.push(le);break;case 3:return!0}}return!0},"parse")},Re=(function(){var yt={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
 `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
diff --git a/apps/pythinker-code/dist-web/assets/channel-Ce13qtYp.js b/apps/pythinker-code/dist-web/assets/channel-Ce13qtYp.js
new file mode 100644
index 000000000..de50973b9
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/channel-Ce13qtYp.js
@@ -0,0 +1 @@
+import{U as a,C as n}from"./mermaid.core-4ur3W-UG.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
diff --git a/apps/pythinker-code/dist-web/assets/channel-DILt7hqb.js b/apps/pythinker-code/dist-web/assets/channel-DILt7hqb.js
deleted file mode 100644
index f4e616348..000000000
--- a/apps/pythinker-code/dist-web/assets/channel-DILt7hqb.js
+++ /dev/null
@@ -1 +0,0 @@
-import{U as a,C as n}from"./mermaid.core-Pmnag6hS.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-BJtTXqt1.js b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-By4pMuFm.js
similarity index 67%
rename from apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-BJtTXqt1.js
rename to apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-By4pMuFm.js
index 0f1a75042..db46ebaf7 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-BJtTXqt1.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-2Q5K7J3B-By4pMuFm.js
@@ -1 +1 @@
-import{_ as i}from"./mermaid.core-Pmnag6hS.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I};
+import{_ as i}from"./mermaid.core-4ur3W-UG.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BhXMeeD7.js b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BjJ31Xiv.js
similarity index 83%
rename from apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BhXMeeD7.js
rename to apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BjJ31Xiv.js
index 5c89f4f64..5dc2434da 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BhXMeeD7.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-5VM5RSS4-BjJ31Xiv.js
@@ -1,4 +1,4 @@
-import{_ as e}from"./mermaid.core-Pmnag6hS.js";var l=e(()=>`
+import{_ as e}from"./mermaid.core-4ur3W-UG.js";var l=e(()=>`
   /* Font Awesome icon styling - consolidated */
   .label-icon {
     display: inline-block;
diff --git a/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CENksy_e.js b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-d2g57_ei.js
similarity index 96%
rename from apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CENksy_e.js
rename to apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-d2g57_ei.js
index 4281957fb..136c982d1 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-CENksy_e.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-F27PBJKO-d2g57_ei.js
@@ -1 +1 @@
-import{_ as i,j as l,n as d,o}from"./mermaid.core-Pmnag6hS.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h};
+import{_ as i,j as l,n as d,o}from"./mermaid.core-4ur3W-UG.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D54gu-ld.js b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D-57FaZo.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D54gu-ld.js
rename to apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D-57FaZo.js
index 93fb3553f..7e1f6cc5f 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D54gu-ld.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-G27WJ6UU-D-57FaZo.js
@@ -1,4 +1,4 @@
-import{g as te}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as ee}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as f,l as _,c as $,y as se,z as ie,a as re,b as ae,g as ne,s as oe,p as le,q as ce,aa as he,k as j,r as ue,j as bt}from"./mermaid.core-Pmnag6hS.js";import{f as de}from"./chunk-F27PBJKO-CENksy_e.js";import{p as fe}from"./purify.es-5AjVNlXF.js";var vt=(function(){var t=f(function(V,a,u,r){for(u=u||{},r=V.length;r--;u[V[r]]=a);return u},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],x=[1,20],k=[1,21],d=[1,22],L=[1,23],R=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],I=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,u,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:N,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:N,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,u){if(u.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=u,r}},"parseError"),parse:f(function(a){var u=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(w){r.length=r.length-2*w,E.length=E.length-w,i.length=i.length-w}f(Zt,"popStack");function Lt(){var w;return w=g.pop()||b.lex()||Q,typeof w!="number"&&(w instanceof Array&&(g=w,w=g.pop()),w=u.symbols_[w]||w),w}f(Lt,"lex");for(var A,W,O,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?O=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),O=B[W]&&B[W][A]),typeof O>"u"||!O.length||!O[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`:
+import{g as te}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as ee}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as f,l as _,c as $,y as se,z as ie,a as re,b as ae,g as ne,s as oe,p as le,q as ce,aa as he,k as j,r as ue,j as bt}from"./mermaid.core-4ur3W-UG.js";import{f as de}from"./chunk-F27PBJKO-d2g57_ei.js";import{p as fe}from"./purify.es-5AjVNlXF.js";var vt=(function(){var t=f(function(V,a,u,r){for(u=u||{},r=V.length;r--;u[V[r]]=a);return u},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],N=[1,33],x=[1,20],k=[1,21],d=[1,22],L=[1,23],R=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],I=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,u,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:N,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:N,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:N,25:x,26:k,27:d,28:L,29:R,32:25,33:v,35:F,37:C,38:P,41:I,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,u){if(u.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=u,r}},"parseError"),parse:f(function(a){var u=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(w){r.length=r.length-2*w,E.length=E.length-w,i.length=i.length-w}f(Zt,"popStack");function Lt(){var w;return w=g.pop()||b.lex()||Q,typeof w!="number"&&(w instanceof Array&&(g=w,w=g.pop()),w=u.symbols_[w]||w),w}f(Lt,"lex");for(var A,W,O,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?O=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),O=B[W]&&B[W][A]),typeof O>"u"||!O.length||!O[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`:
 `+b.showPosition()+`
 Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(O[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(O[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[O[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,O[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[O[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(u,r){if(this.yy.parser)this.yy.parser.parseError(u,r);else throw new Error(u)},"parseError"),setInput:f(function(a,u){return this.yy=u||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var u=a.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var u=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
 `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),u=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
diff --git a/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-DvwwB7DW.js b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CBKlOueZ.js
similarity index 71%
rename from apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-DvwwB7DW.js
rename to apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CBKlOueZ.js
index bebbcc045..4c016825c 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-DvwwB7DW.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-JWPE2WC7-CBKlOueZ.js
@@ -1 +1 @@
-import{_ as i}from"./mermaid.core-Pmnag6hS.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
+import{_ as i}from"./mermaid.core-4ur3W-UG.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-8Wpy_Sgd.js b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BJFLBZ7h.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-8Wpy_Sgd.js
rename to apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BJFLBZ7h.js
index a076ec5ae..5c2972a6a 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-8Wpy_Sgd.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-LCL6LL3I-BJFLBZ7h.js
@@ -1,4 +1,4 @@
-import{g as tt}from"./chunk-5VM5RSS4-BhXMeeD7.js";import{g as st}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as it}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as f,l as Ie,c as F,x as at,y as nt,z as Oe,j as de,b as rt,a as ut,s as lt,g as ct,p as ot,q as ht,k as I,r as dt,t as pt,i as At,a6 as G}from"./mermaid.core-Pmnag6hS.js";import{f as ft}from"./chunk-F27PBJKO-CENksy_e.js";import{p as gt}from"./purify.es-5AjVNlXF.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`:
+import{g as tt}from"./chunk-5VM5RSS4-BjJ31Xiv.js";import{g as st}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as it}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as f,l as Ie,c as F,x as at,y as nt,z as Oe,j as de,b as rt,a as ut,s as lt,g as ct,p as ot,q as ht,k as I,r as dt,t as pt,i as At,a6 as G}from"./mermaid.core-4ur3W-UG.js";import{f as ft}from"./chunk-F27PBJKO-d2g57_ei.js";import{p as gt}from"./purify.es-5AjVNlXF.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`:
 `+D.showPosition()+`
 Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
 `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
diff --git a/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-BOop7K_8.js b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Bc64Qx3F.js
similarity index 87%
rename from apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-BOop7K_8.js
rename to apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Bc64Qx3F.js
index 4e43d1461..3a872600c 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-BOop7K_8.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-POPQ4Y6H-Bc64Qx3F.js
@@ -1 +1 @@
-import{_ as a,d as w,l as x}from"./mermaid.core-Pmnag6hS.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s};
+import{_ as a,d as w,l as x}from"./mermaid.core-4ur3W-UG.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-XNRd51cY.js b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-C1yhxvNc.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-XNRd51cY.js
rename to apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-C1yhxvNc.js
index ed1ff72f9..25eb367fe 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-XNRd51cY.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-SVP7TREG-C1yhxvNc.js
@@ -1,4 +1,4 @@
-import{_ as p,l as w,G as L,A as E,r as X,X as I,d as G,i as H,c as q}from"./mermaid.core-Pmnag6hS.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,q()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),X(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,`
+import{_ as p,l as w,G as L,A as E,r as X,X as I,d as G,i as H,c as q}from"./mermaid.core-4ur3W-UG.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,q()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),X(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,`
 `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...I(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return`
   .railroad-diagram {
     font-family: ${i};
diff --git a/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-LvYS55fD.js b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-B0zDZEAk.js
similarity index 72%
rename from apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-LvYS55fD.js
rename to apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-B0zDZEAk.js
index a0cfbb7ca..57b238ca4 100644
--- a/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-LvYS55fD.js
+++ b/apps/pythinker-code/dist-web/assets/chunk-XXDRQBXY-B0zDZEAk.js
@@ -1 +1 @@
-import{_ as a,j as o}from"./mermaid.core-Pmnag6hS.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
+import{_ as a,j as o}from"./mermaid.core-4ur3W-UG.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-Bf2t55u3.js b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-Bf2t55u3.js
deleted file mode 100644
index 6d1200de8..000000000
--- a/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-Bf2t55u3.js
+++ /dev/null
@@ -1 +0,0 @@
-import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-8Wpy_Sgd.js";import{_ as i}from"./mermaid.core-Pmnag6hS.js";import"./chunk-5VM5RSS4-BhXMeeD7.js";import"./chunk-XXDRQBXY-LvYS55fD.js";import"./chunk-POPQ4Y6H-BOop7K_8.js";import"./chunk-F27PBJKO-CENksy_e.js";import"./purify.es-5AjVNlXF.js";import"./index-BK-wRR5p.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-iewAXWXR.js b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-iewAXWXR.js
new file mode 100644
index 000000000..74f0bdc09
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/classDiagram-DTDB5LWJ-iewAXWXR.js
@@ -0,0 +1 @@
+import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-BJFLBZ7h.js";import{_ as i}from"./mermaid.core-4ur3W-UG.js";import"./chunk-5VM5RSS4-BjJ31Xiv.js";import"./chunk-XXDRQBXY-B0zDZEAk.js";import"./chunk-POPQ4Y6H-Bc64Qx3F.js";import"./chunk-F27PBJKO-d2g57_ei.js";import"./purify.es-5AjVNlXF.js";import"./index-C0iEUKAq.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-Bf2t55u3.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-Bf2t55u3.js
deleted file mode 100644
index 6d1200de8..000000000
--- a/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-Bf2t55u3.js
+++ /dev/null
@@ -1 +0,0 @@
-import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-8Wpy_Sgd.js";import{_ as i}from"./mermaid.core-Pmnag6hS.js";import"./chunk-5VM5RSS4-BhXMeeD7.js";import"./chunk-XXDRQBXY-LvYS55fD.js";import"./chunk-POPQ4Y6H-BOop7K_8.js";import"./chunk-F27PBJKO-CENksy_e.js";import"./purify.es-5AjVNlXF.js";import"./index-BK-wRR5p.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-iewAXWXR.js b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-iewAXWXR.js
new file mode 100644
index 000000000..74f0bdc09
--- /dev/null
+++ b/apps/pythinker-code/dist-web/assets/classDiagram-v2-JRS7N3AN-iewAXWXR.js
@@ -0,0 +1 @@
+import{s as a,c as s,a as e,C as t}from"./chunk-LCL6LL3I-BJFLBZ7h.js";import{_ as i}from"./mermaid.core-4ur3W-UG.js";import"./chunk-5VM5RSS4-BjJ31Xiv.js";import"./chunk-XXDRQBXY-B0zDZEAk.js";import"./chunk-POPQ4Y6H-Bc64Qx3F.js";import"./chunk-F27PBJKO-d2g57_ei.js";import"./purify.es-5AjVNlXF.js";import"./index-C0iEUKAq.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
diff --git a/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJYw1bPd.js b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-vlSnVTfO.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJYw1bPd.js
rename to apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-vlSnVTfO.js
index bdd547a51..9f9405334 100644
--- a/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-DJYw1bPd.js
+++ b/apps/pythinker-code/dist-web/assets/cose-bilkent-JH36ORCC-vlSnVTfO.js
@@ -1 +1 @@
-import{b4 as lt,_ as V,l as $,j as gt}from"./mermaid.core-Pmnag6hS.js";import{c as tt}from"./cytoscape.esm-CNiYdHpY.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render};
+import{b4 as lt,_ as V,l as $,j as gt}from"./mermaid.core-4ur3W-UG.js";import{c as tt}from"./cytoscape.esm-CNiYdHpY.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(k)),k.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{$.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){$.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return $.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw $.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render};
diff --git a/apps/pythinker-code/dist-web/assets/cssMode-DuuEdolQ.js b/apps/pythinker-code/dist-web/assets/cssMode-D5w7-Er3.js
similarity index 93%
rename from apps/pythinker-code/dist-web/assets/cssMode-DuuEdolQ.js
rename to apps/pythinker-code/dist-web/assets/cssMode-D5w7-Er3.js
index 97f699181..cb4ed8525 100644
--- a/apps/pythinker-code/dist-web/assets/cssMode-DuuEdolQ.js
+++ b/apps/pythinker-code/dist-web/assets/cssMode-D5w7-Er3.js
@@ -1 +1 @@
-import{c as h,l as s}from"./editor.main-1e103Orc.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-DhcohILl.js";import{h as y,i as U,j as T,t as x,k as j}from"./lspLanguageFeatures-DhcohILl.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const A=120*1e3;class C{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>A&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-uch7pA5g.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function L(o){const n=[],e=[],a=new C(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,y as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,C as WorkerManager,U as fromPosition,T as fromRange,L as setupMode,x as toRange,j as toTextEdit};
+import{c as h,l as s}from"./editor.main-CmoCOdG5.js";import{C as c,H as u,D as p,a as m,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-C-mvtNbB.js";import{h as y,i as U,j as T,t as x,k as j}from"./lspLanguageFeatures-C-mvtNbB.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const A=120*1e3;class C{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>A&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=h({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-uch7pA5g.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function L(o){const n=[],e=[],a=new C(o);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function l(){const{languageId:t,modeConfiguration:i}=o;g(e),i.completionItems&&e.push(s.registerCompletionItemProvider(t,new c(r,["/","-",":"]))),i.hovers&&e.push(s.registerHoverProvider(t,new u(r))),i.documentHighlights&&e.push(s.registerDocumentHighlightProvider(t,new p(r))),i.definitions&&e.push(s.registerDefinitionProvider(t,new m(r))),i.references&&e.push(s.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(s.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(s.registerRenameProvider(t,new w(r))),i.colors&&e.push(s.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(s.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,o.onDidChange)),i.selectionRanges&&e.push(s.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(s.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(s.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return l(),n.push(d(e)),d(n)}function d(o){return{dispose:()=>g(o)}}function g(o){for(;o.length;)o.pop().dispose()}export{c as CompletionAdapter,m as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,y as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,u as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,C as WorkerManager,U as fromPosition,T as fromRange,L as setupMode,x as toRange,j as toTextEdit};
diff --git a/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CwX4S6So.js b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B_2mZ5_M.js
similarity index 99%
rename from apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CwX4S6So.js
rename to apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B_2mZ5_M.js
index aecf27205..e70ba851f 100644
--- a/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-CwX4S6So.js
+++ b/apps/pythinker-code/dist-web/assets/cynefin-OW5HDTMX-B_2mZ5_M.js
@@ -1,4 +1,4 @@
-import{bR as et}from"./index-BK-wRR5p.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[`
+import{bR as et}from"./index-C0iEUKAq.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[`
 `,`\r
 `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),G=rt(),St=s(()=>G.domains,"getDomains"),Mt=s(()=>G.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(Y.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),G=rt()},"clear"),X={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,X),X.setDomains(t.domains),X.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);Y.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();Y.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),O=["complex","complicated","chaotic","clear"];for(const l of O){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of O){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of O){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const H=x.getBBox();H.width>0&&($=H.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){Y.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,H=-x/C,ht=$/C,et=M+H*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Gt=s(()=>{const t=Vt();return`
+import{p as xt}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{s as gt,g as $t,q as bt,p as wt,a as Ct,b as vt,_ as s,l as Y,G as Dt,d as kt,r as At,D as U,A as Q,E as Tt,X as ot}from"./mermaid.core-4ur3W-UG.js";import{p as Bt}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),G=rt(),St=s(()=>G.domains,"getDomains"),Mt=s(()=>G.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(Y.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),G=rt()},"clear"),X={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,X),X.setDomains(t.domains),X.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);Y.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();Y.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),O=["complex","complicated","chaotic","clear"];for(const l of O){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of O){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of O){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const H=x.getBBox();H.width>0&&($=H.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){Y.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,H=-x/C,ht=$/C,et=M+H*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Gt=s(()=>{const t=Vt();return`
 	.cynefinDomain {
 		stroke: none;
 	}
diff --git a/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BTFijvde.js b/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BWn6Idgx.js
similarity index 98%
rename from apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BTFijvde.js
rename to apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BWn6Idgx.js
index 4cee590ef..a02b9b6a7 100644
--- a/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BTFijvde.js
+++ b/apps/pythinker-code/dist-web/assets/dagre-3AP2YEHR-BWn6Idgx.js
@@ -1,4 +1,4 @@
-import{_ as m,an as x,c as k,a7 as O,l as p,ao as A,ap as Y,aq as b,ar as _,as as z,at as H,au as D,av as J,aw as T,ax as X,ai as R,ag as F,ay as q,az as W}from"./mermaid.core-Pmnag6hS.js";import{l as j}from"./layout-WxS0y9O_.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var C=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),U=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),K=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Q=m((t,e,r,d,a)=>{const f=[],u=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&u.add(i),o!==d&&u.add(o)}),u.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,u=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+u;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-u;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}case"top":default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const u=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:u,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};case"top":default:return{x:u,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(u=>{const c=t.edge(u);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:u.v,end:u.w})}else a.push({edge:c,start:u.v,end:u.w})}),d.forEach(u=>{if(u.length!==3){u.forEach(h=>a.push(h));return}u.sort((h,E)=>h.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=u,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){u.forEach(h=>a.push(h));return}const n={width:l.edge.width,height:l.edge.height},L=Q(t,o,u,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const u=e.graph().rankdir;p.trace("Dir in recursive render - dir:",u);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=U(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const h=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX
+import{_ as m,an as x,c as k,a7 as O,l as p,ao as A,ap as Y,aq as b,ar as _,as as z,at as H,au as D,av as J,aw as T,ax as X,ai as R,ag as F,ay as q,az as W}from"./mermaid.core-4ur3W-UG.js";import{l as j}from"./layout-g7MtGH-g.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var C=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),U=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),K=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Q=m((t,e,r,d,a)=>{const f=[],u=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&u.add(i),o!==d&&u.add(o)}),u.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,u=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+u;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-u;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}case"top":default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const u=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:u,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};case"top":default:return{x:u,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(u=>{const c=t.edge(u);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:u.v,end:u.w})}else a.push({edge:c,start:u.v,end:u.w})}),d.forEach(u=>{if(u.length!==3){u.forEach(h=>a.push(h));return}u.sort((h,E)=>h.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=u,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){u.forEach(h=>a.push(h));return}const n={width:l.edge.width,height:l.edge.height},L=Q(t,o,u,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const u=e.graph().rankdir;p.trace("Dir in recursive render - dir:",u);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=U(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const h=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX
  Node.id = `,y,`
  data=`,h.height,`
 Parent cluster`,a.height),e.setNode(a.id,h),e.parent(y)||(p.trace("Setting parent",y,a.id),e.setParent(y,a.id,h))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){p.info("Cluster identified XBX",y,g.width,e.node(y));const{ranksep:h,nodesep:E}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:h+25,nodesep:E});const S=await oe({element:i,graph:g.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),N=S.elem;z(g,N),g.diff=S.diff||0,p.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),H(N,g)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),p.trace(D(g.id,e)),b.set(g.id,{id:D(g.id,e),node:g})):(p.trace("Node - the non recursive path XAX",y,i,e.node(y),u),await J(i,e.node(y),{config:f,dir:u}))})),await m(async()=>{const y=e.edges().map(async function(g){const h=e.edge(g.v,g.w,g.name);if(p.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),p.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),p.info("Fix",b,"ids:",g.v,g.w,"Translating: ",b.get(g.v),b.get(g.w)),n&&h.selfLoop){if(h.selfLoop.order!==1)return;const E={...h.originalEdge,...h,id:h.selfLoop.id,startLabelLeft:h.originalEdge?.startLabelLeft??h.startLabelLeft,startLabelRight:h.originalEdge?.startLabelRight??h.startLabelRight,endLabelLeft:h.originalEdge?.endLabelLeft??h.endLabelLeft,endLabelRight:h.originalEdge?.endLabelRight??h.endLabelRight};await X(s,E),h.width=E.width,h.height=E.height,h.labelStyle=E.labelStyle;return}await X(s,h)});await Promise.all(y)},"processEdges")();const{subGraphTitleTotalMargin:w}=T(f);return{elem:o,graph:e,groups:{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:n,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=m(t=>{p.info("############################################# XXX"),p.info("###                Layout                 ### XXX"),p.info("############################################# XXX"),j(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{const d=t.node(e);if(!d)return;const a={...d};return d?.clusterNode?a.y=(d.y??0)+r:t.children(e).length>0?a.height=(d.height??0)+r:a.y=(d.y??0)+r/2,a},"normalizeDagreNode"),v=m((t,e)=>{K.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+d:a.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{const{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:a=0}=e,f=new Map(t.nodes.map(c=>[c.id,c]));x(r).forEach(c=>{const l=$(r,c,a);if(!l)return;v(r.node(c),l);const s=f.get(c);s&&v(s,l)});const u=a/2;return t.edges=B(r,u,{mergeSelfLoops:d}).map(({edge:c,start:l,end:s})=>ee(c,l,s,u)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:a,id:f,mergeSelfLoops:u,subGraphTitleTotalMargin:c})=>{let l=0;await Promise.all(x(e).map(async function(o){const n=e.node(o);if(p.info("Position XBX => "+o+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,p.info("A tainted cluster node XBX1",o,n.id,n.width,n.height,n.x,n.y,e.parent(o)),b.get(n.id).node=n,R(n);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,n.id,n.x,n.y,n.width,n.height,e.parent(o)),n.height+=c,e.node(n.parentId);const L=n?.padding/2||0,w=n?.labelBBox?.height||0,y=w-L||0;p.debug("OffsetY",y,"labelHeight",w,"halfPadding",L),await F(r,n),b.get(n.id).node=n}else{const L=e.node(n.parentId);n.y+=c/2,p.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",L,L?.offsetY,n),R(n)}}));const s=c/2;return B(e,s,{mergeSelfLoops:u}).forEach(function({edge:o,start:n,end:L}){p.info("Edge "+n+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(h=>h.y+=s);const w=e.node(n),y=e.node(L),g=q(d,o,b,a,w,y,f);W(o,g)}),e.nodes().forEach(function(o){const n=e.node(o);p.info(o,n.type,n.diff),n.isGroup&&(l=n.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{const e=await I(t);return M(e.graph),await re(e)},"renderDagreSubgraph"),G=m(t=>{const e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){const d=r.start,a=d+"---"+d+"---1",f=d+"---"+d+"---2",u=e.node(d);e.setNode(a,{domId:a,id:a,parentId:u.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,u.parentId),e.setNode(f,{domId:f,id:f,parentId:u.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,u.parentId);const c=structuredClone(r),l=structuredClone(r),s=structuredClone(r),i=structuredClone(r);l.originalEdge=c,l.selfLoop={id:c.id,order:0},s.originalEdge=c,s.selfLoop={id:c.id,order:1},i.originalEdge=c,i.selfLoop={id:c.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",s.startLabelRight="",s.startLabelLeft="",s.endLabelLeft="",s.endLabelRight="",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=d+"-cyclic-special-mid",i.label="",i.startLabelRight="",i.startLabelLeft="",i.arrowTypeStart="none",u.isGroup&&(l.fromCluster=d,i.toCluster=d),i.id=d+"-cyclic-special-2",i.arrowTypeStart="none",e.setEdge(d,a,l,d+"-cyclic-special-0"),e.setEdge(a,f,s,d+"-cyclic-special-1"),e.setEdge(f,d,i,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),A(e),{graph:e}},"prepareLayoutForDagre"),ae=m(async(t,{element:e,preparedLayout:r})=>{const d=r??G(t),a=k(),f=await I({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:a});return d.measuredLayout=f,f},"measureDagreLayout"),ne=m((t,e)=>{const r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return M(r.graph),te(t,r),r},"runDagreLayoutCore"),se=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),ie=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),fe=Y({prepareLayout:G,measureLayout:ae,runLayoutCore:ne,paintOptions:{clusterDb:b,getNodes:se,getEdgeNode:ie,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,B as getEdgesToRender,ae as measureDagreLayout,G as prepareLayoutForDagre,fe as render,ne as runDagreLayoutCore};
diff --git a/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-Bry2fVtY.js b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CsGEy4pv.js
similarity index 96%
rename from apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-Bry2fVtY.js
rename to apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CsGEy4pv.js
index df43c58bb..54aa93acb 100644
--- a/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-Bry2fVtY.js
+++ b/apps/pythinker-code/dist-web/assets/diagram-S7CK7UJ4-CsGEy4pv.js
@@ -1,4 +1,4 @@
-import{I as X}from"./chunk-2Q5K7J3B-BJtTXqt1.js";import{p as z}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{p as O,b as G,s as Y,q as P,g as F,a as q,_ as g,D as N,l as A,G as Z,d as j,A as E,r as U,i as J,aj as K,E as Q,ak as ee}from"./mermaid.core-Pmnag6hS.js";import{p as te}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re="    ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
+import{I as X}from"./chunk-2Q5K7J3B-By4pMuFm.js";import{p as z}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{p as O,b as G,s as Y,q as P,g as F,a as q,_ as g,D as N,l as A,G as Z,d as j,A as E,r as U,i as J,aj as K,E as Q,ak as ee}from"./mermaid.core-4ur3W-UG.js";import{p as te}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re="    ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
 `),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),U()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:q,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(n=>{z(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),$=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;$(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;$(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
 `+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=Z(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),j(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
diff --git a/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-CGYnSu9y.js b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-NCrmzyFy.js
similarity index 95%
rename from apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-CGYnSu9y.js
rename to apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-NCrmzyFy.js
index b9d2191cc..e6adebdb8 100644
--- a/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-CGYnSu9y.js
+++ b/apps/pythinker-code/dist-web/assets/diagram-UQ7AKVKN-NCrmzyFy.js
@@ -1,4 +1,4 @@
-import{p as I}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{s as _,g as E,q as D,p as F,a as G,b as P,_ as c,G as z,r as B,D as w,A as C,E as W,l as b,X as V,d as H}from"./mermaid.core-Pmnag6hS.js";import{p as X}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),j=W.radar,U=c(()=>w({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),q=c(()=>m.curves,"getCurves"),K=c(()=>m.options,"getOptions"),N=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:q,getOptions:K,setAxes:N,setCurves:Y,setOptions:J,getConfig:U,clear:Q,setAccTitle:P,getAccTitle:G,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;rw({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),q=c(()=>m.curves,"getCurves"),K=c(()=>m.options,"getOptions"),N=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:q,getOptions:K,setAxes:N,setCurves:Y,setOptions:J,getConfig:U,clear:Q,setAccTitle:P,getAccTitle:G,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;rge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let l;K(i)?(g.debug("source frame",i.sourceFrames),l=n.frames.filter(d=>i.sourceFrames.some(c=>c.$refText===d.name)),l.forEach(d=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:d})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const l={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,l)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,l),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{q as oe,p as se,s as le,g as de,a as ce,b as me,_ as o,l as g,c as D,j as ue,B as xe,r as fe,D as ge,A as M,E as he,i as y,w as P,al as pe}from"./mermaid.core-4ur3W-UG.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var T="position frame",$="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let l;K(i)?(g.debug("source frame",i.sourceFrames),l=n.frames.filter(d=>i.sourceFrames.some(c=>c.$refText===d.name)),l.forEach(d=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:d})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const l={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,l)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,l),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,l),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:$,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,l=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,l,r),m=c+d.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+d.width,a.maxHeight=Math.max(a.maxHeight,d.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:d,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[T]:V,[S]:J},Be={[$]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:de,setAccDescription:le,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=D(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,l=a.targetBox.swimlane.y+n.swimlanePadding,d=ne(r,l),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${d} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),d?(x=r,u=l+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=l);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),l=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",l).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var De=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:l}=D(),d=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(d,m.maxR,c,r)),m.boxes.forEach(te(d,c)),m.relations.forEach(ie(d,c,x,r)),d.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,d,l?.padding??30,l?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,Ue={parser:Ee,db:F,renderer:Te,styles:Ne};export{Ue as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-CToQJsz-.js b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-Cj2f-GhL.js similarity index 97% rename from apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-CToQJsz-.js rename to apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-Cj2f-GhL.js index 7fc530dac..89b4215f2 100644 --- a/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-CToQJsz-.js +++ b/apps/pythinker-code/dist-web/assets/diagram-VX7I27RA-Cj2f-GhL.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as w,X as ge,A as te,D as Q,G as ye,d as Se,l as ee,bd as B,j as Y,b as ve,a as xe,p as be,q as we,g as Ce,s as Te,E as Le,be as $e,r as Ae}from"./mermaid.core-Pmnag6hS.js";import{s as Fe}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{p as Ne}from"./cynefin-OW5HDTMX-CwX4S6So.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(Ye)}function Xe(e){return e.children}function je(e){return Array.isArray(e)?e[1]:null}function Ye(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);j.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as w,X as ge,A as te,D as Q,G as ye,d as Se,l as ee,bd as B,j as Y,b as ve,a as xe,p as be,q as we,g as Ce,s as Te,E as Le,be as $e,r as Ae}from"./mermaid.core-4ur3W-UG.js";import{s as Fe}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{p as Ne}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(Ye)}function Xe(e){return e.children}function je(e){return Array.isArray(e)?e[1]:null}function Ye(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);j.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DhBfeF96.js b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DQhaVd0o.js similarity index 95% rename from apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DhBfeF96.js rename to apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DQhaVd0o.js index 1e96101d3..1da931834 100644 --- a/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DhBfeF96.js +++ b/apps/pythinker-code/dist-web/assets/diagram-Z3DM3KII-DQhaVd0o.js @@ -1,4 +1,4 @@ -import{p as $}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as b,D as u,G as B,d as C,l as m,b as S,a as D,p as T,q as E,g as P,s as z,A,E as F,r as W}from"./mermaid.core-Pmnag6hS.js";import{p as _}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=E,this.getAccDescription=P,this.setAccDescription=z}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{$(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},G=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=B(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())I(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:G},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=u(j,t);return` +import{p as $}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as b,D as u,G as B,d as C,l as m,b as S,a as D,p as T,q as E,g as P,s as z,A,E as F,r as W}from"./mermaid.core-4ur3W-UG.js";import{p as _}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=E,this.getAccDescription=P,this.setAccDescription=z}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{$(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},G=b((t,e,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=B(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())I(f,y,x,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),O={draw:G},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=b(({packet:t}={})=>{const e=u(j,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Du-YMm3d.js b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-CZX4bYJf.js similarity index 87% rename from apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Du-YMm3d.js rename to apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-CZX4bYJf.js index bda69949e..b82c14d43 100644 --- a/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-Du-YMm3d.js +++ b/apps/pythinker-code/dist-web/assets/ebnfDiagram-PWID7BFC-CZX4bYJf.js @@ -1 +1 @@ -import{g as l,r as m,d as n}from"./chunk-SVP7TREG-XNRd51cY.js";import{p}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as t,l as o}from"./mermaid.core-Pmnag6hS.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-SVP7TREG-C1yhxvNc.js";import{p}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as t,l as o}from"./mermaid.core-4ur3W-UG.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/editor.main-1e103Orc.js b/apps/pythinker-code/dist-web/assets/editor.main-CmoCOdG5.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/editor.main-1e103Orc.js rename to apps/pythinker-code/dist-web/assets/editor.main-CmoCOdG5.js index 229929221..5636f6e89 100644 --- a/apps/pythinker-code/dist-web/assets/editor.main-1e103Orc.js +++ b/apps/pythinker-code/dist-web/assets/editor.main-CmoCOdG5.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cssMode-DuuEdolQ.js","assets/lspLanguageFeatures-DhcohILl.js","assets/index-BK-wRR5p.js","assets/index-Hz7Ro1k-.css","assets/purify.es-5AjVNlXF.js","assets/htmlMode-4dn2fXPN.js","assets/jsonMode-DZLSiusn.js","assets/tsMode-BCl_qc7D.js","assets/freemarker2-Cyl3pVgY.js","assets/handlebars-CatNLgMZ.js","assets/html-BkwYt7NK.js","assets/javascript-OwQmbStS.js","assets/typescript-BJQGTNP2.js","assets/liquid-V_YoDA7v.js","assets/mdx-hT3-rC2J.js","assets/python-Bt9WTZOE.js","assets/razor-B1yVkJwa.js","assets/xml-BfSuxdEx.js","assets/yaml-chKqoSrl.js"])))=>i.map(i=>d[i]); -import{bR as we}from"./index-BK-wRR5p.js";import{p as Gf}from"./purify.es-5AjVNlXF.js";function pV(){return globalThis._VSCODE_NLS_MESSAGES}function AA(){return globalThis._VSCODE_NLS_LANGUAGE}const TX=AA()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function g0(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),TX&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(o,e,...t){return g0(typeof o=="number"?mV(o,e):e,t)}function mV(o,e){const t=pV()?.[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function H(o,e,...t){let i;typeof o=="number"?i=mV(o,e):i=e;const n=g0(i,t);return{value:n,original:e===i?n:g0(e,t)}}function RX(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const wt=window;class OA{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new OA}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function _V(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function PE(o){return OA.INSTANCE.getZoomFactor(o)}const Xm=navigator.userAgent,Ks=Xm.indexOf("Firefox")>=0,rL=Xm.indexOf("AppleWebKit")>=0,sw=Xm.indexOf("Chrome")>=0,vg=!sw&&Xm.indexOf("Safari")>=0,bV=!sw&&!vg&&rL;Xm.indexOf("Electron/")>=0;const L3=Xm.indexOf("Android")>=0;let _D=!1;if(typeof wt.matchMedia=="function"){const o=wt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=wt.matchMedia("(display-mode: fullscreen)");_D=o.matches,_V(wt,o,({matches:t})=>{_D&&e.matches||(_D=t)})}function FA(){return globalThis.MonacoEnvironment}class MX{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dm.isErrorNoTelemetry(e)?new dm(e.message+` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cssMode-D5w7-Er3.js","assets/lspLanguageFeatures-C-mvtNbB.js","assets/index-C0iEUKAq.js","assets/index-Hz7Ro1k-.css","assets/purify.es-5AjVNlXF.js","assets/htmlMode-DdkvK5Eo.js","assets/jsonMode-B4Dmmm_Y.js","assets/tsMode-BFMAlDzX.js","assets/freemarker2-CZNakv6O.js","assets/handlebars-BSa5yURd.js","assets/html-C9Rps5Qh.js","assets/javascript-MaMcwgI8.js","assets/typescript-BEp7AJTK.js","assets/liquid-DZ5uyBpf.js","assets/mdx-G_32mYPD.js","assets/python-C976vrQl.js","assets/razor-C5EZiuVm.js","assets/xml-uimzP1Mc.js","assets/yaml-DWEV3VeY.js"])))=>i.map(i=>d[i]); +import{bR as we}from"./index-C0iEUKAq.js";import{p as Gf}from"./purify.es-5AjVNlXF.js";function pV(){return globalThis._VSCODE_NLS_MESSAGES}function AA(){return globalThis._VSCODE_NLS_LANGUAGE}const TX=AA()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function g0(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),TX&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(o,e,...t){return g0(typeof o=="number"?mV(o,e):e,t)}function mV(o,e){const t=pV()?.[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function H(o,e,...t){let i;typeof o=="number"?i=mV(o,e):i=e;const n=g0(i,t);return{value:n,original:e===i?n:g0(e,t)}}function RX(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const wt=window;class OA{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new OA}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function _V(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function PE(o){return OA.INSTANCE.getZoomFactor(o)}const Xm=navigator.userAgent,Ks=Xm.indexOf("Firefox")>=0,rL=Xm.indexOf("AppleWebKit")>=0,sw=Xm.indexOf("Chrome")>=0,vg=!sw&&Xm.indexOf("Safari")>=0,bV=!sw&&!vg&&rL;Xm.indexOf("Electron/")>=0;const L3=Xm.indexOf("Android")>=0;let _D=!1;if(typeof wt.matchMedia=="function"){const o=wt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=wt.matchMedia("(display-mode: fullscreen)");_D=o.matches,_V(wt,o,({matches:t})=>{_D&&e.matches||(_D=t)})}function FA(){return globalThis.MonacoEnvironment}class MX{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dm.isErrorNoTelemetry(e)?new dm(e.message+` `+e.stack):new Error(e.message+` @@ -900,7 +900,7 @@ ${e.toString()}`}}class Xx{constructor(e=new f_,t=!1,i,n=dMe){this._services=e,t `:`\r `}};mA=ql([Ti(0,Pe)],mA);class SMe{publicLog2(){}}class eL{static{this.SCHEME="inmemory"}constructor(){const e=_e.from({scheme:eL.SCHEME,authority:"model",path:"/"});this.workspace={id:Sq,folders:[new F_e({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===eL.SCHEME?this.workspace.folders[0]:null}}function tL(o,e,t){if(!e||!(o instanceof Jx))return;const i=[];Object.keys(e).forEach(n=>{tbe(n)&&i.push([`editor.${n}`,e[n]]),t&&ibe(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let _A=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:aF.convert(e),n=new Map;for(const a of i){if(!(a instanceof fh))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(gi.replaceMove(L.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:Lg(k2.bulkEditServiceSummary,s,r),isApplied:s>0}}};_A=ql([Ti(0,ei)],_A);class yMe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Lr(e)}}let bA=class extends BTe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};bA=ql([Ti(0,Ul),Ti(1,et)],bA);class xMe{constructor(){this._neverEmitter=new P,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class LMe extends $x{constructor(){super()}}class kMe extends pMe{constructor(){super(new Yee)}}let CA=class extends UP{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};CA=ql([Ti(0,ts),Ti(1,bi),Ti(2,ud),Ti(3,st),Ti(4,Er),Ti(5,Ie)],CA);const DMe={esmModuleLocation:void 0,label:"editorWorkerService"};let vA=class extends TP{constructor(e,t,i,n,s){super(DMe,e,t,i,n,s)}};vA=ql([Ti(0,ei),Ti(1,Xk),Ti(2,Mt),Ti(3,ti),Ti(4,he)],vA);class IMe{async playSignal(e,t){}}$e(Mt,kMe,0);$e(Pe,Jx,0);$e(Xk,pA,0);$e(SZ,mA,0);$e(sd,eL,0);$e(Zg,yMe,0);$e(ts,SMe,0);$e(Xw,vMe,0);$e(bF,CMe,0);$e(bi,Qx,0);$e($l,Fu,0);$e(_i,LMe,0);$e(er,NNe,0);$e(ei,ZP,0);$e(MO,GP,0);$e(Ie,uA,0);$e(ej,bMe,0);$e(id,p3,0);$e(ps,vme,0);$e(eo,vA,0);$e(Ow,_A,0);$e(PZ,xMe,0);$e(fs,gA,0);$e(kn,cA,0);$e(Mr,Iwe,0);$e(Pt,fA,0);$e(st,Ym,0);$e(Jn,lA,0);$e(ud,bA,0);$e(gd,KP,0);$e(Co,hA,0);$e(Jo,CA,0);$e(Er,AT,0);$e(dd,IMe,0);$e(S4,mMe,0);$e(Iz,ete,0);$e(g5,$0e,0);var Ne;(function(o){const e=new f_;for(const[l,c]of _7())e.set(l,c);const t=new Xx(e,!0);e.set(fe,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof hl?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new P;function r(l){if(n)return t;n=!0;for(const[d,h]of _7())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=We(d);e.get(h)instanceof hl&&e.set(h,l[d])}const c=Fbe();for(const d of c)try{t.createInstance(d)}catch(h){Ee(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new z,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(Ne||(Ne={}));var EMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},j6=function(o,e){return function(t,i){e(t,i,o)}},d0;let wA=class{static{d0=this}static{this._ttpTokenizer=Vl("tokenizeToString",{createHTML(e){return e}})}constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){const n=Ha(i.context)?i.context:void 0;let s;e?s=this._languageService.getLanguageIdByLanguageName(e):n&&(s=n.getModel()?.getLanguageId()),s||(s=qo);const r=await nue(this._languageService,t,s),a=d0._ttpTokenizer?d0._ttpTokenizer.createHTML(r)??r:r,l=document.createElement("span");l.innerHTML=a;const c=l.querySelector(".monaco-tokenized-source");return mi(c)?(gn(c,this.getFontInfo(n)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):Mne({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}};wA=d0=EMe([j6(0,Pe),j6(1,_i)],wA);var m3=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},It=function(o,e){return function(t,i){e(t,i,o)}};let NMe=0,q6=!1;function TMe(o){if(!o){if(q6)return;q6=!0}pee(o||wt.document.body)}let iL=class extends Pg{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f){const p={...t};p.ariaLabel=p.ariaLabel||x2.editorViewAccessibleLabel,super(e,p,{},i,n,s,r,c,d,h,u,g),l instanceof Ym?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,TMe(p.ariaContainerElement),Uue((_,b)=>i.createInstance(Tm,_,{instantHover:b},{})),Rfe(a),f.setDefaultCodeBlockRenderer(i.createInstance(wA))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++NMe,s=q.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),A.None;const t=e.id,i=e.label,n=q.and(q.equals("editorId",this.getId()),q.deserialize(e.precondition)),s=e.keybindings,r=q.and(n,q.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...f)=>Promise.resolve(e.run(this,...f)),d=new z,h=this.getId()+":"+t;if(d.add(Ye.registerCommand(h,c)),a){const g={command:{id:h,title:i},when:n,group:a,order:l};d.add(un.appendMenuItem(M.EditorContext,g))}if(Array.isArray(s))for(const g of s)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,g,c,r));const u=new x$(h,i,i,void 0,n,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,u),d.add(ue(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof Wx)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};iL=m3([It(2,fe),It(3,et),It(4,Pt),It(5,Ie),It(6,Ms),It(7,st),It(8,ci),It(9,bi),It(10,kn),It(11,ti),It(12,he),It(13,aa)],iL);let SA=class extends iL{constructor(e,t,i,n,s,r,a,l,c,d,h,u,g,f,p,_,b){const C={...t};tL(h,C,!1);const w=c.registerEditorContainer(e);typeof C.theme=="string"&&c.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!C.autoDetectHighContrast);const v=C.model;delete C.model,super(e,C,i,n,s,r,a,l,c,d,u,p,_,b),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let S;if(typeof v>"u"){const x=f.getLanguageIdByMimeType(C.language)||C.language||qo;S=DY(g,f,C.value||"",x,void 0),this._ownsModel=!0}else S=v,this._ownsModel=!1;if(this._attachModel(S),S){const x={oldModelUrl:null,newModelUrl:S.uri};this._onDidChangeModel.fire(x)}}dispose(){super.dispose()}updateOptions(e){tL(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};SA=m3([It(2,fe),It(3,et),It(4,Pt),It(5,Ie),It(6,Ms),It(7,st),It(8,er),It(9,bi),It(10,Pe),It(11,kn),It(12,ei),It(13,_i),It(14,ti),It(15,he),It(16,aa)],SA);let yA=class extends Pl{constructor(e,t,i,n,s,r,a,l,c,d,h,u){const g={...t};tL(l,g,!0);const f=r.registerEditorContainer(e);typeof g.theme=="string"&&r.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},n,i,s,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(f)}dispose(){super.dispose()}updateOptions(e){tL(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(iL,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};yA=m3([It(2,fe),It(3,Ie),It(4,et),It(5,er),It(6,bi),It(7,Pe),It(8,Jo),It(9,id),It(10,Co),It(11,dd)],yA);function DY(o,e,t,i,n){if(t=t||"",!i){const s=t.indexOf(` `);let r=t;return s!==-1&&(r=t.substring(0,s)),K6(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return K6(o,t,e.createById(i),n)}function K6(o,e,t,i){return o.createModel(e,t,i)}E("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},m(142,"The background color of the diff editor's header"));E("multiDiffEditor.background",ki,m(143,"The background color of the multi file diff editor"));E("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},m(144,"The border color of the multi file diff editor"));var RMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G6=function(o,e){return function(t,i){e(t,i,o)}};class MMe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let xA=class extends A{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=De(this,void 0),this._collapsed=$(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=De(this,500),this.contentHeight=$(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=De(this,0),this._modifiedWidth=De(this,0),this._originalContentWidth=De(this,0),this._originalWidth=De(this,0),this.maxScroll=$(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Qe("div.multiDiffEntry",[Qe("div.header@header",[Qe("div.header-content",[Qe("div.collapse-button@collapseButton"),Qe("div.file-path",[Qe("div.title.modified.show-file-icons@primaryPath",[]),Qe("div.status.deleted@status",["R"]),Qe("div.title.original.show-file-icons@secondaryPath",[])]),Qe("div.actions@actions")])]),Qe("div.editorParent",[Qe("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Pl,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=Jt(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Jt(this.editor.getOriginalEditor()).isFocused,this.isFocused=$(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new z),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new Wy(this._elements.collapseButton,{});this._register(xe(l=>{r.element.className="",r.icon=this._collapsed.read(l)?G.chevronRight:G.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(xe(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{tb(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(xe(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new f_([Ie,this._contextKeyService])));this._register(a.createInstance(pv,this._elements.actions,M.MultiDiffEditorFileToolbar,{actionRunner:this._register(new lq(()=>this._viewModel.get()?.modifiedUri??this._viewModel.get()?.originalUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>oF(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){tb(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(tb(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let s=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,this._resourceLabel2?.setUri(s?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,s]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,s)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const s=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,tb(a=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};xA=RMe([G6(3,fe),G6(4,Ie)],xA);class PMe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(n=>this._itemData.get(n).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var AMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Z6=function(o,e){return function(t,i){e(t,i,o)}};let LA=class extends A{constructor(e,t,i,n,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=r,this._scrollableElements=Qe("div.scrollContent",[Qe("div@content",{style:{overflow:"hidden"}}),Qe("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new u_({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Zs(pe(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new KL(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Qe("div.monaco-component.multiDiffEditor",{},[Qe("div",{},[this._scrollableElement.getDomNode()]),Qe("div.placeholder@placeholder",{},[Qe("div")])]),this._sizeObserver=this._register(new zj(this._element,void 0)),this._objectPool=this._register(new PMe(c=>{const d=this._instantiationService.createInstance(xA,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=dt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=dt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=$(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:f=>{throw new Ce}};const h=d.items.read(c),u=new Map;return{items:h.map(f=>{const p=c.store.add(new FMe(f,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),_=this._lastDocStates?.[p.getKey()];return _&&Et(b=>{p.setViewState(_,b)}),u.set(f,p),p}),getItem:f=>u.get(f)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=$(this,c=>{const d=this._viewModel.read(c)?.activeDiffItem.read(c);return d?this._viewItemsInfo.read(c).getItem(d).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new f_([Ie,this._contextKeyService]))),this._contextKeyService.createKey(N.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(Xn((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,g]of Object.entries(h.contextKeys)){const f=this._contextKeyService.createKey(u,void 0);f.set(g),d.add(ue(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(N.multiDiffEditorAllCollapsed.key,!1);this._register(xe(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(xe(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=$(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?m(145,"Loading..."):m(146,"No Changed Files")});this._register(xe(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(xe(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let g=u;const f=this._viewItems.read(c),p=JO(f,Bn(_=>_.maxScroll.read(c).maxScroll,uo));if(p){const _=p.maxScroll.read(c);g=u+_.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:g})})),e.replaceChildren(this._elements.root),this._register(ue(()=>{e.replaceChildren()})),this._register(xe(c=>{const d=this._viewModel.read(c);if(d&&!d.isLoading.read(c)){if(d.items.read(c).length===0||d.activeDiffItem.read(c))return;this.goToNextChange()}})),this._register(this._register(xe(c=>{tb(d=>{this.render(c)})})))}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(c=>c.viewModel.originalUri?.toString()===e.original?.toString()&&c.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new Ce("Resource not found in diff editor");const s=i[n];this._viewModel.get().activeDiffItem.setCache(s.viewModel,void 0);let r=0;for(let c=0;cl.viewModel===i):-1;if(n===-1){this._goToFile(0,"first");return}const s=t[n];s.viewModel.collapsed.get()&&s.viewModel.collapsed.set(!1,void 0);const r=s.template.get()?.editor;if(r?.getDiffComputationResult()?.changes2?.length){const l=r.getModifiedEditor().getPosition()?.lineNumber||1,c=r.getDiffComputationResult().changes2;if(e==="next"?c.some(h=>h.modified.startLineNumber>l):c.some(h=>h.modified.endLineNumberExclusive<=l)){r.goToDiff(e);return}}const a=(n+(e==="next"?1:-1)+t.length)%t.length;this._goToFile(a,e==="next"?"first":"last")}_goToFile(e,t){const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const n=i.template.get()?.editor;if(n?.getDiffComputationResult()?.changes2?.length)if(t==="first")n.revealFirstDiff();else{const s=n.getDiffComputationResult().changes2.at(-1),r=n.getModifiedEditor();r.setPosition({lineNumber:s.modified.startLineNumber,column:1}),r.revealLineInCenter(s.modified.startLineNumber)}n?.focus()}render(e){const t=this.scrollTop.read(e);let i=0,n=0,s=0;const r=this._sizeObserver.height.read(e),a=ge.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=ge.ofStartAndLength(n,h),g=ge.ofStartAndLength(s,d);if(g.isBefore(a))i-=d-h,c.hide();else if(g.isAfter(a))c.hide();else{const f=Math.max(0,Math.min(a.start-g.start,d-h));i-=f;const p=ge.ofStartAndLength(t+i,r);c.render(u,f,l,p)}n+=h+this._spaceBetweenPx,s+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};LA=AMe([Z6(4,Ie),Z6(5,fe)],LA);function OMe(o,e){const t=o.getModel(),i=o.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{o.getModel()===t&&i.clear()},350)}class FMe extends A{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(gO(this,void 0)),this.contentHeight=$(this,s=>this._templateRef.read(s)?.object.contentHeight?.read(s)??this.viewModel.lastTemplateData.read(s).contentHeight),this.maxScroll=$(this,s=>this._templateRef.read(s)?.object.maxScroll.read(s)??{maxScroll:0,scrollWidth:0}),this.template=$(this,s=>this._templateRef.read(s)?.object),this._isHidden=De(this,!1),this._isFocused=$(this,s=>this.template.read(s)?.isFocused.read(s)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(xe(s=>{const r=this._scrollLeft.read(s);this._templateRef.read(s)?.object.setScrollLeft(r)})),this._register(xe(s=>{const r=this._templateRef.read(s);!r||!this._isHidden.read(s)||r.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(ae.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const s=this._templateRef.get();s&&n&&s.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&Et(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new MMe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&s.object.editor.setSelections(r)}s.object.render(e,i,t,n)}}var WMe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},BMe=function(o,e){return function(t,i){e(t,i,o)}};let kA=class extends A{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=De(this,void 0),this._viewModel=De(this,void 0),this._widgetImpl=$(this,n=>n.store.add(this._instantiationService.createInstance(ac(LA),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(fm(this._widgetImpl))}};kA=WMe([BMe(2,fe)],kA);function HMe(o,e,t){return Ne.initialize(t||{}).createInstance(SA,o,e)}function VMe(o){return Ne.get(et).onCodeEditorAdd(t=>{o(t)})}function zMe(o){return Ne.get(et).onDiffEditorAdd(t=>{o(t)})}function UMe(){return Ne.get(et).listCodeEditors()}function $Me(){return Ne.get(et).listDiffEditors()}function jMe(o,e,t){return Ne.initialize(t||{}).createInstance(yA,o,e)}function qMe(o,e){const t=Ne.initialize(e||{});return new kA(o,{},t)}function KMe(o){if(typeof o.id!="string"||typeof o.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Ye.registerCommand(o.id,o.run)}function GMe(o){if(typeof o.id!="string"||typeof o.label!="string"||typeof o.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=q.deserialize(o.precondition),t=(n,...s)=>Ki.runEditorCommand(n,s,e,(r,a,l)=>Promise.resolve(o.run(a,...l))),i=new z;if(i.add(Ye.registerCommand(o.id,t)),o.contextMenuGroupId){const n={command:{id:o.id,title:o.label},when:e,group:o.contextMenuGroupId,order:o.contextMenuOrder||0};i.add(un.appendMenuItem(M.EditorContext,n))}if(Array.isArray(o.keybindings)){const n=Ne.get(st);if(!(n instanceof Ym))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=q.and(e,q.deserialize(o.keybindingContext));i.add(n.addDynamicKeybindings(o.keybindings.map(r=>({keybinding:r,command:o.id,when:s}))))}}return i}function ZMe(o){return IY([o])}function IY(o){const e=Ne.get(st);return e instanceof Ym?e.addDynamicKeybindings(o.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:q.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),A.None)}function YMe(o,e,t){const i=Ne.get(_i),n=i.getLanguageIdByMimeType(e)||e;return DY(Ne.get(ei),i,o,n,t)}function XMe(o,e){const t=Ne.get(_i),i=t.getLanguageIdByMimeType(e)||e||qo;o.setLanguage(t.createById(i))}function QMe(o,e,t){o&&Ne.get($l).changeOne(e,o.uri,t)}function JMe(o){Ne.get($l).changeAll(o,[])}function e2e(o){return Ne.get($l).read(o)}function t2e(o){return Ne.get($l).onMarkerChanged(o)}function i2e(o){return Ne.get(ei).getModel(o)}function n2e(){return Ne.get(ei).getModels()}function s2e(o){return Ne.get(ei).onModelAdded(o)}function o2e(o){return Ne.get(ei).onModelRemoved(o)}function r2e(o){return Ne.get(ei).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function a2e(o){return uTe(Ne.get(ei),o)}function l2e(o,e){const t=Ne.get(_i),i=Ne.get(er);return a3.colorizeElement(i,t,o,e).then(()=>{i.registerEditorContainer(o)})}function c2e(o,e,t){const i=Ne.get(_i);return Ne.get(er).registerEditorContainer(wt.document.body),a3.colorize(i,o,e,t)}function d2e(o,e,t=4){return Ne.get(er).registerEditorContainer(wt.document.body),a3.colorizeModelLine(o,e,t)}function h2e(o){const e=ui.get(o);return e||{getInitialState:()=>Im,tokenize:(t,i,n)=>w4(o,n)}}function u2e(o,e){ui.getOrCreate(e);const t=h2e(e),i=bo(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r{if(!i)return null;const s=t.options?.selection;let r;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?r=s:s&&(r={lineNumber:s.startLineNumber,column:s.startColumn}),await o.openCodeEditor(i,t.resource,r)?i:null})}function C2e(){return{create:HMe,getEditors:UMe,getDiffEditors:$Me,onDidCreateEditor:VMe,onDidCreateDiffEditor:zMe,createDiffEditor:jMe,addCommand:KMe,addEditorAction:GMe,addKeybindingRule:ZMe,addKeybindingRules:IY,createModel:YMe,setModelLanguage:XMe,setModelMarkers:QMe,getModelMarkers:e2e,removeAllMarkers:JMe,onDidChangeMarkers:t2e,getModels:n2e,getModel:i2e,onDidCreateModel:s2e,onWillDisposeModel:o2e,onDidChangeModelLanguage:r2e,createWebWorker:a2e,colorizeElement:l2e,colorize:c2e,colorizeModelLine:d2e,tokenize:u2e,defineTheme:g2e,setTheme:f2e,remeasureFonts:p2e,registerCommand:m2e,registerLinkOpener:_2e,registerEditorOpener:b2e,AccessibilitySupport:O2,ContentWidgetPositionPreference:z2,CursorChangeReason:U2,DefaultEndOfLine:$2,EditorAutoIndentStrategy:q2,EditorOption:K2,EndOfLinePreference:G2,EndOfLineSequence:Z2,MinimapPosition:aP,MinimapSectionHeaderStyle:lP,MouseTargetType:cP,OverlayWidgetPositionPreference:uP,OverviewRulerLane:gP,GlyphMarginLane:Y2,RenderLineNumbersType:mP,RenderMinimap:_P,ScrollbarVisibility:CP,ScrollType:bP,TextEditorCursorBlinkingStyle:kP,TextEditorCursorStyle:DP,TrackedRangeStickiness:IP,WrappingIndent:EP,InjectedTextCursorStops:J2,PositionAffinity:pP,ShowLightbulbIconMode:wP,TextDirection:LP,ConfigurationChangedEvent:oU,BareFontInfo:Ig,FontInfo:U0,TextModelResolvedOptions:PS,FindMatch:MC,ApplyUpdateResult:Db,EditorZoom:hr,createMultiFileDiffEditor:qMe,EditorType:xw,EditorOptions:rs}}function v2e(o,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!o(t))return!1;return!0}function vS(o,e){return typeof o=="boolean"?o:e}function Y6(o,e){return typeof o=="string"?o:e}function w2e(o){const e={};for(const t of o)e[t]=!0;return e}function X6(o,e=!1){e&&(o=o.map(function(i){return i.toLowerCase()}));const t=w2e(o);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function DA(o,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof o[a]=="string")l=o[a];else if(o[a]&&o[a]instanceof RegExp)l=o[a].source;else throw o[a]===void 0?zt(o,"language definition does not contain attribute '"+a+"', used at: "+e):zt(o,"attribute reference '"+a+"' must be a string, used at: "+e);return Au(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const s=(o.ignoreCase?"i":"")+(o.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(_Te(o,e,c),s)),l)}return new RegExp(e,s)}function S2e(o,e,t,i){if(i<0)return o;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw zt(o,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw zt(o,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!bTe(o,Vd(o,n,"",[],""))))throw zt(o,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,o.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,s=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=DA(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=IA(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function EY(o,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:o,includeLF:vS(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:vS(e.ignoreCase,!1),unicode:vS(e.unicode,!1),tokenPostfix:Y6(e.tokenPostfix,"."+o),defaultToken:Y6(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=o,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw zt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw zt(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new x2e(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw zt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw zt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=vS(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw zt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw zt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw zt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:jc(t,a.open),close:jc(t,a.close)});else throw zt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function L2e(o){mm.registerLanguage(o)}function k2e(){let o=[];return o=o.concat(mm.getLanguages()),o}function D2e(o){return Ne.get(_i).languageIdCodec.encodeLanguageId(o)}function I2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function E2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function N2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ne.get(ti).register(o,e,100)}class T2e{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return iw.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new JL(n.tokens,n.endState)}}class iw{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g{const i=await Promise.resolve(e.create());return i?R2e(i)?TY(o,i):new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe)):null});return ui.registerFactory(o,t)}function A2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return NY(e)?_3(o,{create:()=>e}):ui.register(o,TY(o,e))}function O2e(o,e){const t=i=>new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe));return NY(e)?_3(o,{create:()=>e}):ui.register(o,t(e))}function F2e(o,e){return Ne.get(he).referenceProvider.register(o,e)}function W2e(o,e){return Ne.get(he).renameProvider.register(o,e)}function B2e(o,e){return Ne.get(he).newSymbolNamesProvider.register(o,e)}function H2e(o,e){return Ne.get(he).signatureHelpProvider.register(o,e)}function V2e(o,e){return Ne.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function z2e(o,e){return Ne.get(he).documentSymbolProvider.register(o,e)}function U2e(o,e){return Ne.get(he).documentHighlightProvider.register(o,e)}function $2e(o,e){return Ne.get(he).linkedEditingRangeProvider.register(o,e)}function j2e(o,e){return Ne.get(he).definitionProvider.register(o,e)}function q2e(o,e){return Ne.get(he).implementationProvider.register(o,e)}function K2e(o,e){return Ne.get(he).typeDefinitionProvider.register(o,e)}function G2e(o,e){return Ne.get(he).codeLensProvider.register(o,e)}function Z2e(o,e,t){return Ne.get(he).codeActionProvider.register(o,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,s,r,a)=>{const c=Ne.get($l).read({resource:n.uri}).filter(d=>L.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Y2e(o,e){return Ne.get(he).documentFormattingEditProvider.register(o,e)}function X2e(o,e){return Ne.get(he).documentRangeFormattingEditProvider.register(o,e)}function Q2e(o,e){return Ne.get(he).onTypeFormattingEditProvider.register(o,e)}function J2e(o,e){return Ne.get(he).linkProvider.register(o,e)}function ePe(o,e){return Ne.get(he).completionProvider.register(o,e)}function tPe(o,e){return Ne.get(he).colorProvider.register(o,e)}function iPe(o,e){return Ne.get(he).foldingRangeProvider.register(o,e)}function nPe(o,e){return Ne.get(he).declarationProvider.register(o,e)}function sPe(o,e){return Ne.get(he).selectionRangeProvider.register(o,e)}function oPe(o,e){return Ne.get(he).documentSemanticTokensProvider.register(o,e)}function rPe(o,e){return Ne.get(he).documentRangeSemanticTokensProvider.register(o,e)}function aPe(o,e){return Ne.get(he).inlineCompletionsProvider.register(o,e)}function lPe(o,e){return Ne.get(he).inlayHintsProvider.register(o,e)}function cPe(){return{register:L2e,getLanguages:k2e,onLanguage:I2e,onLanguageEncountered:E2e,getEncodedLanguageId:D2e,setLanguageConfiguration:N2e,setColorMap:P2e,registerTokensProviderFactory:_3,setTokensProvider:A2e,setMonarchTokensProvider:O2e,registerReferenceProvider:F2e,registerRenameProvider:W2e,registerNewSymbolNameProvider:B2e,registerCompletionItemProvider:ePe,registerSignatureHelpProvider:H2e,registerHoverProvider:V2e,registerDocumentSymbolProvider:z2e,registerDocumentHighlightProvider:U2e,registerLinkedEditingRangeProvider:$2e,registerDefinitionProvider:j2e,registerImplementationProvider:q2e,registerTypeDefinitionProvider:K2e,registerCodeLensProvider:G2e,registerCodeActionProvider:Z2e,registerDocumentFormattingEditProvider:Y2e,registerDocumentRangeFormattingEditProvider:X2e,registerOnTypeFormattingEditProvider:Q2e,registerLinkProvider:J2e,registerColorProvider:tPe,registerFoldingRangeProvider:iPe,registerDeclarationProvider:nPe,registerSelectionRangeProvider:sPe,registerDocumentSemanticTokensProvider:oPe,registerDocumentRangeSemanticTokensProvider:rPe,registerInlineCompletionsProvider:aPe,registerInlayHintsProvider:lPe,DocumentHighlightKind:j2,CompletionItemKind:B2,CompletionItemTag:H2,CompletionItemInsertTextRule:W2,SymbolKind:yP,SymbolTag:xP,IndentAction:Q2,CompletionTriggerKind:V2,SignatureHelpTriggerKind:SP,InlayHintKind:eP,InlineCompletionTriggerKind:nP,CodeActionTriggerType:F2,NewSymbolNameTag:dP,NewSymbolNameTriggerKind:hP,PartialAcceptTriggerKind:fP,HoverVerbosityAction:X2,InlineCompletionEndOfLifeReasonKind:tP,InlineCompletionHintStyle:iP,FoldingRangeKind:df,SelectedSuggestionInfo:c$,EditDeltaInfo:ov}}rs.wrappingIndent.defaultValue=0;rs.glyphMargin.defaultValue=!1;rs.autoIndent.defaultValue=3;rs.overviewRulerLanes.defaultValue=2;Vm.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const As=sY();As.editor=C2e();As.languages=cPe();const RY=As.CancellationTokenSource,Ph=As.Emitter,MY=As.KeyCode,PY=As.KeyMod,_d=As.Position,x_=As.Range,AY=As.Selection,OY=As.SelectionDirection,Zr=As.MarkerSeverity,nL=As.MarkerTag,hD=As.Uri,FY=As.Token,Dl=As.editor,de=As.languages,dPe=FA(),rm=globalThis;(dPe?.globalAPI||typeof rm.define=="function"&&rm.define.amd)&&(rm.monaco=As);typeof rm.require<"u"&&typeof rm.require.config=="function"&&rm.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const hPe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:RY,Emitter:Ph,KeyCode:MY,KeyMod:PY,MarkerSeverity:Zr,MarkerTag:nL,Position:_d,Range:x_,Selection:AY,SelectionDirection:OY,Token:FY,Uri:hD,editor:Dl,languages:de},Symbol.toStringTag,{value:"Module"}));let b3=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const C3={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},v3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},WY=new b3("css",C3,v3),BY=new b3("scss",C3,v3),HY=new b3("less",C3,v3);function w3(){return we(()=>import("./cssMode-DuuEdolQ.js"),__vite__mapDeps([0,1,2,3,4]))}de.onLanguage("less",()=>{w3().then(o=>o.setupMode(HY))});de.onLanguage("scss",()=>{w3().then(o=>o.setupMode(BY))});de.onLanguage("css",()=>{w3().then(o=>o.setupMode(WY))});const VY=Object.freeze(Object.defineProperty({__proto__:null,cssDefaults:WY,lessDefaults:HY,scssDefaults:BY},Symbol.toStringTag,{value:"Module"}));let uPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const gPe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},uD={format:gPe,suggest:{},data:{useDefaultDataProvider:!0}};function gD(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===bC,documentFormattingEdits:o===bC,documentRangeFormattingEdits:o===bC}}const bC="html",Q6="handlebars",J6="razor",zY=fD(bC,uD,gD(bC)),fPe=zY.defaults,UY=fD(Q6,uD,gD(Q6)),pPe=UY.defaults,$Y=fD(J6,uD,gD(J6)),mPe=$Y.defaults;function _Pe(){return we(()=>import("./htmlMode-4dn2fXPN.js"),__vite__mapDeps([5,1,2,3,4]))}function fD(o,e=uD,t=gD(o)){const i=new uPe(o,e,t);let n;const s=de.onLanguage(o,async()=>{n=(await _Pe()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}const jY=Object.freeze(Object.defineProperty({__proto__:null,handlebarDefaults:pPe,handlebarLanguageService:UY,htmlDefaults:fPe,htmlLanguageService:zY,razorDefaults:mPe,razorLanguageService:$Y,registerHTMLLanguageService:fD},Symbol.toStringTag,{value:"Module"}));let bPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const CPe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},vPe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},qY=new bPe("json",CPe,vPe),wPe=()=>KY().then(o=>o.getWorker());function KY(){return we(()=>import("./jsonMode-DZLSiusn.js"),__vite__mapDeps([6,1,2,3,4]))}de.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});de.onLanguage("json",()=>{KY().then(o=>o.setupMode(qY))});const GY=Object.freeze(Object.defineProperty({__proto__:null,getWorker:wPe,jsonDefaults:qY},Symbol.toStringTag,{value:"Module"})),SPe="5.9.3";var ZY=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(ZY||{}),YY=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(YY||{}),XY=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(XY||{}),QY=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(QY||{}),JY=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(JY||{});class eX{constructor(e,t,i,n,s){this._onDidChange=new Ph,this._onDidExtraLibsChange=new Ph,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(n),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let i;if(typeof t>"u"?i=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:i=t,this._extraLibs[i]&&this._extraLibs[i].content===e)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[i]&&(n=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(n=this._extraLibs[i].version+1),this._extraLibs[i]={content:e,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[i];s&&s.version===n&&(delete this._extraLibs[i],this._removedExtraLibs[i]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const i=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=t.content;let s=1;this._removedExtraLibs[i]&&(s=this._removedExtraLibs[i]+1),this._extraLibs[i]={content:n,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(void 0)}}const yPe=SPe,tX={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},iX=new eX({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),nX=new eX({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),xPe=()=>pD().then(o=>o.getTypeScriptWorker()),LPe=()=>pD().then(o=>o.getJavaScriptWorker());function pD(){return we(()=>import("./tsMode-BCl_qc7D.js"),__vite__mapDeps([7,2,3,4]))}de.onLanguage("typescript",()=>pD().then(o=>o.setupTypeScript(iX)));de.onLanguage("javascript",()=>pD().then(o=>o.setupJavaScript(nX)));const sX=Object.freeze(Object.defineProperty({__proto__:null,JsxEmit:YY,ModuleKind:ZY,ModuleResolutionKind:JY,NewLineKind:XY,ScriptTarget:QY,getJavaScriptWorker:LPe,getTypeScriptWorker:xPe,javascriptDefaults:nX,typescriptDefaults:iX,typescriptVersion:yPe},Symbol.toStringTag,{value:"Module"})),oX={},NE={};class S3{static getOrCreate(e){return NE[e]||(NE[e]=new S3(e)),NE[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,oX[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function ye(o){const e=o.id;oX[e]=o,de.register(o);const t=S3.getOrCreate(e);de.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),de.onLanguageEncountered(e,async()=>{const i=await t.load();de.setLanguageConfiguration(e,i.conf)})}ye({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>we(()=>import("./abap-DLDM7-KI.js"),[])});ye({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>we(()=>import("./apex-DNDY2TF8.js"),[])});ye({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>we(()=>import("./azcli-Y6nb8tq_.js"),[])});ye({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>we(()=>import("./bat-BwHxbl9M.js"),[])});ye({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>we(()=>import("./bicep-CFznDFnq.js"),[])});ye({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>we(()=>import("./cameligo-Bf6VGUru.js"),[])});ye({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>we(()=>import("./clojure-Dnu-v4kV.js"),[])});ye({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>we(()=>import("./coffee-Bd8akH9Z.js"),[])});ye({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>we(()=>import("./csharp-Co3qMtFm.js"),[])});ye({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>we(()=>import("./csp-D-4FJmMZ.js"),[])});ye({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>we(()=>import("./css-DdJfP1eB.js"),[])});ye({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>we(()=>import("./cypher-cTPe9QuQ.js"),[])});ye({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>we(()=>import("./dart-BOtBlQCF.js"),[])});ye({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>we(()=>import("./dockerfile-BG73LgW2.js"),[])});ye({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>we(()=>import("./ecl-BEgZUVRK.js"),[])});ye({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>we(()=>import("./elixir-BkW5O-1t.js"),[])});ye({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>we(()=>import("./flow9-BeJ5waoc.js"),[])});ye({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>we(()=>import("./fsharp-PahG7c26.js"),[])});ye({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationDollar)});ye({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationBracket)});ye({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationBracket)});ye({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>we(()=>import("./freemarker2-Cyl3pVgY.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationBracket)});ye({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>we(()=>import("./go-acbASCJo.js"),[])});ye({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>we(()=>import("./graphql-BxJiqAUM.js"),[])});ye({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>we(()=>import("./handlebars-CatNLgMZ.js"),__vite__mapDeps([9,2,3,4]))});ye({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>we(()=>import("./hcl-DtV1sZF8.js"),[])});ye({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>we(()=>import("./html-BkwYt7NK.js"),__vite__mapDeps([10,2,3,4]))});ye({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>we(()=>import("./ini-Kd9XrMLS.js"),[])});ye({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>we(()=>import("./java-CXBNlu9o.js"),[])});ye({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>we(()=>import("./javascript-OwQmbStS.js"),__vite__mapDeps([11,12,2,3,4]))});ye({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>we(()=>import("./julia-cl7-CwDS.js"),[])});ye({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>we(()=>import("./kotlin-s7OhZKlX.js"),[])});ye({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>we(()=>import("./less-9HpZscsL.js"),[])});ye({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>we(()=>import("./lexon-OrD6JF1K.js"),[])});ye({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>we(()=>import("./lua-Cyyb5UIc.js"),[])});ye({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>we(()=>import("./liquid-V_YoDA7v.js"),__vite__mapDeps([13,2,3,4]))});ye({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>we(()=>import("./m3-B8OfTtLu.js"),[])});ye({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>we(()=>import("./markdown-BFxVWTOG.js"),[])});ye({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>we(()=>import("./mdx-hT3-rC2J.js"),__vite__mapDeps([14,2,3,4]))});ye({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>we(()=>import("./mips-CiqrrVzr.js"),[])});ye({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>we(()=>import("./msdax-DmeGPVcC.js"),[])});ye({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>we(()=>import("./mysql-C_tMU-Nz.js"),[])});ye({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>we(()=>import("./objective-c-BDtDVThU.js"),[])});ye({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>we(()=>import("./pascal-vHIfCaH5.js"),[])});ye({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>we(()=>import("./pascaligo-DtZ0uQbO.js"),[])});ye({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>we(()=>import("./perl-Ub6l9XKa.js"),[])});ye({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>we(()=>import("./pgsql-BlNEE0v7.js"),[])});ye({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>we(()=>import("./php-BBUBE1dy.js"),[])});ye({id:"pla",extensions:[".pla"],loader:()=>we(()=>import("./pla-DSh2-awV.js"),[])});ye({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>we(()=>import("./postiats-CocnycG-.js"),[])});ye({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>we(()=>import("./powerquery-tScXyioY.js"),[])});ye({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>we(()=>import("./powershell-COWaemsV.js"),[])});ye({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>we(()=>import("./protobuf-Brw8urJB.js"),[])});ye({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>we(()=>import("./pug-8SOpv6rk.js"),[])});ye({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>we(()=>import("./python-Bt9WTZOE.js"),__vite__mapDeps([15,2,3,4]))});ye({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>we(()=>import("./qsharp-Bw9ernYp.js"),[])});ye({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>we(()=>import("./r-j7ic8hl3.js"),[])});ye({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>we(()=>import("./razor-B1yVkJwa.js"),__vite__mapDeps([16,2,3,4]))});ye({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>we(()=>import("./redis-Bu5POkcn.js"),[])});ye({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>we(()=>import("./redshift-Bs9aos_-.js"),[])});ye({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>we(()=>import("./restructuredtext-CqXO7rUv.js"),[])});ye({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>we(()=>import("./ruby-zBfavPgS.js"),[])});ye({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>we(()=>import("./rust-BzKRNQWT.js"),[])});ye({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>we(()=>import("./sb-BBc9UKZt.js"),[])});ye({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>we(()=>import("./scala-D9hQfWCl.js"),[])});ye({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>we(()=>import("./scheme-BPhDTwHR.js"),[])});ye({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>we(()=>import("./scss-CBJaRo0y.js"),[])});ye({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>we(()=>import("./shell-DiJ1NA_G.js"),[])});ye({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>we(()=>import("./solidity-Db0IVjzk.js"),[])});ye({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>we(()=>import("./sophia-CnS9iZB_.js"),[])});ye({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>we(()=>import("./sparql-CJmd_6j2.js"),[])});ye({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>we(()=>import("./sql-ClhHkBeG.js"),[])});ye({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>we(()=>import("./st-CHwy0fLd.js"),[])});ye({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>we(()=>import("./swift-Bqt4WxQ4.js"),[])});ye({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>we(()=>import("./tcl-Dm6ycUr_.js"),[])});ye({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>we(()=>import("./twig-Csy3S7wG.js"),[])});ye({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>we(()=>import("./typescript-BJQGTNP2.js"),__vite__mapDeps([12,2,3,4]))});ye({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>we(()=>import("./typespec-Btyra-wh.js"),[])});ye({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>we(()=>import("./vb-Db0cS2oM.js"),[])});ye({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>we(()=>import("./wgsl-DumH7NcR.js"),[])});ye({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\we(()=>import("./xml-BfSuxdEx.js"),__vite__mapDeps([17,2,3,4]))});ye({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>we(()=>import("./yaml-chKqoSrl.js"),__vite__mapDeps([18,2,3,4]))});var kPe=Object.defineProperty,DPe=(o,e,t)=>e in o?kPe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,ve=(o,e,t)=>DPe(o,typeof e!="symbol"?e+"":e,t),wS,eV,SS,TE,yS;function IPe(o){return o.method!==void 0}var tV;(function(o){function e(t){return t}o.create=e})(tV||(tV={}));var Kr;(function(o){o.parseError=-32700,o.invalidRequest=-32600,o.methodNotFound=-32601,o.invalidParams=-32602,o.internalError=-32603;function e(s){return-32099<=s&&s<=-32e3}o.isServerError=e;function t(s){if(!e(s))throw new Error("Invalid range for a server error.");return s}o.serverError=t,o.unexpectedServerError=-32e3;function i(s){return!0}o.isApplicationError=i;function n(s){return s}o.applicationError=n,o.genericApplicationError=-320100})(Kr||(Kr={}));var y3=class{constructor(){ve(this,"listeners",new Set),ve(this,"event",o=>(this.listeners.add(o),{dispose:()=>{this.listeners.delete(o)}}))}fire(o){this.listeners.forEach(e=>e(o))}},EPe=class{constructor(o){ve(this,"_value"),ve(this,"eventEmitter"),this._value=o,this.eventEmitter=new y3}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this.eventEmitter.fire(o))}get onChange(){return this.eventEmitter.event}};function NPe(o,e){const t=setTimeout(e,o);return{dispose:()=>clearTimeout(t)}}function RE(o,e,t){return o instanceof Set?(o.add(e),{dispose:()=>o.delete(e)}):(o.set(e,t),{dispose:()=>o.delete(e)})}var TPe=class{constructor(){ve(this,"_state","none"),ve(this,"promise"),ve(this,"resolve",()=>{}),ve(this,"reject",()=>{}),this.promise=new Promise((o,e)=>{this.resolve=o,this.reject=e})}get state(){return this._state}},rX=(wS=class{constructor(){ve(this,"_unprocessedMessages",[]),ve(this,"_messageListener"),ve(this,"id",wS.id++),ve(this,"_state",new EPe({state:"open"})),ve(this,"state",this._state)}setListener(o){if(this._messageListener=o,!!o)for(;this._unprocessedMessages.length>0&&this._messageListener!==void 0;){const e=this._unprocessedMessages.shift();this._messageListener(e)}}send(o){return this._sendImpl(o)}_dispatchReceivedMessage(o){this._unprocessedMessages.length===0&&this._messageListener?this._messageListener(o):this._unprocessedMessages.push(o)}_onConnectionClosed(){this._state.value={state:"closed",error:void 0}}log(o){return new RPe(this,o??new MPe)}},ve(wS,"id",0),wS),RPe=class{constructor(o,e){ve(this,"baseStream"),ve(this,"logger"),this.baseStream=o,this.logger=e}get state(){return this.baseStream.state}setListener(o){if(o===void 0){this.baseStream.setListener(void 0);return}this.baseStream.setListener(e=>{this.logger.log(this.baseStream,"incoming",e),o(e)})}send(o){return this.logger.log(this.baseStream,"outgoing",o),this.baseStream.send(o)}toString(){return`StreamLogger/${this.baseStream.toString()}`}},MPe=class{log(o,e,t){console.log(`${e==="incoming"?"<-":"->"} [${o.toString()}] ${JSON.stringify(t)}`)}},PPe=class aX{constructor(e){ve(this,"connect"),this.connect=e}mapContext(e){return new aX(t=>this.connect(t?APe(t,e):void 0))}};function APe(o,e){return{handleNotification:(t,i)=>o.handleNotification(t,e(i)),handleRequest:(t,i,n)=>o.handleRequest(t,i,e(n))}}var OPe=class lX{constructor(e,t,i){ve(this,"_stream"),ve(this,"_listener"),ve(this,"_logger"),ve(this,"_unprocessedResponses",new Map),ve(this,"_lastUsedRequestId",0),this._stream=e,this._listener=t,this._logger=i,this._stream.setListener(n=>{IPe(n)?n.id===void 0?this._processNotification(n):this._processRequest(n):this._processResponse(n)})}static createChannel(e,t){let i=!1;return new PPe(n=>{if(i)throw new Error(`A channel to the stream ${e} was already constructed!`);return i=!0,new lX(e,n,t)})}get state(){return this._stream.state}async _processNotification(e){if(e.id!==void 0)throw new Error;if(!this._listener){this._logger&&this._logger.debug({text:"Notification ignored",message:e});return}try{await this._listener.handleNotification({method:e.method,params:e.params||null})}catch(t){this._logger&&this._logger.warn({text:`Exception was thrown while handling notification: ${t}`,exception:t,message:e})}}async _processRequest(e){if(e.id===void 0)throw new Error;let t;if(this._listener)try{t=await this._listener.handleRequest({method:e.method,params:e.params||null},e.id)}catch(n){this._logger&&this._logger.warn({text:`Exception was thrown while handling request: ${n}`,message:e,exception:n}),t={error:{code:Kr.internalError,message:"An unexpected exception was thrown.",data:void 0}}}else this._logger&&this._logger.debug({text:"Received request even though not listening for requests",message:e}),t={error:{code:Kr.methodNotFound,message:"This endpoint does not listen for requests or notifications.",data:void 0}};let i;"result"in t?i={jsonrpc:"2.0",id:e.id,result:t.result}:i={jsonrpc:"2.0",id:e.id,error:t.error},await this._stream.send(i)}_processResponse(e){const t=""+e.id,i=this._unprocessedResponses.get(t);if(!i){this._logger&&this._logger.debug({text:"Got an unexpected response message",message:e});return}this._unprocessedResponses.delete(t),i(e)}_newRequestId(){return this._lastUsedRequestId++}sendRequest(e,t,i){const n={jsonrpc:"2.0",id:this._newRequestId(),method:e.method,params:e.params||void 0};return i&&i(n.id),new Promise((s,r)=>{const a=""+n.id;this._unprocessedResponses.set(a,l=>{"result"in l?s({result:l.result}):(l.error||r(new Error("Response had neither 'result' nor 'error' field set.")),s({error:l.error}))}),this._stream.send(n).then(void 0,l=>{this._unprocessedResponses.delete(a),r(l)})})}sendNotification(e,t){const i={jsonrpc:"2.0",id:void 0,method:e.method,params:e.params||void 0};return this._stream.send(i)}toString(){return"StreamChannel/"+this._stream.toString()}},am;(function(o){function e(){return{deserializeFromJson:n=>({hasErrors:!1,value:n}),serializeToJson:n=>n}}o.sAny=e;function t(){return{deserializeFromJson:n=>({hasErrors:!1,value:{}}),serializeToJson:n=>({})}}o.sEmptyObject=t;function i(){return{deserializeFromJson:n=>({hasErrors:!1,value:void 0}),serializeToJson:n=>null}}o.sVoidFromNull=i})(am||(am={}));const cX=Symbol("OptionalMethodNotFound");var dX=class{contextualize(o){return new FPe(this,o)}},FPe=class extends dX{constructor(o,e){super(),ve(this,"underylingTypedChannel"),ve(this,"converters"),this.underylingTypedChannel=o,this.converters=e}async request(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.request(o,e,i)}async notify(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.notify(o,e,i)}registerNotificationHandler(o,e){return this.underylingTypedChannel.registerNotificationHandler(o,async(t,i)=>await e(t,await this.converters.getNewContext(i)))}registerRequestHandler(o,e){return this.underylingTypedChannel.registerRequestHandler(o,async(t,i,n)=>await e(t,i,await this.converters.getNewContext(n)))}},EA=class hX extends dX{constructor(e,t={}){super(),ve(this,"channelCtor"),ve(this,"_requestSender"),ve(this,"_handler",new Map),ve(this,"_unknownNotificationHandler",new Set),ve(this,"_timeout"),ve(this,"sendExceptionDetails",!1),ve(this,"_logger"),ve(this,"listeningDeferred",new TPe),ve(this,"onListening",this.listeningDeferred.promise),ve(this,"_requestDidErrorEventEmitter",new y3),ve(this,"onRequestDidError",this._requestDidErrorEventEmitter.event),this.channelCtor=e,this._logger=t.logger,this.sendExceptionDetails=!!t.sendExceptionDetails,this._timeout=NPe(1e3,()=>{this._requestSender||console.warn(`"${this.startListen.name}" has not been called within 1 second after construction of this channel. Did you forget to call it?`,this)})}static fromTransport(e,t={}){return new hX(OPe.createChannel(e,t.logger),t)}startListen(){if(this._requestSender)throw new Error(`"${this.startListen.name}" can be called only once, but it already has been called.`);this._timeout&&(this._timeout.dispose(),this._timeout=void 0),this._requestSender=this.channelCtor.connect({handleRequest:(e,t,i)=>this.handleRequest(e,t,i),handleNotification:(e,t)=>this.handleNotification(e,t)}),this.listeningDeferred.resolve()}checkChannel(e){if(!e)throw new Error(`"${this.startListen.name}" must be called before any messages can be sent or received.`);return!0}async handleRequest(e,t,i){const n=this._handler.get(e.method);if(!n)return this._logger&&this._logger.debug({text:`No request handler for "${e.method}".`,data:{requestObject:e}}),{error:{code:Kr.methodNotFound,message:`No request handler for "${e.method}".`,data:{method:e.method}}};if(n.kind!="request"){const r=`"${e.method}" is registered as notification, but was sent as request.`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e}}),{error:{code:Kr.invalidRequest,message:r,data:{method:e.method}}}}const s=n.requestType.paramsSerializer.deserializeFromJson(e.params);if(s.hasErrors){const r=`Got invalid params: ${s.errorMessage}`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e,errorMessage:s.errorMessage}}),{error:{code:Kr.invalidParams,message:r,data:{errors:s.errorMessage}}}}else{const r=s.value;let a;try{const l=await n.handler(r,t,i);if("error"in l||"errorMessage"in l){const c=l.error?n.requestType.errorSerializer.serializeToJson(l.error):void 0;a={error:{code:l.errorCode||Kr.genericApplicationError,message:l.errorMessage||"An error was returned",data:c}}}else a={result:n.requestType.resultSerializer.serializeToJson(l.ok)}}catch(l){l instanceof nV?a={error:{code:l.code,message:l.message}}:(this._logger&&this._logger.warn({text:`An exception was thrown while handling a request: ${l}.`,exception:l,data:{requestObject:e}}),a={error:{code:Kr.unexpectedServerError,message:this.sendExceptionDetails?`An exception was thrown while handling a request: ${l}.`:"Server has thrown an unexpected exception"}})}return a}}async handleNotification(e,t){const i=this._handler.get(e.method);if(!i){for(const r of this._unknownNotificationHandler)r(e);this._unknownNotificationHandler.size===0&&this._logger&&this._logger.debug({text:`Unhandled notification "${e.method}"`,data:{requestObject:e}});return}if(i.kind!="notification"){this._logger&&this._logger.debug({text:`"${e.method}" is registered as request, but was sent as notification.`,data:{requestObject:e}});return}const n=i.notificationType.paramsSerializer.deserializeFromJson(e.params);if(n.hasErrors){this._logger&&this._logger.debug({text:`Got invalid params: ${n}`,data:{requestObject:e,errorMessage:n.errorMessage}});return}const s=n.value;for(const r of i.handlers)try{r(s,t)}catch(a){this._logger&&this._logger.warn({text:`An exception was thrown while handling a notification: ${a}.`,exception:a,data:{requestObject:e}})}}registerUnknownNotificationHandler(e){return RE(this._unknownNotificationHandler,e)}registerRequestHandler(e,t){if(this._handler.get(e.method))throw new Error(`Handler with method "${e.method}" already registered.`);return RE(this._handler,e.method,{kind:"request",requestType:e,handler:t})}registerNotificationHandler(e,t){let i=this._handler.get(e.method);if(!i)i={kind:"notification",notificationType:e,handlers:new Set},this._handler.set(e.method,i);else{if(i.kind!=="notification")throw new Error(`Method "${e.method}" was already registered as request handler.`);if(i.notificationType!==e)throw new Error(`Method "${e.method}" was registered for a different type.`)}return RE(i.handlers,t)}getRegisteredTypes(){const e=[];for(const t of this._handler.values())t.kind==="notification"?e.push(t.notificationType):t.kind==="request"&&e.push(t.requestType);return e}async request(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error("Impossible");const n=e.paramsSerializer.serializeToJson(t);iV(n);const s=await this._requestSender.sendRequest({method:e.method,params:n},i);if("error"in s){if(e.isOptional&&s.error.code===Kr.methodNotFound)return cX;let r;if(s.error.data!==void 0){const l=e.errorSerializer.deserializeFromJson(s.error.data);if(l.hasErrors)throw new Error(l.errorMessage);r=l.value}else r=void 0;const a=new nV(s.error.message,r,s.error.code);throw this._requestDidErrorEventEmitter.fire({error:a}),a}else{const r=e.resultSerializer.deserializeFromJson(s.result);if(r.hasErrors)throw new Error("Could not deserialize response: "+r.errorMessage+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:jc(t,a.open),close:jc(t,a.close)});else throw zt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function L2e(o){mm.registerLanguage(o)}function k2e(){let o=[];return o=o.concat(mm.getLanguages()),o}function D2e(o){return Ne.get(_i).languageIdCodec.encodeLanguageId(o)}function I2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function E2e(o,e){return Ne.withServices(()=>{const i=Ne.get(_i).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function N2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ne.get(ti).register(o,e,100)}class T2e{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return iw.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new JL(n.tokens,n.endState)}}class iw{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g{const i=await Promise.resolve(e.create());return i?R2e(i)?TY(o,i):new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe)):null});return ui.registerFactory(o,t)}function A2e(o,e){if(!Ne.get(_i).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return NY(e)?_3(o,{create:()=>e}):ui.register(o,TY(o,e))}function O2e(o,e){const t=i=>new Zv(Ne.get(_i),Ne.get(er),o,EY(o,i),Ne.get(Pe));return NY(e)?_3(o,{create:()=>e}):ui.register(o,t(e))}function F2e(o,e){return Ne.get(he).referenceProvider.register(o,e)}function W2e(o,e){return Ne.get(he).renameProvider.register(o,e)}function B2e(o,e){return Ne.get(he).newSymbolNamesProvider.register(o,e)}function H2e(o,e){return Ne.get(he).signatureHelpProvider.register(o,e)}function V2e(o,e){return Ne.get(he).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new L(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new L(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function z2e(o,e){return Ne.get(he).documentSymbolProvider.register(o,e)}function U2e(o,e){return Ne.get(he).documentHighlightProvider.register(o,e)}function $2e(o,e){return Ne.get(he).linkedEditingRangeProvider.register(o,e)}function j2e(o,e){return Ne.get(he).definitionProvider.register(o,e)}function q2e(o,e){return Ne.get(he).implementationProvider.register(o,e)}function K2e(o,e){return Ne.get(he).typeDefinitionProvider.register(o,e)}function G2e(o,e){return Ne.get(he).codeLensProvider.register(o,e)}function Z2e(o,e,t){return Ne.get(he).codeActionProvider.register(o,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,s,r,a)=>{const c=Ne.get($l).read({resource:n.uri}).filter(d=>L.areIntersectingOrTouching(d,s));return e.provideCodeActions(n,s,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function Y2e(o,e){return Ne.get(he).documentFormattingEditProvider.register(o,e)}function X2e(o,e){return Ne.get(he).documentRangeFormattingEditProvider.register(o,e)}function Q2e(o,e){return Ne.get(he).onTypeFormattingEditProvider.register(o,e)}function J2e(o,e){return Ne.get(he).linkProvider.register(o,e)}function ePe(o,e){return Ne.get(he).completionProvider.register(o,e)}function tPe(o,e){return Ne.get(he).colorProvider.register(o,e)}function iPe(o,e){return Ne.get(he).foldingRangeProvider.register(o,e)}function nPe(o,e){return Ne.get(he).declarationProvider.register(o,e)}function sPe(o,e){return Ne.get(he).selectionRangeProvider.register(o,e)}function oPe(o,e){return Ne.get(he).documentSemanticTokensProvider.register(o,e)}function rPe(o,e){return Ne.get(he).documentRangeSemanticTokensProvider.register(o,e)}function aPe(o,e){return Ne.get(he).inlineCompletionsProvider.register(o,e)}function lPe(o,e){return Ne.get(he).inlayHintsProvider.register(o,e)}function cPe(){return{register:L2e,getLanguages:k2e,onLanguage:I2e,onLanguageEncountered:E2e,getEncodedLanguageId:D2e,setLanguageConfiguration:N2e,setColorMap:P2e,registerTokensProviderFactory:_3,setTokensProvider:A2e,setMonarchTokensProvider:O2e,registerReferenceProvider:F2e,registerRenameProvider:W2e,registerNewSymbolNameProvider:B2e,registerCompletionItemProvider:ePe,registerSignatureHelpProvider:H2e,registerHoverProvider:V2e,registerDocumentSymbolProvider:z2e,registerDocumentHighlightProvider:U2e,registerLinkedEditingRangeProvider:$2e,registerDefinitionProvider:j2e,registerImplementationProvider:q2e,registerTypeDefinitionProvider:K2e,registerCodeLensProvider:G2e,registerCodeActionProvider:Z2e,registerDocumentFormattingEditProvider:Y2e,registerDocumentRangeFormattingEditProvider:X2e,registerOnTypeFormattingEditProvider:Q2e,registerLinkProvider:J2e,registerColorProvider:tPe,registerFoldingRangeProvider:iPe,registerDeclarationProvider:nPe,registerSelectionRangeProvider:sPe,registerDocumentSemanticTokensProvider:oPe,registerDocumentRangeSemanticTokensProvider:rPe,registerInlineCompletionsProvider:aPe,registerInlayHintsProvider:lPe,DocumentHighlightKind:j2,CompletionItemKind:B2,CompletionItemTag:H2,CompletionItemInsertTextRule:W2,SymbolKind:yP,SymbolTag:xP,IndentAction:Q2,CompletionTriggerKind:V2,SignatureHelpTriggerKind:SP,InlayHintKind:eP,InlineCompletionTriggerKind:nP,CodeActionTriggerType:F2,NewSymbolNameTag:dP,NewSymbolNameTriggerKind:hP,PartialAcceptTriggerKind:fP,HoverVerbosityAction:X2,InlineCompletionEndOfLifeReasonKind:tP,InlineCompletionHintStyle:iP,FoldingRangeKind:df,SelectedSuggestionInfo:c$,EditDeltaInfo:ov}}rs.wrappingIndent.defaultValue=0;rs.glyphMargin.defaultValue=!1;rs.autoIndent.defaultValue=3;rs.overviewRulerLanes.defaultValue=2;Vm.setFormatterSelector((o,e,t)=>Promise.resolve(o[0]));const As=sY();As.editor=C2e();As.languages=cPe();const RY=As.CancellationTokenSource,Ph=As.Emitter,MY=As.KeyCode,PY=As.KeyMod,_d=As.Position,x_=As.Range,AY=As.Selection,OY=As.SelectionDirection,Zr=As.MarkerSeverity,nL=As.MarkerTag,hD=As.Uri,FY=As.Token,Dl=As.editor,de=As.languages,dPe=FA(),rm=globalThis;(dPe?.globalAPI||typeof rm.define=="function"&&rm.define.amd)&&(rm.monaco=As);typeof rm.require<"u"&&typeof rm.require.config=="function"&&rm.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const hPe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:RY,Emitter:Ph,KeyCode:MY,KeyMod:PY,MarkerSeverity:Zr,MarkerTag:nL,Position:_d,Range:x_,Selection:AY,SelectionDirection:OY,Token:FY,Uri:hD,editor:Dl,languages:de},Symbol.toStringTag,{value:"Module"}));let b3=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const C3={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},v3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},WY=new b3("css",C3,v3),BY=new b3("scss",C3,v3),HY=new b3("less",C3,v3);function w3(){return we(()=>import("./cssMode-D5w7-Er3.js"),__vite__mapDeps([0,1,2,3,4]))}de.onLanguage("less",()=>{w3().then(o=>o.setupMode(HY))});de.onLanguage("scss",()=>{w3().then(o=>o.setupMode(BY))});de.onLanguage("css",()=>{w3().then(o=>o.setupMode(WY))});const VY=Object.freeze(Object.defineProperty({__proto__:null,cssDefaults:WY,lessDefaults:HY,scssDefaults:BY},Symbol.toStringTag,{value:"Module"}));let uPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const gPe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},uD={format:gPe,suggest:{},data:{useDefaultDataProvider:!0}};function gD(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===bC,documentFormattingEdits:o===bC,documentRangeFormattingEdits:o===bC}}const bC="html",Q6="handlebars",J6="razor",zY=fD(bC,uD,gD(bC)),fPe=zY.defaults,UY=fD(Q6,uD,gD(Q6)),pPe=UY.defaults,$Y=fD(J6,uD,gD(J6)),mPe=$Y.defaults;function _Pe(){return we(()=>import("./htmlMode-DdkvK5Eo.js"),__vite__mapDeps([5,1,2,3,4]))}function fD(o,e=uD,t=gD(o)){const i=new uPe(o,e,t);let n;const s=de.onLanguage(o,async()=>{n=(await _Pe()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}const jY=Object.freeze(Object.defineProperty({__proto__:null,handlebarDefaults:pPe,handlebarLanguageService:UY,htmlDefaults:fPe,htmlLanguageService:zY,razorDefaults:mPe,razorLanguageService:$Y,registerHTMLLanguageService:fD},Symbol.toStringTag,{value:"Module"}));let bPe=class{constructor(e,t,i){this._onDidChange=new Ph,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}};const CPe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},vPe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},qY=new bPe("json",CPe,vPe),wPe=()=>KY().then(o=>o.getWorker());function KY(){return we(()=>import("./jsonMode-B4Dmmm_Y.js"),__vite__mapDeps([6,1,2,3,4]))}de.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});de.onLanguage("json",()=>{KY().then(o=>o.setupMode(qY))});const GY=Object.freeze(Object.defineProperty({__proto__:null,getWorker:wPe,jsonDefaults:qY},Symbol.toStringTag,{value:"Module"})),SPe="5.9.3";var ZY=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(ZY||{}),YY=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(YY||{}),XY=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(XY||{}),QY=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(QY||{}),JY=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(JY||{});class eX{constructor(e,t,i,n,s){this._onDidChange=new Ph,this._onDidExtraLibsChange=new Ph,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(i),this.setInlayHintsOptions(n),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let i;if(typeof t>"u"?i=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:i=t,this._extraLibs[i]&&this._extraLibs[i].content===e)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[i]&&(n=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(n=this._extraLibs[i].version+1),this._extraLibs[i]={content:e,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[i];s&&s.version===n&&(delete this._extraLibs[i],this._removedExtraLibs[i]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const i=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=t.content;let s=1;this._removedExtraLibs[i]&&(s=this._removedExtraLibs[i]+1),this._extraLibs[i]={content:n,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(void 0)}}const yPe=SPe,tX={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},iX=new eX({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),nX=new eX({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},tX),xPe=()=>pD().then(o=>o.getTypeScriptWorker()),LPe=()=>pD().then(o=>o.getJavaScriptWorker());function pD(){return we(()=>import("./tsMode-BFMAlDzX.js"),__vite__mapDeps([7,2,3,4]))}de.onLanguage("typescript",()=>pD().then(o=>o.setupTypeScript(iX)));de.onLanguage("javascript",()=>pD().then(o=>o.setupJavaScript(nX)));const sX=Object.freeze(Object.defineProperty({__proto__:null,JsxEmit:YY,ModuleKind:ZY,ModuleResolutionKind:JY,NewLineKind:XY,ScriptTarget:QY,getJavaScriptWorker:LPe,getTypeScriptWorker:xPe,javascriptDefaults:nX,typescriptDefaults:iX,typescriptVersion:yPe},Symbol.toStringTag,{value:"Module"})),oX={},NE={};class S3{static getOrCreate(e){return NE[e]||(NE[e]=new S3(e)),NE[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,oX[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function ye(o){const e=o.id;oX[e]=o,de.register(o);const t=S3.getOrCreate(e);de.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),de.onLanguageEncountered(e,async()=>{const i=await t.load();de.setLanguageConfiguration(e,i.conf)})}ye({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>we(()=>import("./abap-DLDM7-KI.js"),[])});ye({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>we(()=>import("./apex-DNDY2TF8.js"),[])});ye({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>we(()=>import("./azcli-Y6nb8tq_.js"),[])});ye({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>we(()=>import("./bat-BwHxbl9M.js"),[])});ye({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>we(()=>import("./bicep-CFznDFnq.js"),[])});ye({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>we(()=>import("./cameligo-Bf6VGUru.js"),[])});ye({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>we(()=>import("./clojure-Dnu-v4kV.js"),[])});ye({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>we(()=>import("./coffee-Bd8akH9Z.js"),[])});ye({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>we(()=>import("./cpp-BbWJElDN.js"),[])});ye({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>we(()=>import("./csharp-Co3qMtFm.js"),[])});ye({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>we(()=>import("./csp-D-4FJmMZ.js"),[])});ye({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>we(()=>import("./css-DdJfP1eB.js"),[])});ye({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>we(()=>import("./cypher-cTPe9QuQ.js"),[])});ye({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>we(()=>import("./dart-BOtBlQCF.js"),[])});ye({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>we(()=>import("./dockerfile-BG73LgW2.js"),[])});ye({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>we(()=>import("./ecl-BEgZUVRK.js"),[])});ye({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>we(()=>import("./elixir-BkW5O-1t.js"),[])});ye({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>we(()=>import("./flow9-BeJ5waoc.js"),[])});ye({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>we(()=>import("./fsharp-PahG7c26.js"),[])});ye({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationDollar)});ye({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationDollar)});ye({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAngleInterpolationBracket)});ye({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagBracketInterpolationBracket)});ye({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationDollar)});ye({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>we(()=>import("./freemarker2-CZNakv6O.js"),__vite__mapDeps([8,2,3,4])).then(o=>o.TagAutoInterpolationBracket)});ye({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>we(()=>import("./go-acbASCJo.js"),[])});ye({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>we(()=>import("./graphql-BxJiqAUM.js"),[])});ye({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>we(()=>import("./handlebars-BSa5yURd.js"),__vite__mapDeps([9,2,3,4]))});ye({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>we(()=>import("./hcl-DtV1sZF8.js"),[])});ye({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>we(()=>import("./html-C9Rps5Qh.js"),__vite__mapDeps([10,2,3,4]))});ye({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>we(()=>import("./ini-Kd9XrMLS.js"),[])});ye({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>we(()=>import("./java-CXBNlu9o.js"),[])});ye({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>we(()=>import("./javascript-MaMcwgI8.js"),__vite__mapDeps([11,12,2,3,4]))});ye({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>we(()=>import("./julia-cl7-CwDS.js"),[])});ye({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>we(()=>import("./kotlin-s7OhZKlX.js"),[])});ye({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>we(()=>import("./less-9HpZscsL.js"),[])});ye({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>we(()=>import("./lexon-OrD6JF1K.js"),[])});ye({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>we(()=>import("./lua-Cyyb5UIc.js"),[])});ye({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>we(()=>import("./liquid-DZ5uyBpf.js"),__vite__mapDeps([13,2,3,4]))});ye({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>we(()=>import("./m3-B8OfTtLu.js"),[])});ye({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>we(()=>import("./markdown-BFxVWTOG.js"),[])});ye({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>we(()=>import("./mdx-G_32mYPD.js"),__vite__mapDeps([14,2,3,4]))});ye({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>we(()=>import("./mips-CiqrrVzr.js"),[])});ye({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>we(()=>import("./msdax-DmeGPVcC.js"),[])});ye({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>we(()=>import("./mysql-C_tMU-Nz.js"),[])});ye({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>we(()=>import("./objective-c-BDtDVThU.js"),[])});ye({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>we(()=>import("./pascal-vHIfCaH5.js"),[])});ye({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>we(()=>import("./pascaligo-DtZ0uQbO.js"),[])});ye({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>we(()=>import("./perl-Ub6l9XKa.js"),[])});ye({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>we(()=>import("./pgsql-BlNEE0v7.js"),[])});ye({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>we(()=>import("./php-BBUBE1dy.js"),[])});ye({id:"pla",extensions:[".pla"],loader:()=>we(()=>import("./pla-DSh2-awV.js"),[])});ye({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>we(()=>import("./postiats-CocnycG-.js"),[])});ye({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>we(()=>import("./powerquery-tScXyioY.js"),[])});ye({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>we(()=>import("./powershell-COWaemsV.js"),[])});ye({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>we(()=>import("./protobuf-Brw8urJB.js"),[])});ye({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>we(()=>import("./pug-8SOpv6rk.js"),[])});ye({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>we(()=>import("./python-C976vrQl.js"),__vite__mapDeps([15,2,3,4]))});ye({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>we(()=>import("./qsharp-Bw9ernYp.js"),[])});ye({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>we(()=>import("./r-j7ic8hl3.js"),[])});ye({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>we(()=>import("./razor-C5EZiuVm.js"),__vite__mapDeps([16,2,3,4]))});ye({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>we(()=>import("./redis-Bu5POkcn.js"),[])});ye({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>we(()=>import("./redshift-Bs9aos_-.js"),[])});ye({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>we(()=>import("./restructuredtext-CqXO7rUv.js"),[])});ye({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>we(()=>import("./ruby-zBfavPgS.js"),[])});ye({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>we(()=>import("./rust-BzKRNQWT.js"),[])});ye({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>we(()=>import("./sb-BBc9UKZt.js"),[])});ye({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>we(()=>import("./scala-D9hQfWCl.js"),[])});ye({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>we(()=>import("./scheme-BPhDTwHR.js"),[])});ye({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>we(()=>import("./scss-CBJaRo0y.js"),[])});ye({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>we(()=>import("./shell-DiJ1NA_G.js"),[])});ye({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>we(()=>import("./solidity-Db0IVjzk.js"),[])});ye({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>we(()=>import("./sophia-CnS9iZB_.js"),[])});ye({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>we(()=>import("./sparql-CJmd_6j2.js"),[])});ye({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>we(()=>import("./sql-ClhHkBeG.js"),[])});ye({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>we(()=>import("./st-CHwy0fLd.js"),[])});ye({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>we(()=>import("./swift-Bqt4WxQ4.js"),[])});ye({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>we(()=>import("./systemverilog-Bs9z6M-B.js"),[])});ye({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>we(()=>import("./tcl-Dm6ycUr_.js"),[])});ye({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>we(()=>import("./twig-Csy3S7wG.js"),[])});ye({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>we(()=>import("./typescript-BEp7AJTK.js"),__vite__mapDeps([12,2,3,4]))});ye({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>we(()=>import("./typespec-Btyra-wh.js"),[])});ye({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>we(()=>import("./vb-Db0cS2oM.js"),[])});ye({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>we(()=>import("./wgsl-DumH7NcR.js"),[])});ye({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\we(()=>import("./xml-uimzP1Mc.js"),__vite__mapDeps([17,2,3,4]))});ye({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>we(()=>import("./yaml-DWEV3VeY.js"),__vite__mapDeps([18,2,3,4]))});var kPe=Object.defineProperty,DPe=(o,e,t)=>e in o?kPe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,ve=(o,e,t)=>DPe(o,typeof e!="symbol"?e+"":e,t),wS,eV,SS,TE,yS;function IPe(o){return o.method!==void 0}var tV;(function(o){function e(t){return t}o.create=e})(tV||(tV={}));var Kr;(function(o){o.parseError=-32700,o.invalidRequest=-32600,o.methodNotFound=-32601,o.invalidParams=-32602,o.internalError=-32603;function e(s){return-32099<=s&&s<=-32e3}o.isServerError=e;function t(s){if(!e(s))throw new Error("Invalid range for a server error.");return s}o.serverError=t,o.unexpectedServerError=-32e3;function i(s){return!0}o.isApplicationError=i;function n(s){return s}o.applicationError=n,o.genericApplicationError=-320100})(Kr||(Kr={}));var y3=class{constructor(){ve(this,"listeners",new Set),ve(this,"event",o=>(this.listeners.add(o),{dispose:()=>{this.listeners.delete(o)}}))}fire(o){this.listeners.forEach(e=>e(o))}},EPe=class{constructor(o){ve(this,"_value"),ve(this,"eventEmitter"),this._value=o,this.eventEmitter=new y3}get value(){return this._value}set value(o){this._value!==o&&(this._value=o,this.eventEmitter.fire(o))}get onChange(){return this.eventEmitter.event}};function NPe(o,e){const t=setTimeout(e,o);return{dispose:()=>clearTimeout(t)}}function RE(o,e,t){return o instanceof Set?(o.add(e),{dispose:()=>o.delete(e)}):(o.set(e,t),{dispose:()=>o.delete(e)})}var TPe=class{constructor(){ve(this,"_state","none"),ve(this,"promise"),ve(this,"resolve",()=>{}),ve(this,"reject",()=>{}),this.promise=new Promise((o,e)=>{this.resolve=o,this.reject=e})}get state(){return this._state}},rX=(wS=class{constructor(){ve(this,"_unprocessedMessages",[]),ve(this,"_messageListener"),ve(this,"id",wS.id++),ve(this,"_state",new EPe({state:"open"})),ve(this,"state",this._state)}setListener(o){if(this._messageListener=o,!!o)for(;this._unprocessedMessages.length>0&&this._messageListener!==void 0;){const e=this._unprocessedMessages.shift();this._messageListener(e)}}send(o){return this._sendImpl(o)}_dispatchReceivedMessage(o){this._unprocessedMessages.length===0&&this._messageListener?this._messageListener(o):this._unprocessedMessages.push(o)}_onConnectionClosed(){this._state.value={state:"closed",error:void 0}}log(o){return new RPe(this,o??new MPe)}},ve(wS,"id",0),wS),RPe=class{constructor(o,e){ve(this,"baseStream"),ve(this,"logger"),this.baseStream=o,this.logger=e}get state(){return this.baseStream.state}setListener(o){if(o===void 0){this.baseStream.setListener(void 0);return}this.baseStream.setListener(e=>{this.logger.log(this.baseStream,"incoming",e),o(e)})}send(o){return this.logger.log(this.baseStream,"outgoing",o),this.baseStream.send(o)}toString(){return`StreamLogger/${this.baseStream.toString()}`}},MPe=class{log(o,e,t){console.log(`${e==="incoming"?"<-":"->"} [${o.toString()}] ${JSON.stringify(t)}`)}},PPe=class aX{constructor(e){ve(this,"connect"),this.connect=e}mapContext(e){return new aX(t=>this.connect(t?APe(t,e):void 0))}};function APe(o,e){return{handleNotification:(t,i)=>o.handleNotification(t,e(i)),handleRequest:(t,i,n)=>o.handleRequest(t,i,e(n))}}var OPe=class lX{constructor(e,t,i){ve(this,"_stream"),ve(this,"_listener"),ve(this,"_logger"),ve(this,"_unprocessedResponses",new Map),ve(this,"_lastUsedRequestId",0),this._stream=e,this._listener=t,this._logger=i,this._stream.setListener(n=>{IPe(n)?n.id===void 0?this._processNotification(n):this._processRequest(n):this._processResponse(n)})}static createChannel(e,t){let i=!1;return new PPe(n=>{if(i)throw new Error(`A channel to the stream ${e} was already constructed!`);return i=!0,new lX(e,n,t)})}get state(){return this._stream.state}async _processNotification(e){if(e.id!==void 0)throw new Error;if(!this._listener){this._logger&&this._logger.debug({text:"Notification ignored",message:e});return}try{await this._listener.handleNotification({method:e.method,params:e.params||null})}catch(t){this._logger&&this._logger.warn({text:`Exception was thrown while handling notification: ${t}`,exception:t,message:e})}}async _processRequest(e){if(e.id===void 0)throw new Error;let t;if(this._listener)try{t=await this._listener.handleRequest({method:e.method,params:e.params||null},e.id)}catch(n){this._logger&&this._logger.warn({text:`Exception was thrown while handling request: ${n}`,message:e,exception:n}),t={error:{code:Kr.internalError,message:"An unexpected exception was thrown.",data:void 0}}}else this._logger&&this._logger.debug({text:"Received request even though not listening for requests",message:e}),t={error:{code:Kr.methodNotFound,message:"This endpoint does not listen for requests or notifications.",data:void 0}};let i;"result"in t?i={jsonrpc:"2.0",id:e.id,result:t.result}:i={jsonrpc:"2.0",id:e.id,error:t.error},await this._stream.send(i)}_processResponse(e){const t=""+e.id,i=this._unprocessedResponses.get(t);if(!i){this._logger&&this._logger.debug({text:"Got an unexpected response message",message:e});return}this._unprocessedResponses.delete(t),i(e)}_newRequestId(){return this._lastUsedRequestId++}sendRequest(e,t,i){const n={jsonrpc:"2.0",id:this._newRequestId(),method:e.method,params:e.params||void 0};return i&&i(n.id),new Promise((s,r)=>{const a=""+n.id;this._unprocessedResponses.set(a,l=>{"result"in l?s({result:l.result}):(l.error||r(new Error("Response had neither 'result' nor 'error' field set.")),s({error:l.error}))}),this._stream.send(n).then(void 0,l=>{this._unprocessedResponses.delete(a),r(l)})})}sendNotification(e,t){const i={jsonrpc:"2.0",id:void 0,method:e.method,params:e.params||void 0};return this._stream.send(i)}toString(){return"StreamChannel/"+this._stream.toString()}},am;(function(o){function e(){return{deserializeFromJson:n=>({hasErrors:!1,value:n}),serializeToJson:n=>n}}o.sAny=e;function t(){return{deserializeFromJson:n=>({hasErrors:!1,value:{}}),serializeToJson:n=>({})}}o.sEmptyObject=t;function i(){return{deserializeFromJson:n=>({hasErrors:!1,value:void 0}),serializeToJson:n=>null}}o.sVoidFromNull=i})(am||(am={}));const cX=Symbol("OptionalMethodNotFound");var dX=class{contextualize(o){return new FPe(this,o)}},FPe=class extends dX{constructor(o,e){super(),ve(this,"underylingTypedChannel"),ve(this,"converters"),this.underylingTypedChannel=o,this.converters=e}async request(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.request(o,e,i)}async notify(o,e,t){const i=await this.converters.getSendContext(t);return this.underylingTypedChannel.notify(o,e,i)}registerNotificationHandler(o,e){return this.underylingTypedChannel.registerNotificationHandler(o,async(t,i)=>await e(t,await this.converters.getNewContext(i)))}registerRequestHandler(o,e){return this.underylingTypedChannel.registerRequestHandler(o,async(t,i,n)=>await e(t,i,await this.converters.getNewContext(n)))}},EA=class hX extends dX{constructor(e,t={}){super(),ve(this,"channelCtor"),ve(this,"_requestSender"),ve(this,"_handler",new Map),ve(this,"_unknownNotificationHandler",new Set),ve(this,"_timeout"),ve(this,"sendExceptionDetails",!1),ve(this,"_logger"),ve(this,"listeningDeferred",new TPe),ve(this,"onListening",this.listeningDeferred.promise),ve(this,"_requestDidErrorEventEmitter",new y3),ve(this,"onRequestDidError",this._requestDidErrorEventEmitter.event),this.channelCtor=e,this._logger=t.logger,this.sendExceptionDetails=!!t.sendExceptionDetails,this._timeout=NPe(1e3,()=>{this._requestSender||console.warn(`"${this.startListen.name}" has not been called within 1 second after construction of this channel. Did you forget to call it?`,this)})}static fromTransport(e,t={}){return new hX(OPe.createChannel(e,t.logger),t)}startListen(){if(this._requestSender)throw new Error(`"${this.startListen.name}" can be called only once, but it already has been called.`);this._timeout&&(this._timeout.dispose(),this._timeout=void 0),this._requestSender=this.channelCtor.connect({handleRequest:(e,t,i)=>this.handleRequest(e,t,i),handleNotification:(e,t)=>this.handleNotification(e,t)}),this.listeningDeferred.resolve()}checkChannel(e){if(!e)throw new Error(`"${this.startListen.name}" must be called before any messages can be sent or received.`);return!0}async handleRequest(e,t,i){const n=this._handler.get(e.method);if(!n)return this._logger&&this._logger.debug({text:`No request handler for "${e.method}".`,data:{requestObject:e}}),{error:{code:Kr.methodNotFound,message:`No request handler for "${e.method}".`,data:{method:e.method}}};if(n.kind!="request"){const r=`"${e.method}" is registered as notification, but was sent as request.`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e}}),{error:{code:Kr.invalidRequest,message:r,data:{method:e.method}}}}const s=n.requestType.paramsSerializer.deserializeFromJson(e.params);if(s.hasErrors){const r=`Got invalid params: ${s.errorMessage}`;return this._logger&&this._logger.debug({text:r,data:{requestObject:e,errorMessage:s.errorMessage}}),{error:{code:Kr.invalidParams,message:r,data:{errors:s.errorMessage}}}}else{const r=s.value;let a;try{const l=await n.handler(r,t,i);if("error"in l||"errorMessage"in l){const c=l.error?n.requestType.errorSerializer.serializeToJson(l.error):void 0;a={error:{code:l.errorCode||Kr.genericApplicationError,message:l.errorMessage||"An error was returned",data:c}}}else a={result:n.requestType.resultSerializer.serializeToJson(l.ok)}}catch(l){l instanceof nV?a={error:{code:l.code,message:l.message}}:(this._logger&&this._logger.warn({text:`An exception was thrown while handling a request: ${l}.`,exception:l,data:{requestObject:e}}),a={error:{code:Kr.unexpectedServerError,message:this.sendExceptionDetails?`An exception was thrown while handling a request: ${l}.`:"Server has thrown an unexpected exception"}})}return a}}async handleNotification(e,t){const i=this._handler.get(e.method);if(!i){for(const r of this._unknownNotificationHandler)r(e);this._unknownNotificationHandler.size===0&&this._logger&&this._logger.debug({text:`Unhandled notification "${e.method}"`,data:{requestObject:e}});return}if(i.kind!="notification"){this._logger&&this._logger.debug({text:`"${e.method}" is registered as request, but was sent as notification.`,data:{requestObject:e}});return}const n=i.notificationType.paramsSerializer.deserializeFromJson(e.params);if(n.hasErrors){this._logger&&this._logger.debug({text:`Got invalid params: ${n}`,data:{requestObject:e,errorMessage:n.errorMessage}});return}const s=n.value;for(const r of i.handlers)try{r(s,t)}catch(a){this._logger&&this._logger.warn({text:`An exception was thrown while handling a notification: ${a}.`,exception:a,data:{requestObject:e}})}}registerUnknownNotificationHandler(e){return RE(this._unknownNotificationHandler,e)}registerRequestHandler(e,t){if(this._handler.get(e.method))throw new Error(`Handler with method "${e.method}" already registered.`);return RE(this._handler,e.method,{kind:"request",requestType:e,handler:t})}registerNotificationHandler(e,t){let i=this._handler.get(e.method);if(!i)i={kind:"notification",notificationType:e,handlers:new Set},this._handler.set(e.method,i);else{if(i.kind!=="notification")throw new Error(`Method "${e.method}" was already registered as request handler.`);if(i.notificationType!==e)throw new Error(`Method "${e.method}" was registered for a different type.`)}return RE(i.handlers,t)}getRegisteredTypes(){const e=[];for(const t of this._handler.values())t.kind==="notification"?e.push(t.notificationType):t.kind==="request"&&e.push(t.requestType);return e}async request(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error("Impossible");const n=e.paramsSerializer.serializeToJson(t);iV(n);const s=await this._requestSender.sendRequest({method:e.method,params:n},i);if("error"in s){if(e.isOptional&&s.error.code===Kr.methodNotFound)return cX;let r;if(s.error.data!==void 0){const l=e.errorSerializer.deserializeFromJson(s.error.data);if(l.hasErrors)throw new Error(l.errorMessage);r=l.value}else r=void 0;const a=new nV(s.error.message,r,s.error.code);throw this._requestDidErrorEventEmitter.fire({error:a}),a}else{const r=e.resultSerializer.deserializeFromJson(s.result);if(r.hasErrors)throw new Error("Could not deserialize response: "+r.errorMessage+` ${JSON.stringify(s,null,2)}`);return r.value}}async notify(e,t,i){if(!this.checkChannel(this._requestSender))throw new Error;const n=e.paramsSerializer.serializeToJson(t);iV(n),this._requestSender.sendNotification({method:e.method,params:n},i)}};function iV(o){if(o!==null&&Array.isArray(o)&&typeof o!="object")throw new Error("Invalid value! Only null, array and object is allowed.")}var nV=class uX extends Error{constructor(e,t,i=Kr.genericApplicationError){super(e),ve(this,"data"),ve(this,"code"),this.data=t,this.code=i,Object.setPrototypeOf(this,uX.prototype)}},WPe=class NA{constructor(e,t,i,n,s=!1){ve(this,"method"),ve(this,"paramsSerializer"),ve(this,"resultSerializer"),ve(this,"errorSerializer"),ve(this,"isOptional"),ve(this,"kind","request"),this.method=e,this.paramsSerializer=t,this.resultSerializer=i,this.errorSerializer=n,this.isOptional=s}withMethod(e){return new NA(e,this.paramsSerializer,this.resultSerializer,this.errorSerializer)}optional(){return new NA(this.method,this.paramsSerializer,this.resultSerializer,this.errorSerializer,!0)}},BPe=class gX{constructor(e,t){ve(this,"method"),ve(this,"paramsSerializer"),ve(this,"kind","notification"),this.method=e,this.paramsSerializer=t}withMethod(e){return new gX(e,this.paramsSerializer)}};function Oe(o){return new WPe((o||{}).method,am.sAny(),am.sAny(),am.sAny())}function yi(o){return new BPe((o||{}).method,am.sAny())}const HPe=Symbol();var sV=(eV=HPe,SS=class{constructor(o){ve(this,"error"),ve(this,eV),this.error=o}},ve(SS,"factory",o=>new SS(o)),SS);function VPe(o){const e=oV(o.server),t=oV(o.client);return new zPe(o.tags||[],e,t)}function oV(o){const e={};for(const[t,i]of Object.entries(o)){const n=i.method?i.method:t;e[t]=i.withMethod(n)}return e}var zPe=class fX{constructor(e=[],t,i){ve(this,"tags"),ve(this,"server"),ve(this,"client"),this.tags=e,this.server=t,this.client=i}_onlyDesignTime(){return new Error("This property is not meant to be accessed at runtime")}get TContractObject(){throw this._onlyDesignTime()}get TClientInterface(){throw this._onlyDesignTime()}get TServerInterface(){throw this._onlyDesignTime()}get TClientHandler(){throw this._onlyDesignTime()}get TServerHandler(){throw this._onlyDesignTime()}get TTags(){throw this._onlyDesignTime()}getInterface(e,t,i,n){const s=this.buildCounterpart(e,i),r=this.registerHandlers(e,t,n,s);return{counterpart:s,dispose:()=>r.dispose()}}buildCounterpart(e,t){const i={};for(const[n,s]of Object.entries(t)){let r;s.kind==="request"?s.isOptional?r=async(a,l)=>{a===void 0&&(a={});try{return await e.request(s,a,l)}catch(c){if(c&&c.code===Kr.methodNotFound)return cX;throw c}}:r=(a,l)=>(a===void 0&&(a={}),e.request(s,a,l)):r=(a,l)=>(a===void 0&&(a={}),e.notify(s,a,l)),i[n]=r}return i}registerHandlers(e,t,i,n){const s=[];for(const[r,a]of Object.entries(t))if(a.kind==="request"){let l=i[r];if(!l)continue;const c=this.createRequestHandler(n,l);s.push(e.registerRequestHandler(a,c))}else{const l=i[r];l&&s.push(e.registerNotificationHandler(a,(c,d)=>{l(c,{context:d,counterpart:n})}))}return{dispose:()=>s.forEach(r=>r.dispose())}}createRequestHandler(e,t){return async(i,n,s)=>{const r=await t(i,{context:s,counterpart:e,newErr:sV.factory,requestId:n});return r instanceof sV?r.error:{ok:r}}}static getServerFromStream(e,t,i,n){const s=EA.fromTransport(t,i),{server:r}=e.getServer(s,n);return s.startListen(),{channel:s,server:r}}static registerServerToStream(e,t,i,n){const s=EA.fromTransport(t,i),{client:r}=e.registerServer(s,n);return s.startListen(),{channel:s,client:r}}getServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.client,this.server,t);return{server:i,dispose:n}}registerServer(e,t){const{counterpart:i,dispose:n}=this.getInterface(e,this.server,this.client,t);return{client:i,dispose:n}}withContext(){return new fX(this.tags,this.server,this.client)}};let lm=(function(o){return o.Comment="comment",o.Imports="imports",o.Region="region",o})({}),Pi=(function(o){return o[o.File=1]="File",o[o.Module=2]="Module",o[o.Namespace=3]="Namespace",o[o.Package=4]="Package",o[o.Class=5]="Class",o[o.Method=6]="Method",o[o.Property=7]="Property",o[o.Field=8]="Field",o[o.Constructor=9]="Constructor",o[o.Enum=10]="Enum",o[o.Interface=11]="Interface",o[o.Function=12]="Function",o[o.Variable=13]="Variable",o[o.Constant=14]="Constant",o[o.String=15]="String",o[o.Number=16]="Number",o[o.Boolean=17]="Boolean",o[o.Array=18]="Array",o[o.Object=19]="Object",o[o.Key=20]="Key",o[o.Null=21]="Null",o[o.EnumMember=22]="EnumMember",o[o.Struct=23]="Struct",o[o.Event=24]="Event",o[o.Operator=25]="Operator",o[o.TypeParameter=26]="TypeParameter",o})({}),pX=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),rV=(function(o){return o[o.Type=1]="Type",o[o.Parameter=2]="Parameter",o})({}),UPe=(function(o){return o[o.None=0]="None",o[o.Full=1]="Full",o[o.Incremental=2]="Incremental",o})({}),Bi=(function(o){return o[o.Text=1]="Text",o[o.Method=2]="Method",o[o.Function=3]="Function",o[o.Constructor=4]="Constructor",o[o.Field=5]="Field",o[o.Variable=6]="Variable",o[o.Class=7]="Class",o[o.Interface=8]="Interface",o[o.Module=9]="Module",o[o.Property=10]="Property",o[o.Unit=11]="Unit",o[o.Value=12]="Value",o[o.Enum=13]="Enum",o[o.Keyword=14]="Keyword",o[o.Snippet=15]="Snippet",o[o.Color=16]="Color",o[o.File=17]="File",o[o.Reference=18]="Reference",o[o.Folder=19]="Folder",o[o.EnumMember=20]="EnumMember",o[o.Constant=21]="Constant",o[o.Struct=22]="Struct",o[o.Event=23]="Event",o[o.Operator=24]="Operator",o[o.TypeParameter=25]="TypeParameter",o})({}),$Pe=(function(o){return o[o.Deprecated=1]="Deprecated",o})({}),jPe=(function(o){return o[o.PlainText=1]="PlainText",o[o.Snippet=2]="Snippet",o})({}),ME=(function(o){return o[o.Text=1]="Text",o[o.Read=2]="Read",o[o.Write=3]="Write",o})({}),sc=(function(o){return o.Empty="",o.QuickFix="quickfix",o.Refactor="refactor",o.RefactorExtract="refactor.extract",o.RefactorInline="refactor.inline",o.RefactorRewrite="refactor.rewrite",o.Source="source",o.SourceOrganizeImports="source.organizeImports",o.SourceFixAll="source.fixAll",o})({}),sL=(function(o){return o.PlainText="plaintext",o.Markdown="markdown",o})({}),Pc=(function(o){return o[o.Error=1]="Error",o[o.Warning=2]="Warning",o[o.Information=3]="Information",o[o.Hint=4]="Hint",o})({}),aV=(function(o){return o[o.Unnecessary=1]="Unnecessary",o[o.Deprecated=2]="Deprecated",o})({}),h0=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",o})({}),u0=(function(o){return o[o.Invoked=1]="Invoked",o[o.TriggerCharacter=2]="TriggerCharacter",o[o.ContentChange=3]="ContentChange",o})({}),TA=(function(o){return o[o.Invoked=1]="Invoked",o[o.Automatic=2]="Automatic",o})({}),qPe=(function(o){return o.Relative="relative",o})({});var rt=class{constructor(o){this.method=o}};const qe={textDocumentImplementation:new rt("textDocument/implementation"),textDocumentTypeDefinition:new rt("textDocument/typeDefinition"),textDocumentDocumentColor:new rt("textDocument/documentColor"),textDocumentColorPresentation:new rt("textDocument/colorPresentation"),textDocumentFoldingRange:new rt("textDocument/foldingRange"),textDocumentDeclaration:new rt("textDocument/declaration"),textDocumentSelectionRange:new rt("textDocument/selectionRange"),textDocumentPrepareCallHierarchy:new rt("textDocument/prepareCallHierarchy"),textDocumentSemanticTokensFull:new rt("textDocument/semanticTokens/full"),textDocumentSemanticTokensFullDelta:new rt("textDocument/semanticTokens/full/delta"),textDocumentLinkedEditingRange:new rt("textDocument/linkedEditingRange"),workspaceWillCreateFiles:new rt("workspace/willCreateFiles"),workspaceWillRenameFiles:new rt("workspace/willRenameFiles"),workspaceWillDeleteFiles:new rt("workspace/willDeleteFiles"),textDocumentMoniker:new rt("textDocument/moniker"),textDocumentPrepareTypeHierarchy:new rt("textDocument/prepareTypeHierarchy"),textDocumentInlineValue:new rt("textDocument/inlineValue"),textDocumentInlayHint:new rt("textDocument/inlayHint"),textDocumentDiagnostic:new rt("textDocument/diagnostic"),textDocumentInlineCompletion:new rt("textDocument/inlineCompletion"),textDocumentWillSaveWaitUntil:new rt("textDocument/willSaveWaitUntil"),textDocumentCompletion:new rt("textDocument/completion"),textDocumentHover:new rt("textDocument/hover"),textDocumentSignatureHelp:new rt("textDocument/signatureHelp"),textDocumentDefinition:new rt("textDocument/definition"),textDocumentReferences:new rt("textDocument/references"),textDocumentDocumentHighlight:new rt("textDocument/documentHighlight"),textDocumentDocumentSymbol:new rt("textDocument/documentSymbol"),textDocumentCodeAction:new rt("textDocument/codeAction"),workspaceSymbol:new rt("workspace/symbol"),textDocumentCodeLens:new rt("textDocument/codeLens"),textDocumentDocumentLink:new rt("textDocument/documentLink"),textDocumentFormatting:new rt("textDocument/formatting"),textDocumentRangeFormatting:new rt("textDocument/rangeFormatting"),textDocumentRangesFormatting:new rt("textDocument/rangesFormatting"),textDocumentOnTypeFormatting:new rt("textDocument/onTypeFormatting"),textDocumentRename:new rt("textDocument/rename"),workspaceExecuteCommand:new rt("workspace/executeCommand"),workspaceDidCreateFiles:new rt("workspace/didCreateFiles"),workspaceDidRenameFiles:new rt("workspace/didRenameFiles"),workspaceDidDeleteFiles:new rt("workspace/didDeleteFiles"),workspaceDidChangeConfiguration:new rt("workspace/didChangeConfiguration"),textDocumentDidOpen:new rt("textDocument/didOpen"),textDocumentDidChange:new rt("textDocument/didChange"),textDocumentDidClose:new rt("textDocument/didClose"),textDocumentDidSave:new rt("textDocument/didSave"),textDocumentWillSave:new rt("textDocument/willSave"),workspaceDidChangeWatchedFiles:new rt("workspace/didChangeWatchedFiles")},nw=VPe({server:{textDocumentImplementation:Oe({method:"textDocument/implementation"}),textDocumentTypeDefinition:Oe({method:"textDocument/typeDefinition"}),textDocumentDocumentColor:Oe({method:"textDocument/documentColor"}),textDocumentColorPresentation:Oe({method:"textDocument/colorPresentation"}),textDocumentFoldingRange:Oe({method:"textDocument/foldingRange"}),textDocumentDeclaration:Oe({method:"textDocument/declaration"}),textDocumentSelectionRange:Oe({method:"textDocument/selectionRange"}),textDocumentPrepareCallHierarchy:Oe({method:"textDocument/prepareCallHierarchy"}),callHierarchyIncomingCalls:Oe({method:"callHierarchy/incomingCalls"}),callHierarchyOutgoingCalls:Oe({method:"callHierarchy/outgoingCalls"}),textDocumentSemanticTokensFull:Oe({method:"textDocument/semanticTokens/full"}),textDocumentSemanticTokensFullDelta:Oe({method:"textDocument/semanticTokens/full/delta"}),textDocumentSemanticTokensRange:Oe({method:"textDocument/semanticTokens/range"}),textDocumentLinkedEditingRange:Oe({method:"textDocument/linkedEditingRange"}),workspaceWillCreateFiles:Oe({method:"workspace/willCreateFiles"}),workspaceWillRenameFiles:Oe({method:"workspace/willRenameFiles"}),workspaceWillDeleteFiles:Oe({method:"workspace/willDeleteFiles"}),textDocumentMoniker:Oe({method:"textDocument/moniker"}),textDocumentPrepareTypeHierarchy:Oe({method:"textDocument/prepareTypeHierarchy"}),typeHierarchySupertypes:Oe({method:"typeHierarchy/supertypes"}),typeHierarchySubtypes:Oe({method:"typeHierarchy/subtypes"}),textDocumentInlineValue:Oe({method:"textDocument/inlineValue"}),textDocumentInlayHint:Oe({method:"textDocument/inlayHint"}),inlayHintResolve:Oe({method:"inlayHint/resolve"}),textDocumentDiagnostic:Oe({method:"textDocument/diagnostic"}),workspaceDiagnostic:Oe({method:"workspace/diagnostic"}),textDocumentInlineCompletion:Oe({method:"textDocument/inlineCompletion"}),initialize:Oe({method:"initialize"}),shutdown:Oe({method:"shutdown"}),textDocumentWillSaveWaitUntil:Oe({method:"textDocument/willSaveWaitUntil"}),textDocumentCompletion:Oe({method:"textDocument/completion"}),completionItemResolve:Oe({method:"completionItem/resolve"}),textDocumentHover:Oe({method:"textDocument/hover"}),textDocumentSignatureHelp:Oe({method:"textDocument/signatureHelp"}),textDocumentDefinition:Oe({method:"textDocument/definition"}),textDocumentReferences:Oe({method:"textDocument/references"}),textDocumentDocumentHighlight:Oe({method:"textDocument/documentHighlight"}),textDocumentDocumentSymbol:Oe({method:"textDocument/documentSymbol"}),textDocumentCodeAction:Oe({method:"textDocument/codeAction"}),codeActionResolve:Oe({method:"codeAction/resolve"}),workspaceSymbol:Oe({method:"workspace/symbol"}),workspaceSymbolResolve:Oe({method:"workspaceSymbol/resolve"}),textDocumentCodeLens:Oe({method:"textDocument/codeLens"}),codeLensResolve:Oe({method:"codeLens/resolve"}),textDocumentDocumentLink:Oe({method:"textDocument/documentLink"}),documentLinkResolve:Oe({method:"documentLink/resolve"}),textDocumentFormatting:Oe({method:"textDocument/formatting"}),textDocumentRangeFormatting:Oe({method:"textDocument/rangeFormatting"}),textDocumentRangesFormatting:Oe({method:"textDocument/rangesFormatting"}),textDocumentOnTypeFormatting:Oe({method:"textDocument/onTypeFormatting"}),textDocumentRename:Oe({method:"textDocument/rename"}),textDocumentPrepareRename:Oe({method:"textDocument/prepareRename"}),workspaceExecuteCommand:Oe({method:"workspace/executeCommand"}),workspaceDidChangeWorkspaceFolders:yi({method:"workspace/didChangeWorkspaceFolders"}),windowWorkDoneProgressCancel:yi({method:"window/workDoneProgress/cancel"}),workspaceDidCreateFiles:yi({method:"workspace/didCreateFiles"}),workspaceDidRenameFiles:yi({method:"workspace/didRenameFiles"}),workspaceDidDeleteFiles:yi({method:"workspace/didDeleteFiles"}),notebookDocumentDidOpen:yi({method:"notebookDocument/didOpen"}),notebookDocumentDidChange:yi({method:"notebookDocument/didChange"}),notebookDocumentDidSave:yi({method:"notebookDocument/didSave"}),notebookDocumentDidClose:yi({method:"notebookDocument/didClose"}),initialized:yi({method:"initialized"}),exit:yi({method:"exit"}),workspaceDidChangeConfiguration:yi({method:"workspace/didChangeConfiguration"}),textDocumentDidOpen:yi({method:"textDocument/didOpen"}),textDocumentDidChange:yi({method:"textDocument/didChange"}),textDocumentDidClose:yi({method:"textDocument/didClose"}),textDocumentDidSave:yi({method:"textDocument/didSave"}),textDocumentWillSave:yi({method:"textDocument/willSave"}),workspaceDidChangeWatchedFiles:yi({method:"workspace/didChangeWatchedFiles"}),setTrace:yi({method:"$/setTrace"}),cancelRequest:yi({method:"$/cancelRequest"}),progress:yi({method:"$/progress"})},client:{workspaceWorkspaceFolders:Oe({method:"workspace/workspaceFolders"}).optional(),workspaceConfiguration:Oe({method:"workspace/configuration"}).optional(),workspaceFoldingRangeRefresh:Oe({method:"workspace/foldingRange/refresh"}).optional(),windowWorkDoneProgressCreate:Oe({method:"window/workDoneProgress/create"}).optional(),workspaceSemanticTokensRefresh:Oe({method:"workspace/semanticTokens/refresh"}).optional(),windowShowDocument:Oe({method:"window/showDocument"}).optional(),workspaceInlineValueRefresh:Oe({method:"workspace/inlineValue/refresh"}).optional(),workspaceInlayHintRefresh:Oe({method:"workspace/inlayHint/refresh"}).optional(),workspaceDiagnosticRefresh:Oe({method:"workspace/diagnostic/refresh"}).optional(),clientRegisterCapability:Oe({method:"client/registerCapability"}).optional(),clientUnregisterCapability:Oe({method:"client/unregisterCapability"}).optional(),windowShowMessageRequest:Oe({method:"window/showMessageRequest"}).optional(),workspaceCodeLensRefresh:Oe({method:"workspace/codeLens/refresh"}).optional(),workspaceApplyEdit:Oe({method:"workspace/applyEdit"}).optional(),windowShowMessage:yi({method:"window/showMessage"}),windowLogMessage:yi({method:"window/logMessage"}),telemetryEvent:yi({method:"telemetry/event"}),textDocumentPublishDiagnostics:yi({method:"textDocument/publishDiagnostics"}),logTrace:yi({method:"$/logTrace"}),cancelRequest:yi({method:"$/cancelRequest"}),progress:yi({method:"$/progress"})}});function Cg(o,e){if(o.textModel!==e)throw new Error(`Expected text model to be ${e}, but got ${o.textModel}`);return o}var Wi=(TE=class{constructor(){ve(this,"_store",new x3)}dispose(){this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}},ve(TE,"None",Object.freeze({dispose(){}})),TE),x3=(yS=class{constructor(){ve(this,"_toDispose",new Set),ve(this,"_isDisposed",!1)}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){if(this._toDispose.size!==0)try{for(const o of this._toDispose)o.dispose()}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?yS.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}},ve(yS,"DISABLE_DISPOSED_WARNING",!1),yS);const mX=new Map([[sc.Empty,""],[sc.QuickFix,"quickfix"],[sc.Refactor,"refactor"],[sc.RefactorExtract,"refactor.extract"],[sc.RefactorInline,"refactor.inline"],[sc.RefactorRewrite,"refactor.rewrite"],[sc.Source,"source"],[sc.SourceOrganizeImports,"source.organizeImports"],[sc.SourceFixAll,"source.fixAll"]]);function KPe(o){if(o)return mX.get(o)??o}const GPe=new Map([[de.CodeActionTriggerType.Invoke,TA.Invoked],[de.CodeActionTriggerType.Auto,TA.Automatic]]);function ZPe(o){return GPe.get(o)??TA.Invoked}const _X=new Map([[Bi.Text,de.CompletionItemKind.Text],[Bi.Method,de.CompletionItemKind.Method],[Bi.Function,de.CompletionItemKind.Function],[Bi.Constructor,de.CompletionItemKind.Constructor],[Bi.Field,de.CompletionItemKind.Field],[Bi.Variable,de.CompletionItemKind.Variable],[Bi.Class,de.CompletionItemKind.Class],[Bi.Interface,de.CompletionItemKind.Interface],[Bi.Module,de.CompletionItemKind.Module],[Bi.Property,de.CompletionItemKind.Property],[Bi.Unit,de.CompletionItemKind.Unit],[Bi.Value,de.CompletionItemKind.Value],[Bi.Enum,de.CompletionItemKind.Enum],[Bi.Keyword,de.CompletionItemKind.Keyword],[Bi.Snippet,de.CompletionItemKind.Snippet],[Bi.Color,de.CompletionItemKind.Color],[Bi.File,de.CompletionItemKind.File],[Bi.Reference,de.CompletionItemKind.Reference],[Bi.Folder,de.CompletionItemKind.Folder],[Bi.EnumMember,de.CompletionItemKind.EnumMember],[Bi.Constant,de.CompletionItemKind.Constant],[Bi.Struct,de.CompletionItemKind.Struct],[Bi.Event,de.CompletionItemKind.Event],[Bi.Operator,de.CompletionItemKind.Operator],[Bi.TypeParameter,de.CompletionItemKind.TypeParameter]]);function YPe(o){return o?_X.get(o)??de.CompletionItemKind.Text:de.CompletionItemKind.Text}const bX=new Map([[$Pe.Deprecated,de.CompletionItemTag.Deprecated]]);function XPe(o){return bX.get(o)}const QPe=new Map([[de.CompletionTriggerKind.Invoke,h0.Invoked],[de.CompletionTriggerKind.TriggerCharacter,h0.TriggerCharacter],[de.CompletionTriggerKind.TriggerForIncompleteCompletions,h0.TriggerForIncompleteCompletions]]);function JPe(o){return QPe.get(o)??h0.Invoked}const eAe=new Map([[jPe.Snippet,de.CompletionItemInsertTextRule.InsertAsSnippet]]);function tAe(o){if(o)return eAe.get(o)}const CX=new Map([[Pi.File,de.SymbolKind.File],[Pi.Module,de.SymbolKind.Module],[Pi.Namespace,de.SymbolKind.Namespace],[Pi.Package,de.SymbolKind.Package],[Pi.Class,de.SymbolKind.Class],[Pi.Method,de.SymbolKind.Method],[Pi.Property,de.SymbolKind.Property],[Pi.Field,de.SymbolKind.Field],[Pi.Constructor,de.SymbolKind.Constructor],[Pi.Enum,de.SymbolKind.Enum],[Pi.Interface,de.SymbolKind.Interface],[Pi.Function,de.SymbolKind.Function],[Pi.Variable,de.SymbolKind.Variable],[Pi.Constant,de.SymbolKind.Constant],[Pi.String,de.SymbolKind.String],[Pi.Number,de.SymbolKind.Number],[Pi.Boolean,de.SymbolKind.Boolean],[Pi.Array,de.SymbolKind.Array],[Pi.Object,de.SymbolKind.Object],[Pi.Key,de.SymbolKind.Key],[Pi.Null,de.SymbolKind.Null],[Pi.EnumMember,de.SymbolKind.EnumMember],[Pi.Struct,de.SymbolKind.Struct],[Pi.Event,de.SymbolKind.Event],[Pi.Operator,de.SymbolKind.Operator],[Pi.TypeParameter,de.SymbolKind.TypeParameter]]);function vX(o){return CX.get(o)??de.SymbolKind.File}const iAe=new Map([[pX.Deprecated,de.SymbolTag.Deprecated]]);function wX(o){return iAe.get(o)}const nAe=new Map([[ME.Text,de.DocumentHighlightKind.Text],[ME.Read,de.DocumentHighlightKind.Read],[ME.Write,de.DocumentHighlightKind.Write]]);function sAe(o){return o?nAe.get(o)??de.DocumentHighlightKind.Text:de.DocumentHighlightKind.Text}const oAe=new Map([[lm.Comment,de.FoldingRangeKind.Comment],[lm.Imports,de.FoldingRangeKind.Imports],[lm.Region,de.FoldingRangeKind.Region]]);function rAe(o){if(o)return oAe.get(o)}const aAe=new Map([[Zr.Error,Pc.Error],[Zr.Warning,Pc.Warning],[Zr.Info,Pc.Information],[Zr.Hint,Pc.Hint]]);function lAe(o){return aAe.get(o)??Pc.Error}const cAe=new Map([[Pc.Error,Zr.Error],[Pc.Warning,Zr.Warning],[Pc.Information,Zr.Info],[Pc.Hint,Zr.Hint]]);function dAe(o){return o?cAe.get(o)??Zr.Error:Zr.Error}const SX=new Map([[aV.Unnecessary,nL.Unnecessary],[aV.Deprecated,nL.Deprecated]]);function hAe(o){return SX.get(o)}const uAe=new Map([[de.SignatureHelpTriggerKind.Invoke,u0.Invoked],[de.SignatureHelpTriggerKind.TriggerCharacter,u0.TriggerCharacter],[de.SignatureHelpTriggerKind.ContentChange,u0.ContentChange]]);function gAe(o){return uAe.get(o)??u0.Invoked}function cm(o){if(o)return{id:o.command,title:o.title,arguments:o.arguments}}const fAe=new Map([[rV.Type,de.InlayHintKind.Type],[rV.Parameter,de.InlayHintKind.Parameter]]);function pAe(o){return o?fAe.get(o)??de.InlayHintKind.Type:de.InlayHintKind.Type}function Ah(o,e){if("targetUri"in o){const t=e.bridge.translateBackRange({uri:o.targetUri},o.targetRange);return{uri:t.textModel.uri,range:t.range,originSelectionRange:o.originSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.originSelectionRange).range:void 0,targetSelectionRange:o.targetSelectionRange?e.bridge.translateBackRange({uri:o.targetUri},o.targetSelectionRange).range:void 0}}else{const t=e.bridge.translateBackRange({uri:o.uri},o.range);return{uri:t.textModel.uri,range:t.range}}}function In(o){return!o||o.length===0?{language:"*"}:o.map(e=>"notebook"in e?typeof e.notebook=="string"?{notebookType:e.notebook,language:e.language}:{notebookType:e.notebook.notebookType,language:e.language,pattern:e.notebook.pattern,scheme:e.notebook.scheme}:{language:e.language,pattern:e.pattern,scheme:e.scheme})}function mAe(o,e){if(!e)return!0;const t=o.getLanguageId();if(o.uri.toString(!0),!e||e.length===0)return!0;for(const i of e)if(!(i.language&&i.language!=="*"&&i.language!==t))return!0;return!1}function RA(o){const e={severity:dAe(o.severity),startLineNumber:o.range.start.line+1,startColumn:o.range.start.character+1,endLineNumber:o.range.end.line+1,endColumn:o.range.end.character+1,message:o.message,source:o.source,code:typeof o.code=="string"?o.code:o.code?.toString()};return o.tags&&(e.tags=o.tags.map(t=>hAe(t)).filter(t=>t!==void 0)),o.relatedInformation&&(e.relatedInformation=o.relatedInformation.map(t=>({resource:hD.parse(t.location.uri),startLineNumber:t.location.range.start.line+1,startColumn:t.location.range.start.character+1,endLineNumber:t.location.range.end.line+1,endColumn:t.location.range.end.character+1,message:t.message}))),e}var _Ae=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{completion:{dynamicRegistration:!0,contextSupport:!0,completionItemKind:{valueSet:Array.from(_X.keys())},completionItem:{tagSupport:{valueSet:Array.from(bX.keys())},commitCharactersSupport:!0,deprecatedSupport:!0,preselectSupport:!0}}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentCompletion,!0,e=>de.registerCompletionItemProvider(In(e.documentSelector),new bAe(this._connection,e))))}},bAe=class{constructor(o,e){ve(this,"resolveCompletionItem"),this._client=o,this._capabilities=e,e.resolveProvider&&(this.resolveCompletionItem=async(t,i)=>(yX(t,await this._client.server.completionItemResolve(t._lspItem),this._client.bridge,t._translated,t._model),t))}get triggerCharacters(){return this._capabilities.triggerCharacters}async provideCompletionItems(o,e,t,i){const n=this._client.bridge.translate(o,e),s=await this._client.server.textDocumentCompletion({textDocument:n.textDocument,position:n.position,context:t.triggerCharacter?{triggerKind:JPe(t.triggerKind),triggerCharacter:t.triggerCharacter}:void 0});return s?{suggestions:(Array.isArray(s)?s:s.items).map(r=>({...CAe(r,this._client.bridge,n,o,e),_lspItem:r,_translated:n,_model:o}))}:{suggestions:[]}}};function CAe(o,e,t,i,n){let s=o.insertText||o.label,r;o.textEdit&&("range"in o.textEdit?(s=o.textEdit.newText,r=Cg(e.translateBackRange(t.textDocument,o.textEdit.range),i).range):(s=o.textEdit.newText,r={insert:Cg(e.translateBackRange(t.textDocument,o.textEdit.insert),i).range,replace:Cg(e.translateBackRange(t.textDocument,o.textEdit.replace),i).range})),r||(r=x_.fromPositions(n,n));const a={label:o.label,kind:YPe(o.kind),insertText:s,sortText:o.sortText,filterText:o.filterText,preselect:o.preselect,commitCharacters:o.commitCharacters,range:r};return yX(a,o,e,t,i),a}function yX(o,e,t,i,n){e.detail!==void 0&&(o.detail=e.detail),e.documentation!==void 0&&(o.documentation=vAe(e.documentation)),e.insertTextFormat!==void 0&&(o.insertTextRules=tAe(e.insertTextFormat)),e.tags&&e.tags.length>0&&(o.tags=e.tags.map(XPe).filter(s=>s!==void 0)),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(o.additionalTextEdits=e.additionalTextEdits.map(s=>({range:Cg(t.translateBackRange(i.textDocument,s.range),n).range,text:s.newText}))),e.command&&(o.command=cm(e.command))}function vAe(o){if(o)return typeof o=="string"?o:{value:o.value,isTrusted:!0}}var wAe=class extends Wi{constructor(o){super(),this._connection=o,this._register(this._connection.capabilities.addStaticClientCapabilities({textDocument:{hover:{dynamicRegistration:!0,contentFormat:[sL.Markdown,sL.PlainText]}}})),this._register(this._connection.capabilities.registerCapabilityHandler(qe.textDocumentHover,!0,e=>de.registerHoverProvider(In(e.documentSelector),new SAe(this._connection,e))))}},SAe=class{constructor(o,e){this._client=o,this._capabilities=e}async provideHover(o,e,t){const i=this._client.bridge.translate(o,e),n=await this._client.server.textDocumentHover({textDocument:i.textDocument,position:i.position});return!n||!n.contents?null:{contents:yAe(n.contents),range:n.range?this._client.bridge.translateBackRange(i.textDocument,n.range).range:void 0}}};function yAe(o){return Array.isArray(o)?o.map(e=>lV(e)):[lV(o)]}function lV(o){return typeof o=="string"?{value:o,isTrusted:!0}:"kind"in o?{value:o.value,isTrusted:!0}:{value:`\`\`\`${o.language} ${o.value} diff --git a/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-BK7BwULF.js b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-Y2Kx4K01.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-BK7BwULF.js rename to apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-Y2Kx4K01.js index f0d3f41d2..1e1232f16 100644 --- a/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-BK7BwULF.js +++ b/apps/pythinker-code/dist-web/assets/erDiagram-SSCWMZ5O-Y2Kx4K01.js @@ -1,4 +1,4 @@ -import{g as zt}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as Ut}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as p,b as Kt,a as Zt,s as jt,g as qt,p as Wt,q as Ht,c as $,l as M,k as Qt,r as Xt,t as Jt,u as $t,v as te,x as ee,y as se,j as ie,z as re}from"./mermaid.core-Pmnag6hS.js";import{c as ne}from"./channel-DILt7hqb.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var Tt=(function(){var e=p(function(V,n,o,h){for(o=o||{},h=V.length;h--;o[V[h]]=n);return o},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],c=[1,9],b=[1,10],k=[1,11],f=[1,12],S=[1,30],d=[1,23],g=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],A=[1,28],U=[1,29],N=[1,20],I=[1,18],R=[1,21],v=[1,22],Ot=[2,6],l=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],K=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],D=[1,46],L=[1,47],Z=[1,57],j=[43,51,53,54,55,74,75],q=[1,70],W=[1,68],w=[1,65],H=[1,69],Q=[1,71],tt=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],et=[1,78],st=[1,77],it=[1,76],xt=[69,70,71,72,73],Nt=[1,91],Ct=[6,9,45,50],P=[6,9,12,44,45,50,51,52],rt=[1,101],nt=[1,100],at=[1,99],X=[18,61],At=[1,110],It=[1,109],Rt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:p(function(n,o,h,i,y,t,J){var s=t.length-1;switch(y){case 1:break;case 2:this.$=[];break;case 3:this.$=t[s-1].concat(t[s]);break;case 4:this.$=t[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[s-4]),i.addEntity(t[s-2]),i.addRelationship(t[s-4],t[s],t[s-2],t[s-3]),this.$=[t[s-4],t[s-2]];break;case 8:i.addEntity(t[s-8]),i.addEntity(t[s-4]),i.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),i.setClass([t[s-8]],t[s-6]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-8],t[s-4]];break;case 9:i.addEntity(t[s-6]),i.addEntity(t[s-2]),i.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),i.setClass([t[s-6]],t[s-4]),this.$=[t[s-6],t[s-2]];break;case 10:i.addEntity(t[s-6]),i.addEntity(t[s-4]),i.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-6],t[s-4]];break;case 11:i.addEntity(t[s-3]),i.addAttributes(t[s-3],t[s-1]),this.$=[t[s-3]];break;case 12:i.addEntity(t[s-5]),i.addAttributes(t[s-5],t[s-1]),i.setClass([t[s-5]],t[s-3]),this.$=[t[s-5]];break;case 13:i.addEntity(t[s-2]),this.$=[t[s-2]];break;case 14:i.addEntity(t[s-4]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-4]];break;case 15:i.addEntity(t[s]),this.$=[t[s]];break;case 16:i.addEntity(t[s-2]),i.setClass([t[s-2]],t[s]),this.$=[t[s-2]];break;case 17:i.addEntity(t[s-6],t[s-4]),i.addAttributes(t[s-6],t[s-1]),this.$=[t[s-6]];break;case 18:i.addEntity(t[s-8],t[s-6]),i.addAttributes(t[s-8],t[s-1]),i.setClass([t[s-8]],t[s-3]),this.$=[t[s-8]];break;case 19:i.addEntity(t[s-5],t[s-3]),this.$=[t[s-5]];break;case 20:i.addEntity(t[s-7],t[s-5]),i.setClass([t[s-7]],t[s-2]),this.$=[t[s-7]];break;case 21:i.addEntity(t[s-3],t[s-1]);break;case 22:i.addEntity(t[s-5],t[s-3]),i.setClass([t[s-5]],t[s]);break;case 23:case 24:this.$=t[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[s]:(i.setDirection(t[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[s-2].id},t[s-1],{text:t[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-1],text:t[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-4],text:t[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[s];break;case 35:this.$=t[s-1]+" "+t[s];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[s-3],i.addClass(t[s-2],t[s-1]);break;case 41:case 42:case 63:case 72:this.$=[t[s]];break;case 43:case 44:this.$=t[s-2].concat([t[s]]);break;case 45:this.$=t[s-2],i.setClass(t[s-1],t[s]);break;case 46:this.$=t[s-3],i.addCssStyles(t[s-2],t[s-1]);break;case 47:this.$=[t[s]];break;case 48:t[s-2].push(t[s]),this.$=t[s-2];break;case 50:this.$=t[s-1]+t[s];break;case 58:case 84:case 85:this.$=t[s].replace(/"/g,"");break;case 64:t[s].push(t[s-1]),this.$=t[s];break;case 65:this.$={type:t[s-1],name:t[s]};break;case 66:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 67:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 68:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 69:case 71:case 74:this.$=t[s];break;case 70:this.$=t[s-1]+t[s];break;case 73:t[s-2].push(t[s]),this.$=t[s-2];break;case 75:this.$=t[s].replace(/"/g,"");break;case 76:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(a,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},e(a,Ot,{1:[2,1]}),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e(l,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(l,[2,26]),e(l,[2,27]),e(l,[2,28]),e(l,[2,29]),e(l,[2,30]),e(l,u,{5:44}),e(K,[2,58]),e(K,[2,59]),e(K,[2,60]),e(K,[2,61]),e(K,[2,62]),e(l,[2,36]),e(l,[2,37]),e(l,[2,38]),e(l,[2,39]),{15:45,43:D,44:L},{15:48,43:D,44:L},{15:49,43:D,44:L},{10:50,43:m,51:N,53:I,54:R,55:v},{10:51,43:m,51:N,53:I,54:R,55:v},{15:52,43:D,44:L},{17:53,18:[1,54],56:55,57:56,61:Z},{10:58,43:m,51:N,53:I,54:R,55:v},{68:59,74:[1,60],75:[1,61]},e(j,[2,77]),e(j,[2,78]),e(j,[2,79]),e(j,[2,80]),e(j,[2,81]),e(l,[2,23]),e(l,[2,24]),e(l,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},{12:q,42:64,44:W,45:w,48:66,49:67,51:H,52:Q},e(tt,[2,41]),e(tt,[2,42]),{15:72,43:D,44:L,45:w},{12:q,42:73,44:W,45:w,48:66,49:67,51:H,52:Q},{6:et,9:st,19:[1,75],35:74,50:it},{12:[1,79],14:[1,80]},e(l,[2,16],{67:35,11:81,16:[1,82],45:w,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},e(l,[2,13]),{17:84,18:[2,63],56:55,57:56,61:Z},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},e(xt,[2,82]),e(xt,[2,83]),e(l,[2,31]),e(l,Ot),{6:et,9:st,35:90,45:Nt,50:it},{43:[1,92],44:[1,93]},e(Ct,[2,47],{49:94,12:q,44:W,51:H,52:Q}),e(P,[2,49]),e(P,[2,54]),e(P,[2,55]),e(P,[2,56]),e(P,[2,57]),e(l,[2,45],{45:w}),{6:et,9:st,35:95,45:Nt,50:it},e(l,[2,32]),{10:97,36:96,43:m,51:N,53:I,54:R,55:v},e(l,[2,51]),e(l,[2,52]),e(l,[2,53]),{13:98,43:rt,53:nt,76:at},{15:102,43:D,44:L},{10:103,43:m,51:N,53:I,54:R,55:v},{17:104,18:[1,105],56:55,57:56,61:Z},e(l,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:At,66:It}),e([18,61,65,66],[2,71]),{61:[2,70]},e(l,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(l,[2,40]),{12:q,44:W,48:113,49:67,51:H,52:Q},e(tt,[2,43]),e(tt,[2,44]),e(P,[2,50]),e(l,[2,46]),{10:115,20:[1,114],43:m,51:N,53:I,54:R,55:v},e(Rt,[2,34]),e(l,[2,7]),e(l,[2,84]),e(l,[2,85]),e(l,[2,86]),{12:[1,116],45:w},{12:[1,118],14:[1,117]},{18:[1,119]},e(l,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:It}),e(X,[2,67]),e(yt,[2,72]),e(X,[2,75]),e(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:Z},{15:124,43:D,44:L},e(Ct,[2,48],{49:94,12:q,44:W,51:H,52:Q}),{6:et,9:st,35:125,50:it},e(Rt,[2,35]),{13:126,43:rt,53:nt,76:at},{15:127,43:D,44:L},{13:128,43:rt,53:nt,76:at},e(l,[2,12]),e(X,[2,68]),{63:129,65:At},{18:[1,130]},e(l,[2,19]),e(l,[2,22],{16:[1,131],45:w}),e(l,[2,33]),e(l,[2,10]),{12:[1,132],45:w},e(l,[2,9]),e(yt,[2,73]),e(l,[2,17]),{17:133,18:[1,134],56:55,57:56,61:Z},{13:135,43:rt,53:nt,76:at},{18:[1,136]},e(l,[2,20]),e(l,[2,8]),e(l,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:p(function(n,o){if(o.recoverable)this.trace(n);else{var h=new Error(n);throw h.hash=o,h}},"parseError"),parse:p(function(n){var o=this,h=[0],i=[],y=[null],t=[],J=this.table,s="",ct=0,vt=0,Gt=2,Dt=1,Ft=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(G.yy[kt]=this.yy[kt]);_.setInput(n,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var mt=_.yylloc;t.push(mt);var Yt=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pt(T){h.length=h.length-2*T,y.length=y.length-T,t.length=t.length-T}p(Pt,"popStack");function Lt(){var T;return T=i.pop()||_.lex()||Dt,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}p(Lt,"lex");for(var E,F,O,Et,z={},lt,C,wt,ht;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Lt()),O=J[F]&&J[F][E]),typeof O>"u"||!O.length||!O[0]){var St="";ht=[];for(lt in J[F])this.terminals_[lt]&<>Gt&&ht.push("'"+this.terminals_[lt]+"'");_.showPosition?St="Parse error on line "+(ct+1)+`: +import{g as zt}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as Ut}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as p,b as Kt,a as Zt,s as jt,g as qt,p as Wt,q as Ht,c as $,l as M,k as Qt,r as Xt,t as Jt,u as $t,v as te,x as ee,y as se,j as ie,z as re}from"./mermaid.core-4ur3W-UG.js";import{c as ne}from"./channel-Ce13qtYp.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var Tt=(function(){var e=p(function(V,n,o,h){for(o=o||{},h=V.length;h--;o[V[h]]=n);return o},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],u=[2,2],r=[1,7],c=[1,9],b=[1,10],k=[1,11],f=[1,12],S=[1,30],d=[1,23],g=[1,24],x=[1,25],B=[1,26],Y=[1,27],m=[1,19],A=[1,28],U=[1,29],N=[1,20],I=[1,18],R=[1,21],v=[1,22],Ot=[2,6],l=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],K=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],D=[1,46],L=[1,47],Z=[1,57],j=[43,51,53,54,55,74,75],q=[1,70],W=[1,68],w=[1,65],H=[1,69],Q=[1,71],tt=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],et=[1,78],st=[1,77],it=[1,76],xt=[69,70,71,72,73],Nt=[1,91],Ct=[6,9,45,50],P=[6,9,12,44,45,50,51,52],rt=[1,101],nt=[1,100],at=[1,99],X=[18,61],At=[1,110],It=[1,109],Rt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:p(function(n,o,h,i,y,t,J){var s=t.length-1;switch(y){case 1:break;case 2:this.$=[];break;case 3:this.$=t[s-1].concat(t[s]);break;case 4:this.$=t[s];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[s-4]),i.addEntity(t[s-2]),i.addRelationship(t[s-4],t[s],t[s-2],t[s-3]),this.$=[t[s-4],t[s-2]];break;case 8:i.addEntity(t[s-8]),i.addEntity(t[s-4]),i.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),i.setClass([t[s-8]],t[s-6]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-8],t[s-4]];break;case 9:i.addEntity(t[s-6]),i.addEntity(t[s-2]),i.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),i.setClass([t[s-6]],t[s-4]),this.$=[t[s-6],t[s-2]];break;case 10:i.addEntity(t[s-6]),i.addEntity(t[s-4]),i.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-6],t[s-4]];break;case 11:i.addEntity(t[s-3]),i.addAttributes(t[s-3],t[s-1]),this.$=[t[s-3]];break;case 12:i.addEntity(t[s-5]),i.addAttributes(t[s-5],t[s-1]),i.setClass([t[s-5]],t[s-3]),this.$=[t[s-5]];break;case 13:i.addEntity(t[s-2]),this.$=[t[s-2]];break;case 14:i.addEntity(t[s-4]),i.setClass([t[s-4]],t[s-2]),this.$=[t[s-4]];break;case 15:i.addEntity(t[s]),this.$=[t[s]];break;case 16:i.addEntity(t[s-2]),i.setClass([t[s-2]],t[s]),this.$=[t[s-2]];break;case 17:i.addEntity(t[s-6],t[s-4]),i.addAttributes(t[s-6],t[s-1]),this.$=[t[s-6]];break;case 18:i.addEntity(t[s-8],t[s-6]),i.addAttributes(t[s-8],t[s-1]),i.setClass([t[s-8]],t[s-3]),this.$=[t[s-8]];break;case 19:i.addEntity(t[s-5],t[s-3]),this.$=[t[s-5]];break;case 20:i.addEntity(t[s-7],t[s-5]),i.setClass([t[s-7]],t[s-2]),this.$=[t[s-7]];break;case 21:i.addEntity(t[s-3],t[s-1]);break;case 22:i.addEntity(t[s-5],t[s-3]),i.setClass([t[s-5]],t[s]);break;case 23:case 24:this.$=t[s].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[s].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[s]:(i.setDirection(t[s].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[s-2].id},t[s-1],{text:t[s-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-1],text:t[s-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[s-4],text:t[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[s];break;case 35:this.$=t[s-1]+" "+t[s];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[s-3],i.addClass(t[s-2],t[s-1]);break;case 41:case 42:case 63:case 72:this.$=[t[s]];break;case 43:case 44:this.$=t[s-2].concat([t[s]]);break;case 45:this.$=t[s-2],i.setClass(t[s-1],t[s]);break;case 46:this.$=t[s-3],i.addCssStyles(t[s-2],t[s-1]);break;case 47:this.$=[t[s]];break;case 48:t[s-2].push(t[s]),this.$=t[s-2];break;case 50:this.$=t[s-1]+t[s];break;case 58:case 84:case 85:this.$=t[s].replace(/"/g,"");break;case 64:t[s].push(t[s-1]),this.$=t[s];break;case 65:this.$={type:t[s-1],name:t[s]};break;case 66:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 67:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 68:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 69:case 71:case 74:this.$=t[s];break;case 70:this.$=t[s-1]+t[s];break;case 73:t[s-2].push(t[s]),this.$=t[s-2];break;case 75:this.$=t[s].replace(/"/g,"");break;case 76:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(a,u,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},e(a,Ot,{1:[2,1]}),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e(l,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(l,[2,26]),e(l,[2,27]),e(l,[2,28]),e(l,[2,29]),e(l,[2,30]),e(l,u,{5:44}),e(K,[2,58]),e(K,[2,59]),e(K,[2,60]),e(K,[2,61]),e(K,[2,62]),e(l,[2,36]),e(l,[2,37]),e(l,[2,38]),e(l,[2,39]),{15:45,43:D,44:L},{15:48,43:D,44:L},{15:49,43:D,44:L},{10:50,43:m,51:N,53:I,54:R,55:v},{10:51,43:m,51:N,53:I,54:R,55:v},{15:52,43:D,44:L},{17:53,18:[1,54],56:55,57:56,61:Z},{10:58,43:m,51:N,53:I,54:R,55:v},{68:59,74:[1,60],75:[1,61]},e(j,[2,77]),e(j,[2,78]),e(j,[2,79]),e(j,[2,80]),e(j,[2,81]),e(l,[2,23]),e(l,[2,24]),e(l,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:c,23:b,25:k,27:f,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:S,37:d,38:g,39:x,40:B,41:Y,43:m,46:A,47:U,51:N,53:I,54:R,55:v},{12:q,42:64,44:W,45:w,48:66,49:67,51:H,52:Q},e(tt,[2,41]),e(tt,[2,42]),{15:72,43:D,44:L,45:w},{12:q,42:73,44:W,45:w,48:66,49:67,51:H,52:Q},{6:et,9:st,19:[1,75],35:74,50:it},{12:[1,79],14:[1,80]},e(l,[2,16],{67:35,11:81,16:[1,82],45:w,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},e(l,[2,13]),{17:84,18:[2,63],56:55,57:56,61:Z},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},e(xt,[2,82]),e(xt,[2,83]),e(l,[2,31]),e(l,Ot),{6:et,9:st,35:90,45:Nt,50:it},{43:[1,92],44:[1,93]},e(Ct,[2,47],{49:94,12:q,44:W,51:H,52:Q}),e(P,[2,49]),e(P,[2,54]),e(P,[2,55]),e(P,[2,56]),e(P,[2,57]),e(l,[2,45],{45:w}),{6:et,9:st,35:95,45:Nt,50:it},e(l,[2,32]),{10:97,36:96,43:m,51:N,53:I,54:R,55:v},e(l,[2,51]),e(l,[2,52]),e(l,[2,53]),{13:98,43:rt,53:nt,76:at},{15:102,43:D,44:L},{10:103,43:m,51:N,53:I,54:R,55:v},{17:104,18:[1,105],56:55,57:56,61:Z},e(l,[2,11]),{18:[2,64]},e(X,[2,65],{59:106,60:107,63:108,65:At,66:It}),e([18,61,65,66],[2,71]),{61:[2,70]},e(l,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(l,[2,40]),{12:q,44:W,48:113,49:67,51:H,52:Q},e(tt,[2,43]),e(tt,[2,44]),e(P,[2,50]),e(l,[2,46]),{10:115,20:[1,114],43:m,51:N,53:I,54:R,55:v},e(Rt,[2,34]),e(l,[2,7]),e(l,[2,84]),e(l,[2,85]),e(l,[2,86]),{12:[1,116],45:w},{12:[1,118],14:[1,117]},{18:[1,119]},e(l,[2,14]),e(X,[2,66],{60:120,64:[1,121],66:It}),e(X,[2,67]),e(yt,[2,72]),e(X,[2,75]),e(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:Z},{15:124,43:D,44:L},e(Ct,[2,48],{49:94,12:q,44:W,51:H,52:Q}),{6:et,9:st,35:125,50:it},e(Rt,[2,35]),{13:126,43:rt,53:nt,76:at},{15:127,43:D,44:L},{13:128,43:rt,53:nt,76:at},e(l,[2,12]),e(X,[2,68]),{63:129,65:At},{18:[1,130]},e(l,[2,19]),e(l,[2,22],{16:[1,131],45:w}),e(l,[2,33]),e(l,[2,10]),{12:[1,132],45:w},e(l,[2,9]),e(yt,[2,73]),e(l,[2,17]),{17:133,18:[1,134],56:55,57:56,61:Z},{13:135,43:rt,53:nt,76:at},{18:[1,136]},e(l,[2,20]),e(l,[2,8]),e(l,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:p(function(n,o){if(o.recoverable)this.trace(n);else{var h=new Error(n);throw h.hash=o,h}},"parseError"),parse:p(function(n){var o=this,h=[0],i=[],y=[null],t=[],J=this.table,s="",ct=0,vt=0,Gt=2,Dt=1,Ft=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(G.yy[kt]=this.yy[kt]);_.setInput(n,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var mt=_.yylloc;t.push(mt);var Yt=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pt(T){h.length=h.length-2*T,y.length=y.length-T,t.length=t.length-T}p(Pt,"popStack");function Lt(){var T;return T=i.pop()||_.lex()||Dt,typeof T!="number"&&(T instanceof Array&&(i=T,T=i.pop()),T=o.symbols_[T]||T),T}p(Lt,"lex");for(var E,F,O,Et,z={},lt,C,wt,ht;;){if(F=h[h.length-1],this.defaultActions[F]?O=this.defaultActions[F]:((E===null||typeof E>"u")&&(E=Lt()),O=J[F]&&J[F][E]),typeof O>"u"||!O.length||!O[0]){var St="";ht=[];for(lt in J[F])this.terminals_[lt]&<>Gt&&ht.push("'"+this.terminals_[lt]+"'");_.showPosition?St="Parse error on line "+(ct+1)+`: `+_.showPosition()+` Expecting `+ht.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(ct+1)+": Unexpected "+(E==Dt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:_.match,token:this.terminals_[E]||E,line:_.yylineno,loc:mt,expected:ht})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+E);switch(O[0]){case 1:h.push(E),y.push(_.yytext),t.push(_.yylloc),h.push(O[1]),E=null,vt=_.yyleng,s=_.yytext,ct=_.yylineno,mt=_.yylloc;break;case 2:if(C=this.productions_[O[1]][1],z.$=y[y.length-C],z._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},Yt&&(z._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(z,[s,vt,ct,G.yy,O[1],y,t].concat(Ft)),typeof Et<"u")return Et;C&&(h=h.slice(0,-1*C*2),y=y.slice(0,-1*C),t=t.slice(0,-1*C)),h.push(this.productions_[O[1]][0]),y.push(z.$),t.push(z._$),wt=J[h[h.length-2]][h[h.length-1]],h.push(wt);break;case 3:return!0}}return!0},"parse")},Bt=(function(){var V={EOF:1,parseError:p(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw new Error(o)},"parseError"),setInput:p(function(n,o){return this.yy=o||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var o=n.length,h=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===i.length?this.yylloc.first_column:0)+i[i.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-CyNh512Q.js b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-DnEfMg9m.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-CyNh512Q.js rename to apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-DnEfMg9m.js index 9be7829f6..8550bcfa7 100644 --- a/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-CyNh512Q.js +++ b/apps/pythinker-code/dist-web/assets/flowDiagram-A5DVABFB-DnEfMg9m.js @@ -1,4 +1,4 @@ -import{g as Ht}from"./chunk-5VM5RSS4-BhXMeeD7.js";import{g as Xt}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as Qt}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as k,b3 as Zt,Y as Ot,l as J,c as Ae,x as Jt,y as $t,z as it,b as e1,s as t1,p as s1,a as i1,g as r1,q as a1,k as n1,Z as u1,$ as o1,ca as l1,t as tt,j as st,r as c1,b7 as h1,u as d1}from"./mermaid.core-Pmnag6hS.js";import{f as p1}from"./chunk-F27PBJKO-CENksy_e.js";import{p as f1}from"./purify.es-5AjVNlXF.js";import{c as g1}from"./channel-DILt7hqb.js";var b1="flowchart-",A1=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{k(this,"FlowDB")}sanitizeText(e){return n1.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,u,f,l={},b){if(!e||e.trim().length===0)return;let h;if(b!==void 0){let o;b.includes(` +import{g as Ht}from"./chunk-5VM5RSS4-BjJ31Xiv.js";import{g as Xt}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as Qt}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as k,b3 as Zt,Y as Ot,l as J,c as Ae,x as Jt,y as $t,z as it,b as e1,s as t1,p as s1,a as i1,g as r1,q as a1,k as n1,Z as u1,$ as o1,ca as l1,t as tt,j as st,r as c1,b7 as h1,u as d1}from"./mermaid.core-4ur3W-UG.js";import{f as p1}from"./chunk-F27PBJKO-d2g57_ei.js";import{p as f1}from"./purify.es-5AjVNlXF.js";import{c as g1}from"./channel-Ce13qtYp.js";var b1="flowchart-",A1=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{k(this,"FlowDB")}sanitizeText(e){return n1.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,u,f,l={},b){if(!e||e.trim().length===0)return;let h;if(b!==void 0){let o;b.includes(` `)?o=b+` `:o=`{ `+b+` diff --git a/apps/pythinker-code/dist-web/assets/freemarker2-Cyl3pVgY.js b/apps/pythinker-code/dist-web/assets/freemarker2-CZNakv6O.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/freemarker2-Cyl3pVgY.js rename to apps/pythinker-code/dist-web/assets/freemarker2-CZNakv6O.js index f8c64c25a..d7288b233 100644 --- a/apps/pythinker-code/dist-web/assets/freemarker2-Cyl3pVgY.js +++ b/apps/pythinker-code/dist-web/assets/freemarker2-CZNakv6O.js @@ -1,3 +1,3 @@ -import{l as c}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:` +import{l as c}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const s=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],d=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],r={close:">",id:"angle",open:"<"},a={close:"\\]",id:"bracket",open:"\\["},F={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:` \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${d.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function g(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:` \r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${d.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${d.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:c.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${s.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:c.IndentAction.Indent}}]}}function _(t,n){const i=`_${t.id}_${n.id}`,e=u=>u.replace(/__id__/g,i),o=u=>{const m=u.source.replace(/__id__/g,i);return new RegExp(m,u.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function A(t){const n=_(r,t),i=_(a,t),e=_(F,t);return{...n,...i,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,...i.tokenizer,...e.tokenizer}}}const $={conf:l(r),language:_(r,k)},E={conf:l(a),language:_(a,k)},B={conf:l(r),language:_(r,p)},D={conf:l(a),language:_(a,p)},C={conf:g(),language:A(k)},v={conf:g(),language:A(p)};export{B as TagAngleInterpolationBracket,$ as TagAngleInterpolationDollar,v as TagAutoInterpolationBracket,C as TagAutoInterpolationDollar,D as TagBracketInterpolationBracket,E as TagBracketInterpolationDollar}; diff --git a/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-CPhXhxrU.js b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-DHRYTGQL.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-CPhXhxrU.js rename to apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-DHRYTGQL.js index 1b4cb925c..a2ab47421 100644 --- a/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-CPhXhxrU.js +++ b/apps/pythinker-code/dist-web/assets/ganttDiagram-EL5Y4UJY-DHRYTGQL.js @@ -1,4 +1,4 @@ -import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,b4 as oe,g as Nn,s as Pn,q as Vn,p as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,o as Xn,r as Gn,z as jn}from"./mermaid.core-Pmnag6hS.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-CJbRkaTL.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,b4 as oe,g as Nn,s as Pn,q as Vn,p as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,o as Xn,r as Gn,z as jn}from"./mermaid.core-4ur3W-UG.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-CTZFHtw0.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-CFwfjpOY.js b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-B6MjdyCr.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-CFwfjpOY.js rename to apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-B6MjdyCr.js index e62fbb585..9cf4dc7cd 100644 --- a/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-CFwfjpOY.js +++ b/apps/pythinker-code/dist-web/assets/gitGraphDiagram-WWUBYQGX-B6MjdyCr.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-BJtTXqt1.js";import{p as he}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,A as J,l as w,j as me,c as W,z as pe,B as be,r as we,k as B,D as ke,E as ve,F as Ce}from"./mermaid.core-Pmnag6hS.js";import{p as Ee}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-By4pMuFm.js";import{p as he}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{q as $e,p as fe,s as ge,g as ue,a as ye,b as xe,_ as h,A as J,l as w,j as me,c as W,z as pe,B as be,r as we,k as B,D as ke,E as ve,F as Ce}from"./mermaid.core-4ur3W-UG.js";import{p as Ee}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/pythinker-code/dist-web/assets/handlebars-CatNLgMZ.js b/apps/pythinker-code/dist-web/assets/handlebars-BSa5yURd.js similarity index 97% rename from apps/pythinker-code/dist-web/assets/handlebars-CatNLgMZ.js rename to apps/pythinker-code/dist-web/assets/handlebars-BSa5yURd.js index 59ec76b81..0365ef75c 100644 --- a/apps/pythinker-code/dist-web/assets/handlebars-CatNLgMZ.js +++ b/apps/pythinker-code/dist-web/assets/handlebars-BSa5yURd.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},i={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{r as conf,i as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},i={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{r as conf,i as language}; diff --git a/apps/pythinker-code/dist-web/assets/html-BkwYt7NK.js b/apps/pythinker-code/dist-web/assets/html-C9Rps5Qh.js similarity index 97% rename from apps/pythinker-code/dist-web/assets/html-BkwYt7NK.js rename to apps/pythinker-code/dist-web/assets/html-C9Rps5Qh.js index bd334d1e3..58528c01e 100644 --- a/apps/pythinker-code/dist-web/assets/html-BkwYt7NK.js +++ b/apps/pythinker-code/dist-web/assets/html-C9Rps5Qh.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},s={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{o as conf,s as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},s={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{o as conf,s as language}; diff --git a/apps/pythinker-code/dist-web/assets/htmlMode-4dn2fXPN.js b/apps/pythinker-code/dist-web/assets/htmlMode-DdkvK5Eo.js similarity index 94% rename from apps/pythinker-code/dist-web/assets/htmlMode-4dn2fXPN.js rename to apps/pythinker-code/dist-web/assets/htmlMode-DdkvK5Eo.js index 86b334dc1..de259d1ac 100644 --- a/apps/pythinker-code/dist-web/assets/htmlMode-4dn2fXPN.js +++ b/apps/pythinker-code/dist-web/assets/htmlMode-DdkvK5Eo.js @@ -1 +1 @@ -import{c as D,l as t}from"./editor.main-1e103Orc.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-DhcohILl.js";import{a as b,e as y,d as T,R as U,i as x,j as M,t as j,k as O}from"./lspLanguageFeatures-DhcohILl.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-C8KWqYYR.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function F(i){const n=new f(i),e=(...o)=>n.getLanguageServiceWorker(...o);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function L(i){const n=[],e=[],r=new f(i);n.push(r);const o=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(o))),a.hovers&&e.push(t.registerHoverProvider(s,new d(o))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new l(o))),a.links&&e.push(t.registerLinkProvider(s,new c(o))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new h(o))),a.rename&&e.push(t.registerRenameProvider(s,new p(o))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new u(o))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new m(o))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(o))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(o)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,b as DefinitionAdapter,y as DiagnosticsAdapter,T as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,U as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,x as fromPosition,M as fromRange,L as setupMode,F as setupMode1,j as toRange,O as toTextEdit}; +import{c as D,l as t}from"./editor.main-CmoCOdG5.js";import{H as d,D as l,h as c,F as u,b as h,S as m,c as p,f as w,g as _,C as R}from"./lspLanguageFeatures-C-mvtNbB.js";import{a as b,e as y,d as T,R as U,i as x,j as M,t as j,k as O}from"./lspLanguageFeatures-C-mvtNbB.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const I=120*1e3;class f{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-C8KWqYYR.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(r=>e)}}class v extends R{constructor(n){super(n,[".",":","<",'"',"=","/"])}}function F(i){const n=new f(i),e=(...o)=>n.getLanguageServiceWorker(...o);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new l(e)),t.registerLinkProvider(r,new c(e)),t.registerFoldingRangeProvider(r,new u(e)),t.registerDocumentSymbolProvider(r,new h(e)),t.registerSelectionRangeProvider(r,new m(e)),t.registerRenameProvider(r,new p(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function L(i){const n=[],e=[],r=new f(i);n.push(r);const o=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(o))),a.hovers&&e.push(t.registerHoverProvider(s,new d(o))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new l(o))),a.links&&e.push(t.registerLinkProvider(s,new c(o))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new h(o))),a.rename&&e.push(t.registerRenameProvider(s,new p(o))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new u(o))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new m(o))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(o))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(o)))}return P(),n.push(g(e)),g(n)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,b as DefinitionAdapter,y as DiagnosticsAdapter,T as DocumentColorAdapter,w as DocumentFormattingEditProvider,l as DocumentHighlightAdapter,c as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,h as DocumentSymbolAdapter,u as FoldingRangeAdapter,d as HoverAdapter,U as ReferenceAdapter,p as RenameAdapter,m as SelectionRangeAdapter,f as WorkerManager,x as fromPosition,M as fromRange,L as setupMode,F as setupMode1,j as toRange,O as toTextEdit}; diff --git a/apps/pythinker-code/dist-web/assets/index-BSdLbOxc.js b/apps/pythinker-code/dist-web/assets/index-BFFX6GbO.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index-BSdLbOxc.js rename to apps/pythinker-code/dist-web/assets/index-BFFX6GbO.js index f0ffa3347..c37f28906 100644 --- a/apps/pythinker-code/dist-web/assets/index-BSdLbOxc.js +++ b/apps/pythinker-code/dist-web/assets/index-BFFX6GbO.js @@ -1,4 +1,4 @@ -import{t as ee,b as Jn,n as Do,c as Po,a as _o,d as Fo,s as Oo,g as No,e as zo}from"./index-BfLDYVXY.js";import{f as Rc}from"./index-BfLDYVXY.js";import{bR as w}from"./index-BK-wRR5p.js";const ur="diffs-container",Uo=(()=>{try{return!1}catch{return!1}})(),Vo=/(?=^From [a-f0-9]+ .+$)/m,fr=/(?=^diff --git)/gm,$h=/(?=^---\s+\S)/gm,Wh=/(?=^@@ )/gm,Bo=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,$o=/(?<=\n)/,Wo=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Go=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,jo=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,qo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Gh=/^<{7,}(?:\s.*)?$/,jh=/^\|{7,}(?:\s.*)?$/,qh=/^={7,}$/,Kh=/^>{7,}(?:\s.*)?$/,Hn="header-prefix",Mn="header-filename-suffix",Dn="header-metadata",Pn="header-custom",O={dark:"pierre-dark",light:"pierre-light"},pr="data-theme-css",gr="data-unsafe-css",Ko="data-core-css",Yo="data-diffs-scrollbar-measure",Xo="data-diffs-code-view-header",Qo="data-diffs-code-view-footer",mr="--diffs-scrollbar-gutter-measured",Yh=1,Zo=1e5,_n={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},et={..._n,hunkLineCount:1},Jo={paddingTop:8,paddingBottom:8,gap:8},es={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},ts=Object.freeze({fromStart:0,fromEnd:0}),Xe={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vr={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Oe=new Set;let we=null;function G(e){Oe.add(e),we??=requestAnimationFrame(Cr)}function ze(e){Oe.delete(e)&&Oe.size===0&&we!=null&&(cancelAnimationFrame(we),we=null)}function Xh(){Oe.clear(),we!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(we),we=null}function Cr(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?we=requestAnimationFrame(Cr):we=null}function Qe(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Je(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Fn(e,t){const n=e?.theme??O,i=t?.theme??O,r=ei(e),o=ei(t);return Je(n,i)&&Qe(e,t,["theme","parseDiffOptions"])&&Qe(r,o)}function ei(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function _t(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function cn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const d=Math.max(e-r,0),c=Math.min(e+l,t);return{top:d,bottom:Math.max(c,d)}}let a=e+n/2-s/2,h=a+s;return a<0&&(a=0),h>t&&(h=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(h,t),a))}}function Te(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const ns=new TextEncoder,is=new TextDecoder("utf-8",{ignoreBOM:!0}),rs=/[\uD800-\uDFFF]/,un=1024;let qe=new Uint8Array(un);function Sr(){qe.length!==un&&(qe=new Uint8Array(un))}function B(e){if(e.length===0)return e;if(rs.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;qe.length0&&r.deletions>0||o.type!=="context")continue;const s=r.additions>0,l=s?t.additionLines:t.deletionLines,a=s?r.additionLineIndex:r.deletionLineIndex,h=s?r.additions:r.deletions,d=l[a]??"";if(d.trim()!=="")continue;let c=!0;for(let C=1;Cos)return null;const a=[];for(let g=0;gn;let c=0,u=-1;for(let g=0;g<=l;g++){let C=0;for(let m=0;mu&&(u=C,c=g)}if(c===0)return null;const f=[],p=(g,C,m,v)=>{(g>0||C>0)&&f.push({type:"change",deletions:g,additions:C,deletionLineIndex:m,additionLineIndex:v})};return d?(p(0,c,r,o),p(s,s,r,o+c),p(0,i-s-c,r+s,o+c+s)):(p(c,0,r,o),p(s,s,r+c,o),p(n-s-c,0,r+c+s,o+s)),f}const hs=/\s+/g;function ti(e){return e.replace(hs,"")}function cs(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r0&&(f[f.length-1]===` +import{t as ee,b as Jn,n as Do,c as Po,a as _o,d as Fo,s as Oo,g as No,e as zo}from"./index-DzVg_0FS.js";import{f as Rc}from"./index-DzVg_0FS.js";import{bR as w}from"./index-C0iEUKAq.js";const ur="diffs-container",Uo=(()=>{try{return!1}catch{return!1}})(),Vo=/(?=^From [a-f0-9]+ .+$)/m,fr=/(?=^diff --git)/gm,$h=/(?=^---\s+\S)/gm,Wh=/(?=^@@ )/gm,Bo=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,$o=/(?<=\n)/,Wo=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Go=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,jo=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,qo=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Gh=/^<{7,}(?:\s.*)?$/,jh=/^\|{7,}(?:\s.*)?$/,qh=/^={7,}$/,Kh=/^>{7,}(?:\s.*)?$/,Hn="header-prefix",Mn="header-filename-suffix",Dn="header-metadata",Pn="header-custom",O={dark:"pierre-dark",light:"pierre-light"},pr="data-theme-css",gr="data-unsafe-css",Ko="data-core-css",Yo="data-diffs-scrollbar-measure",Xo="data-diffs-code-view-header",Qo="data-diffs-code-view-footer",mr="--diffs-scrollbar-gutter-measured",Yh=1,Zo=1e5,_n={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},et={..._n,hunkLineCount:1},Jo={paddingTop:8,paddingBottom:8,gap:8},es={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},ts=Object.freeze({fromStart:0,fromEnd:0}),Xe={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vr={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Oe=new Set;let we=null;function G(e){Oe.add(e),we??=requestAnimationFrame(Cr)}function ze(e){Oe.delete(e)&&Oe.size===0&&we!=null&&(cancelAnimationFrame(we),we=null)}function Xh(){Oe.clear(),we!=null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(we),we=null}function Cr(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?we=requestAnimationFrame(Cr):we=null}function Qe(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Je(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Fn(e,t){const n=e?.theme??O,i=t?.theme??O,r=ei(e),o=ei(t);return Je(n,i)&&Qe(e,t,["theme","parseDiffOptions"])&&Qe(r,o)}function ei(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function _t(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function cn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const d=Math.max(e-r,0),c=Math.min(e+l,t);return{top:d,bottom:Math.max(c,d)}}let a=e+n/2-s/2,h=a+s;return a<0&&(a=0),h>t&&(h=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(h,t),a))}}function Te(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const ns=new TextEncoder,is=new TextDecoder("utf-8",{ignoreBOM:!0}),rs=/[\uD800-\uDFFF]/,un=1024;let qe=new Uint8Array(un);function Sr(){qe.length!==un&&(qe=new Uint8Array(un))}function B(e){if(e.length===0)return e;if(rs.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;qe.length0&&r.deletions>0||o.type!=="context")continue;const s=r.additions>0,l=s?t.additionLines:t.deletionLines,a=s?r.additionLineIndex:r.deletionLineIndex,h=s?r.additions:r.deletions,d=l[a]??"";if(d.trim()!=="")continue;let c=!0;for(let C=1;Cos)return null;const a=[];for(let g=0;gn;let c=0,u=-1;for(let g=0;g<=l;g++){let C=0;for(let m=0;mu&&(u=C,c=g)}if(c===0)return null;const f=[],p=(g,C,m,v)=>{(g>0||C>0)&&f.push({type:"change",deletions:g,additions:C,deletionLineIndex:m,additionLineIndex:v})};return d?(p(0,c,r,o),p(s,s,r,o+c),p(0,i-s-c,r+s,o+c+s)):(p(c,0,r,o),p(s,s,r+c,o),p(n-s-c,0,r+c+s,o+s)),f}const hs=/\s+/g;function ti(e){return e.replace(hs,"")}function cs(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r0&&(f[f.length-1]===` `||f[f.length-1]==="\r"||f[f.length-1]===`\r `||f[f.length-1]==="");)f.pop();const{additionStart:y,deletionStart:S}=g;d=h?d:S-1,c=h?c:y-1;const L={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:y,additionLines:C,deletionCount:g.deletionCount,deletionStart:S,deletionLines:m,deletionLineIndex:d,additionLineIndex:c,hunkContent:[],hunkContext:oi(g.hunkContext),hunkSpecs:B(p),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let x=0,E=0;for(let k=1;k=L.additionCount&&E>=L.deletionCount&&!R.startsWith("\\")){if(o&&bs(R)&&!ys(R))throw Error("parsePatchContent: hunk has more lines than expected");break}const F=R[0];if(F!=="+"&&F!=="-"&&F!==" "&&F!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${F}", full line: "${R}"`),console.error("processFile: invalid rawLine:",R);continue}const T=ks(F);if(T==="addition"){if(o&&x>=L.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const I=Kt(R);(v==null||v.type!=="change")&&(v=Yt("change",d,c),L.hunkContent.push(v)),c++,x++,h&&a.additionLines.push(I),v.additions++,C++,b="addition"}else if(T==="deletion"){if(o&&E>=L.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const I=Kt(R);(v==null||v.type!=="change")&&(v=Yt("change",d,c),L.hunkContent.push(v)),d++,E++,h&&a.deletionLines.push(I),v.deletions++,m++,b="deletion"}else if(T==="context"){if(o&&(E>=L.deletionCount||x>=L.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const I=Kt(R);(v==null||v.type!=="context")&&(v=Yt("context",d,c),L.hunkContent.push(v)),c++,d++,x++,E++,h&&(a.deletionLines.push(I),a.additionLines.push(I)),v.lines++,b="context"}else if(T==="metadata"&&v!=null){if(v.type==="context"?(L.noEOFCRAdditions=!0,L.noEOFCRDeletions=!0):b==="deletion"?L.noEOFCRDeletions=!0:b==="addition"&&(L.noEOFCRAdditions=!0),h&&(b==="addition"||b==="context")){const I=a.additionLines.length-1;I>=0&&(a.additionLines[I]=Te(a.additionLines[I]))}if(h&&(b==="deletion"||b==="context")){const I=a.deletionLines.length-1;I>=0&&(a.deletionLines[I]=Te(a.deletionLines[I]))}}}if(o&&(x!==L.additionCount||E!==L.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");L.additionLines=C,L.deletionLines=m,L.collapsedBefore=Math.max(oe(L.additionStart,L.additionCount)-s,0),a.hunks.push(L),s=W(L.additionStart,L.additionCount);for(const k of L.hunkContent)k.type==="context"?(L.splitLineCount+=k.lines,L.unifiedLineCount+=k.lines):(L.splitLineCount+=Math.max(k.additions,k.deletions),L.unifiedLineCount+=k.deletions+k.additions);L.splitLineStart=a.splitLineCount+L.collapsedBefore,L.unifiedLineStart=a.unifiedLineCount+L.collapsedBefore,a.splitLineCount+=L.collapsedBefore+L.splitLineCount,a.unifiedLineCount+=L.collapsedBefore+L.unifiedLineCount}if(a!=null){if(o&&h&&!n&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!h&&a.additionLines.length>0&&a.deletionLines.length>0){const u=a.hunks[a.hunks.length-1],f=W(u.additionStart,u.additionCount),p=a.additionLines.length,g=Math.max(p-f,0);a.splitLineCount+=g,a.unifiedLineCount+=g}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),as(a),a}}function gs(e,t,n=!1){const i=[],r=ms(e)?e.split(Vo):[e];for(const o of r)try{i.push(us(o,t!=null?`${t}-${i.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return i}function ms(e){return e.startsWith("From ")||e.includes(` From `)}function ni(e){const t=yr(e);for(let n=0;ni.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-U5edWnzl.js","assets/DesignSystemView-I872M2Sr.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-4ur3W-UG.js","assets/purify.es-5AjVNlXF.js","assets/CodeBlockNode-BWayTGpE.js","assets/safeRaf-DGuzXxDK.js","assets/index5-CFutgKd9.js","assets/index11-HcP9dkU1.js","assets/editor.main-CmoCOdG5.js","assets/editor-Ck3IbhyB.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/** * @vue/shared v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function X5(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const On={},Ic=[],ki=()=>{},lM=()=>!1,Vd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),J5=e=>e.startsWith("onUpdate:"),go=Object.assign,Z7=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},IB=Object.prototype.hasOwnProperty,Qn=(e,t)=>IB.call(e,t),Xt=Array.isArray,Lc=e=>uu(e)==="[object Map]",A0=e=>uu(e)==="[object Set]",qw=e=>uu(e)==="[object Date]",LB=e=>uu(e)==="[object RegExp]",wn=e=>typeof e=="function",bo=e=>typeof e=="string",Qr=e=>typeof e=="symbol",eo=e=>e!==null&&typeof e=="object",K7=e=>(eo(e)||wn(e))&&wn(e.then)&&wn(e.catch),aM=Object.prototype.toString,uu=e=>aM.call(e),$B=e=>uu(e).slice(8,-1),Q5=e=>uu(e)==="[object Object]",ep=e=>bo(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,a0=X5(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),tp=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},NB=/-\w/g,Ms=tp(e=>e.replace(NB,t=>t.slice(1).toUpperCase())),zB=/\B([A-Z])/g,Lr=tp(e=>e.replace(zB,"-$1").toLowerCase()),np=tp(e=>e.charAt(0).toUpperCase()+e.slice(1)),K3=tp(e=>e?`on${np(e)}`:""),Us=(e,t)=>!Object.is(e,t),$c=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},op=e=>{const t=parseFloat(e);return isNaN(t)?e:t},A4=e=>{const t=bo(e)?Number(e):NaN;return isNaN(t)?e:t};let Uw;const sp=()=>Uw||(Uw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),BB="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",RB=X5(BB);function Wt(e){if(Xt(e)){const t={};for(let n=0;n{if(n){const o=n.split(jB);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Be(e){let t="";if(bo(e))t=e;else if(Xt(e))for(let n=0;nYl(n,t))}const dM=e=>!!(e&&e.__v_isRef===!0),I=e=>bo(e)?e:e==null?"":Xt(e)||eo(e)&&(e.toString===aM||!wn(e.toString))?dM(e)?I(e.value):JSON.stringify(e,fM,2):String(e),fM=(e,t)=>dM(t)?fM(e,t.value):Lc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],r)=>(n[Y6(o,r)+" =>"]=s,n),{})}:A0(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Y6(n))}:Qr(t)?Y6(t):eo(t)&&!Xt(t)&&!Q5(t)?String(t):t,Y6=(e,t="")=>{var n;return Qr(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function qB(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** +**/function J5(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const On={},Lc=[],kr=()=>{},uM=()=>!1,Wd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Q5=e=>e.startsWith("onUpdate:"),go=Object.assign,K7=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},zB=Object.prototype.hasOwnProperty,Qn=(e,t)=>zB.call(e,t),Xt=Array.isArray,$c=e=>du(e)==="[object Map]",A0=e=>du(e)==="[object Set]",Uw=e=>du(e)==="[object Date]",BB=e=>du(e)==="[object RegExp]",wn=e=>typeof e=="function",bo=e=>typeof e=="string",Qi=e=>typeof e=="symbol",eo=e=>e!==null&&typeof e=="object",G7=e=>(eo(e)||wn(e))&&wn(e.then)&&wn(e.catch),dM=Object.prototype.toString,du=e=>dM.call(e),RB=e=>du(e).slice(8,-1),ep=e=>du(e)==="[object Object]",tp=e=>bo(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,a0=J5(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),np=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},FB=/-\w/g,Ms=np(e=>e.replace(FB,t=>t.slice(1).toUpperCase())),jB=/\B([A-Z])/g,Li=np(e=>e.replace(jB,"-$1").toLowerCase()),op=np(e=>e.charAt(0).toUpperCase()+e.slice(1)),G3=np(e=>e?`on${op(e)}`:""),Us=(e,t)=>!Object.is(e,t),Nc=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},sp=e=>{const t=parseFloat(e);return isNaN(t)?e:t},E4=e=>{const t=bo(e)?Number(e):NaN;return isNaN(t)?e:t};let Zw;const ip=()=>Zw||(Zw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),OB="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",PB=J5(OB);function Wt(e){if(Xt(e)){const t={};for(let n=0;n{if(n){const o=n.split(DB);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Be(e){let t="";if(bo(e))t=e;else if(Xt(e))for(let n=0;nYl(n,t))}const hM=e=>!!(e&&e.__v_isRef===!0),I=e=>bo(e)?e:e==null?"":Xt(e)||eo(e)&&(e.toString===dM||!wn(e.toString))?hM(e)?I(e.value):JSON.stringify(e,mM,2):String(e),mM=(e,t)=>hM(t)?mM(e,t.value):$c(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[X6(o,i)+" =>"]=s,n),{})}:A0(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>X6(n))}:Qi(t)?X6(t):eo(t)&&!Xt(t)&&!ep(t)?String(t):t,X6=(e,t="")=>{var n;return Qi(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function GB(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** * @vue/reactivity v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let xs;class pM{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xs&&(xs.active?(this.parent=xs,this.index=(xs.scopes||(xs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(xs===this)xs=this.prevScope;else{let t=xs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n0)return;if(F2){let t=F2;for(F2=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;R2;){let t=R2;for(R2=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function gM(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vM(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),J7(o),ZB(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function qm(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(wM(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function wM(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===id)||(e.globalVersion=id,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qm(e))))return;e.flags|=2;const t=e.dep,n=Ao,o=Wi;Ao=e,Wi=!0;try{gM(e);const s=e.fn(e._value);(t.version===0||Us(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Ao=n,Wi=o,vM(e),e.flags&=-3}}function J7(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)J7(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ZB(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function VVe(e,t){e.effect instanceof T4&&(e=e.effect.fn);const n=new T4(e);t&&go(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function WVe(e){e.effect.stop()}let Wi=!0;const yM=[];function Xl(){yM.push(Wi),Wi=!1}function Jl(){const e=yM.pop();Wi=e===void 0?!0:e}function Zw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ao;Ao=void 0;try{t()}finally{Ao=n}}}let id=0;class KB{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ip{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Ao||!Wi||Ao===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ao)n=this.activeLink=new KB(Ao,this),Ao.deps?(n.prevDep=Ao.depsTail,Ao.depsTail.nextDep=n,Ao.depsTail=n):Ao.deps=Ao.depsTail=n,kM(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Ao.depsTail,n.nextDep=void 0,Ao.depsTail.nextDep=n,Ao.depsTail=n,Ao.deps===n&&(Ao.deps=o)}return n}trigger(t){this.version++,id++,this.notify(t)}notify(t){Y7();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{X7()}}}function kM(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)kM(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const E4=new WeakMap,c0=Symbol(""),Um=Symbol(""),ld=Symbol("");function tr(e,t,n){if(Wi&&Ao){let o=E4.get(e);o||E4.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new ip),s.map=o,s.key=n),s.track()}}function Pl(e,t,n,o,s,r){const i=E4.get(e);if(!i){id++;return}const l=a=>{a&&a.trigger()};if(Y7(),t==="clear")i.forEach(l);else{const a=Xt(e),c=a&&ep(n);if(a&&n==="length"){const u=Number(o);i.forEach((d,f)=>{(f==="length"||f===ld||!Qr(f)&&f>=u)&&l(d)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),c&&l(i.get(ld)),t){case"add":a?c&&l(i.get("length")):(l(i.get(c0)),Lc(e)&&l(i.get(Um)));break;case"delete":a||(l(i.get(c0)),Lc(e)&&l(i.get(Um)));break;case"set":Lc(e)&&l(i.get(c0));break}}X7()}function GB(e,t){const n=E4.get(e);return n&&n.get(t)}function X0(e){const t=Dn(e);return t===e?t:(tr(t,"iterate",ld),Zr(e)?t:t.map(Zi))}function lp(e){return tr(e=Dn(e),"iterate",ld),e}function dl(e,t){return Ql(e)?Gc(Ua(e)?Zi(t):t):Zi(t)}const YB={__proto__:null,[Symbol.iterator](){return J6(this,Symbol.iterator,e=>dl(this,e))},concat(...e){return X0(this).concat(...e.map(t=>Xt(t)?X0(t):t))},entries(){return J6(this,"entries",e=>(e[1]=dl(this,e[1]),e))},every(e,t){return Tl(this,"every",e,t,void 0,arguments)},filter(e,t){return Tl(this,"filter",e,t,n=>n.map(o=>dl(this,o)),arguments)},find(e,t){return Tl(this,"find",e,t,n=>dl(this,n),arguments)},findIndex(e,t){return Tl(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Tl(this,"findLast",e,t,n=>dl(this,n),arguments)},findLastIndex(e,t){return Tl(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Tl(this,"forEach",e,t,void 0,arguments)},includes(...e){return Q6(this,"includes",e)},indexOf(...e){return Q6(this,"indexOf",e)},join(e){return X0(this).join(e)},lastIndexOf(...e){return Q6(this,"lastIndexOf",e)},map(e,t){return Tl(this,"map",e,t,void 0,arguments)},pop(){return Yu(this,"pop")},push(...e){return Yu(this,"push",e)},reduce(e,...t){return Kw(this,"reduce",e,t)},reduceRight(e,...t){return Kw(this,"reduceRight",e,t)},shift(){return Yu(this,"shift")},some(e,t){return Tl(this,"some",e,t,void 0,arguments)},splice(...e){return Yu(this,"splice",e)},toReversed(){return X0(this).toReversed()},toSorted(e){return X0(this).toSorted(e)},toSpliced(...e){return X0(this).toSpliced(...e)},unshift(...e){return Yu(this,"unshift",e)},values(){return J6(this,"values",e=>dl(this,e))}};function J6(e,t,n){const o=lp(e),s=o[t]();return o!==e&&!Zr(e)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=n(r.value)),r}),s}const XB=Array.prototype;function Tl(e,t,n,o,s,r){const i=lp(e),l=i!==e&&!Zr(e),a=i[t];if(a!==XB[t]){const d=a.apply(e,r);return l?Zi(d):d}let c=n;i!==e&&(l?c=function(d,f){return n.call(this,dl(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(i,c,o);return l&&s?s(u):u}function Kw(e,t,n,o){const s=lp(e),r=s!==e&&!Zr(e);let i=n,l=!1;s!==e&&(r?(l=o.length===0,i=function(c,u,d){return l&&(l=!1,c=dl(e,c)),n.call(this,c,dl(e,u),d,e)}):n.length>3&&(i=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](i,...o);return l?dl(e,a):a}function Q6(e,t,n){const o=Dn(e);tr(o,"iterate",ld);const s=o[t](...n);return(s===-1||s===!1)&&up(n[0])?(n[0]=Dn(n[0]),o[t](...n)):s}function Yu(e,t,n=[]){Xl(),Y7();const o=Dn(e)[t].apply(e,n);return X7(),Jl(),o}const JB=X5("__proto__,__v_isRef,__isVue"),bM=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Qr));function QB(e){Qr(e)||(e=String(e));const t=Dn(this);return tr(t,"has",e),t.hasOwnProperty(e)}class _M{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return r;if(n==="__v_raw")return o===(s?r?TM:AM:r?MM:CM).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const i=Xt(t);if(!s){let a;if(i&&(a=YB[n]))return a;if(n==="hasOwnProperty")return QB}const l=Reflect.get(t,n,rs(t)?t:o);if((Qr(n)?bM.has(n):JB(n))||(s||tr(t,"get",n),r))return l;if(rs(l)){const a=i&&ep(n)?l:l.value;return s&&eo(a)?pi(a):a}return eo(l)?s?pi(l):Rs(l):l}}class xM extends _M{constructor(t=!1){super(!1,t)}set(t,n,o,s){let r=t[n];const i=Xt(t)&&ep(n);if(!this._isShallow){const c=Ql(r);if(!Zr(o)&&!Ql(o)&&(r=Dn(r),o=Dn(o)),!i&&rs(r)&&!rs(o))return c||(r.value=o),!0}const l=i?Number(n)e,Wf=e=>Reflect.getPrototypeOf(e);function sR(e,t,n){return function(...o){const s=this.__v_raw,r=Dn(s),i=Lc(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,c=s[e](...o),u=n?Zm:t?Gc:Zi;return!t&&tr(r,"iterate",a?Um:c0),go(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function qf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function rR(e,t){const n={get(s){const r=this.__v_raw,i=Dn(r),l=Dn(s);e||(Us(s,l)&&tr(i,"get",s),tr(i,"get",l));const{has:a}=Wf(i),c=t?Zm:e?Gc:Zi;if(a.call(i,s))return c(r.get(s));if(a.call(i,l))return c(r.get(l));r!==i&&r.get(s)},get size(){const s=this.__v_raw;return!e&&tr(Dn(s),"iterate",c0),s.size},has(s){const r=this.__v_raw,i=Dn(r),l=Dn(s);return e||(Us(s,l)&&tr(i,"has",s),tr(i,"has",l)),s===l?r.has(s):r.has(s)||r.has(l)},forEach(s,r){const i=this,l=i.__v_raw,a=Dn(l),c=t?Zm:e?Gc:Zi;return!e&&tr(a,"iterate",c0),l.forEach((u,d)=>s.call(r,c(u),c(d),i))}};return go(n,e?{add:qf("add"),set:qf("set"),delete:qf("delete"),clear:qf("clear")}:{add(s){const r=Dn(this),i=Wf(r),l=Dn(s),a=!t&&!Zr(s)&&!Ql(s)?l:s;return i.has.call(r,a)||Us(s,a)&&i.has.call(r,s)||Us(l,a)&&i.has.call(r,l)||(r.add(a),Pl(r,"add",a,a)),this},set(s,r){!t&&!Zr(r)&&!Ql(r)&&(r=Dn(r));const i=Dn(this),{has:l,get:a}=Wf(i);let c=l.call(i,s);c||(s=Dn(s),c=l.call(i,s));const u=a.call(i,s);return i.set(s,r),c?Us(r,u)&&Pl(i,"set",s,r):Pl(i,"add",s,r),this},delete(s){const r=Dn(this),{has:i,get:l}=Wf(r);let a=i.call(r,s);a||(s=Dn(s),a=i.call(r,s)),l&&l.call(r,s);const c=r.delete(s);return a&&Pl(r,"delete",s,void 0),c},clear(){const s=Dn(this),r=s.size!==0,i=s.clear();return r&&Pl(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=sR(s,e,t)}),n}function ap(e,t){const n=rR(e,t);return(o,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(Qn(n,s)&&s in o?n:o,s,r)}const iR={get:ap(!1,!1)},lR={get:ap(!1,!0)},aR={get:ap(!0,!1)},cR={get:ap(!0,!0)},CM=new WeakMap,MM=new WeakMap,AM=new WeakMap,TM=new WeakMap;function uR(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Rs(e){return Ql(e)?e:cp(e,!1,eR,iR,CM)}function dR(e){return cp(e,!1,nR,lR,MM)}function pi(e){return cp(e,!0,tR,aR,AM)}function qVe(e){return cp(e,!0,oR,cR,TM)}function cp(e,t,n,o,s){if(!eo(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=s.get(e);if(r)return r;const i=uR($B(e));if(i===0)return e;const l=new Proxy(e,i===2?o:n);return s.set(e,l),l}function Ua(e){return Ql(e)?Ua(e.__v_raw):!!(e&&e.__v_isReactive)}function Ql(e){return!!(e&&e.__v_isReadonly)}function Zr(e){return!!(e&&e.__v_isShallow)}function up(e){return e?!!e.__v_raw:!1}function Dn(e){const t=e&&e.__v_raw;return t?Dn(t):e}function Nt(e){return!Qn(e,"__v_skip")&&Object.isExtensible(e)&&cM(e,"__v_skip",!0),e}const Zi=e=>eo(e)?Rs(e):e,Gc=e=>eo(e)?pi(e):e;function rs(e){return e?e.__v_isRef===!0:!1}function U(e){return EM(e,!1)}function jo(e){return EM(e,!0)}function EM(e,t){return rs(e)?e:new fR(e,t)}class fR{constructor(t,n){this.dep=new ip,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Dn(t),this._value=n?t:Zi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Zr(t)||Ql(t);t=o?t:Dn(t),Us(t,n)&&(this._rawValue=t,this._value=o?t:Zi(t),this.dep.trigger())}}function pR(e){e.dep&&e.dep.trigger()}function y(e){return rs(e)?e.value:e}function Km(e){return wn(e)?e():y(e)}const hR={get:(e,t,n)=>t==="__v_raw"?e:y(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return rs(s)&&!rs(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function IM(e){return Ua(e)?e:new Proxy(e,hR)}class mR{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ip,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function gR(e){return new mR(e)}function UVe(e){const t=Xt(e)?new Array(e.length):{};for(const n in e)t[n]=LM(e,n);return t}class vR{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Qr(n)?n:String(n),this._raw=Dn(t);let s=!0,r=t;if(!Xt(t)||Qr(this._key)||!ep(this._key))do s=!up(r)||Zr(r);while(s&&(r=r.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=y(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&rs(this._raw[this._key])){const n=this._object[this._key];if(rs(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return GB(this._raw,this._key)}}class wR{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function ZVe(e,t,n){return rs(e)?e:wn(e)?new wR(e):eo(e)&&arguments.length>1?LM(e,t,n):U(e)}function LM(e,t,n){return new vR(e,t,n)}class yR{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ip(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=id-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Ao!==this)return mM(this,!0),!0}get value(){const t=this.dep.track();return wM(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function kR(e,t,n=!1){let o,s;return wn(e)?o=e:(o=e.get,s=e.set),new yR(o,s,n)}const KVe={GET:"get",HAS:"has",ITERATE:"iterate"},GVe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Uf={},I4=new WeakMap;let za;function YVe(){return za}function bR(e,t=!1,n=za){if(n){let o=I4.get(n);o||I4.set(n,o=[]),o.push(e)}}function _R(e,t,n=On){const{immediate:o,deep:s,once:r,scheduler:i,augmentJob:l,call:a}=n,c=b=>s?b:Zr(b)||s===!1||s===0?Hl(b,1):Hl(b);let u,d,f,p,h=!1,m=!1;if(rs(e)?(d=()=>e.value,h=Zr(e)):Ua(e)?(d=()=>c(e),h=!0):Xt(e)?(m=!0,h=e.some(b=>Ua(b)||Zr(b)),d=()=>e.map(b=>{if(rs(b))return b.value;if(Ua(b))return c(b);if(wn(b))return a?a(b,2):b()})):wn(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Xl();try{f()}finally{Jl()}}const b=za;za=u;try{return a?a(e,3,[p]):e(p)}finally{za=b}}:d=ki,t&&s){const b=d,M=s===!0?1/0:s;d=()=>Hl(b(),M)}const k=G7(),x=()=>{u.stop(),k&&k.active&&Z7(k.effects,u)};if(r&&t){const b=t;t=(...M)=>{b(...M),x()}}let w=m?new Array(e.length).fill(Uf):Uf;const v=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const M=u.run();if(s||h||(m?M.some((R,z)=>Us(R,w[z])):Us(M,w))){f&&f();const R=za;za=u;try{const z=[M,w===Uf?void 0:m&&w[0]===Uf?[]:w,p];w=M,a?a(t,3,z):t(...z)}finally{za=R}}}else u.run()};return l&&l(v),u=new T4(d),u.scheduler=i?()=>i(v,!1):v,p=b=>bR(b,!1,u),f=u.onStop=()=>{const b=I4.get(u);if(b){if(a)a(b,4);else for(const M of b)M();I4.delete(u)}},t?o?v(!0):w=u.run():i?i(v.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function Hl(e,t=1/0,n){if(t<=0||!eo(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,rs(e))Hl(e.value,t,n);else if(Xt(e))for(let o=0;o{Hl(o,t,n)});else if(Q5(e)){for(const o in e)Hl(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Hl(e[o],t,n)}return e}/** +**/let xs;class gM{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xs&&(xs.active?(this.parent=xs,this.index=(xs.scopes||(xs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(xs===this)xs=this.prevScope;else{let t=xs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n0)return;if(j2){let t=j2;for(j2=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;F2;){let t=F2;for(F2=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function yM(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function kM(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Q7(o),XB(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Um(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bM(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bM(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ld)||(e.globalVersion=ld,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Um(e))))return;e.flags|=2;const t=e.dep,n=Ao,o=Wr;Ao=e,Wr=!0;try{yM(e);const s=e.fn(e._value);(t.version===0||Us(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Ao=n,Wr=o,kM(e),e.flags&=-3}}function Q7(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Q7(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function XB(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function oWe(e,t){e.effect instanceof T4&&(e=e.effect.fn);const n=new T4(e);t&&go(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function sWe(e){e.effect.stop()}let Wr=!0;const _M=[];function Xl(){_M.push(Wr),Wr=!1}function Jl(){const e=_M.pop();Wr=e===void 0?!0:e}function Kw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ao;Ao=void 0;try{t()}finally{Ao=n}}}let ld=0;class JB{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class lp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Ao||!Wr||Ao===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ao)n=this.activeLink=new JB(Ao,this),Ao.deps?(n.prevDep=Ao.depsTail,Ao.depsTail.nextDep=n,Ao.depsTail=n):Ao.deps=Ao.depsTail=n,xM(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Ao.depsTail,n.nextDep=void 0,Ao.depsTail.nextDep=n,Ao.depsTail=n,Ao.deps===n&&(Ao.deps=o)}return n}trigger(t){this.version++,ld++,this.notify(t)}notify(t){X7();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{J7()}}}function xM(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)xM(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const I4=new WeakMap,c0=Symbol(""),Zm=Symbol(""),ad=Symbol("");function ti(e,t,n){if(Wr&&Ao){let o=I4.get(e);o||I4.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new lp),s.map=o,s.key=n),s.track()}}function Pl(e,t,n,o,s,i){const r=I4.get(e);if(!r){ld++;return}const l=a=>{a&&a.trigger()};if(X7(),t==="clear")r.forEach(l);else{const a=Xt(e),c=a&&tp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===ad||!Qi(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(ad)),t){case"add":a?c&&l(r.get("length")):(l(r.get(c0)),$c(e)&&l(r.get(Zm)));break;case"delete":a||(l(r.get(c0)),$c(e)&&l(r.get(Zm)));break;case"set":$c(e)&&l(r.get(c0));break}}J7()}function QB(e,t){const n=I4.get(e);return n&&n.get(t)}function X0(e){const t=Dn(e);return t===e?t:(ti(t,"iterate",ad),Zi(e)?t:t.map(Zr))}function ap(e){return ti(e=Dn(e),"iterate",ad),e}function dl(e,t){return Ql(e)?Yc(Ua(e)?Zr(t):t):Zr(t)}const eR={__proto__:null,[Symbol.iterator](){return Q6(this,Symbol.iterator,e=>dl(this,e))},concat(...e){return X0(this).concat(...e.map(t=>Xt(t)?X0(t):t))},entries(){return Q6(this,"entries",e=>(e[1]=dl(this,e[1]),e))},every(e,t){return El(this,"every",e,t,void 0,arguments)},filter(e,t){return El(this,"filter",e,t,n=>n.map(o=>dl(this,o)),arguments)},find(e,t){return El(this,"find",e,t,n=>dl(this,n),arguments)},findIndex(e,t){return El(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return El(this,"findLast",e,t,n=>dl(this,n),arguments)},findLastIndex(e,t){return El(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return El(this,"forEach",e,t,void 0,arguments)},includes(...e){return eh(this,"includes",e)},indexOf(...e){return eh(this,"indexOf",e)},join(e){return X0(this).join(e)},lastIndexOf(...e){return eh(this,"lastIndexOf",e)},map(e,t){return El(this,"map",e,t,void 0,arguments)},pop(){return Xu(this,"pop")},push(...e){return Xu(this,"push",e)},reduce(e,...t){return Gw(this,"reduce",e,t)},reduceRight(e,...t){return Gw(this,"reduceRight",e,t)},shift(){return Xu(this,"shift")},some(e,t){return El(this,"some",e,t,void 0,arguments)},splice(...e){return Xu(this,"splice",e)},toReversed(){return X0(this).toReversed()},toSorted(e){return X0(this).toSorted(e)},toSpliced(...e){return X0(this).toSpliced(...e)},unshift(...e){return Xu(this,"unshift",e)},values(){return Q6(this,"values",e=>dl(this,e))}};function Q6(e,t,n){const o=ap(e),s=o[t]();return o!==e&&!Zi(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const tR=Array.prototype;function El(e,t,n,o,s,i){const r=ap(e),l=r!==e&&!Zi(e),a=r[t];if(a!==tR[t]){const d=a.apply(e,i);return l?Zr(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,dl(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Gw(e,t,n,o){const s=ap(e),i=s!==e&&!Zi(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=dl(e,c)),n.call(this,c,dl(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?dl(e,a):a}function eh(e,t,n){const o=Dn(e);ti(o,"iterate",ad);const s=o[t](...n);return(s===-1||s===!1)&&dp(n[0])?(n[0]=Dn(n[0]),o[t](...n)):s}function Xu(e,t,n=[]){Xl(),X7();const o=Dn(e)[t].apply(e,n);return J7(),Jl(),o}const nR=J5("__proto__,__v_isRef,__isVue"),SM=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Qi));function oR(e){Qi(e)||(e=String(e));const t=Dn(this);return ti(t,"has",e),t.hasOwnProperty(e)}class CM{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?LM:IM:i?TM:EM).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=Xt(t);if(!s){let a;if(r&&(a=eR[n]))return a;if(n==="hasOwnProperty")return oR}const l=Reflect.get(t,n,is(t)?t:o);if((Qi(n)?SM.has(n):nR(n))||(s||ti(t,"get",n),i))return l;if(is(l)){const a=r&&tp(n)?l:l.value;return s&&eo(a)?pr(a):a}return eo(l)?s?pr(l):Rs(l):l}}class MM extends CM{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=Xt(t)&&tp(n);if(!this._isShallow){const c=Ql(i);if(!Zi(o)&&!Ql(o)&&(i=Dn(i),o=Dn(o)),!r&&is(i)&&!is(o))return c||(i.value=o),!0}const l=r?Number(n)e,qf=e=>Reflect.getPrototypeOf(e);function aR(e,t,n){return function(...o){const s=this.__v_raw,i=Dn(s),r=$c(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Km:t?Yc:Zr;return!t&&ti(i,"iterate",a?Zm:c0),go(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Uf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function cR(e,t){const n={get(s){const i=this.__v_raw,r=Dn(i),l=Dn(s);e||(Us(s,l)&&ti(r,"get",s),ti(r,"get",l));const{has:a}=qf(r),c=t?Km:e?Yc:Zr;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&ti(Dn(s),"iterate",c0),s.size},has(s){const i=this.__v_raw,r=Dn(i),l=Dn(s);return e||(Us(s,l)&&ti(r,"has",s),ti(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=Dn(l),c=t?Km:e?Yc:Zr;return!e&&ti(a,"iterate",c0),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return go(n,e?{add:Uf("add"),set:Uf("set"),delete:Uf("delete"),clear:Uf("clear")}:{add(s){const i=Dn(this),r=qf(i),l=Dn(s),a=!t&&!Zi(s)&&!Ql(s)?l:s;return r.has.call(i,a)||Us(s,a)&&r.has.call(i,s)||Us(l,a)&&r.has.call(i,l)||(i.add(a),Pl(i,"add",a,a)),this},set(s,i){!t&&!Zi(i)&&!Ql(i)&&(i=Dn(i));const r=Dn(this),{has:l,get:a}=qf(r);let c=l.call(r,s);c||(s=Dn(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Us(i,u)&&Pl(r,"set",s,i):Pl(r,"add",s,i),this},delete(s){const i=Dn(this),{has:r,get:l}=qf(i);let a=r.call(i,s);a||(s=Dn(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Pl(i,"delete",s,void 0),c},clear(){const s=Dn(this),i=s.size!==0,r=s.clear();return i&&Pl(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=aR(s,e,t)}),n}function cp(e,t){const n=cR(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(Qn(n,s)&&s in o?n:o,s,i)}const uR={get:cp(!1,!1)},dR={get:cp(!1,!0)},fR={get:cp(!0,!1)},pR={get:cp(!0,!0)},EM=new WeakMap,TM=new WeakMap,IM=new WeakMap,LM=new WeakMap;function hR(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Rs(e){return Ql(e)?e:up(e,!1,sR,uR,EM)}function mR(e){return up(e,!1,rR,dR,TM)}function pr(e){return up(e,!0,iR,fR,IM)}function iWe(e){return up(e,!0,lR,pR,LM)}function up(e,t,n,o,s){if(!eo(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=hR(RB(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Ua(e){return Ql(e)?Ua(e.__v_raw):!!(e&&e.__v_isReactive)}function Ql(e){return!!(e&&e.__v_isReadonly)}function Zi(e){return!!(e&&e.__v_isShallow)}function dp(e){return e?!!e.__v_raw:!1}function Dn(e){const t=e&&e.__v_raw;return t?Dn(t):e}function Nt(e){return!Qn(e,"__v_skip")&&Object.isExtensible(e)&&fM(e,"__v_skip",!0),e}const Zr=e=>eo(e)?Rs(e):e,Yc=e=>eo(e)?pr(e):e;function is(e){return e?e.__v_isRef===!0:!1}function U(e){return $M(e,!1)}function jo(e){return $M(e,!0)}function $M(e,t){return is(e)?e:new gR(e,t)}class gR{constructor(t,n){this.dep=new lp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Dn(t),this._value=n?t:Zr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Zi(t)||Ql(t);t=o?t:Dn(t),Us(t,n)&&(this._rawValue=t,this._value=o?t:Zr(t),this.dep.trigger())}}function vR(e){e.dep&&e.dep.trigger()}function y(e){return is(e)?e.value:e}function Gm(e){return wn(e)?e():y(e)}const wR={get:(e,t,n)=>t==="__v_raw"?e:y(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return is(s)&&!is(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function NM(e){return Ua(e)?e:new Proxy(e,wR)}class yR{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new lp,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function kR(e){return new yR(e)}function rWe(e){const t=Xt(e)?new Array(e.length):{};for(const n in e)t[n]=zM(e,n);return t}class bR{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Qi(n)?n:String(n),this._raw=Dn(t);let s=!0,i=t;if(!Xt(t)||Qi(this._key)||!tp(this._key))do s=!dp(i)||Zi(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=y(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&is(this._raw[this._key])){const n=this._object[this._key];if(is(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return QB(this._raw,this._key)}}class _R{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function lWe(e,t,n){return is(e)?e:wn(e)?new _R(e):eo(e)&&arguments.length>1?zM(e,t,n):U(e)}function zM(e,t,n){return new bR(e,t,n)}class xR{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new lp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ld-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Ao!==this)return wM(this,!0),!0}get value(){const t=this.dep.track();return bM(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function SR(e,t,n=!1){let o,s;return wn(e)?o=e:(o=e.get,s=e.set),new xR(o,s,n)}const aWe={GET:"get",HAS:"has",ITERATE:"iterate"},cWe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Zf={},L4=new WeakMap;let za;function uWe(){return za}function CR(e,t=!1,n=za){if(n){let o=L4.get(n);o||L4.set(n,o=[]),o.push(e)}}function MR(e,t,n=On){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=b=>s?b:Zi(b)||s===!1||s===0?Hl(b,1):Hl(b);let u,d,f,p,h=!1,m=!1;if(is(e)?(d=()=>e.value,h=Zi(e)):Ua(e)?(d=()=>c(e),h=!0):Xt(e)?(m=!0,h=e.some(b=>Ua(b)||Zi(b)),d=()=>e.map(b=>{if(is(b))return b.value;if(Ua(b))return c(b);if(wn(b))return a?a(b,2):b()})):wn(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Xl();try{f()}finally{Jl()}}const b=za;za=u;try{return a?a(e,3,[p]):e(p)}finally{za=b}}:d=kr,t&&s){const b=d,M=s===!0?1/0:s;d=()=>Hl(b(),M)}const k=Y7(),x=()=>{u.stop(),k&&k.active&&K7(k.effects,u)};if(i&&t){const b=t;t=(...M)=>{b(...M),x()}}let v=m?new Array(e.length).fill(Zf):Zf;const w=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const M=u.run();if(s||h||(m?M.some((R,z)=>Us(R,v[z])):Us(M,v))){f&&f();const R=za;za=u;try{const z=[M,v===Zf?void 0:m&&v[0]===Zf?[]:v,p];v=M,a?a(t,3,z):t(...z)}finally{za=R}}}else u.run()};return l&&l(w),u=new T4(d),u.scheduler=r?()=>r(w,!1):w,p=b=>CR(b,!1,u),f=u.onStop=()=>{const b=L4.get(u);if(b){if(a)a(b,4);else for(const M of b)M();L4.delete(u)}},t?o?w(!0):v=u.run():r?r(w.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function Hl(e,t=1/0,n){if(t<=0||!eo(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,is(e))Hl(e.value,t,n);else if(Xt(e))for(let o=0;o{Hl(o,t,n)});else if(ep(e)){for(const o in e)Hl(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Hl(e[o],t,n)}return e}/** * @vue/runtime-core v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const $M=[];function xR(e){$M.push(e)}function SR(){$M.pop()}function XVe(e,t){}const JVe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},CR={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Wd(e,t,n,o){try{return o?e(...o):e()}catch(s){fu(s,t,n)}}function _i(e,t,n,o){if(wn(e)){const s=Wd(e,t,n,o);return s&&K7(s)&&s.catch(r=>{fu(r,t,n)}),s}if(Xt(e)){const s=[];for(let r=0;r>>1,s=dr[o],r=ad(s);r=ad(n)?dr.push(e):dr.splice(AR(t),0,e),e.flags|=1,zM()}}function zM(){L4||(L4=NM.then(BM))}function $4(e){Xt(e)?Nc.push(...e):Ba&&e.id===-1?Ba.splice(dc+1,0,e):e.flags&1||(Nc.push(e),e.flags|=1),zM()}function Gw(e,t,n=al+1){for(;nad(n)-ad(o));if(Nc.length=0,Ba){Ba.push(...t);return}for(Ba=t,dc=0;dce.id==null?e.flags&2?-1:1/0:e.id;function BM(e){try{for(al=0;alfc.emit(s,...r)),Zf=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{RM(r,t)}),setTimeout(()=>{fc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Zf=[])},3e3)):Zf=[]}let Ks=null,dp=null;function cd(e){const t=Ks;return Ks=e,dp=e&&e.type.__scopeId||null,t}function QVe(e){dp=e}function eWe(){dp=null}const tWe=e=>ue;function ue(e,t=Ks,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&j4(-1);const r=cd(t);let i;try{i=e(...s)}finally{cd(r),o._d&&j4(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function Zn(e,t){if(Ks===null)return e;const n=Kd(Ks),o=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&wn(t)?t.call(o&&o.proxy):t}}function nWe(){return!!(gs()||u0)}const TR=Symbol.for("v-scx"),ER=()=>pn(TR);function FM(e,t){return qd(e,null,t)}function oWe(e,t){return qd(e,null,{flush:"post"})}function IR(e,t){return qd(e,null,{flush:"sync"})}function Ue(e,t,n){return qd(e,t,n)}function qd(e,t,n=On){const{immediate:o,deep:s,flush:r,once:i}=n,l=go({},n),a=t&&o||!t&&r!=="post";let c;if(v0){if(r==="sync"){const p=ER();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=ki,p.resume=ki,p.pause=ki,p}}const u=Zs;l.call=(p,h,m)=>_i(p,u,h,m);let d=!1;r==="post"?l.scheduler=p=>{as(p,u&&u.suspense)}:r!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Q7(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=_R(e,t,l);return v0&&(c?c.push(f):a&&f()),f}function LR(e,t,n){const o=this.proxy,s=bo(e)?e.includes(".")?jM(o,e):()=>o[e]:e.bind(o,o);let r;wn(t)?r=t:(r=t.handler,n=t);const i=pu(this),l=qd(s,r.bind(o),n);return i(),l}function jM(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;se.__isTeleport,K1=e=>e&&(e.disabled||e.disabled===""),$R=e=>e&&(e.defer||e.defer===""),Yw=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Xw=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Gm=(e,t)=>{const n=e&&e.to;return bo(n)?t?t(n):null:n},NR={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,r,i,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:k,parentNode:x}}=c,w=K1(t.props);let{dynamicChildren:v}=t;const b=(z,$,T)=>{z.shapeFlag&16&&u(z.children,$,T,s,r,i,l,a)},M=(z=t)=>{const $=K1(z.props),T=z.target=Gm(z.props,h),E=Ym(T,z,m,p);T&&(i!=="svg"&&Yw(T)?i="svg":i!=="mathml"&&Xw(T)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(T),$||(b(z,T,E),y2(z,!1)))},R=z=>{const $=()=>{if(Ia.get(z)===$){if(Ia.delete(z),K1(z.props)){const T=x(z.el)||n;b(z,T,z.anchor),y2(z,!0)}M(z)}};Ia.set(z,$),as($,r)};if(e==null){const z=t.el=m(""),$=t.anchor=m("");if(p(z,n,o),p($,n,o),$R(t.props)||r&&r.pendingBranch){R(t);return}w&&(b(t,n,$),y2(t,!0)),M()}else{t.el=e.el;const z=t.anchor=e.anchor,$=Ia.get(e);if($){$.flags|=8,Ia.delete(e),R(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,E=t.targetAnchor=e.targetAnchor,N=K1(e.props),C=N?n:T,O=N?z:E;if(i==="svg"||Yw(T)?i="svg":(i==="mathml"||Xw(T))&&(i="mathml"),v?(f(e.dynamicChildren,v,C,s,r,i,l),cg(e,t,!0)):a||d(e,t,C,O,s,r,i,l,!1),w)N?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Kf(t,n,z,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const H=t.target=Gm(t.props,h);H&&Kf(t,H,null,c,0)}else N&&Kf(t,T,E,c,1);y2(t,w)}},remove(e,t,n,{um:o,o:{remove:s}},r){const{shapeFlag:i,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,p=r||!K1(f),h=Ia.get(e);if(h&&(h.flags|=8,Ia.delete(e)),d&&(s(c),s(u)),r&&s(a),!h&&i&16)for(let m=0;m{e.isMounted=!0}),vo(()=>{e.isUnmounting=!0}),e}const ii=[Function,Array],DM={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ii,onEnter:ii,onAfterEnter:ii,onEnterCancelled:ii,onBeforeLeave:ii,onLeave:ii,onAfterLeave:ii,onLeaveCancelled:ii,onBeforeAppear:ii,onAppear:ii,onAfterAppear:ii,onAppearCancelled:ii},VM=e=>{const t=e.subTree;return t.component?VM(t.component):t},BR={name:"BaseTransition",props:DM,setup(e,{slots:t}){const n=gs(),o=HM();return()=>{const s=t.default&&eg(t.default(),!0),r=s&&s.length?WM(s):n.subTree?J():void 0;if(!r)return;const i=Dn(e),{mode:l}=i;if(o.isLeaving)return eh(r);const a=Jw(r);if(!a)return eh(r);let c=ud(a,i,o,n,d=>c=d);a.type!==ds&&t1(a,c);let u=n.subTree&&Jw(n.subTree);if(u&&u.type!==ds&&!Pi(u,a)&&VM(n).type!==ds){let d=ud(u,i,o,n);if(t1(u,d),l==="out-in"&&a.type!==ds)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},eh(r);l==="in-out"&&a.type!==ds?d.delayLeave=(f,p,h)=>{const m=qM(o,u);m[String(u.key)]=u,f[fi]=()=>{p(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function WM(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ds){t=n;break}}return t}const RR=BR;function qM(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function ud(e,t,n,o,s){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:k,onAppear:x,onAfterAppear:w,onAppearCancelled:v}=t,b=String(e.key),M=qM(n,e),R=(T,E)=>{T&&_i(T,o,9,E)},z=(T,E)=>{const N=E[1];R(T,E),Xt(T)?T.every(C=>C.length<=1)&&N():T.length<=1&&N()},$={mode:i,persisted:l,beforeEnter(T){let E=a;if(!n.isMounted)if(r)E=k||a;else return;T[fi]&&T[fi](!0);const N=M[b];N&&Pi(e,N)&&N.el[fi]&&N.el[fi](),R(E,[T])},enter(T){if(M[b]===e)return;let E=c,N=u,C=d;if(!n.isMounted)if(r)E=x||c,N=w||u,C=v||d;else return;let O=!1;T[Xu]=V=>{O||(O=!0,V?R(C,[T]):R(N,[T]),$.delayedLeave&&$.delayedLeave(),T[Xu]=void 0)};const H=T[Xu].bind(null,!1);E?z(E,[T,H]):H()},leave(T,E){const N=String(e.key);if(T[Xu]&&T[Xu](!0),n.isUnmounting)return E();R(f,[T]);let C=!1;T[fi]=H=>{C||(C=!0,E(),H?R(m,[T]):R(h,[T]),T[fi]=void 0,M[N]===e&&delete M[N])};const O=T[fi].bind(null,!1);M[N]=e,p?z(p,[T,O]):O()},clone(T){const E=ud(T,t,n,o,s);return s&&s(E),E}};return $}function eh(e){if(Ud(e))return e=ea(e),e.children=null,e}function Jw(e){if(!Ud(e))return PM(e.type)&&e.children?WM(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&wn(n.default))return n.default()}}function t1(e,t){e.shapeFlag&6&&e.component?(e.transition=t,t1(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function eg(e,t=!1,n){let o=[],s=0;for(let r=0;r1)for(let r=0;rn.value,set:r=>n.value=r})}return n}function Qw(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const z4=new WeakMap;function zc(e,t,n,o,s=!1){if(Xt(e)){e.forEach((m,k)=>zc(m,t&&(Xt(t)?t[k]:t),n,o,s));return}if(Gl(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&zc(e,t,n,o.component.subTree);return}const r=o.shapeFlag&4?Kd(o.component):o.el,i=s?null:r,{i:l,r:a}=e,c=t&&t.r,u=l.refs===On?l.refs={}:l.refs,d=l.setupState,f=Dn(d),p=d===On?lM:m=>Qw(u,m)?!1:Qn(f,m),h=(m,k)=>!(k&&Qw(u,k));if(c!=null&&c!==a){if(ey(t),bo(c))u[c]=null,p(c)&&(d[c]=null);else if(rs(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(wn(a))Wd(a,l,12,[i,u]);else{const m=bo(a),k=rs(a);if(m||k){const x=()=>{if(e.f){const w=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(s)Xt(w)&&Z7(w,r);else if(Xt(w))w.includes(r)||w.push(r);else if(m)u[a]=[r],p(a)&&(d[a]=u[a]);else{const v=[r];h(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=i,p(a)&&(d[a]=i)):k&&(h(a,e.k)&&(a.value=i),e.k&&(u[e.k]=i))};if(i){const w=()=>{x(),z4.delete(e)};w.id=-1,z4.set(e,w),as(w,n)}else ey(e),x()}}}function ey(e){const t=z4.get(e);t&&(t.flags|=8,z4.delete(e))}let ty=!1;const J0=()=>{ty||(console.error("Hydration completed but contains mismatches."),ty=!0)},FR=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",jR=e=>e.namespaceURI.includes("MathML"),Gf=e=>{if(e.nodeType===1){if(FR(e))return"svg";if(jR(e))return"mathml"}},kc=e=>e.nodeType===8;function OR(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:r,parentNode:i,remove:l,insert:a,createComment:c}}=e,u=(v,b)=>{if(!b.hasChildNodes()){n(null,v,b),N4(),b._vnode=v;return}d(b.firstChild,v,null,null,null),N4(),b._vnode=v},d=(v,b,M,R,z,$=!1)=>{$=$||!!b.dynamicChildren;const T=kc(v)&&v.data==="[",E=()=>m(v,b,M,R,z,T),{type:N,ref:C,shapeFlag:O,patchFlag:H}=b;let V=v.nodeType;b.el=v,H===-2&&($=!1,b.dynamicChildren=null);let A=null;switch(N){case Za:V!==3?b.children===""?(a(b.el=s(""),i(v),v),A=v):A=E():(v.data!==b.children&&(J0(),v.data=b.children),A=r(v));break;case ds:w(v)?(A=r(v),x(b.el=v.content.firstChild,v,M)):V!==8||T?A=E():A=r(v);break;case Rc:if(T&&(v=r(v),V=v.nodeType),V===1||V===3){A=v;const F=!b.children.length;for(let j=0;j{$=$||!!b.dynamicChildren;const{type:T,props:E,patchFlag:N,shapeFlag:C,dirs:O,transition:H}=b,V=T==="input"||T==="option";if(V||N!==-1){O&&cl(b,null,M,"created");let A=!1;if(w(v)){A=dA(null,H)&&M&&M.vnode.props&&M.vnode.props.appear;const j=v.content.firstChild;if(A){const q=j.getAttribute("class");q&&(j.$cls=q),H.beforeEnter(j)}x(j,v,M),b.el=v=j}if(C&16&&!(E&&(E.innerHTML||E.textContent))){let j=p(v.firstChild,b,v,M,R,z,$);for(j&&!Yf(v,1)&&J0();j;){const q=j;j=j.nextSibling,l(q)}}else if(C&8){let j=b.children;j[0]===` -`&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(j=j.slice(1));const{textContent:q}=v;q!==j&&q!==j.replace(/\r\n|\r/g,` -`)&&(Yf(v,0)||J0(),v.textContent=b.children)}if(E){if(V||!$||N&48){const j=v.tagName.includes("-");for(const q in E)(V&&(q.endsWith("value")||q==="indeterminate")||Vd(q)&&!a0(q)||q[0]==="."||j&&!a0(q))&&o(v,q,null,E[q],void 0,M)}else if(E.onClick)o(v,"onClick",null,E.onClick,void 0,M);else if(N&4&&Ua(E.style))for(const j in E.style)E.style[j]}let F;(F=E&&E.onVnodeBeforeMount)&&Cr(F,M,b),O&&cl(b,null,M,"beforeMount"),((F=E&&E.onVnodeMounted)||O||A)&&mA(()=>{F&&Cr(F,M,b),A&&H.enter(v),O&&cl(b,null,M,"mounted")},R)}return v.nextSibling},p=(v,b,M,R,z,$,T)=>{T=T||!!b.dynamicChildren;const E=b.children,N=E.length;let C=!1;for(let O=0;O{const{slotScopeIds:T}=b;T&&(z=z?z.concat(T):T);const E=i(v),N=p(r(v),b,E,M,R,z,$);return N&&kc(N)&&N.data==="]"?r(b.anchor=N):(J0(),a(b.anchor=c("]"),E,N),N)},m=(v,b,M,R,z,$)=>{if(Yf(v.parentElement,1)||J0(),b.el=null,$){const N=k(v);for(;;){const C=r(v);if(C&&C!==N)l(C);else break}}const T=r(v),E=i(v);return l(v),n(null,b,E,T,M,R,Gf(E),z),M&&(M.vnode.el=b.el,hp(M,b.el)),T},k=(v,b="[",M="]")=>{let R=0;for(;v;)if(v=r(v),v&&kc(v)&&(v.data===b&&R++,v.data===M)){if(R===0)return r(v);R--}return v},x=(v,b,M)=>{const R=b.parentNode;R&&R.replaceChild(v,b);let z=M;for(;z;)z.vnode.el===b&&(z.vnode.el=z.subTree.el=v),z=z.parent},w=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const ny="data-allow-mismatch",PR={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Yf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(ny);)e=e.parentElement;const n=e&&e.getAttribute(ny);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(PR[t])}}const HR=sp().requestIdleCallback||(e=>setTimeout(e,1)),DR=sp().cancelIdleCallback||(e=>clearTimeout(e)),rWe=(e=1e4)=>t=>{const n=HR(t,{timeout:e});return()=>DR(n)};function VR(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:r,innerWidth:i}=window;return(t>0&&t0&&o0&&n0&&s(t,n)=>{const o=new IntersectionObserver(s=>{for(const r of s)if(r.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(VR(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},lWe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},aWe=(e=[])=>(t,n)=>{bo(e)&&(e=[e]);let o=!1;const s=i=>{o||(o=!0,r(),t(),i.target.dispatchEvent(new i.constructor(i.type,i)))},r=()=>{n(i=>{for(const l of e)i.removeEventListener(l,s)})};return n(i=>{for(const l of e)i.addEventListener(l,s,{once:!0})}),r};function WR(e,t){if(kc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(kc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Gl=e=>!!e.type.__asyncLoader;function mi(e){wn(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:r,timeout:i,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((k,x)=>{a(m,()=>k(f()),()=>x(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ge({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,k){let x=!1;(m.bu||(m.bu=[])).push(()=>x=!0);const w=()=>{x||k()},v=r?()=>{const b=r(w,M=>WR(h,M));b&&(m.bum||(m.bum=[])).push(b)}:w;u?v():p().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const h=Zs;if(tg(h),u)return()=>Xf(u,h);const m=v=>{c=null,fu(v,h,13,!o)};if(l&&h.suspense||v0)return p().then(v=>()=>Xf(v,h)).catch(v=>(m(v),()=>o?Z(o,{error:v}):null));const k=U(!1),x=U(),w=U(!!s);return s&&setTimeout(()=>{w.value=!1},s),i!=null&&setTimeout(()=>{if(!k.value&&!x.value){const v=new Error(`Async component timed out after ${i}ms.`);m(v),x.value=v}},i),p().then(()=>{k.value=!0,h.parent&&Ud(h.parent.vnode)&&h.parent.update()}).catch(v=>{m(v),x.value=v}),()=>{if(k.value&&u)return Xf(u,h);if(x.value&&o)return Z(o,{error:x.value});if(n&&!w.value)return Xf(n,h)}}})}function Xf(e,t){const{ref:n,props:o,children:s,ce:r}=t.vnode,i=Z(e,o,s);return i.ref=n,i.ce=r,delete t.vnode.ce,i}const Ud=e=>e.type.__isKeepAlive,qR={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=gs(),o=n.ctx;if(!o.renderer)return()=>{const w=t.default&&t.default();return w&&w.length===1?w[0]:w};const s=new Map,r=new Set;let i=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(w,v,b,M,R)=>{const z=w.component;c(w,v,b,0,l),a(z.vnode,w,v,b,z,l,M,w.slotScopeIds,R),as(()=>{z.isDeactivated=!1,z.a&&$c(z.a);const $=w.props&&w.props.onVnodeMounted;$&&Cr($,z.parent,w)},l)},o.deactivate=w=>{const v=w.component;R4(v.m),R4(v.a),c(w,f,null,1,l),as(()=>{v.da&&$c(v.da);const b=w.props&&w.props.onVnodeUnmounted;b&&Cr(b,v.parent,w),v.isDeactivated=!0},l)};function p(w){th(w),u(w,n,l,!0)}function h(w){s.forEach((v,b)=>{const M=r8(Gl(v)?v.type.__asyncResolved||{}:v.type);M&&!w(M)&&m(b)})}function m(w){const v=s.get(w);v&&(!i||!Pi(v,i))?p(v):i&&th(i),s.delete(w),r.delete(w)}Ue(()=>[e.include,e.exclude],([w,v])=>{w&&h(b=>k2(w,b)),v&&h(b=>!k2(v,b))},{flush:"post",deep:!0});let k=null;const x=()=>{k!=null&&(F4(n.subTree.type)?as(()=>{s.set(k,Jf(n.subTree))},n.subTree.suspense):s.set(k,Jf(n.subTree)))};return xn(x),ng(x),vo(()=>{s.forEach(w=>{const{subTree:v,suspense:b}=n,M=Jf(v);if(w.type===M.type&&w.key===M.key){th(M);const R=M.component.da;R&&as(R,b);return}p(w)})}),()=>{if(k=null,!t.default)return i=null;const w=t.default(),v=w[0];if(w.length>1)return i=null,w;if(!n1(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return i=null,v;let b=Jf(v);if(b.type===ds)return i=null,b;const M=b.type,R=r8(Gl(b)?b.type.__asyncResolved||{}:M),{include:z,exclude:$,max:T}=e;if(z&&(!R||!k2(z,R))||$&&R&&k2($,R))return b.shapeFlag&=-257,i=b,v;const E=b.key==null?M:b.key,N=s.get(E);return b.el&&(b=ea(b),v.shapeFlag&128&&(v.ssContent=b)),k=E,N?(b.el=N.el,b.component=N.component,b.transition&&t1(b,b.transition),b.shapeFlag|=512,r.delete(E),r.add(E)):(r.add(E),T&&r.size>parseInt(T,10)&&m(r.values().next().value)),b.shapeFlag|=256,i=b,F4(v.type)?v:b}}},cWe=qR;function k2(e,t){return Xt(e)?e.some(n=>k2(n,t)):bo(e)?e.split(",").includes(t):LB(e)?(e.lastIndex=0,e.test(t)):!1}function UR(e,t){UM(e,"a",t)}function ZR(e,t){UM(e,"da",t)}function UM(e,t,n=Zs){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(fp(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Ud(s.parent.vnode)&&KR(o,t,n,s),s=s.parent}}function KR(e,t,n,o){const s=fp(t,e,o,!0);An(()=>{Z7(o[t],s)},n)}function th(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Jf(e){return e.shapeFlag&128?e.ssContent:e}function fp(e,t,n=Zs,o=!1){if(n){const s=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Xl();const l=pu(n),a=_i(t,n,e,i);return l(),Jl(),a});return o?s.unshift(r):s.push(r),r}}const aa=e=>(t,n=Zs)=>{(!v0||e==="sp")&&fp(e,(...o)=>t(...o),n)},GR=aa("bm"),xn=aa("m"),ZM=aa("bu"),ng=aa("u"),vo=aa("bum"),An=aa("um"),YR=aa("sp"),XR=aa("rtg"),JR=aa("rtc");function QR(e,t=Zs){fp("ec",e,t)}const og="components",eF="directives";function KM(e,t){return sg(og,e,!0,t)||e}const GM=Symbol.for("v-ndc");function ns(e){return bo(e)?sg(og,e,!1)||e:e||GM}function uWe(e){return sg(eF,e)}function sg(e,t,n=!0,o=!1){const s=Ks||Zs;if(s){const r=s.type;if(e===og){const l=r8(r,!1);if(l&&(l===t||l===Ms(t)||l===np(Ms(t))))return r}const i=oy(s[e]||r[e],t)||oy(s.appContext[e],t);return!i&&o?r:i}}function oy(e,t){return e&&(e[t]||e[Ms(t)]||e[np(Ms(t))])}function rt(e,t,n,o){let s;const r=n&&n[o],i=Xt(e);if(i||bo(e)){const l=i&&Ua(e);let a=!1,c=!1;l&&(a=!Zr(e),c=Ql(e),e=lp(e)),s=new Array(e.length);for(let u=0,d=e.length;ut(l,a,void 0,r&&r[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a{const r=o.fn(...s);return r&&(r.key=o.key),r}:o.fn)}return e}function Tn(e,t,n={},o,s){if(Ks.ce||Ks.parent&&Gl(Ks.parent)&&Ks.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),g(),ce(Me,null,[Z("slot",n,o&&o())],c?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),g();const i=r&&rg(r(n)),l=n.key||i&&i.key,a=ce(Me,{key:(l&&!Qr(l)?l:`_${t}`)+(!i&&o?"_fb":"")},i||(o?o():[]),i&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function rg(e){return e.some(t=>n1(t)?!(t.type===ds||t.type===Me&&!rg(t.children)):!0)?e:null}function dWe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:K3(o)]=e[o];return n}const Xm=e=>e?bA(e)?Kd(e):Xm(e.parent):null,j2=go(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xm(e.parent),$root:e=>Xm(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ig(e),$forceUpdate:e=>e.f||(e.f=()=>{Q7(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>LR.bind(e)}),nh=(e,t)=>e!==On&&!e.__isScriptSetup&&Qn(e,t),Jm={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const f=i[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return r[t]}else{if(nh(o,t))return i[t]=1,o[t];if(s!==On&&Qn(s,t))return i[t]=2,s[t];if(Qn(r,t))return i[t]=3,r[t];if(n!==On&&Qn(n,t))return i[t]=4,n[t];Qm&&(i[t]=0)}}const c=j2[t];let u,d;if(c)return t==="$attrs"&&tr(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==On&&Qn(n,t))return i[t]=4,n[t];if(d=a.config.globalProperties,Qn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:r}=e;return nh(s,t)?(s[t]=n,!0):o!==On&&Qn(o,t)?(o[t]=n,!0):Qn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:r,type:i}},l){let a;return!!(n[l]||e!==On&&l[0]!=="$"&&Qn(e,l)||nh(t,l)||Qn(r,l)||Qn(o,l)||Qn(j2,l)||Qn(s.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Qn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tF=go({},Jm,{get(e,t){if(t!==Symbol.unscopables)return Jm.get(e,t,e)},has(e,t){return t[0]!=="_"&&!RB(t)}});function fWe(){return null}function pWe(){return null}function hWe(e){}function mWe(e){}function gWe(){return null}function vWe(){}function wWe(e,t){return null}function yWe(){return YM().slots}function Zd(){return YM().attrs}function YM(e){const t=gs();return t.setupContext||(t.setupContext=SA(t))}function fd(e){return Xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function kWe(e,t){const n=fd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?Xt(s)||wn(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function bWe(e,t){return!e||!t?e||t:Xt(e)&&Xt(t)?e.concat(t):go({},fd(e),fd(t))}function _We(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function xWe(e){const t=gs(),n=v0;let o=e();hd(),n&&Fc(!1);const s=()=>{pu(t),n&&Fc(!0)},r=()=>{gs()!==t&&t.scope.off(),hd(),n&&Fc(!1)};return K7(o)&&(o=o.catch(i=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(r)),i})),[o,()=>{s(),Promise.resolve().then(r)}]}let Qm=!0;function nF(e){const t=ig(e),n=e.proxy,o=e.ctx;Qm=!1,t.beforeCreate&&sy(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:i,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:k,beforeDestroy:x,beforeUnmount:w,destroyed:v,unmounted:b,render:M,renderTracked:R,renderTriggered:z,errorCaptured:$,serverPrefetch:T,expose:E,inheritAttrs:N,components:C,directives:O,filters:H}=t;if(c&&oF(c,o,null),i)for(const F in i){const j=i[F];wn(j)&&(o[F]=j.bind(n))}if(s){const F=s.call(n,n);eo(F)&&(e.data=Rs(F))}if(Qm=!0,r)for(const F in r){const j=r[F],q=wn(j)?j.bind(n,n):wn(j.get)?j.get.bind(n,n):ki,P=!wn(j)&&wn(j.set)?j.set.bind(n):ki,W=B({get:q,set:P});Object.defineProperty(o,F,{enumerable:!0,configurable:!0,get:()=>W.value,set:G=>W.value=G})}if(l)for(const F in l)XM(l[F],o,n,F);if(a){const F=wn(a)?a.call(n):a;Reflect.ownKeys(F).forEach(j=>{jn(j,F[j])})}u&&sy(u,e,"c");function A(F,j){Xt(j)?j.forEach(q=>F(q.bind(n))):j&&F(j.bind(n))}if(A(GR,d),A(xn,f),A(ZM,p),A(ng,h),A(UR,m),A(ZR,k),A(QR,$),A(JR,R),A(XR,z),A(vo,w),A(An,b),A(YR,T),Xt(E))if(E.length){const F=e.exposed||(e.exposed={});E.forEach(j=>{Object.defineProperty(F,j,{get:()=>n[j],set:q=>n[j]=q,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===ki&&(e.render=M),N!=null&&(e.inheritAttrs=N),C&&(e.components=C),O&&(e.directives=O),T&&tg(e)}function oF(e,t,n=ki){Xt(e)&&(e=e8(e));for(const o in e){const s=e[o];let r;eo(s)?"default"in s?r=pn(s.from||o,s.default,!0):r=pn(s.from||o):r=pn(s),rs(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[o]=r}}function sy(e,t,n){_i(Xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function XM(e,t,n,o){let s=o.includes(".")?jM(n,o):()=>n[o];if(bo(e)){const r=t[e];wn(r)&&Ue(s,r)}else if(wn(e))Ue(s,e.bind(n));else if(eo(e))if(Xt(e))e.forEach(r=>XM(r,t,n,o));else{const r=wn(e.handler)?e.handler.bind(n):t[e.handler];wn(r)&&Ue(s,r,e)}}function ig(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>B4(a,c,i,!0)),B4(a,t,i)),eo(t)&&r.set(t,a),a}function B4(e,t,n,o=!1){const{mixins:s,extends:r}=t;r&&B4(e,r,n,!0),s&&s.forEach(i=>B4(e,i,n,!0));for(const i in t)if(!(o&&i==="expose")){const l=sF[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const sF={data:ry,props:iy,emits:iy,methods:b2,computed:b2,beforeCreate:lr,created:lr,beforeMount:lr,mounted:lr,beforeUpdate:lr,updated:lr,beforeDestroy:lr,beforeUnmount:lr,destroyed:lr,unmounted:lr,activated:lr,deactivated:lr,errorCaptured:lr,serverPrefetch:lr,components:b2,directives:b2,watch:iF,provide:ry,inject:rF};function ry(e,t){return t?e?function(){return go(wn(e)?e.call(this,this):e,wn(t)?t.call(this,this):t)}:t:e}function rF(e,t){return b2(e8(e),e8(t))}function e8(e){if(Xt(e)){const t={};for(let n=0;n{let u,d=On,f;return IR(()=>{const p=e[s];Us(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Us(h,u)&&!(d!==On&&Us(p,d)))return;const m=o.vnode.props;m&&(t in m||s in m||r in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${r}`in m)||(u=p,c()),o.emit(`update:${t}`,h),Us(p,h)&&Us(p,d)&&!Us(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?i||On:l,done:!1}:{done:!0}}}},l}const QM=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ms(t)}Modifiers`]||e[`${Lr(t)}Modifiers`];function cF(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||On;let s=n;const r=t.startsWith("update:"),i=r&&QM(o,t.slice(7));i&&(i.trim&&(s=n.map(u=>bo(u)?u.trim():u)),i.number&&(s=n.map(op)));let l,a=o[l=K3(t)]||o[l=K3(Ms(t))];!a&&r&&(a=o[l=K3(Lr(t))]),a&&_i(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,_i(c,e,6,s)}}const uF=new WeakMap;function eA(e,t,n=!1){const o=n?uF:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const r=e.emits;let i={},l=!1;if(!wn(e)){const a=c=>{const u=eA(c,t,!0);u&&(l=!0,go(i,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(eo(e)&&o.set(e,null),null):(Xt(r)?r.forEach(a=>i[a]=null):go(i,r),eo(e)&&o.set(e,i),i)}function pp(e,t){return!e||!Vd(t)?!1:(t=t.slice(2).replace(/Once$/,""),Qn(e,t[0].toLowerCase()+t.slice(1))||Qn(e,Lr(t))||Qn(e,t))}function Y3(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[r],slots:i,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=e,k=cd(e);let x,w;try{if(n.shapeFlag&4){const b=s||o,M=b;x=Ir(c.call(M,b,u,d,p,f,h)),w=l}else{const b=t;x=Ir(b.length>1?b(d,{attrs:l,slots:i,emit:a}):b(d,null)),w=t.props?l:fF(l)}}catch(b){O2.length=0,fu(b,e,1),x=Z(ds)}let v=x;if(w&&m!==!1){const b=Object.keys(w),{shapeFlag:M}=v;b.length&&M&7&&(r&&b.some(J5)&&(w=pF(w,r)),v=ea(v,w,!1,!0))}return n.dirs&&(v=ea(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&t1(v,n.transition),x=v,cd(k),x}function dF(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||Vd(n))&&((t||(t={}))[n]=e[n]);return t},pF=(e,t)=>{const n={};for(const o in e)(!J5(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function hF(e,t,n){const{props:o,children:s,component:r}=e,{props:i,children:l,patchFlag:a}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?ly(o,i,c):!!i;if(a&8){const u=t.dynamicProps;for(let d=0;dObject.create(nA),sA=e=>Object.getPrototypeOf(e)===nA;function mF(e,t,n,o=!1){const s={},r=oA();e.propsDefaults=Object.create(null),rA(e,t,s,r);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=o?s:dR(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function gF(e,t,n,o){const{props:s,attrs:r,vnode:{patchFlag:i}}=e,l=Dn(s),[a]=e.propsOptions;let c=!1;if((o||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[f,p]=iA(d,t,!0);go(i,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!a)return eo(e)&&o.set(e,Ic),Ic;if(Xt(r))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",ag=e=>Xt(e)?e.map(Ir):[Ir(e)],wF=(e,t,n)=>{if(t._n)return t;const o=ue((...s)=>ag(t(...s)),n);return o._c=!1,o},lA=(e,t,n)=>{const o=e._ctx;for(const s in e){if(lg(s))continue;const r=e[s];if(wn(r))t[s]=wF(s,r,o);else if(r!=null){const i=ag(r);t[s]=()=>i}}},aA=(e,t)=>{const n=ag(t);e.slots.default=()=>n},cA=(e,t,n)=>{for(const o in t)(n||!lg(o))&&(e[o]=t[o])},yF=(e,t,n)=>{const o=e.slots=oA();if(e.vnode.shapeFlag&32){const s=t._;s?(cA(o,t,n),n&&cM(o,"_",s,!0)):lA(t,o)}else t&&aA(e,t)},kF=(e,t,n)=>{const{vnode:o,slots:s}=e;let r=!0,i=On;if(o.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:cA(s,t,n):(r=!t.$stable,lA(t,s)),i=t}else t&&(aA(e,t),i={default:1});if(r)for(const l in s)!lg(l)&&i[l]==null&&delete s[l]},as=mA;function bF(e){return uA(e)}function _F(e){return uA(e,OR)}function uA(e,t){const n=sp();n.__VUE__=!0;const{insert:o,remove:s,patchProp:r,createElement:i,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=ki,insertStaticContent:h}=e,m=(D,X,ve,fe=null,pe=null,te=null,de=void 0,ye=null,Ce=!!X.dynamicChildren)=>{if(D===X)return;D&&!Pi(D,X)&&(fe=ge(D),G(D,pe,te,!0),D=null),X.patchFlag===-2&&(Ce=!1,X.dynamicChildren=null);const{type:me,ref:be,shapeFlag:re}=X;switch(me){case Za:k(D,X,ve,fe);break;case ds:x(D,X,ve,fe);break;case Rc:D==null&&w(X,ve,fe,de);break;case Me:C(D,X,ve,fe,pe,te,de,ye,Ce);break;default:re&1?M(D,X,ve,fe,pe,te,de,ye,Ce):re&6?O(D,X,ve,fe,pe,te,de,ye,Ce):(re&64||re&128)&&me.process(D,X,ve,fe,pe,te,de,ye,Ce,et)}be!=null&&pe?zc(be,D&&D.ref,te,X||D,!X):be==null&&D&&D.ref!=null&&zc(D.ref,null,te,D,!0)},k=(D,X,ve,fe)=>{if(D==null)o(X.el=l(X.children),ve,fe);else{const pe=X.el=D.el;X.children!==D.children&&c(pe,X.children)}},x=(D,X,ve,fe)=>{D==null?o(X.el=a(X.children||""),ve,fe):X.el=D.el},w=(D,X,ve,fe)=>{[D.el,D.anchor]=h(D.children,X,ve,fe,D.el,D.anchor)},v=({el:D,anchor:X},ve,fe)=>{let pe;for(;D&&D!==X;)pe=f(D),o(D,ve,fe),D=pe;o(X,ve,fe)},b=({el:D,anchor:X})=>{let ve;for(;D&&D!==X;)ve=f(D),s(D),D=ve;s(X)},M=(D,X,ve,fe,pe,te,de,ye,Ce)=>{if(X.type==="svg"?de="svg":X.type==="math"&&(de="mathml"),D==null)R(X,ve,fe,pe,te,de,ye,Ce);else{const me=D.el&&D.el._isVueCE?D.el:null;try{me&&me._beginPatch(),T(D,X,pe,te,de,ye,Ce)}finally{me&&me._endPatch()}}},R=(D,X,ve,fe,pe,te,de,ye)=>{let Ce,me;const{props:be,shapeFlag:re,transition:ke,dirs:Fe}=D;if(Ce=D.el=i(D.type,te,be&&be.is,be),re&8?u(Ce,D.children):re&16&&$(D.children,Ce,null,fe,pe,oh(D,te),de,ye),Fe&&cl(D,null,fe,"created"),z(Ce,D,D.scopeId,de,fe),be){for(const dt in be)dt!=="value"&&!a0(dt)&&r(Ce,dt,null,be[dt],te,fe);"value"in be&&r(Ce,"value",null,be.value,te),(me=be.onVnodeBeforeMount)&&Cr(me,fe,D)}Fe&&cl(D,null,fe,"beforeMount");const at=dA(pe,ke);at&&ke.beforeEnter(Ce),o(Ce,X,ve),((me=be&&be.onVnodeMounted)||at||Fe)&&as(()=>{try{me&&Cr(me,fe,D),at&&ke.enter(Ce),Fe&&cl(D,null,fe,"mounted")}finally{}},pe)},z=(D,X,ve,fe,pe)=>{if(ve&&p(D,ve),fe)for(let te=0;te{for(let me=Ce;me{const ye=X.el=D.el;let{patchFlag:Ce,dynamicChildren:me,dirs:be}=X;Ce|=D.patchFlag&16;const re=D.props||On,ke=X.props||On;let Fe;if(ve&&z1(ve,!1),(Fe=ke.onVnodeBeforeUpdate)&&Cr(Fe,ve,X,D),be&&cl(X,D,ve,"beforeUpdate"),ve&&z1(ve,!0),(re.innerHTML&&ke.innerHTML==null||re.textContent&&ke.textContent==null)&&u(ye,""),me?E(D.dynamicChildren,me,ye,ve,fe,oh(X,pe),te):de||j(D,X,ye,null,ve,fe,oh(X,pe),te,!1),Ce>0){if(Ce&16)N(ye,re,ke,ve,pe);else if(Ce&2&&re.class!==ke.class&&r(ye,"class",null,ke.class,pe),Ce&4&&r(ye,"style",re.style,ke.style,pe),Ce&8){const at=X.dynamicProps;for(let dt=0;dt{Fe&&Cr(Fe,ve,X,D),be&&cl(X,D,ve,"updated")},fe)},E=(D,X,ve,fe,pe,te,de)=>{for(let ye=0;ye{if(X!==ve){if(X!==On)for(const te in X)!a0(te)&&!(te in ve)&&r(D,te,X[te],null,pe,fe);for(const te in ve){if(a0(te))continue;const de=ve[te],ye=X[te];de!==ye&&te!=="value"&&r(D,te,ye,de,pe,fe)}"value"in ve&&r(D,"value",X.value,ve.value,pe)}},C=(D,X,ve,fe,pe,te,de,ye,Ce)=>{const me=X.el=D?D.el:l(""),be=X.anchor=D?D.anchor:l("");let{patchFlag:re,dynamicChildren:ke,slotScopeIds:Fe}=X;Fe&&(ye=ye?ye.concat(Fe):Fe),D==null?(o(me,ve,fe),o(be,ve,fe),$(X.children||[],ve,be,pe,te,de,ye,Ce)):re>0&&re&64&&ke&&D.dynamicChildren&&D.dynamicChildren.length===ke.length?(E(D.dynamicChildren,ke,ve,pe,te,de,ye),(X.key!=null||pe&&X===pe.subTree)&&cg(D,X,!0)):j(D,X,ve,be,pe,te,de,ye,Ce)},O=(D,X,ve,fe,pe,te,de,ye,Ce)=>{X.slotScopeIds=ye,D==null?X.shapeFlag&512?pe.ctx.activate(X,ve,fe,de,Ce):H(X,ve,fe,pe,te,de,Ce):V(D,X,Ce)},H=(D,X,ve,fe,pe,te,de)=>{const ye=D.component=kA(D,fe,pe);if(Ud(D)&&(ye.ctx.renderer=et),_A(ye,!1,de),ye.asyncDep){if(pe&&pe.registerDep(ye,A,de),!D.el){const Ce=ye.subTree=Z(ds);x(null,Ce,X,ve),D.placeholder=Ce.el}}else A(ye,D,X,ve,pe,te,de)},V=(D,X,ve)=>{const fe=X.component=D.component;if(hF(D,X,ve))if(fe.asyncDep&&!fe.asyncResolved){F(fe,X,ve);return}else fe.next=X,fe.update();else X.el=D.el,fe.vnode=X},A=(D,X,ve,fe,pe,te,de)=>{const ye=()=>{if(D.isMounted){let{next:re,bu:ke,u:Fe,parent:at,vnode:dt}=D;{const en=fA(D);if(en){re&&(re.el=dt.el,F(D,re,de)),en.asyncDep.then(()=>{as(()=>{D.isUnmounted||me()},pe)});return}}let $t=re,Tt;z1(D,!1),re?(re.el=dt.el,F(D,re,de)):re=dt,ke&&$c(ke),(Tt=re.props&&re.props.onVnodeBeforeUpdate)&&Cr(Tt,at,re,dt),z1(D,!0);const Qt=Y3(D),Dt=D.subTree;D.subTree=Qt,m(Dt,Qt,d(Dt.el),ge(Dt),D,pe,te),re.el=Qt.el,$t===null&&hp(D,Qt.el),Fe&&as(Fe,pe),(Tt=re.props&&re.props.onVnodeUpdated)&&as(()=>Cr(Tt,at,re,dt),pe)}else{let re;const{el:ke,props:Fe}=X,{bm:at,m:dt,parent:$t,root:Tt,type:Qt}=D,Dt=Gl(X);if(z1(D,!1),at&&$c(at),!Dt&&(re=Fe&&Fe.onVnodeBeforeMount)&&Cr(re,$t,X),z1(D,!0),ke&&ne){const en=()=>{D.subTree=Y3(D),ne(ke,D.subTree,D,pe,null)};Dt&&Qt.__asyncHydrate?Qt.__asyncHydrate(ke,D,en):en()}else{Tt.ce&&Tt.ce._hasShadowRoot()&&Tt.ce._injectChildStyle(Qt,D.parent?D.parent.type:void 0);const en=D.subTree=Y3(D);m(null,en,ve,fe,D,pe,te),X.el=en.el}if(dt&&as(dt,pe),!Dt&&(re=Fe&&Fe.onVnodeMounted)){const en=X;as(()=>Cr(re,$t,en),pe)}(X.shapeFlag&256||$t&&Gl($t.vnode)&&$t.vnode.shapeFlag&256)&&D.a&&as(D.a,pe),D.isMounted=!0,X=ve=fe=null}};D.scope.on();const Ce=D.effect=new T4(ye);D.scope.off();const me=D.update=Ce.run.bind(Ce),be=D.job=Ce.runIfDirty.bind(Ce);be.i=D,be.id=D.uid,Ce.scheduler=()=>Q7(be),z1(D,!0),me()},F=(D,X,ve)=>{X.component=D;const fe=D.vnode.props;D.vnode=X,D.next=null,gF(D,X.props,fe,ve),kF(D,X.children,ve),Xl(),Gw(D),Jl()},j=(D,X,ve,fe,pe,te,de,ye,Ce=!1)=>{const me=D&&D.children,be=D?D.shapeFlag:0,re=X.children,{patchFlag:ke,shapeFlag:Fe}=X;if(ke>0){if(ke&128){P(me,re,ve,fe,pe,te,de,ye,Ce);return}else if(ke&256){q(me,re,ve,fe,pe,te,de,ye,Ce);return}}Fe&8?(be&16&&Q(me,pe,te),re!==me&&u(ve,re)):be&16?Fe&16?P(me,re,ve,fe,pe,te,de,ye,Ce):Q(me,pe,te,!0):(be&8&&u(ve,""),Fe&16&&$(re,ve,fe,pe,te,de,ye,Ce))},q=(D,X,ve,fe,pe,te,de,ye,Ce)=>{D=D||Ic,X=X||Ic;const me=D.length,be=X.length,re=Math.min(me,be);let ke;for(ke=0;kebe?Q(D,pe,te,!0,!1,re):$(X,ve,fe,pe,te,de,ye,Ce,re)},P=(D,X,ve,fe,pe,te,de,ye,Ce)=>{let me=0;const be=X.length;let re=D.length-1,ke=be-1;for(;me<=re&&me<=ke;){const Fe=D[me],at=X[me]=Ce?jl(X[me]):Ir(X[me]);if(Pi(Fe,at))m(Fe,at,ve,null,pe,te,de,ye,Ce);else break;me++}for(;me<=re&&me<=ke;){const Fe=D[re],at=X[ke]=Ce?jl(X[ke]):Ir(X[ke]);if(Pi(Fe,at))m(Fe,at,ve,null,pe,te,de,ye,Ce);else break;re--,ke--}if(me>re){if(me<=ke){const Fe=ke+1,at=Feke)for(;me<=re;)G(D[me],pe,te,!0),me++;else{const Fe=me,at=me,dt=new Map;for(me=at;me<=ke;me++){const Mn=X[me]=Ce?jl(X[me]):Ir(X[me]);Mn.key!=null&&dt.set(Mn.key,me)}let $t,Tt=0;const Qt=ke-at+1;let Dt=!1,en=0;const kn=new Array(Qt);for(me=0;me=Qt){G(Mn,pe,te,!0);continue}let Re;if(Mn.key!=null)Re=dt.get(Mn.key);else for($t=at;$t<=ke;$t++)if(kn[$t-at]===0&&Pi(Mn,X[$t])){Re=$t;break}Re===void 0?G(Mn,pe,te,!0):(kn[Re-at]=me+1,Re>=en?en=Re:Dt=!0,m(Mn,X[Re],ve,null,pe,te,de,ye,Ce),Tt++)}const In=Dt?xF(kn):Ic;for($t=In.length-1,me=Qt-1;me>=0;me--){const Mn=at+me,Re=X[Mn],lt=X[Mn+1],tt=Mn+1{const{el:te,type:de,transition:ye,children:Ce,shapeFlag:me}=D;if(me&6){W(D.component.subTree,X,ve,fe);return}if(me&128){D.suspense.move(X,ve,fe);return}if(me&64){de.move(D,X,ve,et);return}if(de===Me){o(te,X,ve);for(let re=0;reye.enter(te),pe));else{const{leave:re,delayLeave:ke,afterLeave:Fe}=ye,at=()=>{D.ctx.isUnmounted?s(te):o(te,X,ve)},dt=()=>{const $t=te._isLeaving||!!te[fi];te._isLeaving&&te[fi](!0),ye.persisted&&!$t?at():re(te,()=>{at(),Fe&&Fe()})};ke?ke(te,at,dt):dt()}else o(te,X,ve)},G=(D,X,ve,fe=!1,pe=!1)=>{const{type:te,props:de,ref:ye,children:Ce,dynamicChildren:me,shapeFlag:be,patchFlag:re,dirs:ke,cacheIndex:Fe,memo:at}=D;if(re===-2&&(pe=!1),ye!=null&&(Xl(),zc(ye,null,ve,D,!0),Jl()),Fe!=null&&(X.renderCache[Fe]=void 0),be&256){X.ctx.deactivate(D);return}const dt=be&1&&ke,$t=!Gl(D);let Tt;if($t&&(Tt=de&&de.onVnodeBeforeUnmount)&&Cr(Tt,X,D),be&6)oe(D.component,ve,fe);else{if(be&128){D.suspense.unmount(ve,fe);return}dt&&cl(D,null,X,"beforeUnmount"),be&64?D.type.remove(D,X,ve,et,fe):me&&!me.hasOnce&&(te!==Me||re>0&&re&64)?Q(me,X,ve,!1,!0):(te===Me&&re&384||!pe&&be&16)&&Q(Ce,X,ve),fe&&ee(D)}const Qt=at!=null&&Fe==null;($t&&(Tt=de&&de.onVnodeUnmounted)||dt||Qt)&&as(()=>{Tt&&Cr(Tt,X,D),dt&&cl(D,null,X,"unmounted"),Qt&&(D.el=null)},ve)},ee=D=>{const{type:X,el:ve,anchor:fe,transition:pe}=D;if(X===Me){se(ve,fe);return}if(X===Rc){b(D);return}const te=()=>{s(ve),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(D.shapeFlag&1&&pe&&!pe.persisted){const{leave:de,delayLeave:ye}=pe,Ce=()=>de(ve,te);ye?ye(D.el,te,Ce):Ce()}else te()},se=(D,X)=>{let ve;for(;D!==X;)ve=f(D),s(D),D=ve;s(X)},oe=(D,X,ve)=>{const{bum:fe,scope:pe,job:te,subTree:de,um:ye,m:Ce,a:me}=D;R4(Ce),R4(me),fe&&$c(fe),pe.stop(),te&&(te.flags|=8,G(de,D,X,ve)),ye&&as(ye,X),as(()=>{D.isUnmounted=!0},X)},Q=(D,X,ve,fe=!1,pe=!1,te=0)=>{for(let de=te;de{if(D.shapeFlag&6)return ge(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const X=f(D.anchor||D.el),ve=X&&X[OM];return ve?f(ve):X};let xe=!1;const Ke=(D,X,ve)=>{let fe;D==null?X._vnode&&(G(X._vnode,null,null,!0),fe=X._vnode.component):m(X._vnode||null,D,X,null,null,null,ve),X._vnode=D,xe||(xe=!0,Gw(fe),N4(),xe=!1)},et={p:m,um:G,m:W,r:ee,mt:H,mc:$,pc:j,pbc:E,n:ge,o:e};let Y,ne;return t&&([Y,ne]=t(et)),{render:Ke,hydrate:Y,createApp:aF(Ke,Y)}}function oh({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function z1({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function dA(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function cg(e,t,n=!1){const o=e.children,s=t.children;if(Xt(o)&&Xt(s))for(let r=0;r>1,e[n[l]]0&&(t[o]=n[r-1]),n[r]=o)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function fA(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:fA(t)}function R4(e){if(e)for(let t=0;te.__isSuspense;let n8=0;const SF={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,r,i,l,a,c){if(e==null)CF(t,n,o,s,r,i,l,a,c);else{if(r&&r.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}MF(e,t,n,o,s,i,l,a,c)}},hydrate:AF,normalize:TF},CWe=SF;function pd(e,t){const n=e.props&&e.props[t];wn(n)&&n()}function CF(e,t,n,o,s,r,i,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=hA(e,s,o,t,d,n,r,i,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,r,i),f.deps>0?(pd(e,"onPending"),pd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,r,i),Bc(f,e.ssFallback)):f.resolve(!1,!0)}function MF(e,t,n,o,s,r,i,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:k,isHydrating:x}=d;if(m)d.pendingBranch=f,Pi(m,f)?(a(m,f,d.hiddenContainer,null,s,d,r,i,l),d.deps<=0?d.resolve():k&&(x||(a(h,p,n,o,s,null,r,i,l),Bc(d,p)))):(d.pendingId=n8++,x?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),k?(a(null,f,d.hiddenContainer,null,s,d,r,i,l),d.deps<=0?d.resolve():(a(h,p,n,o,s,null,r,i,l),Bc(d,p))):h&&Pi(h,f)?(a(h,f,n,o,s,d,r,i,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,r,i,l),d.deps<=0&&d.resolve()));else if(h&&Pi(h,f))a(h,f,n,o,s,d,r,i,l),Bc(d,f);else if(pd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=n8++,a(null,f,d.hiddenContainer,null,s,d,r,i,l),d.deps<=0)d.resolve();else{const{timeout:w,pendingId:v}=d;w>0?setTimeout(()=>{d.pendingId===v&&d.fallback(p)},w):w===0&&d.fallback(p)}}function hA(e,t,n,o,s,r,i,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:k}}=c;let x;const w=EF(e);w&&t&&t.pendingBranch&&(x=t.pendingId,t.deps++);const v=e.props?A4(e.props.timeout):void 0,b=r,M={vnode:e,parent:t,parentComponent:n,namespace:i,container:o,hiddenContainer:s,deps:0,pendingId:n8++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(R=!1,z=!1){const{vnode:$,activeBranch:T,pendingBranch:E,pendingId:N,effects:C,parentComponent:O,container:H,isInFallback:V}=M;let A=!1;if(M.isHydrating)M.isHydrating=!1;else if(!R){A=T&&E.transition&&E.transition.mode==="out-in";let q=!1;A&&(T.transition.afterLeave=()=>{N===M.pendingId&&(f(E,H,r===b&&!q?h(T):r,0),$4(C),V&&$.ssFallback&&($.ssFallback.el=null))}),T&&!M.isFallbackMountPending&&(m(T.el)===H&&(r=h(T),q=!0),p(T,O,M,!0),!A&&V&&$.ssFallback&&as(()=>$.ssFallback.el=null,M)),A||f(E,H,r,0)}M.isFallbackMountPending=!1,Bc(M,E),M.pendingBranch=null,M.isInFallback=!1;let F=M.parent,j=!1;for(;F;){if(F.pendingBranch){F.effects.push(...C),j=!0;break}F=F.parent}!j&&!A&&$4(C),M.effects=[],w&&t&&t.pendingBranch&&x===t.pendingId&&(t.deps--,t.deps===0&&!z&&t.resolve()),pd($,"onResolve")},fallback(R){if(!M.pendingBranch)return;const{vnode:z,activeBranch:$,parentComponent:T,container:E,namespace:N}=M;pd(z,"onFallback");const C=h($),O=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,R,E,C,T,null,N,l,a),Bc(M,R))},H=R.transition&&R.transition.mode==="out-in";H&&(M.isFallbackMountPending=!0,$.transition.afterLeave=O),M.isInFallback=!0,p($,T,null,!0),H||O()},move(R,z,$){M.activeBranch&&f(M.activeBranch,R,z,$),M.container=R},next(){return M.activeBranch&&h(M.activeBranch)},registerDep(R,z,$){const T=!!M.pendingBranch;T&&M.deps++;const E=R.vnode.el;R.asyncDep.catch(N=>{fu(N,R,0)}).then(N=>{if(R.isUnmounted||M.isUnmounted||M.pendingId!==R.suspenseId)return;hd(),R.asyncResolved=!0;const{vnode:C}=R;o8(R,N,!1),E&&(C.el=E);const O=!E&&R.subTree.el;z(R,C,m(E||R.subTree.el),E?null:h(R.subTree),M,i,$),O&&(C.placeholder=null,k(O)),hp(R,C.el),T&&--M.deps===0&&M.resolve()})},unmount(R,z){M.isUnmounted=!0,M.activeBranch&&p(M.activeBranch,n,R,z),M.pendingBranch&&p(M.pendingBranch,n,R,z)}};return M}function AF(e,t,n,o,s,r,i,l,a){const c=t.suspense=hA(t,o,n,e.parentNode,document.createElement("div"),null,s,r,i,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,r,i);return c.deps===0&&c.resolve(!1,!0),u}function TF(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=cy(o?n.default:n),e.ssFallback=o?cy(n.fallback):Z(ds)}function cy(e){let t;if(wn(e)){const n=g0&&e._c;n&&(e._d=!1,g()),e=e(),n&&(e._d=!0,t=or,gA())}return Xt(e)&&(e=dF(e)),e=Ir(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function mA(e,t){t&&t.pendingBranch?Xt(e)?t.effects.push(...e):t.effects.push(e):$4(e)}function Bc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,hp(o,s))}function EF(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Me=Symbol.for("v-fgt"),Za=Symbol.for("v-txt"),ds=Symbol.for("v-cmt"),Rc=Symbol.for("v-stc"),O2=[];let or=null;function g(e=!1){O2.push(or=e?null:[])}function gA(){O2.pop(),or=O2[O2.length-1]||null}let g0=1;function j4(e,t=!1){g0+=e,e<0&&or&&t&&(or.hasOnce=!0)}function vA(e){return e.dynamicChildren=g0>0?or||Ic:null,gA(),g0>0&&or&&or.push(e),e}function S(e,t,n,o,s,r){return vA(_(e,t,n,o,s,r,!0))}function ce(e,t,n,o,s){return vA(Z(e,t,n,o,s,!0))}function n1(e){return e?e.__v_isVNode===!0:!1}function Pi(e,t){return e.type===t.type&&e.key===t.key}function MWe(e){}const wA=({key:e})=>e??null,X3=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bo(e)||rs(e)||wn(e)?{i:Ks,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,r=e===Me?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&wA(t),ref:t&&X3(t),scopeId:dp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ks};return l?(ug(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=bo(n)?8:16),g0>0&&!i&&or&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&or.push(a),a}const Z=IF;function IF(e,t=null,n=null,o=0,s=null,r=!1){if((!e||e===GM)&&(e=ds),n1(e)){const l=ea(e,t,!0);return n&&ug(l,n),g0>0&&!r&&or&&(l.shapeFlag&6?or[or.indexOf(e)]=l:or.push(l)),l.patchFlag=-2,l}if(BF(e)&&(e=e.__vccOpts),t){t=yA(t);let{class:l,style:a}=t;l&&!bo(l)&&(t.class=Be(l)),eo(a)&&(up(a)&&!Xt(a)&&(a=go({},a)),t.style=Wt(a))}const i=bo(e)?1:F4(e)?128:PM(e)?64:eo(e)?4:wn(e)?2:0;return _(e,t,n,o,s,i,r,!0)}function yA(e){return e?up(e)||sA(e)?go({},e):e:null}function ea(e,t,n=!1,o=!1){const{props:s,ref:r,patchFlag:i,children:l,transition:a}=e,c=t?Vn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&wA(c),ref:t&&t.ref?n&&r?Xt(r)?r.concat(X3(t)):[r,X3(t)]:X3(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Me?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ea(e.ssContent),ssFallback:e.ssFallback&&ea(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&t1(u,a.clone(u)),u}function He(e=" ",t=0){return Z(Za,null,e,t)}function P2(e,t){const n=Z(Rc,null,e);return n.staticCount=t,n}function J(e="",t=!1){return t?(g(),ce(ds,null,e)):Z(ds,null,e)}function Ir(e){return e==null||typeof e=="boolean"?Z(ds):Xt(e)?Z(Me,null,e.slice()):n1(e)?jl(e):Z(Za,null,String(e))}function jl(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ea(e)}function ug(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(Xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),ug(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!sA(t)?t._ctx=Ks:s===3&&Ks&&(Ks.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else wn(t)?(t={default:t,_ctx:Ks},n=32):(t=String(t),o&64?(n=16,t=[He(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vn(...e){const t={};for(let n=0;nZs||Ks;let O4,Fc;{const e=sp(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),r=>{s.length>1?s.forEach(i=>i(r)):s[0](r)}};O4=t("__VUE_INSTANCE_SETTERS__",n=>Zs=n),Fc=t("__VUE_SSR_SETTERS__",n=>v0=n)}const pu=e=>{const t=Zs;return O4(e),e.scope.on(),()=>{e.scope.off(),O4(t)}},hd=()=>{Zs&&Zs.scope.off(),O4(null)};function bA(e){return e.vnode.shapeFlag&4}let v0=!1;function _A(e,t=!1,n=!1){t&&Fc(t);const{props:o,children:s}=e.vnode,r=bA(e);mF(e,o,r,t),yF(e,s,n||t);const i=r?NF(e,t):void 0;return t&&Fc(!1),i}function NF(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Jm);const{setup:o}=n;if(o){Xl();const s=e.setupContext=o.length>1?SA(e):null,r=pu(e),i=Wd(o,e,0,[e.props,s]),l=K7(i);if(Jl(),r(),(l||e.sp)&&!Gl(e)&&tg(e),l){if(i.then(hd,hd),t)return i.then(a=>{o8(e,a,t)}).catch(a=>{fu(a,e,0)});e.asyncDep=i}else o8(e,i,t)}else xA(e,t)}function o8(e,t,n){wn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:eo(t)&&(e.setupState=IM(t)),xA(e,n)}let P4,s8;function AWe(e){P4=e,s8=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tF))}}const TWe=()=>!P4;function xA(e,t,n){const o=e.type;if(!e.render){if(!t&&P4&&!o.render){const s=o.template||ig(e).template;if(s){const{isCustomElement:r,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=go(go({isCustomElement:r,delimiters:l},i),a);o.render=P4(s,c)}}e.render=o.render||ki,s8&&s8(e)}{const s=pu(e);Xl();try{nF(e)}finally{Jl(),s()}}}const zF={get(e,t){return tr(e,"get",""),e[t]}};function SA(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,zF),slots:e.slots,emit:e.emit,expose:t}}function Kd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(IM(Nt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in j2)return j2[n](e)},has(t,n){return n in t||n in j2}})):e.proxy}function r8(e,t=!0){return wn(e)?e.displayName||e.name:e.name||t&&e.__name}function BF(e){return wn(e)&&"__vccOpts"in e}const B=(e,t)=>kR(e,t,v0);function hn(e,t,n){try{j4(-1);const o=arguments.length;return o===2?eo(t)&&!Xt(t)?n1(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&n1(n)&&(n=[n]),Z(e,t,n))}finally{j4(1)}}function EWe(){}function IWe(e,t,n,o){const s=n[o];if(s&&RF(s,e))return s;const r=t();return r.memo=e.slice(),r.cacheIndex=o,n[o]=r}function RF(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o0&&or&&or.push(e),!0}const FF="3.5.35",LWe=ki,$We=CR,NWe=fc,zWe=RM,jF={createComponentInstance:kA,setupComponent:_A,renderComponentRoot:Y3,setCurrentRenderingInstance:cd,isVNode:n1,normalizeVNode:Ir,getComponentPublicInstance:Kd,ensureValidVNode:rg,pushWarningContext:xR,popWarningContext:SR},BWe=jF,RWe=null,FWe=null,jWe=null;/** +**/const BM=[];function AR(e){BM.push(e)}function ER(){BM.pop()}function dWe(e,t){}const fWe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},TR={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function qd(e,t,n,o){try{return o?e(...o):e()}catch(s){pu(s,t,n)}}function _r(e,t,n,o){if(wn(e)){const s=qd(e,t,n,o);return s&&G7(s)&&s.catch(i=>{pu(i,t,n)}),s}if(Xt(e)){const s=[];for(let i=0;i>>1,s=di[o],i=cd(s);i=cd(n)?di.push(e):di.splice(LR(t),0,e),e.flags|=1,FM()}}function FM(){$4||($4=RM.then(jM))}function N4(e){Xt(e)?zc.push(...e):Ba&&e.id===-1?Ba.splice(fc+1,0,e):e.flags&1||(zc.push(e),e.flags|=1),FM()}function Yw(e,t,n=al+1){for(;ncd(n)-cd(o));if(zc.length=0,Ba){Ba.push(...t);return}for(Ba=t,fc=0;fce.id==null?e.flags&2?-1:1/0:e.id;function jM(e){try{for(al=0;alpc.emit(s,...i)),Kf=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{OM(i,t)}),setTimeout(()=>{pc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Kf=[])},3e3)):Kf=[]}let Ks=null,fp=null;function ud(e){const t=Ks;return Ks=e,fp=e&&e.type.__scopeId||null,t}function pWe(e){fp=e}function hWe(){fp=null}const mWe=e=>ue;function ue(e,t=Ks,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&O4(-1);const i=ud(t);let r;try{r=e(...s)}finally{ud(i),o._d&&O4(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Zn(e,t){if(Ks===null)return e;const n=Gd(Ks),o=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&wn(t)?t.call(o&&o.proxy):t}}function gWe(){return!!(gs()||u0)}const $R=Symbol.for("v-scx"),NR=()=>pn($R);function PM(e,t){return Ud(e,null,t)}function vWe(e,t){return Ud(e,null,{flush:"post"})}function zR(e,t){return Ud(e,null,{flush:"sync"})}function Ue(e,t,n){return Ud(e,t,n)}function Ud(e,t,n=On){const{immediate:o,deep:s,flush:i,once:r}=n,l=go({},n),a=t&&o||!t&&i!=="post";let c;if(v0){if(i==="sync"){const p=NR();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=kr,p.resume=kr,p.pause=kr,p}}const u=Zs;l.call=(p,h,m)=>_r(p,u,h,m);let d=!1;i==="post"?l.scheduler=p=>{as(p,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():eg(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=MR(e,t,l);return v0&&(c?c.push(f):a&&f()),f}function BR(e,t,n){const o=this.proxy,s=bo(e)?e.includes(".")?HM(o,e):()=>o[e]:e.bind(o,o);let i;wn(t)?i=t:(i=t.handler,n=t);const r=hu(this),l=Ud(s,i.bind(o),n);return r(),l}function HM(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;se.__isTeleport,K1=e=>e&&(e.disabled||e.disabled===""),RR=e=>e&&(e.defer||e.defer===""),Xw=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Jw=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ym=(e,t)=>{const n=e&&e.to;return bo(n)?t?t(n):null:n},FR={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:k,parentNode:x}}=c,v=K1(t.props);let{dynamicChildren:w}=t;const b=(z,$,E)=>{z.shapeFlag&16&&u(z.children,$,E,s,i,r,l,a)},M=(z=t)=>{const $=K1(z.props),E=z.target=Ym(z.props,h),T=Xm(E,z,m,p);E&&(r!=="svg"&&Xw(E)?r="svg":r!=="mathml"&&Jw(E)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(E),$||(b(z,E,T),k2(z,!1)))},R=z=>{const $=()=>{if(Ia.get(z)===$){if(Ia.delete(z),K1(z.props)){const E=x(z.el)||n;b(z,E,z.anchor),k2(z,!0)}M(z)}};Ia.set(z,$),as($,i)};if(e==null){const z=t.el=m(""),$=t.anchor=m("");if(p(z,n,o),p($,n,o),RR(t.props)||i&&i.pendingBranch){R(t);return}v&&(b(t,n,$),k2(t,!0)),M()}else{t.el=e.el;const z=t.anchor=e.anchor,$=Ia.get(e);if($){$.flags|=8,Ia.delete(e),R(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,T=t.targetAnchor=e.targetAnchor,N=K1(e.props),C=N?n:E,O=N?z:T;if(r==="svg"||Xw(E)?r="svg":(r==="mathml"||Jw(E))&&(r="mathml"),w?(f(e.dynamicChildren,w,C,s,i,r,l),ug(e,t,!0)):a||d(e,t,C,O,s,i,r,l,!1),v)N?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Gf(t,n,z,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const H=t.target=Ym(t.props,h);H&&Gf(t,H,null,c,0)}else N&&Gf(t,E,T,c,1);k2(t,v)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,p=i||!K1(f),h=Ia.get(e);if(h&&(h.flags|=8,Ia.delete(e)),d&&(s(c),s(u)),i&&s(a),!h&&r&16)for(let m=0;m{e.isMounted=!0}),vo(()=>{e.isUnmounting=!0}),e}const rr=[Function,Array],qM={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:rr,onEnter:rr,onAfterEnter:rr,onEnterCancelled:rr,onBeforeLeave:rr,onLeave:rr,onAfterLeave:rr,onLeaveCancelled:rr,onBeforeAppear:rr,onAppear:rr,onAfterAppear:rr,onAppearCancelled:rr},UM=e=>{const t=e.subTree;return t.component?UM(t.component):t},OR={name:"BaseTransition",props:qM,setup(e,{slots:t}){const n=gs(),o=WM();return()=>{const s=t.default&&tg(t.default(),!0),i=s&&s.length?ZM(s):n.subTree?J():void 0;if(!i)return;const r=Dn(e),{mode:l}=r;if(o.isLeaving)return th(i);const a=Qw(i);if(!a)return th(i);let c=dd(a,r,o,n,d=>c=d);a.type!==ds&&t1(a,c);let u=n.subTree&&Qw(n.subTree);if(u&&u.type!==ds&&!Pr(u,a)&&UM(n).type!==ds){let d=dd(u,r,o,n);if(t1(u,d),l==="out-in"&&a.type!==ds)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},th(i);l==="in-out"&&a.type!==ds?d.delayLeave=(f,p,h)=>{const m=KM(o,u);m[String(u.key)]=u,f[fr]=()=>{p(),f[fr]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function ZM(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ds){t=n;break}}return t}const PR=OR;function KM(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function dd(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:k,onAppear:x,onAfterAppear:v,onAppearCancelled:w}=t,b=String(e.key),M=KM(n,e),R=(E,T)=>{E&&_r(E,o,9,T)},z=(E,T)=>{const N=T[1];R(E,T),Xt(E)?E.every(C=>C.length<=1)&&N():E.length<=1&&N()},$={mode:r,persisted:l,beforeEnter(E){let T=a;if(!n.isMounted)if(i)T=k||a;else return;E[fr]&&E[fr](!0);const N=M[b];N&&Pr(e,N)&&N.el[fr]&&N.el[fr](),R(T,[E])},enter(E){if(M[b]===e)return;let T=c,N=u,C=d;if(!n.isMounted)if(i)T=x||c,N=v||u,C=w||d;else return;let O=!1;E[Ju]=V=>{O||(O=!0,V?R(C,[E]):R(N,[E]),$.delayedLeave&&$.delayedLeave(),E[Ju]=void 0)};const H=E[Ju].bind(null,!1);T?z(T,[E,H]):H()},leave(E,T){const N=String(e.key);if(E[Ju]&&E[Ju](!0),n.isUnmounting)return T();R(f,[E]);let C=!1;E[fr]=H=>{C||(C=!0,T(),H?R(m,[E]):R(h,[E]),E[fr]=void 0,M[N]===e&&delete M[N])};const O=E[fr].bind(null,!1);M[N]=e,p?z(p,[E,O]):O()},clone(E){const T=dd(E,t,n,o,s);return s&&s(T),T}};return $}function th(e){if(Zd(e))return e=ea(e),e.children=null,e}function Qw(e){if(!Zd(e))return VM(e.type)&&e.children?ZM(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&wn(n.default))return n.default()}}function t1(e,t){e.shapeFlag&6&&e.component?(e.transition=t,t1(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function tg(e,t=!1,n){let o=[],s=0;for(let i=0;i1)for(let i=0;in.value,set:i=>n.value=i})}return n}function ey(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const B4=new WeakMap;function Bc(e,t,n,o,s=!1){if(Xt(e)){e.forEach((m,k)=>Bc(m,t&&(Xt(t)?t[k]:t),n,o,s));return}if(Gl(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Bc(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Gd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===On?l.refs={}:l.refs,d=l.setupState,f=Dn(d),p=d===On?uM:m=>ey(u,m)?!1:Qn(f,m),h=(m,k)=>!(k&&ey(u,k));if(c!=null&&c!==a){if(ty(t),bo(c))u[c]=null,p(c)&&(d[c]=null);else if(is(c)){const m=t;h(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(wn(a))qd(a,l,12,[r,u]);else{const m=bo(a),k=is(a);if(m||k){const x=()=>{if(e.f){const v=m?p(a)?d[a]:u[a]:h()||!e.k?a.value:u[e.k];if(s)Xt(v)&&K7(v,i);else if(Xt(v))v.includes(i)||v.push(i);else if(m)u[a]=[i],p(a)&&(d[a]=u[a]);else{const w=[i];h(a,e.k)&&(a.value=w),e.k&&(u[e.k]=w)}}else m?(u[a]=r,p(a)&&(d[a]=r)):k&&(h(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const v=()=>{x(),B4.delete(e)};v.id=-1,B4.set(e,v),as(v,n)}else ty(e),x()}}}function ty(e){const t=B4.get(e);t&&(t.flags|=8,B4.delete(e))}let ny=!1;const J0=()=>{ny||(console.error("Hydration completed but contains mismatches."),ny=!0)},HR=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",DR=e=>e.namespaceURI.includes("MathML"),Yf=e=>{if(e.nodeType===1){if(HR(e))return"svg";if(DR(e))return"mathml"}},bc=e=>e.nodeType===8;function VR(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(w,b)=>{if(!b.hasChildNodes()){n(null,w,b),z4(),b._vnode=w;return}d(b.firstChild,w,null,null,null),z4(),b._vnode=w},d=(w,b,M,R,z,$=!1)=>{$=$||!!b.dynamicChildren;const E=bc(w)&&w.data==="[",T=()=>m(w,b,M,R,z,E),{type:N,ref:C,shapeFlag:O,patchFlag:H}=b;let V=w.nodeType;b.el=w,H===-2&&($=!1,b.dynamicChildren=null);let A=null;switch(N){case Za:V!==3?b.children===""?(a(b.el=s(""),r(w),w),A=w):A=T():(w.data!==b.children&&(J0(),w.data=b.children),A=i(w));break;case ds:v(w)?(A=i(w),x(b.el=w.content.firstChild,w,M)):V!==8||E?A=T():A=i(w);break;case Fc:if(E&&(w=i(w),V=w.nodeType),V===1||V===3){A=w;const F=!b.children.length;for(let j=0;j{$=$||!!b.dynamicChildren;const{type:E,props:T,patchFlag:N,shapeFlag:C,dirs:O,transition:H}=b,V=E==="input"||E==="option";if(V||N!==-1){O&&cl(b,null,M,"created");let A=!1;if(v(w)){A=hA(null,H)&&M&&M.vnode.props&&M.vnode.props.appear;const j=w.content.firstChild;if(A){const q=j.getAttribute("class");q&&(j.$cls=q),H.beforeEnter(j)}x(j,w,M),b.el=w=j}if(C&16&&!(T&&(T.innerHTML||T.textContent))){let j=p(w.firstChild,b,w,M,R,z,$);for(j&&!Xf(w,1)&&J0();j;){const q=j;j=j.nextSibling,l(q)}}else if(C&8){let j=b.children;j[0]===` +`&&(w.tagName==="PRE"||w.tagName==="TEXTAREA")&&(j=j.slice(1));const{textContent:q}=w;q!==j&&q!==j.replace(/\r\n|\r/g,` +`)&&(Xf(w,0)||J0(),w.textContent=b.children)}if(T){if(V||!$||N&48){const j=w.tagName.includes("-");for(const q in T)(V&&(q.endsWith("value")||q==="indeterminate")||Wd(q)&&!a0(q)||q[0]==="."||j&&!a0(q))&&o(w,q,null,T[q],void 0,M)}else if(T.onClick)o(w,"onClick",null,T.onClick,void 0,M);else if(N&4&&Ua(T.style))for(const j in T.style)T.style[j]}let F;(F=T&&T.onVnodeBeforeMount)&&Ci(F,M,b),O&&cl(b,null,M,"beforeMount"),((F=T&&T.onVnodeMounted)||O||A)&&wA(()=>{F&&Ci(F,M,b),A&&H.enter(w),O&&cl(b,null,M,"mounted")},R)}return w.nextSibling},p=(w,b,M,R,z,$,E)=>{E=E||!!b.dynamicChildren;const T=b.children,N=T.length;let C=!1;for(let O=0;O{const{slotScopeIds:E}=b;E&&(z=z?z.concat(E):E);const T=r(w),N=p(i(w),b,T,M,R,z,$);return N&&bc(N)&&N.data==="]"?i(b.anchor=N):(J0(),a(b.anchor=c("]"),T,N),N)},m=(w,b,M,R,z,$)=>{if(Xf(w.parentElement,1)||J0(),b.el=null,$){const N=k(w);for(;;){const C=i(w);if(C&&C!==N)l(C);else break}}const E=i(w),T=r(w);return l(w),n(null,b,T,E,M,R,Yf(T),z),M&&(M.vnode.el=b.el,mp(M,b.el)),E},k=(w,b="[",M="]")=>{let R=0;for(;w;)if(w=i(w),w&&bc(w)&&(w.data===b&&R++,w.data===M)){if(R===0)return i(w);R--}return w},x=(w,b,M)=>{const R=b.parentNode;R&&R.replaceChild(w,b);let z=M;for(;z;)z.vnode.el===b&&(z.vnode.el=z.subTree.el=w),z=z.parent},v=w=>w.nodeType===1&&w.tagName==="TEMPLATE";return[u,d]}const oy="data-allow-mismatch",WR={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Xf(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(oy);)e=e.parentElement;const n=e&&e.getAttribute(oy);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(WR[t])}}const qR=ip().requestIdleCallback||(e=>setTimeout(e,1)),UR=ip().cancelIdleCallback||(e=>clearTimeout(e)),yWe=(e=1e4)=>t=>{const n=qR(t,{timeout:e});return()=>UR(n)};function ZR(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t0&&o0&&n0&&s(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(ZR(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},bWe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},_We=(e=[])=>(t,n)=>{bo(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function KR(e,t){if(bc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(bc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Gl=e=>!!e.type.__asyncLoader;function mr(e){wn(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((k,x)=>{a(m,()=>k(f()),()=>x(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Ge({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,k){let x=!1;(m.bu||(m.bu=[])).push(()=>x=!0);const v=()=>{x||k()},w=i?()=>{const b=i(v,M=>KR(h,M));b&&(m.bum||(m.bum=[])).push(b)}:v;u?w():p().then(()=>!m.isUnmounted&&w())},get __asyncResolved(){return u},setup(){const h=Zs;if(ng(h),u)return()=>Jf(u,h);const m=w=>{c=null,pu(w,h,13,!o)};if(l&&h.suspense||v0)return p().then(w=>()=>Jf(w,h)).catch(w=>(m(w),()=>o?Z(o,{error:w}):null));const k=U(!1),x=U(),v=U(!!s);return s&&setTimeout(()=>{v.value=!1},s),r!=null&&setTimeout(()=>{if(!k.value&&!x.value){const w=new Error(`Async component timed out after ${r}ms.`);m(w),x.value=w}},r),p().then(()=>{k.value=!0,h.parent&&Zd(h.parent.vnode)&&h.parent.update()}).catch(w=>{m(w),x.value=w}),()=>{if(k.value&&u)return Jf(u,h);if(x.value&&o)return Z(o,{error:x.value});if(n&&!v.value)return Jf(n,h)}}})}function Jf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=Z(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const Zd=e=>e.type.__isKeepAlive,GR={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=gs(),o=n.ctx;if(!o.renderer)return()=>{const v=t.default&&t.default();return v&&v.length===1?v[0]:v};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(v,w,b,M,R)=>{const z=v.component;c(v,w,b,0,l),a(z.vnode,v,w,b,z,l,M,v.slotScopeIds,R),as(()=>{z.isDeactivated=!1,z.a&&Nc(z.a);const $=v.props&&v.props.onVnodeMounted;$&&Ci($,z.parent,v)},l)},o.deactivate=v=>{const w=v.component;F4(w.m),F4(w.a),c(v,f,null,1,l),as(()=>{w.da&&Nc(w.da);const b=v.props&&v.props.onVnodeUnmounted;b&&Ci(b,w.parent,v),w.isDeactivated=!0},l)};function p(v){nh(v),u(v,n,l,!0)}function h(v){s.forEach((w,b)=>{const M=r8(Gl(w)?w.type.__asyncResolved||{}:w.type);M&&!v(M)&&m(b)})}function m(v){const w=s.get(v);w&&(!r||!Pr(w,r))?p(w):r&&nh(r),s.delete(v),i.delete(v)}Ue(()=>[e.include,e.exclude],([v,w])=>{v&&h(b=>b2(v,b)),w&&h(b=>!b2(w,b))},{flush:"post",deep:!0});let k=null;const x=()=>{k!=null&&(j4(n.subTree.type)?as(()=>{s.set(k,Qf(n.subTree))},n.subTree.suspense):s.set(k,Qf(n.subTree)))};return xn(x),og(x),vo(()=>{s.forEach(v=>{const{subTree:w,suspense:b}=n,M=Qf(w);if(v.type===M.type&&v.key===M.key){nh(M);const R=M.component.da;R&&as(R,b);return}p(v)})}),()=>{if(k=null,!t.default)return r=null;const v=t.default(),w=v[0];if(v.length>1)return r=null,v;if(!n1(w)||!(w.shapeFlag&4)&&!(w.shapeFlag&128))return r=null,w;let b=Qf(w);if(b.type===ds)return r=null,b;const M=b.type,R=r8(Gl(b)?b.type.__asyncResolved||{}:M),{include:z,exclude:$,max:E}=e;if(z&&(!R||!b2(z,R))||$&&R&&b2($,R))return b.shapeFlag&=-257,r=b,w;const T=b.key==null?M:b.key,N=s.get(T);return b.el&&(b=ea(b),w.shapeFlag&128&&(w.ssContent=b)),k=T,N?(b.el=N.el,b.component=N.component,b.transition&&t1(b,b.transition),b.shapeFlag|=512,i.delete(T),i.add(T)):(i.add(T),E&&i.size>parseInt(E,10)&&m(i.values().next().value)),b.shapeFlag|=256,r=b,j4(w.type)?w:b}}},xWe=GR;function b2(e,t){return Xt(e)?e.some(n=>b2(n,t)):bo(e)?e.split(",").includes(t):BB(e)?(e.lastIndex=0,e.test(t)):!1}function YR(e,t){GM(e,"a",t)}function XR(e,t){GM(e,"da",t)}function GM(e,t,n=Zs){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(pp(t,o,n),n){let s=n.parent;for(;s&&s.parent;)Zd(s.parent.vnode)&&JR(o,t,n,s),s=s.parent}}function JR(e,t,n,o){const s=pp(t,e,o,!0);An(()=>{K7(o[t],s)},n)}function nh(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Qf(e){return e.shapeFlag&128?e.ssContent:e}function pp(e,t,n=Zs,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Xl();const l=hu(n),a=_r(t,n,e,r);return l(),Jl(),a});return o?s.unshift(i):s.push(i),i}}const aa=e=>(t,n=Zs)=>{(!v0||e==="sp")&&pp(e,(...o)=>t(...o),n)},QR=aa("bm"),xn=aa("m"),YM=aa("bu"),og=aa("u"),vo=aa("bum"),An=aa("um"),eF=aa("sp"),tF=aa("rtg"),nF=aa("rtc");function oF(e,t=Zs){pp("ec",e,t)}const sg="components",sF="directives";function XM(e,t){return ig(sg,e,!0,t)||e}const JM=Symbol.for("v-ndc");function ns(e){return bo(e)?ig(sg,e,!1)||e:e||JM}function SWe(e){return ig(sF,e)}function ig(e,t,n=!0,o=!1){const s=Ks||Zs;if(s){const i=s.type;if(e===sg){const l=r8(i,!1);if(l&&(l===t||l===Ms(t)||l===op(Ms(t))))return i}const r=sy(s[e]||i[e],t)||sy(s.appContext[e],t);return!r&&o?i:r}}function sy(e,t){return e&&(e[t]||e[Ms(t)]||e[op(Ms(t))])}function it(e,t,n,o){let s;const i=n&&n[o],r=Xt(e);if(r||bo(e)){const l=r&&Ua(e);let a=!1,c=!1;l&&(a=!Zi(e),c=Ql(e),e=ap(e)),s=new Array(e.length);for(let u=0,d=e.length;ut(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function En(e,t,n={},o,s){if(Ks.ce||Ks.parent&&Gl(Ks.parent)&&Ks.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),g(),ce(Me,null,[Z("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),g();const r=i&&rg(i(n)),l=n.key||r&&r.key,a=ce(Me,{key:(l&&!Qi(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function rg(e){return e.some(t=>n1(t)?!(t.type===ds||t.type===Me&&!rg(t.children)):!0)?e:null}function CWe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:G3(o)]=e[o];return n}const Jm=e=>e?SA(e)?Gd(e):Jm(e.parent):null,O2=go(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Jm(e.parent),$root:e=>Jm(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lg(e),$forceUpdate:e=>e.f||(e.f=()=>{eg(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>BR.bind(e)}),oh=(e,t)=>e!==On&&!e.__isScriptSetup&&Qn(e,t),Qm={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(oh(o,t))return r[t]=1,o[t];if(s!==On&&Qn(s,t))return r[t]=2,s[t];if(Qn(i,t))return r[t]=3,i[t];if(n!==On&&Qn(n,t))return r[t]=4,n[t];e8&&(r[t]=0)}}const c=O2[t];let u,d;if(c)return t==="$attrs"&&ti(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==On&&Qn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Qn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return oh(s,t)?(s[t]=n,!0):o!==On&&Qn(o,t)?(o[t]=n,!0):Qn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==On&&l[0]!=="$"&&Qn(e,l)||oh(t,l)||Qn(i,l)||Qn(o,l)||Qn(O2,l)||Qn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Qn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},iF=go({},Qm,{get(e,t){if(t!==Symbol.unscopables)return Qm.get(e,t,e)},has(e,t){return t[0]!=="_"&&!PB(t)}});function MWe(){return null}function AWe(){return null}function EWe(e){}function TWe(e){}function IWe(){return null}function LWe(){}function $We(e,t){return null}function NWe(){return QM().slots}function Kd(){return QM().attrs}function QM(e){const t=gs();return t.setupContext||(t.setupContext=AA(t))}function pd(e){return Xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function zWe(e,t){const n=pd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?Xt(s)||wn(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function BWe(e,t){return!e||!t?e||t:Xt(e)&&Xt(t)?e.concat(t):go({},pd(e),pd(t))}function RWe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function FWe(e){const t=gs(),n=v0;let o=e();md(),n&&jc(!1);const s=()=>{hu(t),n&&jc(!0)},i=()=>{gs()!==t&&t.scope.off(),md(),n&&jc(!1)};return G7(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let e8=!0;function rF(e){const t=lg(e),n=e.proxy,o=e.ctx;e8=!1,t.beforeCreate&&iy(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:k,beforeDestroy:x,beforeUnmount:v,destroyed:w,unmounted:b,render:M,renderTracked:R,renderTriggered:z,errorCaptured:$,serverPrefetch:E,expose:T,inheritAttrs:N,components:C,directives:O,filters:H}=t;if(c&&lF(c,o,null),r)for(const F in r){const j=r[F];wn(j)&&(o[F]=j.bind(n))}if(s){const F=s.call(n,n);eo(F)&&(e.data=Rs(F))}if(e8=!0,i)for(const F in i){const j=i[F],q=wn(j)?j.bind(n,n):wn(j.get)?j.get.bind(n,n):kr,P=!wn(j)&&wn(j.set)?j.set.bind(n):kr,W=B({get:q,set:P});Object.defineProperty(o,F,{enumerable:!0,configurable:!0,get:()=>W.value,set:G=>W.value=G})}if(l)for(const F in l)eA(l[F],o,n,F);if(a){const F=wn(a)?a.call(n):a;Reflect.ownKeys(F).forEach(j=>{jn(j,F[j])})}u&&iy(u,e,"c");function A(F,j){Xt(j)?j.forEach(q=>F(q.bind(n))):j&&F(j.bind(n))}if(A(QR,d),A(xn,f),A(YM,p),A(og,h),A(YR,m),A(XR,k),A(oF,$),A(nF,R),A(tF,z),A(vo,v),A(An,b),A(eF,E),Xt(T))if(T.length){const F=e.exposed||(e.exposed={});T.forEach(j=>{Object.defineProperty(F,j,{get:()=>n[j],set:q=>n[j]=q,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===kr&&(e.render=M),N!=null&&(e.inheritAttrs=N),C&&(e.components=C),O&&(e.directives=O),E&&ng(e)}function lF(e,t,n=kr){Xt(e)&&(e=t8(e));for(const o in e){const s=e[o];let i;eo(s)?"default"in s?i=pn(s.from||o,s.default,!0):i=pn(s.from||o):i=pn(s),is(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function iy(e,t,n){_r(Xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function eA(e,t,n,o){let s=o.includes(".")?HM(n,o):()=>n[o];if(bo(e)){const i=t[e];wn(i)&&Ue(s,i)}else if(wn(e))Ue(s,e.bind(n));else if(eo(e))if(Xt(e))e.forEach(i=>eA(i,t,n,o));else{const i=wn(e.handler)?e.handler.bind(n):t[e.handler];wn(i)&&Ue(s,i,e)}}function lg(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>R4(a,c,r,!0)),R4(a,t,r)),eo(t)&&i.set(t,a),a}function R4(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&R4(e,i,n,!0),s&&s.forEach(r=>R4(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=aF[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const aF={data:ry,props:ly,emits:ly,methods:_2,computed:_2,beforeCreate:li,created:li,beforeMount:li,mounted:li,beforeUpdate:li,updated:li,beforeDestroy:li,beforeUnmount:li,destroyed:li,unmounted:li,activated:li,deactivated:li,errorCaptured:li,serverPrefetch:li,components:_2,directives:_2,watch:uF,provide:ry,inject:cF};function ry(e,t){return t?e?function(){return go(wn(e)?e.call(this,this):e,wn(t)?t.call(this,this):t)}:t:e}function cF(e,t){return _2(t8(e),t8(t))}function t8(e){if(Xt(e)){const t={};for(let n=0;n{let u,d=On,f;return zR(()=>{const p=e[s];Us(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Us(h,u)&&!(d!==On&&Us(p,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=p,c()),o.emit(`update:${t}`,h),Us(p,h)&&Us(p,d)&&!Us(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||On:l,done:!1}:{done:!0}}}},l}const nA=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ms(t)}Modifiers`]||e[`${Li(t)}Modifiers`];function pF(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||On;let s=n;const i=t.startsWith("update:"),r=i&&nA(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>bo(u)?u.trim():u)),r.number&&(s=n.map(sp)));let l,a=o[l=G3(t)]||o[l=G3(Ms(t))];!a&&i&&(a=o[l=G3(Li(t))]),a&&_r(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,_r(c,e,6,s)}}const hF=new WeakMap;function oA(e,t,n=!1){const o=n?hF:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!wn(e)){const a=c=>{const u=oA(c,t,!0);u&&(l=!0,go(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(eo(e)&&o.set(e,null),null):(Xt(i)?i.forEach(a=>r[a]=null):go(r,i),eo(e)&&o.set(e,r),r)}function hp(e,t){return!e||!Wd(t)?!1:(t=t.slice(2).replace(/Once$/,""),Qn(e,t[0].toLowerCase()+t.slice(1))||Qn(e,Li(t))||Qn(e,t))}function X3(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=e,k=ud(e);let x,v;try{if(n.shapeFlag&4){const b=s||o,M=b;x=Ii(c.call(M,b,u,d,p,f,h)),v=l}else{const b=t;x=Ii(b.length>1?b(d,{attrs:l,slots:r,emit:a}):b(d,null)),v=t.props?l:gF(l)}}catch(b){P2.length=0,pu(b,e,1),x=Z(ds)}let w=x;if(v&&m!==!1){const b=Object.keys(v),{shapeFlag:M}=w;b.length&&M&7&&(i&&b.some(Q5)&&(v=vF(v,i)),w=ea(w,v,!1,!0))}return n.dirs&&(w=ea(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&t1(w,n.transition),x=w,ud(k),x}function mF(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||Wd(n))&&((t||(t={}))[n]=e[n]);return t},vF=(e,t)=>{const n={};for(const o in e)(!Q5(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function wF(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?ay(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;dObject.create(iA),lA=e=>Object.getPrototypeOf(e)===iA;function yF(e,t,n,o=!1){const s={},i=rA();e.propsDefaults=Object.create(null),aA(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:mR(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function kF(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=Dn(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[f,p]=cA(d,t,!0);go(r,f),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return eo(e)&&o.set(e,Lc),Lc;if(Xt(i))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",cg=e=>Xt(e)?e.map(Ii):[Ii(e)],_F=(e,t,n)=>{if(t._n)return t;const o=ue((...s)=>cg(t(...s)),n);return o._c=!1,o},uA=(e,t,n)=>{const o=e._ctx;for(const s in e){if(ag(s))continue;const i=e[s];if(wn(i))t[s]=_F(s,i,o);else if(i!=null){const r=cg(i);t[s]=()=>r}}},dA=(e,t)=>{const n=cg(t);e.slots.default=()=>n},fA=(e,t,n)=>{for(const o in t)(n||!ag(o))&&(e[o]=t[o])},xF=(e,t,n)=>{const o=e.slots=rA();if(e.vnode.shapeFlag&32){const s=t._;s?(fA(o,t,n),n&&fM(o,"_",s,!0)):uA(t,o)}else t&&dA(e,t)},SF=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=On;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:fA(s,t,n):(i=!t.$stable,uA(t,s)),r=t}else t&&(dA(e,t),r={default:1});if(i)for(const l in s)!ag(l)&&r[l]==null&&delete s[l]},as=wA;function CF(e){return pA(e)}function MF(e){return pA(e,VR)}function pA(e,t){const n=ip();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=kr,insertStaticContent:h}=e,m=(D,X,ve,fe=null,pe=null,te=null,de=void 0,ye=null,Ce=!!X.dynamicChildren)=>{if(D===X)return;D&&!Pr(D,X)&&(fe=ge(D),G(D,pe,te,!0),D=null),X.patchFlag===-2&&(Ce=!1,X.dynamicChildren=null);const{type:me,ref:be,shapeFlag:ie}=X;switch(me){case Za:k(D,X,ve,fe);break;case ds:x(D,X,ve,fe);break;case Fc:D==null&&v(X,ve,fe,de);break;case Me:C(D,X,ve,fe,pe,te,de,ye,Ce);break;default:ie&1?M(D,X,ve,fe,pe,te,de,ye,Ce):ie&6?O(D,X,ve,fe,pe,te,de,ye,Ce):(ie&64||ie&128)&&me.process(D,X,ve,fe,pe,te,de,ye,Ce,et)}be!=null&&pe?Bc(be,D&&D.ref,te,X||D,!X):be==null&&D&&D.ref!=null&&Bc(D.ref,null,te,D,!0)},k=(D,X,ve,fe)=>{if(D==null)o(X.el=l(X.children),ve,fe);else{const pe=X.el=D.el;X.children!==D.children&&c(pe,X.children)}},x=(D,X,ve,fe)=>{D==null?o(X.el=a(X.children||""),ve,fe):X.el=D.el},v=(D,X,ve,fe)=>{[D.el,D.anchor]=h(D.children,X,ve,fe,D.el,D.anchor)},w=({el:D,anchor:X},ve,fe)=>{let pe;for(;D&&D!==X;)pe=f(D),o(D,ve,fe),D=pe;o(X,ve,fe)},b=({el:D,anchor:X})=>{let ve;for(;D&&D!==X;)ve=f(D),s(D),D=ve;s(X)},M=(D,X,ve,fe,pe,te,de,ye,Ce)=>{if(X.type==="svg"?de="svg":X.type==="math"&&(de="mathml"),D==null)R(X,ve,fe,pe,te,de,ye,Ce);else{const me=D.el&&D.el._isVueCE?D.el:null;try{me&&me._beginPatch(),E(D,X,pe,te,de,ye,Ce)}finally{me&&me._endPatch()}}},R=(D,X,ve,fe,pe,te,de,ye)=>{let Ce,me;const{props:be,shapeFlag:ie,transition:ke,dirs:Fe}=D;if(Ce=D.el=r(D.type,te,be&&be.is,be),ie&8?u(Ce,D.children):ie&16&&$(D.children,Ce,null,fe,pe,sh(D,te),de,ye),Fe&&cl(D,null,fe,"created"),z(Ce,D,D.scopeId,de,fe),be){for(const dt in be)dt!=="value"&&!a0(dt)&&i(Ce,dt,null,be[dt],te,fe);"value"in be&&i(Ce,"value",null,be.value,te),(me=be.onVnodeBeforeMount)&&Ci(me,fe,D)}Fe&&cl(D,null,fe,"beforeMount");const at=hA(pe,ke);at&&ke.beforeEnter(Ce),o(Ce,X,ve),((me=be&&be.onVnodeMounted)||at||Fe)&&as(()=>{try{me&&Ci(me,fe,D),at&&ke.enter(Ce),Fe&&cl(D,null,fe,"mounted")}finally{}},pe)},z=(D,X,ve,fe,pe)=>{if(ve&&p(D,ve),fe)for(let te=0;te{for(let me=Ce;me{const ye=X.el=D.el;let{patchFlag:Ce,dynamicChildren:me,dirs:be}=X;Ce|=D.patchFlag&16;const ie=D.props||On,ke=X.props||On;let Fe;if(ve&&z1(ve,!1),(Fe=ke.onVnodeBeforeUpdate)&&Ci(Fe,ve,X,D),be&&cl(X,D,ve,"beforeUpdate"),ve&&z1(ve,!0),(ie.innerHTML&&ke.innerHTML==null||ie.textContent&&ke.textContent==null)&&u(ye,""),me?T(D.dynamicChildren,me,ye,ve,fe,sh(X,pe),te):de||j(D,X,ye,null,ve,fe,sh(X,pe),te,!1),Ce>0){if(Ce&16)N(ye,ie,ke,ve,pe);else if(Ce&2&&ie.class!==ke.class&&i(ye,"class",null,ke.class,pe),Ce&4&&i(ye,"style",ie.style,ke.style,pe),Ce&8){const at=X.dynamicProps;for(let dt=0;dt{Fe&&Ci(Fe,ve,X,D),be&&cl(X,D,ve,"updated")},fe)},T=(D,X,ve,fe,pe,te,de)=>{for(let ye=0;ye{if(X!==ve){if(X!==On)for(const te in X)!a0(te)&&!(te in ve)&&i(D,te,X[te],null,pe,fe);for(const te in ve){if(a0(te))continue;const de=ve[te],ye=X[te];de!==ye&&te!=="value"&&i(D,te,ye,de,pe,fe)}"value"in ve&&i(D,"value",X.value,ve.value,pe)}},C=(D,X,ve,fe,pe,te,de,ye,Ce)=>{const me=X.el=D?D.el:l(""),be=X.anchor=D?D.anchor:l("");let{patchFlag:ie,dynamicChildren:ke,slotScopeIds:Fe}=X;Fe&&(ye=ye?ye.concat(Fe):Fe),D==null?(o(me,ve,fe),o(be,ve,fe),$(X.children||[],ve,be,pe,te,de,ye,Ce)):ie>0&&ie&64&&ke&&D.dynamicChildren&&D.dynamicChildren.length===ke.length?(T(D.dynamicChildren,ke,ve,pe,te,de,ye),(X.key!=null||pe&&X===pe.subTree)&&ug(D,X,!0)):j(D,X,ve,be,pe,te,de,ye,Ce)},O=(D,X,ve,fe,pe,te,de,ye,Ce)=>{X.slotScopeIds=ye,D==null?X.shapeFlag&512?pe.ctx.activate(X,ve,fe,de,Ce):H(X,ve,fe,pe,te,de,Ce):V(D,X,Ce)},H=(D,X,ve,fe,pe,te,de)=>{const ye=D.component=xA(D,fe,pe);if(Zd(D)&&(ye.ctx.renderer=et),CA(ye,!1,de),ye.asyncDep){if(pe&&pe.registerDep(ye,A,de),!D.el){const Ce=ye.subTree=Z(ds);x(null,Ce,X,ve),D.placeholder=Ce.el}}else A(ye,D,X,ve,pe,te,de)},V=(D,X,ve)=>{const fe=X.component=D.component;if(wF(D,X,ve))if(fe.asyncDep&&!fe.asyncResolved){F(fe,X,ve);return}else fe.next=X,fe.update();else X.el=D.el,fe.vnode=X},A=(D,X,ve,fe,pe,te,de)=>{const ye=()=>{if(D.isMounted){let{next:ie,bu:ke,u:Fe,parent:at,vnode:dt}=D;{const en=mA(D);if(en){ie&&(ie.el=dt.el,F(D,ie,de)),en.asyncDep.then(()=>{as(()=>{D.isUnmounted||me()},pe)});return}}let $t=ie,Et;z1(D,!1),ie?(ie.el=dt.el,F(D,ie,de)):ie=dt,ke&&Nc(ke),(Et=ie.props&&ie.props.onVnodeBeforeUpdate)&&Ci(Et,at,ie,dt),z1(D,!0);const Qt=X3(D),Dt=D.subTree;D.subTree=Qt,m(Dt,Qt,d(Dt.el),ge(Dt),D,pe,te),ie.el=Qt.el,$t===null&&mp(D,Qt.el),Fe&&as(Fe,pe),(Et=ie.props&&ie.props.onVnodeUpdated)&&as(()=>Ci(Et,at,ie,dt),pe)}else{let ie;const{el:ke,props:Fe}=X,{bm:at,m:dt,parent:$t,root:Et,type:Qt}=D,Dt=Gl(X);if(z1(D,!1),at&&Nc(at),!Dt&&(ie=Fe&&Fe.onVnodeBeforeMount)&&Ci(ie,$t,X),z1(D,!0),ke&&ne){const en=()=>{D.subTree=X3(D),ne(ke,D.subTree,D,pe,null)};Dt&&Qt.__asyncHydrate?Qt.__asyncHydrate(ke,D,en):en()}else{Et.ce&&Et.ce._hasShadowRoot()&&Et.ce._injectChildStyle(Qt,D.parent?D.parent.type:void 0);const en=D.subTree=X3(D);m(null,en,ve,fe,D,pe,te),X.el=en.el}if(dt&&as(dt,pe),!Dt&&(ie=Fe&&Fe.onVnodeMounted)){const en=X;as(()=>Ci(ie,$t,en),pe)}(X.shapeFlag&256||$t&&Gl($t.vnode)&&$t.vnode.shapeFlag&256)&&D.a&&as(D.a,pe),D.isMounted=!0,X=ve=fe=null}};D.scope.on();const Ce=D.effect=new T4(ye);D.scope.off();const me=D.update=Ce.run.bind(Ce),be=D.job=Ce.runIfDirty.bind(Ce);be.i=D,be.id=D.uid,Ce.scheduler=()=>eg(be),z1(D,!0),me()},F=(D,X,ve)=>{X.component=D;const fe=D.vnode.props;D.vnode=X,D.next=null,kF(D,X.props,fe,ve),SF(D,X.children,ve),Xl(),Yw(D),Jl()},j=(D,X,ve,fe,pe,te,de,ye,Ce=!1)=>{const me=D&&D.children,be=D?D.shapeFlag:0,ie=X.children,{patchFlag:ke,shapeFlag:Fe}=X;if(ke>0){if(ke&128){P(me,ie,ve,fe,pe,te,de,ye,Ce);return}else if(ke&256){q(me,ie,ve,fe,pe,te,de,ye,Ce);return}}Fe&8?(be&16&&Q(me,pe,te),ie!==me&&u(ve,ie)):be&16?Fe&16?P(me,ie,ve,fe,pe,te,de,ye,Ce):Q(me,pe,te,!0):(be&8&&u(ve,""),Fe&16&&$(ie,ve,fe,pe,te,de,ye,Ce))},q=(D,X,ve,fe,pe,te,de,ye,Ce)=>{D=D||Lc,X=X||Lc;const me=D.length,be=X.length,ie=Math.min(me,be);let ke;for(ke=0;kebe?Q(D,pe,te,!0,!1,ie):$(X,ve,fe,pe,te,de,ye,Ce,ie)},P=(D,X,ve,fe,pe,te,de,ye,Ce)=>{let me=0;const be=X.length;let ie=D.length-1,ke=be-1;for(;me<=ie&&me<=ke;){const Fe=D[me],at=X[me]=Ce?jl(X[me]):Ii(X[me]);if(Pr(Fe,at))m(Fe,at,ve,null,pe,te,de,ye,Ce);else break;me++}for(;me<=ie&&me<=ke;){const Fe=D[ie],at=X[ke]=Ce?jl(X[ke]):Ii(X[ke]);if(Pr(Fe,at))m(Fe,at,ve,null,pe,te,de,ye,Ce);else break;ie--,ke--}if(me>ie){if(me<=ke){const Fe=ke+1,at=Feke)for(;me<=ie;)G(D[me],pe,te,!0),me++;else{const Fe=me,at=me,dt=new Map;for(me=at;me<=ke;me++){const Mn=X[me]=Ce?jl(X[me]):Ii(X[me]);Mn.key!=null&&dt.set(Mn.key,me)}let $t,Et=0;const Qt=ke-at+1;let Dt=!1,en=0;const kn=new Array(Qt);for(me=0;me=Qt){G(Mn,pe,te,!0);continue}let Re;if(Mn.key!=null)Re=dt.get(Mn.key);else for($t=at;$t<=ke;$t++)if(kn[$t-at]===0&&Pr(Mn,X[$t])){Re=$t;break}Re===void 0?G(Mn,pe,te,!0):(kn[Re-at]=me+1,Re>=en?en=Re:Dt=!0,m(Mn,X[Re],ve,null,pe,te,de,ye,Ce),Et++)}const In=Dt?AF(kn):Lc;for($t=In.length-1,me=Qt-1;me>=0;me--){const Mn=at+me,Re=X[Mn],lt=X[Mn+1],tt=Mn+1{const{el:te,type:de,transition:ye,children:Ce,shapeFlag:me}=D;if(me&6){W(D.component.subTree,X,ve,fe);return}if(me&128){D.suspense.move(X,ve,fe);return}if(me&64){de.move(D,X,ve,et);return}if(de===Me){o(te,X,ve);for(let ie=0;ieye.enter(te),pe));else{const{leave:ie,delayLeave:ke,afterLeave:Fe}=ye,at=()=>{D.ctx.isUnmounted?s(te):o(te,X,ve)},dt=()=>{const $t=te._isLeaving||!!te[fr];te._isLeaving&&te[fr](!0),ye.persisted&&!$t?at():ie(te,()=>{at(),Fe&&Fe()})};ke?ke(te,at,dt):dt()}else o(te,X,ve)},G=(D,X,ve,fe=!1,pe=!1)=>{const{type:te,props:de,ref:ye,children:Ce,dynamicChildren:me,shapeFlag:be,patchFlag:ie,dirs:ke,cacheIndex:Fe,memo:at}=D;if(ie===-2&&(pe=!1),ye!=null&&(Xl(),Bc(ye,null,ve,D,!0),Jl()),Fe!=null&&(X.renderCache[Fe]=void 0),be&256){X.ctx.deactivate(D);return}const dt=be&1&&ke,$t=!Gl(D);let Et;if($t&&(Et=de&&de.onVnodeBeforeUnmount)&&Ci(Et,X,D),be&6)oe(D.component,ve,fe);else{if(be&128){D.suspense.unmount(ve,fe);return}dt&&cl(D,null,X,"beforeUnmount"),be&64?D.type.remove(D,X,ve,et,fe):me&&!me.hasOnce&&(te!==Me||ie>0&&ie&64)?Q(me,X,ve,!1,!0):(te===Me&&ie&384||!pe&&be&16)&&Q(Ce,X,ve),fe&&ee(D)}const Qt=at!=null&&Fe==null;($t&&(Et=de&&de.onVnodeUnmounted)||dt||Qt)&&as(()=>{Et&&Ci(Et,X,D),dt&&cl(D,null,X,"unmounted"),Qt&&(D.el=null)},ve)},ee=D=>{const{type:X,el:ve,anchor:fe,transition:pe}=D;if(X===Me){se(ve,fe);return}if(X===Fc){b(D);return}const te=()=>{s(ve),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(D.shapeFlag&1&&pe&&!pe.persisted){const{leave:de,delayLeave:ye}=pe,Ce=()=>de(ve,te);ye?ye(D.el,te,Ce):Ce()}else te()},se=(D,X)=>{let ve;for(;D!==X;)ve=f(D),s(D),D=ve;s(X)},oe=(D,X,ve)=>{const{bum:fe,scope:pe,job:te,subTree:de,um:ye,m:Ce,a:me}=D;F4(Ce),F4(me),fe&&Nc(fe),pe.stop(),te&&(te.flags|=8,G(de,D,X,ve)),ye&&as(ye,X),as(()=>{D.isUnmounted=!0},X)},Q=(D,X,ve,fe=!1,pe=!1,te=0)=>{for(let de=te;de{if(D.shapeFlag&6)return ge(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const X=f(D.anchor||D.el),ve=X&&X[DM];return ve?f(ve):X};let xe=!1;const Ke=(D,X,ve)=>{let fe;D==null?X._vnode&&(G(X._vnode,null,null,!0),fe=X._vnode.component):m(X._vnode||null,D,X,null,null,null,ve),X._vnode=D,xe||(xe=!0,Yw(fe),z4(),xe=!1)},et={p:m,um:G,m:W,r:ee,mt:H,mc:$,pc:j,pbc:T,n:ge,o:e};let Y,ne;return t&&([Y,ne]=t(et)),{render:Ke,hydrate:Y,createApp:fF(Ke,Y)}}function sh({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function z1({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function hA(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ug(e,t,n=!1){const o=e.children,s=t.children;if(Xt(o)&&Xt(s))for(let i=0;i>1,e[n[l]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function mA(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:mA(t)}function F4(e){if(e)for(let t=0;te.__isSuspense;let o8=0;const EF={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)TF(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}IF(e,t,n,o,s,r,l,a,c)}},hydrate:LF,normalize:$F},OWe=EF;function hd(e,t){const n=e.props&&e.props[t];wn(n)&&n()}function TF(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=vA(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(hd(e,"onPending"),hd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Rc(f,e.ssFallback)):f.resolve(!1,!0)}function IF(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:k,isHydrating:x}=d;if(m)d.pendingBranch=f,Pr(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():k&&(x||(a(h,p,n,o,s,null,i,r,l),Rc(d,p)))):(d.pendingId=o8++,x?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),k?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(h,p,n,o,s,null,i,r,l),Rc(d,p))):h&&Pr(h,f)?(a(h,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(h&&Pr(h,f))a(h,f,n,o,s,d,i,r,l),Rc(d,f);else if(hd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=o8++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:v,pendingId:w}=d;v>0?setTimeout(()=>{d.pendingId===w&&d.fallback(p)},v):v===0&&d.fallback(p)}}function vA(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:k}}=c;let x;const v=NF(e);v&&t&&t.pendingBranch&&(x=t.pendingId,t.deps++);const w=e.props?E4(e.props.timeout):void 0,b=i,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:o8++,timeout:typeof w=="number"?w:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(R=!1,z=!1){const{vnode:$,activeBranch:E,pendingBranch:T,pendingId:N,effects:C,parentComponent:O,container:H,isInFallback:V}=M;let A=!1;if(M.isHydrating)M.isHydrating=!1;else if(!R){A=E&&T.transition&&T.transition.mode==="out-in";let q=!1;A&&(E.transition.afterLeave=()=>{N===M.pendingId&&(f(T,H,i===b&&!q?h(E):i,0),N4(C),V&&$.ssFallback&&($.ssFallback.el=null))}),E&&!M.isFallbackMountPending&&(m(E.el)===H&&(i=h(E),q=!0),p(E,O,M,!0),!A&&V&&$.ssFallback&&as(()=>$.ssFallback.el=null,M)),A||f(T,H,i,0)}M.isFallbackMountPending=!1,Rc(M,T),M.pendingBranch=null,M.isInFallback=!1;let F=M.parent,j=!1;for(;F;){if(F.pendingBranch){F.effects.push(...C),j=!0;break}F=F.parent}!j&&!A&&N4(C),M.effects=[],v&&t&&t.pendingBranch&&x===t.pendingId&&(t.deps--,t.deps===0&&!z&&t.resolve()),hd($,"onResolve")},fallback(R){if(!M.pendingBranch)return;const{vnode:z,activeBranch:$,parentComponent:E,container:T,namespace:N}=M;hd(z,"onFallback");const C=h($),O=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,R,T,C,E,null,N,l,a),Rc(M,R))},H=R.transition&&R.transition.mode==="out-in";H&&(M.isFallbackMountPending=!0,$.transition.afterLeave=O),M.isInFallback=!0,p($,E,null,!0),H||O()},move(R,z,$){M.activeBranch&&f(M.activeBranch,R,z,$),M.container=R},next(){return M.activeBranch&&h(M.activeBranch)},registerDep(R,z,$){const E=!!M.pendingBranch;E&&M.deps++;const T=R.vnode.el;R.asyncDep.catch(N=>{pu(N,R,0)}).then(N=>{if(R.isUnmounted||M.isUnmounted||M.pendingId!==R.suspenseId)return;md(),R.asyncResolved=!0;const{vnode:C}=R;s8(R,N,!1),T&&(C.el=T);const O=!T&&R.subTree.el;z(R,C,m(T||R.subTree.el),T?null:h(R.subTree),M,r,$),O&&(C.placeholder=null,k(O)),mp(R,C.el),E&&--M.deps===0&&M.resolve()})},unmount(R,z){M.isUnmounted=!0,M.activeBranch&&p(M.activeBranch,n,R,z),M.pendingBranch&&p(M.pendingBranch,n,R,z)}};return M}function LF(e,t,n,o,s,i,r,l,a){const c=t.suspense=vA(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function $F(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=uy(o?n.default:n),e.ssFallback=o?uy(n.fallback):Z(ds)}function uy(e){let t;if(wn(e)){const n=g0&&e._c;n&&(e._d=!1,g()),e=e(),n&&(e._d=!0,t=oi,yA())}return Xt(e)&&(e=mF(e)),e=Ii(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function wA(e,t){t&&t.pendingBranch?Xt(e)?t.effects.push(...e):t.effects.push(e):N4(e)}function Rc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,mp(o,s))}function NF(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Me=Symbol.for("v-fgt"),Za=Symbol.for("v-txt"),ds=Symbol.for("v-cmt"),Fc=Symbol.for("v-stc"),P2=[];let oi=null;function g(e=!1){P2.push(oi=e?null:[])}function yA(){P2.pop(),oi=P2[P2.length-1]||null}let g0=1;function O4(e,t=!1){g0+=e,e<0&&oi&&t&&(oi.hasOnce=!0)}function kA(e){return e.dynamicChildren=g0>0?oi||Lc:null,yA(),g0>0&&oi&&oi.push(e),e}function S(e,t,n,o,s,i){return kA(_(e,t,n,o,s,i,!0))}function ce(e,t,n,o,s){return kA(Z(e,t,n,o,s,!0))}function n1(e){return e?e.__v_isVNode===!0:!1}function Pr(e,t){return e.type===t.type&&e.key===t.key}function PWe(e){}const bA=({key:e})=>e??null,J3=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bo(e)||is(e)||wn(e)?{i:Ks,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Me?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&bA(t),ref:t&&J3(t),scopeId:fp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ks};return l?(dg(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=bo(n)?8:16),g0>0&&!r&&oi&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&oi.push(a),a}const Z=zF;function zF(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===JM)&&(e=ds),n1(e)){const l=ea(e,t,!0);return n&&dg(l,n),g0>0&&!i&&oi&&(l.shapeFlag&6?oi[oi.indexOf(e)]=l:oi.push(l)),l.patchFlag=-2,l}if(OF(e)&&(e=e.__vccOpts),t){t=_A(t);let{class:l,style:a}=t;l&&!bo(l)&&(t.class=Be(l)),eo(a)&&(dp(a)&&!Xt(a)&&(a=go({},a)),t.style=Wt(a))}const r=bo(e)?1:j4(e)?128:VM(e)?64:eo(e)?4:wn(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function _A(e){return e?dp(e)||lA(e)?go({},e):e:null}function ea(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Vn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&bA(c),ref:t&&t.ref?n&&i?Xt(i)?i.concat(J3(t)):[i,J3(t)]:J3(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Me?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ea(e.ssContent),ssFallback:e.ssFallback&&ea(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&t1(u,a.clone(u)),u}function He(e=" ",t=0){return Z(Za,null,e,t)}function H2(e,t){const n=Z(Fc,null,e);return n.staticCount=t,n}function J(e="",t=!1){return t?(g(),ce(ds,null,e)):Z(ds,null,e)}function Ii(e){return e==null||typeof e=="boolean"?Z(ds):Xt(e)?Z(Me,null,e.slice()):n1(e)?jl(e):Z(Za,null,String(e))}function jl(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ea(e)}function dg(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(Xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),dg(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!lA(t)?t._ctx=Ks:s===3&&Ks&&(Ks.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else wn(t)?(t={default:t,_ctx:Ks},n=32):(t=String(t),o&64?(n=16,t=[He(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vn(...e){const t={};for(let n=0;nZs||Ks;let P4,jc;{const e=ip(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};P4=t("__VUE_INSTANCE_SETTERS__",n=>Zs=n),jc=t("__VUE_SSR_SETTERS__",n=>v0=n)}const hu=e=>{const t=Zs;return P4(e),e.scope.on(),()=>{e.scope.off(),P4(t)}},md=()=>{Zs&&Zs.scope.off(),P4(null)};function SA(e){return e.vnode.shapeFlag&4}let v0=!1;function CA(e,t=!1,n=!1){t&&jc(t);const{props:o,children:s}=e.vnode,i=SA(e);yF(e,o,i,t),xF(e,s,n||t);const r=i?FF(e,t):void 0;return t&&jc(!1),r}function FF(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Qm);const{setup:o}=n;if(o){Xl();const s=e.setupContext=o.length>1?AA(e):null,i=hu(e),r=qd(o,e,0,[e.props,s]),l=G7(r);if(Jl(),i(),(l||e.sp)&&!Gl(e)&&ng(e),l){if(r.then(md,md),t)return r.then(a=>{s8(e,a,t)}).catch(a=>{pu(a,e,0)});e.asyncDep=r}else s8(e,r,t)}else MA(e,t)}function s8(e,t,n){wn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:eo(t)&&(e.setupState=NM(t)),MA(e,n)}let H4,i8;function HWe(e){H4=e,i8=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,iF))}}const DWe=()=>!H4;function MA(e,t,n){const o=e.type;if(!e.render){if(!t&&H4&&!o.render){const s=o.template||lg(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=go(go({isCustomElement:i,delimiters:l},r),a);o.render=H4(s,c)}}e.render=o.render||kr,i8&&i8(e)}{const s=hu(e);Xl();try{rF(e)}finally{Jl(),s()}}}const jF={get(e,t){return ti(e,"get",""),e[t]}};function AA(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,jF),slots:e.slots,emit:e.emit,expose:t}}function Gd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(NM(Nt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in O2)return O2[n](e)},has(t,n){return n in t||n in O2}})):e.proxy}function r8(e,t=!0){return wn(e)?e.displayName||e.name:e.name||t&&e.__name}function OF(e){return wn(e)&&"__vccOpts"in e}const B=(e,t)=>SR(e,t,v0);function hn(e,t,n){try{O4(-1);const o=arguments.length;return o===2?eo(t)&&!Xt(t)?n1(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&n1(n)&&(n=[n]),Z(e,t,n))}finally{O4(1)}}function VWe(){}function WWe(e,t,n,o){const s=n[o];if(s&&PF(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function PF(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o0&&oi&&oi.push(e),!0}const HF="3.5.35",qWe=kr,UWe=TR,ZWe=pc,KWe=OM,DF={createComponentInstance:xA,setupComponent:CA,renderComponentRoot:X3,setCurrentRenderingInstance:ud,isVNode:n1,normalizeVNode:Ii,getComponentPublicInstance:Gd,ensureValidVNode:rg,pushWarningContext:AR,popWarningContext:ER},GWe=DF,YWe=null,XWe=null,JWe=null;/** * @vue/runtime-dom v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let i8;const uy=typeof window<"u"&&window.trustedTypes;if(uy)try{i8=uy.createPolicy("vue",{createHTML:e=>e})}catch{}const CA=i8?e=>i8.createHTML(e):e=>e,OF="http://www.w3.org/2000/svg",PF="http://www.w3.org/1998/Math/MathML",Nl=typeof document<"u"?document:null,dy=Nl&&Nl.createElement("template"),HF={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Nl.createElementNS(OF,e):t==="mathml"?Nl.createElementNS(PF,e):n?Nl.createElement(e,{is:n}):Nl.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Nl.createTextNode(e),createComment:e=>Nl.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Nl.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,r){const i=n?n.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===r||!(s=s.nextSibling)););else{dy.innerHTML=CA(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const l=dy.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ka="transition",Ju="animation",Yc=Symbol("_vtc"),MA={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},AA=go({},DM,MA),DF=e=>(e.displayName="Transition",e.props=AA,e),gi=DF((e,{slots:t})=>hn(RR,TA(e),t)),B1=(e,t=[])=>{Xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},fy=e=>e?Xt(e)?e.some(t=>t.length>1):e.length>1:!1;function TA(e){const t={};for(const C in e)C in MA||(t[C]=e[C]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:r=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=VF(s),m=h&&h[0],k=h&&h[1],{onBeforeEnter:x,onEnter:w,onEnterCancelled:v,onLeave:b,onLeaveCancelled:M,onBeforeAppear:R=x,onAppear:z=w,onAppearCancelled:$=v}=t,T=(C,O,H,V)=>{C._enterCancelled=V,La(C,O?u:l),La(C,O?c:i),H&&H()},E=(C,O)=>{C._isLeaving=!1,La(C,d),La(C,p),La(C,f),O&&O()},N=C=>(O,H)=>{const V=C?z:w,A=()=>T(O,C,H);B1(V,[O,A]),py(()=>{La(O,C?a:r),ll(O,C?u:l),fy(V)||hy(O,o,m,A)})};return go(t,{onBeforeEnter(C){B1(x,[C]),ll(C,r),ll(C,i)},onBeforeAppear(C){B1(R,[C]),ll(C,a),ll(C,c)},onEnter:N(!1),onAppear:N(!0),onLeave(C,O){C._isLeaving=!0;const H=()=>E(C,O);ll(C,d),C._enterCancelled?(ll(C,f),l8(C)):(l8(C),ll(C,f)),py(()=>{C._isLeaving&&(La(C,d),ll(C,p),fy(b)||hy(C,o,k,H))}),B1(b,[C,H])},onEnterCancelled(C){T(C,!1,void 0,!0),B1(v,[C])},onAppearCancelled(C){T(C,!0,void 0,!0),B1($,[C])},onLeaveCancelled(C){E(C),B1(M,[C])}})}function VF(e){if(e==null)return null;if(eo(e))return[sh(e.enter),sh(e.leave)];{const t=sh(e);return[t,t]}}function sh(e){return A4(e)}function ll(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yc]||(e[Yc]=new Set)).add(t)}function La(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Yc];n&&(n.delete(t),n.size||(e[Yc]=void 0))}function py(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let WF=0;function hy(e,t,n,o){const s=e._endId=++WF,r=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:i,timeout:l,propCount:a}=EA(e,t);if(!i)return o();const c=i+"end";let u=0;const d=()=>{e.removeEventListener(c,f),r()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[h]||"").split(", "),s=o(`${ka}Delay`),r=o(`${ka}Duration`),i=my(s,r),l=o(`${Ju}Delay`),a=o(`${Ju}Duration`),c=my(l,a);let u=null,d=0,f=0;t===ka?i>0&&(u=ka,d=i,f=r.length):t===Ju?c>0&&(u=Ju,d=c,f=a.length):(d=Math.max(i,c),u=d>0?i>c?ka:Ju:null,f=u?u===ka?r.length:a.length:0);const p=u===ka&&/\b(?:transform|all)(?:,|$)/.test(o(`${ka}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function my(e,t){for(;e.lengthgy(n)+gy(e[o])))}function gy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function l8(e){return(e?e.ownerDocument:document).body.offsetHeight}function qF(e,t,n){const o=e[Yc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const H4=Symbol("_vod"),IA=Symbol("_vsh"),Er={name:"show",beforeMount(e,{value:t},{transition:n}){e[H4]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Qu(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Qu(e,!0),o.enter(e)):o.leave(e,()=>{Qu(e,!1)}):Qu(e,t))},beforeUnmount(e,{value:t}){Qu(e,t)}};function Qu(e,t){e.style.display=t?e[H4]:"none",e[IA]=!t}function UF(){Er.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const LA=Symbol("");function OWe(e){const t=gs();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(r=>D4(r,s))},o=()=>{const s=e(t.proxy);t.ce?D4(t.ce,s):a8(t.subTree,s),n(s)};ZM(()=>{$4(o)}),xn(()=>{Ue(o,ki,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),An(()=>s.disconnect())})}function a8(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{a8(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)D4(e.el,t);else if(e.type===Me)e.children.forEach(n=>a8(n,t));else if(e.type===Rc){let{el:n,anchor:o}=e;for(;n&&(D4(n,t),n!==o);)n=n.nextSibling}}function D4(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const r=qB(t[s]);n.setProperty(`--${s}`,r),o+=`--${s}: ${r};`}n[LA]=o}}const ZF=/(?:^|;)\s*display\s*:/;function KF(e,t,n){const o=e.style,s=bo(n);let r=!1;if(n&&!s){if(t)if(bo(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&_2(o,l,"")}else for(const i in t)n[i]==null&&_2(o,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?YF(e,i,!bo(t)&&t?t[i]:void 0,l)||_2(o,i,l):_2(o,i,"")}}else if(s){if(t!==n){const i=o[LA];i&&(n+=";"+i),o.cssText=n,r=ZF.test(n)}}else t&&e.removeAttribute("style");H4 in e&&(e[H4]=r?o.display:"",e[IA]&&(o.display="none"))}const vy=/\s*!important$/;function _2(e,t,n){if(Xt(n))n.forEach(o=>_2(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=GF(e,t);vy.test(n)?e.setProperty(Lr(o),n.replace(vy,""),"important"):e[o]=n}}const wy=["Webkit","Moz","ms"],rh={};function GF(e,t){const n=rh[t];if(n)return n;let o=Ms(t);if(o!=="filter"&&o in e)return rh[t]=o;o=np(o);for(let s=0;sih||(ej.then(()=>ih=0),ih=Date.now());function nj(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(Xt(s)){const r=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{r.call(o),o._stopped=!0};const i=s.slice(),l=[o];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,oj=(e,t,n,o,s,r)=>{const i=s==="svg";t==="class"?qF(e,o,i):t==="style"?KF(e,n,o):Vd(t)?J5(t)||JF(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sj(e,t,o,i))?(by(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ky(e,t,o,i,r,t!=="value")):e._isVueCE&&(rj(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bo(o)))?by(e,Ms(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),ky(e,t,o,i))};function sj(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sy(t)&&wn(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Sy(t)&&bo(n)?!1:t in e}function rj(e,t){const n=e._def.props;if(!n)return!1;const o=Ms(t);return Array.isArray(n)?n.some(s=>Ms(s)===o):Object.keys(n).some(s=>Ms(s)===o)}const Cy={};function ij(e,t,n){let o=Ge(e,t);Q5(o)&&(o=go({},o,t));class s extends dg{constructor(i){super(o,i,n)}}return s.def=o,s}const PWe=((e,t)=>ij(e,t,xj)),lj=typeof HTMLElement<"u"?HTMLElement:class{};class dg extends lj{constructor(t,n={},o=q4){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==q4?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(go({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof dg){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,vt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:i}=o;let l;if(r&&!Xt(r))for(const a in r){const c=r[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=A4(this._props[a])),(l||(l=Object.create(null)))[Ms(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(i),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)Qn(this,o)||Object.defineProperty(this,o,{get:()=>y(n[o])})}_resolveProps(t){const{props:n}=t,o=Xt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Ms))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(r){this._setProp(s,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Cy;const s=Ms(t);n&&this._numberProps&&this._numberProps[s]&&(o=A4(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Cy?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(Lr(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Lr(t),n+""):n||this.removeAttribute(Lr(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),_j(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Z(this._def,go(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(r,i)=>{this.dispatchEvent(new CustomEvent(r,Q5(i[0])?go({detail:i},i[0]):{detail:i}))};o.emit=(r,...i)=>{s(r,i),Lr(r)!==r&&s(Lr(r),i)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,r=this.shadowRoot,i=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(r);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],r.insertBefore(c,l||i),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),uj=cj({name:"TransitionGroup",props:go({},AA,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=gs(),o=HM();let s,r;return ng(()=>{if(!s.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!mj(s[0].el,n.vnode.el,i)){s=[];return}s.forEach(fj),s.forEach(pj);const l=s.filter(hj);l8(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;ll(c,i),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[V4]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[V4]=null,La(c,i))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const i=Dn(e),l=TA(i);let a=i.tag||Me;if(s=[],r)for(let c=0;c{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(o);const{hasTransform:i}=EA(o);return r.removeChild(o),i}const o1=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Xt(t)?n=>$c(t,n):t};function gj(e){e.target.composing=!0}function Ay(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function Ty(e,t,n){return t&&(e=e.trim()),n&&(e=op(e)),e}const Fs={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[bi]=o1(s);const r=o||s.props&&s.props.type==="number";Dl(e,t?"change":"input",i=>{i.target.composing||e[bi](Ty(e.value,n,r))}),(n||r)&&Dl(e,"change",()=>{e.value=Ty(e.value,n,r)}),t||(Dl(e,"compositionstart",gj),Dl(e,"compositionend",Ay),Dl(e,"change",Ay))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:r}},i){if(e[bi]=o1(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?op(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},W4={deep:!0,created(e,t,n){e[bi]=o1(n),Dl(e,"change",()=>{const o=e._modelValue,s=Xc(e),r=e.checked,i=e[bi];if(Xt(o)){const l=rp(o,s),a=l!==-1;if(r&&!a)i(o.concat(s));else if(!r&&a){const c=[...o];c.splice(l,1),i(c)}}else if(A0(o)){const l=new Set(o);r?l.add(s):l.delete(s),i(l)}else i(RA(e,r))})},mounted:Ey,beforeUpdate(e,t,n){e[bi]=o1(n),Ey(e,t,n)}};function Ey(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(Xt(t))s=rp(t,o.props.value)>-1;else if(A0(t))s=t.has(o.props.value);else{if(t===n)return;s=Yl(t,RA(e,!0))}e.checked!==s&&(e.checked=s)}const BA={created(e,{value:t},n){e.checked=Yl(t,n.props.value),e[bi]=o1(n),Dl(e,"change",()=>{e[bi](Xc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[bi]=o1(o),t!==n&&(e.checked=Yl(t,o.props.value))}},c8={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=A0(t);Dl(e,"change",()=>{const r=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?op(Xc(i)):Xc(i));e[bi](e.multiple?s?new Set(r):r:r[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[bi]=o1(o)},mounted(e,{value:t}){Iy(e,t)},beforeUpdate(e,t,n){e[bi]=o1(n)},updated(e,{value:t}){e._assigning||Iy(e,t)}};function Iy(e,t){const n=e.multiple,o=Xt(t);if(!(n&&!o&&!A0(t))){for(let s=0,r=e.options.length;sString(c)===String(l)):i.selected=rp(t,l)>-1}else i.selected=t.has(l);else if(Yl(Xc(i),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Xc(e){return"_value"in e?e._value:e.value}function RA(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const vj={created(e,t,n){Qf(e,t,n,null,"created")},mounted(e,t,n){Qf(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Qf(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Qf(e,t,n,o,"updated")}};function FA(e,t){switch(e){case"SELECT":return c8;case"TEXTAREA":return Fs;default:switch(t){case"checkbox":return W4;case"radio":return BA;default:return Fs}}}function Qf(e,t,n,o,s){const i=FA(e.tagName,n.props&&n.props.type)[s];i&&i(e,t,n,o)}function wj(){Fs.getSSRProps=({value:e})=>({value:e}),BA.getSSRProps=({value:e},t)=>{if(t.props&&Yl(t.props.value,e))return{checked:!0}},W4.getSSRProps=({value:e},t)=>{if(Xt(e)){if(t.props&&rp(e,t.props.value)>-1)return{checked:!0}}else if(A0(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},vj.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=FA(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const yj=["ctrl","shift","alt","meta"],kj={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>yj.some(n=>e[`${n}Key`]&&!t.includes(n))},xt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...r)=>{for(let i=0;i{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const r=Lr(s.key);if(t.some(i=>i===r||bj[i]===r))return e(s)}))},jA=go({patchProp:oj},HF);let H2,Ly=!1;function OA(){return H2||(H2=bF(jA))}function PA(){return H2=Ly?H2:_F(jA),Ly=!0,H2}const _j=((...e)=>{OA().render(...e)}),VWe=((...e)=>{PA().hydrate(...e)}),q4=((...e)=>{const t=OA().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=DA(o);if(!s)return;const r=t._component;!wn(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,HA(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t}),xj=((...e)=>{const t=PA().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=DA(o);if(s)return n(s,!0,HA(s))},t});function HA(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function DA(e){return bo(e)?document.querySelector(e):e}let $y=!1;const WWe=()=>{$y||($y=!0,wj(),UF())};/*! +**/let l8;const dy=typeof window<"u"&&window.trustedTypes;if(dy)try{l8=dy.createPolicy("vue",{createHTML:e=>e})}catch{}const EA=l8?e=>l8.createHTML(e):e=>e,VF="http://www.w3.org/2000/svg",WF="http://www.w3.org/1998/Math/MathML",Nl=typeof document<"u"?document:null,fy=Nl&&Nl.createElement("template"),qF={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Nl.createElementNS(VF,e):t==="mathml"?Nl.createElementNS(WF,e):n?Nl.createElement(e,{is:n}):Nl.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Nl.createTextNode(e),createComment:e=>Nl.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Nl.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{fy.innerHTML=EA(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const l=fy.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ka="transition",Qu="animation",Xc=Symbol("_vtc"),TA={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},IA=go({},qM,TA),UF=e=>(e.displayName="Transition",e.props=IA,e),gr=UF((e,{slots:t})=>hn(PR,LA(e),t)),B1=(e,t=[])=>{Xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},py=e=>e?Xt(e)?e.some(t=>t.length>1):e.length>1:!1;function LA(e){const t={};for(const C in e)C in TA||(t[C]=e[C]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=ZF(s),m=h&&h[0],k=h&&h[1],{onBeforeEnter:x,onEnter:v,onEnterCancelled:w,onLeave:b,onLeaveCancelled:M,onBeforeAppear:R=x,onAppear:z=v,onAppearCancelled:$=w}=t,E=(C,O,H,V)=>{C._enterCancelled=V,La(C,O?u:l),La(C,O?c:r),H&&H()},T=(C,O)=>{C._isLeaving=!1,La(C,d),La(C,p),La(C,f),O&&O()},N=C=>(O,H)=>{const V=C?z:v,A=()=>E(O,C,H);B1(V,[O,A]),hy(()=>{La(O,C?a:i),ll(O,C?u:l),py(V)||my(O,o,m,A)})};return go(t,{onBeforeEnter(C){B1(x,[C]),ll(C,i),ll(C,r)},onBeforeAppear(C){B1(R,[C]),ll(C,a),ll(C,c)},onEnter:N(!1),onAppear:N(!0),onLeave(C,O){C._isLeaving=!0;const H=()=>T(C,O);ll(C,d),C._enterCancelled?(ll(C,f),a8(C)):(a8(C),ll(C,f)),hy(()=>{C._isLeaving&&(La(C,d),ll(C,p),py(b)||my(C,o,k,H))}),B1(b,[C,H])},onEnterCancelled(C){E(C,!1,void 0,!0),B1(w,[C])},onAppearCancelled(C){E(C,!0,void 0,!0),B1($,[C])},onLeaveCancelled(C){T(C),B1(M,[C])}})}function ZF(e){if(e==null)return null;if(eo(e))return[ih(e.enter),ih(e.leave)];{const t=ih(e);return[t,t]}}function ih(e){return E4(e)}function ll(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Xc]||(e[Xc]=new Set)).add(t)}function La(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Xc];n&&(n.delete(t),n.size||(e[Xc]=void 0))}function hy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let KF=0;function my(e,t,n,o){const s=e._endId=++KF,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=$A(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=a&&d()};setTimeout(()=>{u(n[h]||"").split(", "),s=o(`${ka}Delay`),i=o(`${ka}Duration`),r=gy(s,i),l=o(`${Qu}Delay`),a=o(`${Qu}Duration`),c=gy(l,a);let u=null,d=0,f=0;t===ka?r>0&&(u=ka,d=r,f=i.length):t===Qu?c>0&&(u=Qu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?ka:Qu:null,f=u?u===ka?i.length:a.length:0);const p=u===ka&&/\b(?:transform|all)(?:,|$)/.test(o(`${ka}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function gy(e,t){for(;e.lengthvy(n)+vy(e[o])))}function vy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function a8(e){return(e?e.ownerDocument:document).body.offsetHeight}function GF(e,t,n){const o=e[Xc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const D4=Symbol("_vod"),NA=Symbol("_vsh"),Ti={name:"show",beforeMount(e,{value:t},{transition:n}){e[D4]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):e2(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),e2(e,!0),o.enter(e)):o.leave(e,()=>{e2(e,!1)}):e2(e,t))},beforeUnmount(e,{value:t}){e2(e,t)}};function e2(e,t){e.style.display=t?e[D4]:"none",e[NA]=!t}function YF(){Ti.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const zA=Symbol("");function QWe(e){const t=gs();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>V4(i,s))},o=()=>{const s=e(t.proxy);t.ce?V4(t.ce,s):c8(t.subTree,s),n(s)};YM(()=>{N4(o)}),xn(()=>{Ue(o,kr,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),An(()=>s.disconnect())})}function c8(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{c8(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)V4(e.el,t);else if(e.type===Me)e.children.forEach(n=>c8(n,t));else if(e.type===Fc){let{el:n,anchor:o}=e;for(;n&&(V4(n,t),n!==o);)n=n.nextSibling}}function V4(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=GB(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[zA]=o}}const XF=/(?:^|;)\s*display\s*:/;function JF(e,t,n){const o=e.style,s=bo(n);let i=!1;if(n&&!s){if(t)if(bo(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&x2(o,l,"")}else for(const r in t)n[r]==null&&x2(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?ej(e,r,!bo(t)&&t?t[r]:void 0,l)||x2(o,r,l):x2(o,r,"")}}else if(s){if(t!==n){const r=o[zA];r&&(n+=";"+r),o.cssText=n,i=XF.test(n)}}else t&&e.removeAttribute("style");D4 in e&&(e[D4]=i?o.display:"",e[NA]&&(o.display="none"))}const wy=/\s*!important$/;function x2(e,t,n){if(Xt(n))n.forEach(o=>x2(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=QF(e,t);wy.test(n)?e.setProperty(Li(o),n.replace(wy,""),"important"):e[o]=n}}const yy=["Webkit","Moz","ms"],rh={};function QF(e,t){const n=rh[t];if(n)return n;let o=Ms(t);if(o!=="filter"&&o in e)return rh[t]=o;o=op(o);for(let s=0;slh||(sj.then(()=>lh=0),lh=Date.now());function rj(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(Xt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,lj=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?GF(e,o,r):t==="style"?JF(e,n,o):Wd(t)?Q5(t)||nj(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):aj(e,t,o,r))?(_y(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&by(e,t,o,r,i,t!=="value")):e._isVueCE&&(cj(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bo(o)))?_y(e,Ms(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),by(e,t,o,r))};function aj(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Cy(t)&&wn(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Cy(t)&&bo(n)?!1:t in e}function cj(e,t){const n=e._def.props;if(!n)return!1;const o=Ms(t);return Array.isArray(n)?n.some(s=>Ms(s)===o):Object.keys(n).some(s=>Ms(s)===o)}const My={};function uj(e,t,n){let o=Ge(e,t);ep(o)&&(o=go({},o,t));class s extends fg{constructor(r){super(o,r,n)}}return s.def=o,s}const eqe=((e,t)=>uj(e,t,Aj)),dj=typeof HTMLElement<"u"?HTMLElement:class{};class fg extends dj{constructor(t,n={},o=U4){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==U4?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(go({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof fg){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,vt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!Xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=E4(this._props[a])),(l||(l=Object.create(null)))[Ms(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)Qn(this,o)||Object.defineProperty(this,o,{get:()=>y(n[o])})}_resolveProps(t){const{props:n}=t,o=Xt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Ms))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):My;const s=Ms(t);n&&this._numberProps&&this._numberProps[s]&&(o=E4(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===My?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Li(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Li(t),n+""):n||this.removeAttribute(Li(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Mj(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=Z(this._def,go(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,ep(r[0])?go({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Li(i)!==i&&s(Li(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),hj=pj({name:"TransitionGroup",props:go({},IA,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=gs(),o=WM();let s,i;return og(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!yj(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(gj),s.forEach(vj);const l=s.filter(wj);a8(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;ll(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[W4]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[W4]=null,La(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=Dn(e),l=LA(r);let a=r.tag||Me;if(s=[],i)for(let c=0;c{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=$A(o);return i.removeChild(o),r}const o1=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Xt(t)?n=>Nc(t,n):t};function kj(e){e.target.composing=!0}function Ey(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const br=Symbol("_assign");function Ty(e,t,n){return t&&(e=e.trim()),n&&(e=sp(e)),e}const Fs={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[br]=o1(s);const i=o||s.props&&s.props.type==="number";Dl(e,t?"change":"input",r=>{r.target.composing||e[br](Ty(e.value,n,i))}),(n||i)&&Dl(e,"change",()=>{e.value=Ty(e.value,n,i)}),t||(Dl(e,"compositionstart",kj),Dl(e,"compositionend",Ey),Dl(e,"change",Ey))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[br]=o1(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?sp(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},q4={deep:!0,created(e,t,n){e[br]=o1(n),Dl(e,"change",()=>{const o=e._modelValue,s=Jc(e),i=e.checked,r=e[br];if(Xt(o)){const l=rp(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(A0(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(OA(e,i))})},mounted:Iy,beforeUpdate(e,t,n){e[br]=o1(n),Iy(e,t,n)}};function Iy(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(Xt(t))s=rp(t,o.props.value)>-1;else if(A0(t))s=t.has(o.props.value);else{if(t===n)return;s=Yl(t,OA(e,!0))}e.checked!==s&&(e.checked=s)}const jA={created(e,{value:t},n){e.checked=Yl(t,n.props.value),e[br]=o1(n),Dl(e,"change",()=>{e[br](Jc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[br]=o1(o),t!==n&&(e.checked=Yl(t,o.props.value))}},u8={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=A0(t);Dl(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?sp(Jc(r)):Jc(r));e[br](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[br]=o1(o)},mounted(e,{value:t}){Ly(e,t)},beforeUpdate(e,t,n){e[br]=o1(n)},updated(e,{value:t}){e._assigning||Ly(e,t)}};function Ly(e,t){const n=e.multiple,o=Xt(t);if(!(n&&!o&&!A0(t))){for(let s=0,i=e.options.length;sString(c)===String(l)):r.selected=rp(t,l)>-1}else r.selected=t.has(l);else if(Yl(Jc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Jc(e){return"_value"in e?e._value:e.value}function OA(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const bj={created(e,t,n){e3(e,t,n,null,"created")},mounted(e,t,n){e3(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){e3(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){e3(e,t,n,o,"updated")}};function PA(e,t){switch(e){case"SELECT":return u8;case"TEXTAREA":return Fs;default:switch(t){case"checkbox":return q4;case"radio":return jA;default:return Fs}}}function e3(e,t,n,o,s){const r=PA(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function _j(){Fs.getSSRProps=({value:e})=>({value:e}),jA.getSSRProps=({value:e},t)=>{if(t.props&&Yl(t.props.value,e))return{checked:!0}},q4.getSSRProps=({value:e},t)=>{if(Xt(e)){if(t.props&&rp(e,t.props.value)>-1)return{checked:!0}}else if(A0(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},bj.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=PA(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const xj=["ctrl","shift","alt","meta"],Sj={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>xj.some(n=>e[`${n}Key`]&&!t.includes(n))},xt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Li(s.key);if(t.some(r=>r===i||Cj[r]===i))return e(s)}))},HA=go({patchProp:lj},qF);let D2,$y=!1;function DA(){return D2||(D2=CF(HA))}function VA(){return D2=$y?D2:MF(HA),$y=!0,D2}const Mj=((...e)=>{DA().render(...e)}),oqe=((...e)=>{VA().hydrate(...e)}),U4=((...e)=>{const t=DA().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=qA(o);if(!s)return;const i=t._component;!wn(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,WA(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),Aj=((...e)=>{const t=VA().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=qA(o);if(s)return n(s,!0,WA(s))},t});function WA(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function qA(e){return bo(e)?document.querySelector(e):e}let Ny=!1;const sqe=()=>{Ny||(Ny=!0,_j(),YF())};/*! * shared v11.4.8 * (c) 2026 kazuya kawaguchi * Released under the MIT License. - */const U4=typeof window<"u",u1=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Sj=(e,t,n)=>Cj({l:e,k:t,s:n}),Cj=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),fs=e=>typeof e=="number"&&isFinite(e),VA=e=>pg(e)==="[object Date]",Jc=e=>pg(e)==="[object RegExp]",fg=e=>ho(e)&&Object.keys(e).length===0,hs=Object.assign,Mj=Object.create,ko=(e=null)=>Mj(e);let Ny;const t0=()=>Ny||(Ny=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:ko()),Aj=Object.prototype.hasOwnProperty;function vi(e,t){return Aj.call(e,t)}const Uo=Array.isArray,No=e=>typeof e=="function",Vt=e=>typeof e=="string",Kn=e=>typeof e=="boolean",Gn=e=>e!==null&&typeof e=="object",Tj=e=>Gn(e)&&No(e.then)&&No(e.catch),WA=Object.prototype.toString,pg=e=>WA.call(e),ho=e=>pg(e)==="[object Object]",Ej=e=>e==null?"":Uo(e)||ho(e)&&e.toString===WA?JSON.stringify(e,null,2):String(e);function hg(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}function Ij(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function zy(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Lj(e){return e.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const $j=/^javascript:/i,Nj=/^(?:href|src|action|formaction)$/i,zj=/&#(?:x([0-9a-f]+)|(\d+));?/gi,Bj=/&(?:Tab|NewLine);/g,Rj=/:?/gi,Fj=/[\u0000-\u0020\u007f-\u009f]/g,jj=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,Oj=/(^|[\s"'<>/])on(\w+\s*=)/gi,Pj=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function Hj(e,t,n){const o=t||n;if(!o)return e;const s=Number.parseInt(o,t?16:10);return s<=127?String.fromCharCode(s):e}function mg(e){const t=e.replace(zj,Hj).replace(Bj,"").replace(Rj,":").replace(Fj,"");return $j.test(t)}function Dj(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const r=s.index,i=t.lastIndex-1;let l=i+1,a=1,c=null;for(;l`${n}="${By(n,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(t,n,o)=>`${n}='${By(n,o)}'`),jj.test(e)&&(e=e.replace(Oj,"$1on$2")),e=e.replace(Pj,(t,n,o,s)=>mg(s)?`${n}${o}about:blank`:t),e}const e3=e=>!Gn(e)||Uo(e);function J3(e,t){if(e3(e)||e3(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(r=>{r!=="__proto__"&&(Gn(o[r])&&!Gn(s[r])&&(s[r]=Array.isArray(o[r])?[]:ko()),e3(s[r])||e3(o[r])?s[r]=o[r]:n.push({src:o[r],des:s[r]}))})}}/*! + */const Z4=typeof window<"u",u1=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Ej=(e,t,n)=>Tj({l:e,k:t,s:n}),Tj=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),fs=e=>typeof e=="number"&&isFinite(e),UA=e=>hg(e)==="[object Date]",Qc=e=>hg(e)==="[object RegExp]",pg=e=>ho(e)&&Object.keys(e).length===0,hs=Object.assign,Ij=Object.create,ko=(e=null)=>Ij(e);let zy;const t0=()=>zy||(zy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:ko()),Lj=Object.prototype.hasOwnProperty;function vr(e,t){return Lj.call(e,t)}const Uo=Array.isArray,No=e=>typeof e=="function",Vt=e=>typeof e=="string",Kn=e=>typeof e=="boolean",Gn=e=>e!==null&&typeof e=="object",$j=e=>Gn(e)&&No(e.then)&&No(e.catch),ZA=Object.prototype.toString,hg=e=>ZA.call(e),ho=e=>hg(e)==="[object Object]",Nj=e=>e==null?"":Uo(e)||ho(e)&&e.toString===ZA?JSON.stringify(e,null,2):String(e);function mg(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}function zj(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function By(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Bj(e){return e.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const Rj=/^javascript:/i,Fj=/^(?:href|src|action|formaction)$/i,jj=/&#(?:x([0-9a-f]+)|(\d+));?/gi,Oj=/&(?:Tab|NewLine);/g,Pj=/:?/gi,Hj=/[\u0000-\u0020\u007f-\u009f]/g,Dj=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,Vj=/(^|[\s"'<>/])on(\w+\s*=)/gi,Wj=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function qj(e,t,n){const o=t||n;if(!o)return e;const s=Number.parseInt(o,t?16:10);return s<=127?String.fromCharCode(s):e}function gg(e){const t=e.replace(jj,qj).replace(Oj,"").replace(Pj,":").replace(Hj,"");return Rj.test(t)}function Uj(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l`${n}="${Ry(n,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(t,n,o)=>`${n}='${Ry(n,o)}'`),Dj.test(e)&&(e=e.replace(Vj,"$1on$2")),e=e.replace(Wj,(t,n,o,s)=>gg(s)?`${n}${o}about:blank`:t),e}const t3=e=>!Gn(e)||Uo(e);function Q3(e,t){if(t3(e)||t3(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(Gn(o[i])&&!Gn(s[i])&&(s[i]=Array.isArray(o[i])?[]:ko()),t3(s[i])||t3(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*! * message-compiler v11.4.8 * (c) 2026 kazuya kawaguchi * Released under the MIT License. - */function Wj(e,t,n){return{line:e,column:t,offset:n}}function u8(e,t,n){return{start:e,end:t}}const lo={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},qj=17;function mp(e,t,n={}){const{domain:o,messages:s,args:r}=n,i=e,l=new SyntaxError(String(i));return l.code=e,t&&(l.location=t),l.domain=o,l}function Uj(e){throw e}const nl=" ",Zj="\r",Qs=` -`,Kj="\u2028",Gj="\u2029";function Yj(e){const t=e;let n=0,o=1,s=1,r=0;const i=z=>t[z]===Zj&&t[z+1]===Qs,l=z=>t[z]===Qs,a=z=>t[z]===Gj,c=z=>t[z]===Kj,u=z=>i(z)||l(z)||a(z)||c(z),d=()=>n,f=()=>o,p=()=>s,h=()=>r,m=z=>i(z)||a(z)||c(z)?Qs:t[z],k=()=>m(n),x=()=>m(n+r);function w(){return r=0,u(n)&&(o++,s=0),i(n)&&n++,n++,s++,t[n]}function v(){return i(n+r)&&r++,r++,t[n+r]}function b(){n=0,o=1,s=1,r=0}function M(z=0){r=z}function R(){const z=n+r;for(;z!==n;)w();r=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:k,currentPeek:x,next:w,peek:v,reset:b,resetPeek:M,skipToPeek:R}}const El=void 0,Xj=".",Ry="'",Jj="tokenizer";function Qj(e,t={}){const n=t.location!==!1,o=Yj(e),s=()=>o.index(),r=()=>Wj(o.line(),o.column(),o.index()),i=r(),l=s(),a={currentType:13,offset:l,startLoc:i,endLoc:i,lastType:13,lastOffset:l,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(te,de,ye,...Ce){const me=c();if(de.column+=ye,de.offset+=ye,u){const be=n?u8(me.startLoc,de):null,re=mp(te,be,{domain:Jj,args:Ce});u(re)}}function f(te,de,ye){te.endLoc=r(),te.currentType=de;const Ce={type:de};return n&&(Ce.loc=u8(te.startLoc,te.endLoc)),ye!=null&&(Ce.value=ye),Ce}const p=te=>f(te,13);function h(te,de){return te.currentChar()===de?(te.next(),de):(d(lo.EXPECTED_TOKEN,r(),0,de),"")}function m(te){let de="";for(;te.currentPeek()===nl||te.currentPeek()===Qs;)de+=te.currentPeek(),te.peek();return de}function k(te){const de=m(te);return te.skipToPeek(),de}function x(te){if(te===El)return!1;const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de===95}function w(te){if(te===El)return!1;const de=te.charCodeAt(0);return de>=48&&de<=57}function v(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=x(te.currentPeek());return te.resetPeek(),Ce}function b(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=te.currentPeek()==="-"?te.peek():te.currentPeek(),me=w(Ce);return te.resetPeek(),me}function M(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=te.currentPeek()===Ry;return te.resetPeek(),Ce}function R(te,de){const{currentType:ye}=de;if(ye!==7)return!1;m(te);const Ce=te.currentPeek()===".";return te.resetPeek(),Ce}function z(te,de){const{currentType:ye}=de;if(ye!==8)return!1;m(te);const Ce=x(te.currentPeek());return te.resetPeek(),Ce}function $(te,de){const{currentType:ye}=de;if(!(ye===7||ye===11))return!1;m(te);const Ce=te.currentPeek()===":";return te.resetPeek(),Ce}function T(te,de){const{currentType:ye}=de;if(ye!==9)return!1;const Ce=()=>{const be=te.currentPeek();return be==="{"?x(te.peek()):be==="@"||be==="|"||be===":"||be==="."||be===nl||!be?!1:be===Qs?(te.peek(),Ce()):N(te,!1)},me=Ce();return te.resetPeek(),me}function E(te){m(te);const de=te.currentPeek()==="|";return te.resetPeek(),de}function N(te,de=!0){const ye=(me=!1,be="")=>{const re=te.currentPeek();return re==="{"||re==="@"||!re?me:re==="|"?!(be===nl||be===Qs):re===nl?(te.peek(),ye(!0,nl)):re===Qs?(te.peek(),ye(!0,Qs)):!0},Ce=ye();return de&&te.resetPeek(),Ce}function C(te,de){const ye=te.currentChar();return ye===El?El:de(ye)?(te.next(),ye):null}function O(te){const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de>=48&&de<=57||de===95||de===36}function H(te){return C(te,O)}function V(te){const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de>=48&&de<=57||de===95||de===36||de===45}function A(te){return C(te,V)}function F(te){const de=te.charCodeAt(0);return de>=48&&de<=57}function j(te){return C(te,F)}function q(te){const de=te.charCodeAt(0);return de>=48&&de<=57||de>=65&&de<=70||de>=97&&de<=102}function P(te){return C(te,q)}function W(te){let de="",ye="";for(;de=j(te);)ye+=de;return ye}function G(te){let de="";for(;;){const ye=te.currentChar();if(ye==="\\"){const Ce=te.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(de+=ye+Ce,te.next(),te.next()):(te.resetPeek(),de+=ye,te.next())}else{if(ye==="{"||ye==="}"||ye==="@"||ye==="|"||!ye)break;if(ye===nl||ye===Qs)if(N(te))de+=ye,te.next();else{if(E(te))break;de+=ye,te.next()}else de+=ye,te.next()}}return de}function ee(te){k(te);let de="",ye="";for(;de=A(te);)ye+=de;const Ce=te.currentChar();if(Ce&&Ce!=="}"&&Ce!==El&&Ce!==nl&&Ce!==Qs&&Ce!==" "){const me=et(te);return d(lo.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,ye+me),ye+me}return te.currentChar()===El&&d(lo.UNTERMINATED_CLOSING_BRACE,r(),0),ye}function se(te){k(te);let de="";return te.currentChar()==="-"?(te.next(),de+=`-${W(te)}`):de+=W(te),te.currentChar()===El&&d(lo.UNTERMINATED_CLOSING_BRACE,r(),0),de}function oe(te){return te!==Ry&&te!==Qs}function Q(te){k(te),h(te,"'");let de="",ye="";for(;de=C(te,oe);)de==="\\"?ye+=ge(te):ye+=de;const Ce=te.currentChar();return Ce===Qs||Ce===El?(d(lo.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),Ce===Qs&&(te.next(),h(te,"'")),ye):(h(te,"'"),ye)}function ge(te){const de=te.currentChar();switch(de){case"\\":case"'":return te.next(),`\\${de}`;case"u":return xe(te,de,4);case"U":return xe(te,de,6);default:return d(lo.UNKNOWN_ESCAPE_SEQUENCE,r(),0,de),""}}function xe(te,de,ye){h(te,de);let Ce="";for(let me=0;me{const Ce=te.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===nl?ye:(ye+=Ce,te.next(),de(ye))};return de("")}function D(te){k(te);const de=h(te,"|");return k(te),de}function X(te,de){let ye=null;switch(te.currentChar()){case"{":return de.braceNest>=1&&d(lo.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),te.next(),ye=f(de,2,"{"),k(te),de.braceNest++,ye;case"}":return de.braceNest>0&&de.currentType===2&&d(lo.EMPTY_PLACEHOLDER,r(),0),te.next(),ye=f(de,3,"}"),de.braceNest--,de.braceNest>0&&k(te),de.inLinked&&de.braceNest===0&&(de.inLinked=!1),ye;case"@":return de.braceNest>0&&d(lo.UNTERMINATED_CLOSING_BRACE,r(),0),ye=ve(te,de)||p(de),de.braceNest=0,ye;default:{let me=!0,be=!0,re=!0;if(E(te))return de.braceNest>0&&d(lo.UNTERMINATED_CLOSING_BRACE,r(),0),ye=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,ye;if(de.braceNest>0&&(de.currentType===4||de.currentType===5||de.currentType===6))return d(lo.UNTERMINATED_CLOSING_BRACE,r(),0),de.braceNest=0,fe(te,de);if(me=v(te,de))return ye=f(de,4,ee(te)),k(te),ye;if(be=b(te,de))return ye=f(de,5,se(te)),k(te),ye;if(re=M(te,de))return ye=f(de,6,Q(te)),k(te),ye;if(!me&&!be&&!re)return ye=f(de,12,et(te)),d(lo.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,ye.value),k(te),ye;break}}return ye}function ve(te,de){const{currentType:ye}=de;let Ce=null;const me=te.currentChar();switch((ye===7||ye===8||ye===11||ye===9)&&(me===Qs||me===nl)&&d(lo.INVALID_LINKED_FORMAT,r(),0),me){case"@":return te.next(),Ce=f(de,7,"@"),de.inLinked=!0,Ce;case".":return k(te),te.next(),f(de,8,".");case":":return k(te),te.next(),f(de,9,":");default:return E(te)?(Ce=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,Ce):R(te,de)||$(te,de)?(k(te),ve(te,de)):z(te,de)?(k(te),f(de,11,Y(te))):T(te,de)?(k(te),me==="{"?X(te,de)||Ce:f(de,10,ne(te))):(ye===7&&d(lo.INVALID_LINKED_FORMAT,r(),0),de.braceNest=0,de.inLinked=!1,fe(te,de))}}function fe(te,de){let ye={type:13};if(de.braceNest>0)return X(te,de)||p(de);if(de.inLinked)return ve(te,de)||p(de);switch(te.currentChar()){case"{":return X(te,de)||p(de);case"}":return d(lo.UNBALANCED_CLOSING_BRACE,r(),0),te.next(),f(de,3,"}");case"@":return ve(te,de)||p(de);default:{if(E(te))return ye=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,ye;if(N(te))return f(de,0,G(te));break}}return ye}function pe(){const{currentType:te,offset:de,startLoc:ye,endLoc:Ce}=a;return a.lastType=te,a.lastOffset=de,a.lastStartLoc=ye,a.lastEndLoc=Ce,a.offset=s(),a.startLoc=r(),o.currentChar()===El?f(a,13):fe(o,a)}return{nextToken:pe,currentOffset:s,currentPosition:r,context:c}}const eO="parser",tO=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,nO=/\\([\\@{}|])/g;function oO(e,t){return t}function sO(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function rO(e={}){const t=e.location!==!1,{onError:n}=e;function o(x,w,v,b,...M){const R=x.currentPosition();if(R.offset+=b,R.column+=b,n){const z=t?u8(v,R):null,$=mp(w,z,{domain:eO,args:M});n($)}}function s(x,w,v){const b={type:x};return t&&(b.start=w,b.end=w,b.loc={start:v,end:v}),b}function r(x,w,v,b){t&&(x.end=w,x.loc&&(x.loc.end=v))}function i(x,w){const v=x.context(),b=s(3,v.offset,v.startLoc);return b.value=w.replace(nO,oO),r(b,x.currentOffset(),x.currentPosition()),b}function l(x,w){const v=x.context(),{lastOffset:b,lastStartLoc:M}=v,R=s(5,b,M);return R.index=parseInt(w,10),x.nextToken(),r(R,x.currentOffset(),x.currentPosition()),R}function a(x,w){const v=x.context(),{lastOffset:b,lastStartLoc:M}=v,R=s(4,b,M);return R.key=w,x.nextToken(),r(R,x.currentOffset(),x.currentPosition()),R}function c(x,w){const v=x.context(),{lastOffset:b,lastStartLoc:M}=v,R=s(9,b,M);return R.value=w.replace(tO,sO),x.nextToken(),r(R,x.currentOffset(),x.currentPosition()),R}function u(x){const w=x.nextToken(),v=x.context(),{lastOffset:b,lastStartLoc:M}=v,R=s(8,b,M);return w.type!==11?(o(x,lo.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),R.value="",r(R,b,M),{nextConsumeToken:w,node:R}):(w.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(w)),R.value=w.value||"",r(R,x.currentOffset(),x.currentPosition()),{node:R})}function d(x,w){const v=x.context(),b=s(7,v.offset,v.startLoc);return b.value=w,r(b,x.currentOffset(),x.currentPosition()),b}function f(x){const w=x.context(),v=s(6,w.offset,w.startLoc);let b=x.nextToken();if(b.type===8){const M=u(x);v.modifier=M.node,b=M.nextConsumeToken||x.nextToken()}switch(b.type!==9&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(b)),b=x.nextToken(),b.type===2&&(b=x.nextToken()),b.type){case 10:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(b)),v.key=d(x,b.value||"");break;case 4:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(b)),v.key=a(x,b.value||"");break;case 5:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(b)),v.key=l(x,b.value||"");break;case 6:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(b)),v.key=c(x,b.value||"");break;default:{o(x,lo.UNEXPECTED_EMPTY_LINKED_KEY,w.lastStartLoc,0);const M=x.context(),R=s(7,M.offset,M.startLoc);return R.value="",r(R,M.offset,M.startLoc),v.key=R,r(v,M.offset,M.startLoc),{nextConsumeToken:b,node:v}}}return r(v,x.currentOffset(),x.currentPosition()),{node:v}}function p(x){const w=x.context(),v=w.currentType===1?x.currentOffset():w.offset,b=w.currentType===1?w.endLoc:w.startLoc,M=s(2,v,b);M.items=[];let R=null;do{const T=R||x.nextToken();switch(R=null,T.type){case 0:T.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(T)),M.items.push(i(x,T.value||""));break;case 5:T.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(T)),M.items.push(l(x,T.value||""));break;case 4:T.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(T)),M.items.push(a(x,T.value||""));break;case 6:T.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(T)),M.items.push(c(x,T.value||""));break;case 7:{const E=f(x);M.items.push(E.node),R=E.nextConsumeToken||null;break}}}while(w.currentType!==13&&w.currentType!==1);const z=w.currentType===1?w.lastOffset:x.currentOffset(),$=w.currentType===1?w.lastEndLoc:x.currentPosition();return r(M,z,$),M}function h(x,w,v,b){const M=x.context();let R=b.items.length===0;const z=s(1,w,v);z.cases=[],z.cases.push(b);do{const $=p(x);R||(R=$.items.length===0),z.cases.push($)}while(M.currentType!==13);return R&&o(x,lo.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),r(z,x.currentOffset(),x.currentPosition()),z}function m(x){const w=x.context(),{offset:v,startLoc:b}=w,M=p(x);return w.currentType===13?M:h(x,v,b,M)}function k(x){const w=Qj(x,hs({},e)),v=w.context(),b=s(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=x),b.body=m(w),e.onCacheKey&&(b.cacheKey=e.onCacheKey(x)),v.currentType!==13&&o(w,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,x[v.offset]||""),r(b,w.currentOffset(),w.currentPosition()),b}return{parse:k}}function ol(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function iO(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:r=>(n.helpers.add(r),r)}}function Fy(e,t){for(let n=0;njy(n)),e}function jy(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;ni;function a(m,k){i.code+=m}function c(m,k=!0){const x=k?o:"";a(s?x+" ".repeat(m):x)}function u(m=!0){const k=++i.indentLevel;m&&c(k)}function d(m=!0){const k=--i.indentLevel;m&&c(k)}function f(){c(i.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>i.needIndent}}function uO(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Qc(e,t.key),t.modifier?(e.push(", "),Qc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function dO(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let r=0;r1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let r=0;r{const n=Vt(t.mode)?t.mode:"normal",o=Vt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` -`,r=t.needIndent?t.needIndent:n!=="arrow",i=e.helpers||[],l=cO(e,{filename:o,breakLineCode:s,needIndent:r});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(r),i.length>0&&(l.push(`const { ${hg(i.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Qc(l,e),l.deindent(r),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function mO(e,t={}){const n=hs({},t),o=!!n.jit,s=!!n.minify,r=n.optimize==null?!0:n.optimize,l=rO(n).parse(e);return o?(r&&aO(l),s&&pc(l),{ast:l,code:""}):(lO(l,n),hO(l,n))}/*! + */function Kj(e,t,n){return{line:e,column:t,offset:n}}function d8(e,t,n){return{start:e,end:t}}const lo={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Gj=17;function gp(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function Yj(e){throw e}const nl=" ",Xj="\r",Qs=` +`,Jj="\u2028",Qj="\u2029";function eO(e){const t=e;let n=0,o=1,s=1,i=0;const r=z=>t[z]===Xj&&t[z+1]===Qs,l=z=>t[z]===Qs,a=z=>t[z]===Qj,c=z=>t[z]===Jj,u=z=>r(z)||l(z)||a(z)||c(z),d=()=>n,f=()=>o,p=()=>s,h=()=>i,m=z=>r(z)||a(z)||c(z)?Qs:t[z],k=()=>m(n),x=()=>m(n+i);function v(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function w(){return r(n+i)&&i++,i++,t[n+i]}function b(){n=0,o=1,s=1,i=0}function M(z=0){i=z}function R(){const z=n+i;for(;z!==n;)v();i=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:k,currentPeek:x,next:v,peek:w,reset:b,resetPeek:M,skipToPeek:R}}const Tl=void 0,tO=".",Fy="'",nO="tokenizer";function oO(e,t={}){const n=t.location!==!1,o=eO(e),s=()=>o.index(),i=()=>Kj(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(te,de,ye,...Ce){const me=c();if(de.column+=ye,de.offset+=ye,u){const be=n?d8(me.startLoc,de):null,ie=gp(te,be,{domain:nO,args:Ce});u(ie)}}function f(te,de,ye){te.endLoc=i(),te.currentType=de;const Ce={type:de};return n&&(Ce.loc=d8(te.startLoc,te.endLoc)),ye!=null&&(Ce.value=ye),Ce}const p=te=>f(te,13);function h(te,de){return te.currentChar()===de?(te.next(),de):(d(lo.EXPECTED_TOKEN,i(),0,de),"")}function m(te){let de="";for(;te.currentPeek()===nl||te.currentPeek()===Qs;)de+=te.currentPeek(),te.peek();return de}function k(te){const de=m(te);return te.skipToPeek(),de}function x(te){if(te===Tl)return!1;const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de===95}function v(te){if(te===Tl)return!1;const de=te.charCodeAt(0);return de>=48&&de<=57}function w(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=x(te.currentPeek());return te.resetPeek(),Ce}function b(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=te.currentPeek()==="-"?te.peek():te.currentPeek(),me=v(Ce);return te.resetPeek(),me}function M(te,de){const{currentType:ye}=de;if(ye!==2)return!1;m(te);const Ce=te.currentPeek()===Fy;return te.resetPeek(),Ce}function R(te,de){const{currentType:ye}=de;if(ye!==7)return!1;m(te);const Ce=te.currentPeek()===".";return te.resetPeek(),Ce}function z(te,de){const{currentType:ye}=de;if(ye!==8)return!1;m(te);const Ce=x(te.currentPeek());return te.resetPeek(),Ce}function $(te,de){const{currentType:ye}=de;if(!(ye===7||ye===11))return!1;m(te);const Ce=te.currentPeek()===":";return te.resetPeek(),Ce}function E(te,de){const{currentType:ye}=de;if(ye!==9)return!1;const Ce=()=>{const be=te.currentPeek();return be==="{"?x(te.peek()):be==="@"||be==="|"||be===":"||be==="."||be===nl||!be?!1:be===Qs?(te.peek(),Ce()):N(te,!1)},me=Ce();return te.resetPeek(),me}function T(te){m(te);const de=te.currentPeek()==="|";return te.resetPeek(),de}function N(te,de=!0){const ye=(me=!1,be="")=>{const ie=te.currentPeek();return ie==="{"||ie==="@"||!ie?me:ie==="|"?!(be===nl||be===Qs):ie===nl?(te.peek(),ye(!0,nl)):ie===Qs?(te.peek(),ye(!0,Qs)):!0},Ce=ye();return de&&te.resetPeek(),Ce}function C(te,de){const ye=te.currentChar();return ye===Tl?Tl:de(ye)?(te.next(),ye):null}function O(te){const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de>=48&&de<=57||de===95||de===36}function H(te){return C(te,O)}function V(te){const de=te.charCodeAt(0);return de>=97&&de<=122||de>=65&&de<=90||de>=48&&de<=57||de===95||de===36||de===45}function A(te){return C(te,V)}function F(te){const de=te.charCodeAt(0);return de>=48&&de<=57}function j(te){return C(te,F)}function q(te){const de=te.charCodeAt(0);return de>=48&&de<=57||de>=65&&de<=70||de>=97&&de<=102}function P(te){return C(te,q)}function W(te){let de="",ye="";for(;de=j(te);)ye+=de;return ye}function G(te){let de="";for(;;){const ye=te.currentChar();if(ye==="\\"){const Ce=te.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(de+=ye+Ce,te.next(),te.next()):(te.resetPeek(),de+=ye,te.next())}else{if(ye==="{"||ye==="}"||ye==="@"||ye==="|"||!ye)break;if(ye===nl||ye===Qs)if(N(te))de+=ye,te.next();else{if(T(te))break;de+=ye,te.next()}else de+=ye,te.next()}}return de}function ee(te){k(te);let de="",ye="";for(;de=A(te);)ye+=de;const Ce=te.currentChar();if(Ce&&Ce!=="}"&&Ce!==Tl&&Ce!==nl&&Ce!==Qs&&Ce!==" "){const me=et(te);return d(lo.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ye+me),ye+me}return te.currentChar()===Tl&&d(lo.UNTERMINATED_CLOSING_BRACE,i(),0),ye}function se(te){k(te);let de="";return te.currentChar()==="-"?(te.next(),de+=`-${W(te)}`):de+=W(te),te.currentChar()===Tl&&d(lo.UNTERMINATED_CLOSING_BRACE,i(),0),de}function oe(te){return te!==Fy&&te!==Qs}function Q(te){k(te),h(te,"'");let de="",ye="";for(;de=C(te,oe);)de==="\\"?ye+=ge(te):ye+=de;const Ce=te.currentChar();return Ce===Qs||Ce===Tl?(d(lo.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ce===Qs&&(te.next(),h(te,"'")),ye):(h(te,"'"),ye)}function ge(te){const de=te.currentChar();switch(de){case"\\":case"'":return te.next(),`\\${de}`;case"u":return xe(te,de,4);case"U":return xe(te,de,6);default:return d(lo.UNKNOWN_ESCAPE_SEQUENCE,i(),0,de),""}}function xe(te,de,ye){h(te,de);let Ce="";for(let me=0;me{const Ce=te.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===nl?ye:(ye+=Ce,te.next(),de(ye))};return de("")}function D(te){k(te);const de=h(te,"|");return k(te),de}function X(te,de){let ye=null;switch(te.currentChar()){case"{":return de.braceNest>=1&&d(lo.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),te.next(),ye=f(de,2,"{"),k(te),de.braceNest++,ye;case"}":return de.braceNest>0&&de.currentType===2&&d(lo.EMPTY_PLACEHOLDER,i(),0),te.next(),ye=f(de,3,"}"),de.braceNest--,de.braceNest>0&&k(te),de.inLinked&&de.braceNest===0&&(de.inLinked=!1),ye;case"@":return de.braceNest>0&&d(lo.UNTERMINATED_CLOSING_BRACE,i(),0),ye=ve(te,de)||p(de),de.braceNest=0,ye;default:{let me=!0,be=!0,ie=!0;if(T(te))return de.braceNest>0&&d(lo.UNTERMINATED_CLOSING_BRACE,i(),0),ye=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,ye;if(de.braceNest>0&&(de.currentType===4||de.currentType===5||de.currentType===6))return d(lo.UNTERMINATED_CLOSING_BRACE,i(),0),de.braceNest=0,fe(te,de);if(me=w(te,de))return ye=f(de,4,ee(te)),k(te),ye;if(be=b(te,de))return ye=f(de,5,se(te)),k(te),ye;if(ie=M(te,de))return ye=f(de,6,Q(te)),k(te),ye;if(!me&&!be&&!ie)return ye=f(de,12,et(te)),d(lo.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,ye.value),k(te),ye;break}}return ye}function ve(te,de){const{currentType:ye}=de;let Ce=null;const me=te.currentChar();switch((ye===7||ye===8||ye===11||ye===9)&&(me===Qs||me===nl)&&d(lo.INVALID_LINKED_FORMAT,i(),0),me){case"@":return te.next(),Ce=f(de,7,"@"),de.inLinked=!0,Ce;case".":return k(te),te.next(),f(de,8,".");case":":return k(te),te.next(),f(de,9,":");default:return T(te)?(Ce=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,Ce):R(te,de)||$(te,de)?(k(te),ve(te,de)):z(te,de)?(k(te),f(de,11,Y(te))):E(te,de)?(k(te),me==="{"?X(te,de)||Ce:f(de,10,ne(te))):(ye===7&&d(lo.INVALID_LINKED_FORMAT,i(),0),de.braceNest=0,de.inLinked=!1,fe(te,de))}}function fe(te,de){let ye={type:13};if(de.braceNest>0)return X(te,de)||p(de);if(de.inLinked)return ve(te,de)||p(de);switch(te.currentChar()){case"{":return X(te,de)||p(de);case"}":return d(lo.UNBALANCED_CLOSING_BRACE,i(),0),te.next(),f(de,3,"}");case"@":return ve(te,de)||p(de);default:{if(T(te))return ye=f(de,1,D(te)),de.braceNest=0,de.inLinked=!1,ye;if(N(te))return f(de,0,G(te));break}}return ye}function pe(){const{currentType:te,offset:de,startLoc:ye,endLoc:Ce}=a;return a.lastType=te,a.lastOffset=de,a.lastStartLoc=ye,a.lastEndLoc=Ce,a.offset=s(),a.startLoc=i(),o.currentChar()===Tl?f(a,13):fe(o,a)}return{nextToken:pe,currentOffset:s,currentPosition:i,context:c}}const sO="parser",iO=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,rO=/\\([\\@{}|])/g;function lO(e,t){return t}function aO(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function cO(e={}){const t=e.location!==!1,{onError:n}=e;function o(x,v,w,b,...M){const R=x.currentPosition();if(R.offset+=b,R.column+=b,n){const z=t?d8(w,R):null,$=gp(v,z,{domain:sO,args:M});n($)}}function s(x,v,w){const b={type:x};return t&&(b.start=v,b.end=v,b.loc={start:w,end:w}),b}function i(x,v,w,b){t&&(x.end=v,x.loc&&(x.loc.end=w))}function r(x,v){const w=x.context(),b=s(3,w.offset,w.startLoc);return b.value=v.replace(rO,lO),i(b,x.currentOffset(),x.currentPosition()),b}function l(x,v){const w=x.context(),{lastOffset:b,lastStartLoc:M}=w,R=s(5,b,M);return R.index=parseInt(v,10),x.nextToken(),i(R,x.currentOffset(),x.currentPosition()),R}function a(x,v){const w=x.context(),{lastOffset:b,lastStartLoc:M}=w,R=s(4,b,M);return R.key=v,x.nextToken(),i(R,x.currentOffset(),x.currentPosition()),R}function c(x,v){const w=x.context(),{lastOffset:b,lastStartLoc:M}=w,R=s(9,b,M);return R.value=v.replace(iO,aO),x.nextToken(),i(R,x.currentOffset(),x.currentPosition()),R}function u(x){const v=x.nextToken(),w=x.context(),{lastOffset:b,lastStartLoc:M}=w,R=s(8,b,M);return v.type!==11?(o(x,lo.UNEXPECTED_EMPTY_LINKED_MODIFIER,w.lastStartLoc,0),R.value="",i(R,b,M),{nextConsumeToken:v,node:R}):(v.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,ol(v)),R.value=v.value||"",i(R,x.currentOffset(),x.currentPosition()),{node:R})}function d(x,v){const w=x.context(),b=s(7,w.offset,w.startLoc);return b.value=v,i(b,x.currentOffset(),x.currentPosition()),b}function f(x){const v=x.context(),w=s(6,v.offset,v.startLoc);let b=x.nextToken();if(b.type===8){const M=u(x);w.modifier=M.node,b=M.nextConsumeToken||x.nextToken()}switch(b.type!==9&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(b)),b=x.nextToken(),b.type===2&&(b=x.nextToken()),b.type){case 10:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(b)),w.key=d(x,b.value||"");break;case 4:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(b)),w.key=a(x,b.value||"");break;case 5:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(b)),w.key=l(x,b.value||"");break;case 6:b.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(b)),w.key=c(x,b.value||"");break;default:{o(x,lo.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const M=x.context(),R=s(7,M.offset,M.startLoc);return R.value="",i(R,M.offset,M.startLoc),w.key=R,i(w,M.offset,M.startLoc),{nextConsumeToken:b,node:w}}}return i(w,x.currentOffset(),x.currentPosition()),{node:w}}function p(x){const v=x.context(),w=v.currentType===1?x.currentOffset():v.offset,b=v.currentType===1?v.endLoc:v.startLoc,M=s(2,w,b);M.items=[];let R=null;do{const E=R||x.nextToken();switch(R=null,E.type){case 0:E.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(E)),M.items.push(r(x,E.value||""));break;case 5:E.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(E)),M.items.push(l(x,E.value||""));break;case 4:E.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(E)),M.items.push(a(x,E.value||""));break;case 6:E.value==null&&o(x,lo.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,ol(E)),M.items.push(c(x,E.value||""));break;case 7:{const T=f(x);M.items.push(T.node),R=T.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const z=v.currentType===1?v.lastOffset:x.currentOffset(),$=v.currentType===1?v.lastEndLoc:x.currentPosition();return i(M,z,$),M}function h(x,v,w,b){const M=x.context();let R=b.items.length===0;const z=s(1,v,w);z.cases=[],z.cases.push(b);do{const $=p(x);R||(R=$.items.length===0),z.cases.push($)}while(M.currentType!==13);return R&&o(x,lo.MUST_HAVE_MESSAGES_IN_PLURAL,w,0),i(z,x.currentOffset(),x.currentPosition()),z}function m(x){const v=x.context(),{offset:w,startLoc:b}=v,M=p(x);return v.currentType===13?M:h(x,w,b,M)}function k(x){const v=oO(x,hs({},e)),w=v.context(),b=s(0,w.offset,w.startLoc);return t&&b.loc&&(b.loc.source=x),b.body=m(v),e.onCacheKey&&(b.cacheKey=e.onCacheKey(x)),w.currentType!==13&&o(v,lo.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,x[w.offset]||""),i(b,v.currentOffset(),v.currentPosition()),b}return{parse:k}}function ol(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function uO(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function jy(e,t){for(let n=0;nOy(n)),e}function Oy(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;nr;function a(m,k){r.code+=m}function c(m,k=!0){const x=k?o:"";a(s?x+" ".repeat(m):x)}function u(m=!0){const k=++r.indentLevel;m&&c(k)}function d(m=!0){const k=--r.indentLevel;m&&c(k)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function hO(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),eu(e,t.key),t.modifier?(e.push(", "),eu(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function mO(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i{const n=Vt(t.mode)?t.mode:"normal",o=Vt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` +`,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=pO(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${mg(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),eu(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function yO(e,t={}){const n=hs({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=cO(n).parse(e);return o?(i&&fO(l),s&&hc(l),{ast:l,code:""}):(dO(l,n),wO(l,n))}/*! * core-base v11.4.8 * (c) 2026 kazuya kawaguchi * Released under the MIT License. - */function gO(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(t0().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(t0().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function vl(e){return Gn(e)&&vg(e)===0&&(vi(e,"b")||vi(e,"body"))}const qA=["b","body"];function vO(e){return d1(e,qA)}const UA=["c","cases"];function wO(e){return d1(e,UA,[])}const ZA=["s","static"];function yO(e){return d1(e,ZA)}const KA=["i","items"];function kO(e){return d1(e,KA,[])}const GA=["t","type"];function vg(e){return d1(e,GA)}const YA=["v","value"];function t3(e,t){const n=d1(e,YA);if(n!=null)return n;throw md(t)}const XA=["m","modifier"];function bO(e){return d1(e,XA)}const JA=["k","key"];function _O(e){const t=d1(e,JA);if(t)return t;throw md(6)}function d1(e,t,n){for(let o=0;oxO(n,e)}function xO(e,t){const n=vO(t);if(n==null)throw md(0);if(vg(n)===1){const r=wO(n);return e.plural(r.reduce((i,l)=>[...i,Oy(e,l)],[]))}else return Oy(e,n)}function Oy(e,t){const n=yO(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=kO(t).reduce((s,r)=>[...s,d8(e,r)],[]);return e.normalize(o)}}function d8(e,t){const n=vg(t);switch(n){case 3:return t3(t,n);case 9:return t3(t,n);case 4:{const o=t;if(vi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(vi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw md(n)}case 5:{const o=t;if(vi(o,"i")&&fs(o.i))return e.interpolate(e.list(o.i));if(vi(o,"index")&&fs(o.index))return e.interpolate(e.list(o.index));throw md(n)}case 6:{const o=t,s=bO(o),r=_O(o);return e.linked(d8(e,r),s?d8(e,s):void 0,e.type)}case 7:return t3(t,n);case 8:return t3(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const SO=e=>e;let n3=ko();function CO(e,t={}){let n=!1;const o=t.onError||Uj;return t.onError=s=>{n=!0,o(s)},{...mO(e,t),detectError:n}}function MO(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Vt(e)){Kn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||SO)(e),s=n3[o];if(s)return s;const{ast:r,detectError:i}=CO(e,{...t,location:!1,jit:!0}),l=lh(r);return i?l:n3[o]=l}else{const n=e.cacheKey;if(n){const o=n3[n];return o||(n3[n]=lh(e))}else return lh(e)}}let gd=null;function AO(e){gd=e}function TO(e,t,n){gd&&gd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const EO=IO("function:translate");function IO(e){return t=>gd&&gd.emit(e,t)}const Ul={INVALID_ARGUMENT:qj,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},LO=24;function Zl(e){return mp(e,null,void 0)}function wg(e,t){return t.locale!=null?Py(t.locale):Py(e.locale)}let ah;function Py(e){if(Vt(e))return e;if(No(e)){if(e.resolvedOnce&&ah!=null)return ah;if(e.constructor.name==="Function"){const t=e();if(Tj(t))throw Zl(Ul.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ah=t}else throw Zl(Ul.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Zl(Ul.NOT_SUPPORT_LOCALE_TYPE)}function $O(e,t,n){return[...new Set([n,...Uo(t)?t:Gn(t)?Object.keys(t):Vt(t)?[t]:[n]])]}function f8(e,t,n){const o=Vt(n)?n:vd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(o);if(!r){r=[];let i=[n];for(;Uo(i);)i=Hy(r,i,t);const l=Uo(t)||!ho(t)?t:t.default?t.default:null;i=Vt(l)?[l]:l,Uo(i)&&Hy(r,i,!1),s.__localeChainCache.set(o,r)}return r}function Hy(e,t,n){let o=!0;for(let s=0;s{i===void 0?i=l:i+=l},f[1]=()=>{i!==void 0&&(t.push(i),i=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,i===void 0||(i=OO(i),i===!1))return!1;f[1]()}};function p(){const h=e[n+1];if(o===5&&h==="'"||o===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;o!==null;)if(n++,r=e[n],!(r==="\\"&&p())){if(a=jO(r),d=f1[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=r,u()===!1))))return;if(o===7)return t}}const Dy=new Map;function HO(e,t){return Gn(e)?e[t]:null}function DO(e,t){if(!Gn(e))return null;let n=Dy.get(t);if(n||(n=PO(t),n&&Dy.set(t,n)),!n)return null;const o=n.length;let s=e,r=0;for(;r`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function WO(){return{upper:(e,t)=>t==="text"&&Vt(e)?e.toUpperCase():t==="vnode"&&Gn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&Vt(e)?e.toLowerCase():t==="vnode"&&Gn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&Vt(e)?Vy(e):t==="vnode"&&Gn(e)&&"__v_isVNode"in e?Vy(e.children):e}}let eT;function qO(e){eT=e}let tT;function UO(e){tT=e}let nT;function ZO(e){nT=e}let oT=null;const KO=e=>{oT=e},GO=()=>oT;let sT=null;const Wy=e=>{sT=e},YO=()=>sT;let qy=0;function XO(e={}){const t=No(e.onWarn)?e.onWarn:Ij,n=Vt(e.version)?e.version:VO,o=Vt(e.locale)||No(e.locale)?e.locale:vd,s=No(o)?vd:o,r=Uo(e.fallbackLocale)||ho(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,i=ho(e.messages)?e.messages:ch(s),l=ho(e.datetimeFormats)?e.datetimeFormats:ch(s),a=ho(e.numberFormats)?e.numberFormats:ch(s),c=hs(ko(),e.modifiers,WO()),u=e.pluralRules||ko(),d=No(e.missing)?e.missing:null,f=Kn(e.missingWarn)||Jc(e.missingWarn)?e.missingWarn:!0,p=Kn(e.fallbackWarn)||Jc(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,k=No(e.postTranslation)?e.postTranslation:null,x=ho(e.processor)?e.processor:null,w=Kn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,b=No(e.messageCompiler)?e.messageCompiler:eT,M=No(e.messageResolver)?e.messageResolver:tT||HO,R=No(e.localeFallbacker)?e.localeFallbacker:nT||$O,z=Gn(e.fallbackContext)?e.fallbackContext:void 0,$=e,T=Gn($.__datetimeFormatters)?$.__datetimeFormatters:new Map,E=Gn($.__numberFormatters)?$.__numberFormatters:new Map,N=Gn($.__meta)?$.__meta:{};qy++;const C={version:n,cid:qy,locale:o,fallbackLocale:r,messages:i,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:k,processor:x,warnHtmlMessage:w,escapeParameter:v,messageCompiler:b,messageResolver:M,localeFallbacker:R,fallbackContext:z,onWarn:t,__meta:N};return C.datetimeFormats=l,C.numberFormats=a,C.__datetimeFormatters=T,C.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&TO(C,n,N),C}const ch=e=>({[e]:ko()});function rT(e,t,n,o,s){const{missing:r,onWarn:i}=e;if(r!==null){const l=r(e,n,t,s);return Vt(l)?l:t}else return t}function e2(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function JO(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function QO(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o{o.includes(a)?l[a]=s[a]:t[a]=s[a]}),Vt(r)?t.locale=r:ho(r)&&(l=r),ho(i)&&(l=i),l}function Uy(e,...t){const{datetimeFormats:n,unresolving:o,onWarn:s}=e,{__datetimeFormatters:r}=e;if(!Vt(t[0])&&!VA(t[0])&&!fs(t[0]))return Z4;const[i,l,a,c]=p8(...t),u=Kn(a.missingWarn)?a.missingWarn:e.missingWarn,d=Kn(a.fallbackWarn)?a.fallbackWarn:e.fallbackWarn,f=!!a.part,p=wg(e,a);if(!Vt(i)||i===""){const w=new Intl.DateTimeFormat(p.replace(/!/g,""),c);return f?w.formatToParts(l):w.format(l)}const h=iT(e,i,p,n,u,d,"datetime format");if(!Vt(h))return o?gp:i;const m=n[h][i],k=lT(h,i,c);let x=r.get(k);return x||(x=new Intl.DateTimeFormat(h,hs({},m,c)),r.set(k,x)),f?x.formatToParts(l):x.format(l)}const uT=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function p8(...e){const[t]=e,n=ko(),o=ko();let s;if(Vt(t)){const i=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!i)throw Zl(Ul.INVALID_ISO_DATE_ARGUMENT);const l=i[3]?i[3].trim().startsWith("T")?`${i[1].trim()}${i[3].trim()}`:`${i[1].trim()}T${i[3].trim()}`:i[1].trim();s=new Date(l);try{s.toISOString()}catch{throw Zl(Ul.INVALID_ISO_DATE_ARGUMENT)}}else if(VA(t)){if(isNaN(t.getTime()))throw Zl(Ul.INVALID_DATE_ARGUMENT);s=t}else if(fs(t))s=t;else throw Zl(Ul.INVALID_ARGUMENT);const r=cT(e,n,o,uT);return[n.key||"",s,n,r]}function Zy(e,t,n){aT(e.__datetimeFormatters,t,n)}function Ky(e,...t){const{numberFormats:n,unresolving:o,onWarn:s}=e,{__numberFormatters:r}=e;if(!fs(t[0]))return Z4;const[i,l,a,c]=h8(...t),u=Kn(a.missingWarn)?a.missingWarn:e.missingWarn,d=Kn(a.fallbackWarn)?a.fallbackWarn:e.fallbackWarn,f=!!a.part,p=wg(e,a);if(!Vt(i)||i===""){const w=new Intl.NumberFormat(p.replace(/!/g,""),c);return f?w.formatToParts(l):w.format(l)}const h=iT(e,i,p,n,u,d,"number format");if(!Vt(h))return o?gp:i;const m=n[h][i],k=lT(h,i,c);let x=r.get(k);return x||(x=new Intl.NumberFormat(h,hs({},m,c)),r.set(k,x)),f?x.formatToParts(l):x.format(l)}const dT=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function h8(...e){const[t]=e,n=ko(),o=ko();if(!fs(t))throw Zl(Ul.INVALID_ARGUMENT);const s=t,r=cT(e,n,o,dT);return[n.key||"",s,n,r]}function Gy(e,t,n){aT(e.__numberFormatters,t,n)}const eP=e=>e,tP=e=>"",nP="text",oP=e=>e.length===0?"":hg(e),sP=Ej;function uh(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function rP(e){const t=fs(e.pluralIndex)?e.pluralIndex:-1;return fs(e.named?.count)?e.named.count:fs(e.named?.n)?e.named.n:t}function iP(e={}){const t=e.locale,n=rP(e),o=Vt(t)&&No(e.pluralRules?.[t])?e.pluralRules[t]:uh,s=o===uh?void 0:uh,r=x=>x[o(n,x.length,s)],i=e.list||[],l=x=>i[x],a=e.named||ko();fs(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=x=>a[x];function u(x,w){const v=No(e.messages)?e.messages(x,!!w):Gn(e.messages)?e.messages[x]:!1;return v||(e.parent?e.parent.message(x):tP)}const d=x=>e.modifiers?e.modifiers[x]:eP,f=No(e.processor?.normalize)?e.processor.normalize:oP,p=No(e.processor?.interpolate)?e.processor.interpolate:sP,h=Vt(e.processor?.type)?e.processor.type:nP,k={list:l,named:c,plural:r,linked:(x,...w)=>{const[v,b]=w;let M="text",R="";w.length===1?Gn(v)?(R=v.modifier||R,M=v.type||M):Vt(v)&&(R=v||R):w.length===2&&(Vt(v)&&(R=v||R),Vt(b)&&(M=b||M));const z=u(x,!0)(k),$=z===""||z===void 0?x:z,T=M==="vnode"&&Uo($)&&R?$[0]:$;return R?d(R)(T,M):T},message:u,type:h,interpolate:p,normalize:f,values:hs(ko(),i,a)};return k}const Yy=()=>"",hi=e=>No(e);function Xy(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:r,fallbackLocale:i,messages:l}=e,[a,c]=m8(...t),u=Kn(c.missingWarn)?c.missingWarn:e.missingWarn,d=Kn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Kn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,h=Vt(c.default)||Kn(c.default)?Kn(c.default)?r?a:()=>a:c.default:n?r?a:()=>a:null,m=n||h!=null&&(Vt(h)||No(h)),k=wg(e,c);f&&lP(c);let[x,w,v]=p?[a,k,l[k]||ko()]:fT(e,a,k,i,d,u),b=x,M=a;if(!p&&!(Vt(b)||vl(b)||hi(b))&&m&&(b=h,M=b),!p&&(!(Vt(b)||vl(b)||hi(b))||!Vt(w)))return s?gp:a;let R=!1;const z=()=>{R=!0},$=hi(b)?b:pT(e,a,w,b,M,z);if(R)return b;const T=uP(e,w,v,c),E=iP(T),N=aP(e,$,E);let C=o?o(N,a):N;if(f&&Vt(C)&&(C=Vj(C)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:Vt(a)?a:hi(b)?b.key:"",locale:w||(hi(b)?b.locale:""),format:Vt(b)?b:hi(b)?b.source:"",message:C};O.meta=hs({},e.__meta,GO()||{}),EO(O)}return C}function lP(e){Uo(e.list)?e.list=e.list.map(t=>Vt(t)?zy(t):t):Gn(e.named)&&Object.keys(e.named).forEach(t=>{Vt(e.named[t])&&(e.named[t]=zy(e.named[t]))})}function fT(e,t,n,o,s,r){const{messages:i,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=ko(),f,p=null;const h="translate";for(let m=0;mo);return c.locale=n,c.key=t,c}const a=i(o,cP(e,n,s,o,l,r));return a.locale=n,a.key=t,a.source=o,a}function aP(e,t,n){return t(n)}function m8(...e){const[t,n,o]=e,s=ko();if(!Vt(t)&&!fs(t)&&!hi(t)&&!vl(t))throw Zl(Ul.INVALID_ARGUMENT);const r=fs(t)?String(t):(hi(t),t);return fs(n)?s.plural=n:Vt(n)?s.default=n:ho(n)&&!fg(n)?s.named=n:Uo(n)&&(s.list=n),fs(o)?s.plural=o:Vt(o)?s.default=o:ho(o)&&hs(s,o),[r,s]}function cP(e,t,n,o,s,r){return{locale:t,key:n,warnHtmlMessage:s,onError:i=>{throw r&&r(i),i},onCacheKey:i=>Sj(t,n,i)}}function uP(e,t,n,o){const{modifiers:s,pluralRules:r,messageResolver:i,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:r,messages:(p,h)=>{let m=i(n,p);if(m==null&&(u||h)){const[k,,x]=fT(u||e,p,t,l,a,c);m=k??i(x,p)}if(Vt(m)||vl(m)){let k=!1;const w=pT(e,p,t,m,p,()=>{k=!0});return k?Yy:w}else return hi(m)?m:Yy}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),fs(o.plural)&&(f.pluralIndex=o.plural),f}gO();/*! + */function kO(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(t0().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(t0().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function vl(e){return Gn(e)&&wg(e)===0&&(vr(e,"b")||vr(e,"body"))}const KA=["b","body"];function bO(e){return d1(e,KA)}const GA=["c","cases"];function _O(e){return d1(e,GA,[])}const YA=["s","static"];function xO(e){return d1(e,YA)}const XA=["i","items"];function SO(e){return d1(e,XA,[])}const JA=["t","type"];function wg(e){return d1(e,JA)}const QA=["v","value"];function n3(e,t){const n=d1(e,QA);if(n!=null)return n;throw gd(t)}const eE=["m","modifier"];function CO(e){return d1(e,eE)}const tE=["k","key"];function MO(e){const t=d1(e,tE);if(t)return t;throw gd(6)}function d1(e,t,n){for(let o=0;oAO(n,e)}function AO(e,t){const n=bO(t);if(n==null)throw gd(0);if(wg(n)===1){const i=_O(n);return e.plural(i.reduce((r,l)=>[...r,Py(e,l)],[]))}else return Py(e,n)}function Py(e,t){const n=xO(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=SO(t).reduce((s,i)=>[...s,f8(e,i)],[]);return e.normalize(o)}}function f8(e,t){const n=wg(t);switch(n){case 3:return n3(t,n);case 9:return n3(t,n);case 4:{const o=t;if(vr(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(vr(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw gd(n)}case 5:{const o=t;if(vr(o,"i")&&fs(o.i))return e.interpolate(e.list(o.i));if(vr(o,"index")&&fs(o.index))return e.interpolate(e.list(o.index));throw gd(n)}case 6:{const o=t,s=CO(o),i=MO(o);return e.linked(f8(e,i),s?f8(e,s):void 0,e.type)}case 7:return n3(t,n);case 8:return n3(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const EO=e=>e;let o3=ko();function TO(e,t={}){let n=!1;const o=t.onError||Yj;return t.onError=s=>{n=!0,o(s)},{...yO(e,t),detectError:n}}function IO(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Vt(e)){Kn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||EO)(e),s=o3[o];if(s)return s;const{ast:i,detectError:r}=TO(e,{...t,location:!1,jit:!0}),l=ah(i);return r?l:o3[o]=l}else{const n=e.cacheKey;if(n){const o=o3[n];return o||(o3[n]=ah(e))}else return ah(e)}}let vd=null;function LO(e){vd=e}function $O(e,t,n){vd&&vd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const NO=zO("function:translate");function zO(e){return t=>vd&&vd.emit(e,t)}const Ul={INVALID_ARGUMENT:Gj,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},BO=24;function Zl(e){return gp(e,null,void 0)}function yg(e,t){return t.locale!=null?Hy(t.locale):Hy(e.locale)}let ch;function Hy(e){if(Vt(e))return e;if(No(e)){if(e.resolvedOnce&&ch!=null)return ch;if(e.constructor.name==="Function"){const t=e();if($j(t))throw Zl(Ul.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ch=t}else throw Zl(Ul.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Zl(Ul.NOT_SUPPORT_LOCALE_TYPE)}function RO(e,t,n){return[...new Set([n,...Uo(t)?t:Gn(t)?Object.keys(t):Vt(t)?[t]:[n]])]}function p8(e,t,n){const o=Vt(n)?n:wd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;Uo(r);)r=Dy(i,r,t);const l=Uo(t)||!ho(t)?t:t.default?t.default:null;r=Vt(l)?[l]:l,Uo(r)&&Dy(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Dy(e,t,n){let o=!0;for(let s=0;s{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=VO(r),r===!1))return!1;f[1]()}};function p(){const h=e[n+1];if(o===5&&h==="'"||o===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&p())){if(a=DO(i),d=f1[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Vy=new Map;function qO(e,t){return Gn(e)?e[t]:null}function UO(e,t){if(!Gn(e))return null;let n=Vy.get(t);if(n||(n=WO(t),n&&Vy.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function KO(){return{upper:(e,t)=>t==="text"&&Vt(e)?e.toUpperCase():t==="vnode"&&Gn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&Vt(e)?e.toLowerCase():t==="vnode"&&Gn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&Vt(e)?Wy(e):t==="vnode"&&Gn(e)&&"__v_isVNode"in e?Wy(e.children):e}}let oE;function GO(e){oE=e}let sE;function YO(e){sE=e}let iE;function XO(e){iE=e}let rE=null;const JO=e=>{rE=e},QO=()=>rE;let lE=null;const qy=e=>{lE=e},eP=()=>lE;let Uy=0;function tP(e={}){const t=No(e.onWarn)?e.onWarn:zj,n=Vt(e.version)?e.version:ZO,o=Vt(e.locale)||No(e.locale)?e.locale:wd,s=No(o)?wd:o,i=Uo(e.fallbackLocale)||ho(e.fallbackLocale)||Vt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=ho(e.messages)?e.messages:uh(s),l=ho(e.datetimeFormats)?e.datetimeFormats:uh(s),a=ho(e.numberFormats)?e.numberFormats:uh(s),c=hs(ko(),e.modifiers,KO()),u=e.pluralRules||ko(),d=No(e.missing)?e.missing:null,f=Kn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,p=Kn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,h=!!e.fallbackFormat,m=!!e.unresolving,k=No(e.postTranslation)?e.postTranslation:null,x=ho(e.processor)?e.processor:null,v=Kn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,w=!!e.escapeParameter,b=No(e.messageCompiler)?e.messageCompiler:oE,M=No(e.messageResolver)?e.messageResolver:sE||qO,R=No(e.localeFallbacker)?e.localeFallbacker:iE||RO,z=Gn(e.fallbackContext)?e.fallbackContext:void 0,$=e,E=Gn($.__datetimeFormatters)?$.__datetimeFormatters:new Map,T=Gn($.__numberFormatters)?$.__numberFormatters:new Map,N=Gn($.__meta)?$.__meta:{};Uy++;const C={version:n,cid:Uy,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:k,processor:x,warnHtmlMessage:v,escapeParameter:w,messageCompiler:b,messageResolver:M,localeFallbacker:R,fallbackContext:z,onWarn:t,__meta:N};return C.datetimeFormats=l,C.numberFormats=a,C.__datetimeFormatters=E,C.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&$O(C,n,N),C}const uh=e=>({[e]:ko()});function aE(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return Vt(l)?l:t}else return t}function t2(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function nP(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function oP(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o{o.includes(a)?l[a]=s[a]:t[a]=s[a]}),Vt(i)?t.locale=i:ho(i)&&(l=i),ho(r)&&(l=r),l}function Zy(e,...t){const{datetimeFormats:n,unresolving:o,onWarn:s}=e,{__datetimeFormatters:i}=e;if(!Vt(t[0])&&!UA(t[0])&&!fs(t[0]))return K4;const[r,l,a,c]=h8(...t),u=Kn(a.missingWarn)?a.missingWarn:e.missingWarn,d=Kn(a.fallbackWarn)?a.fallbackWarn:e.fallbackWarn,f=!!a.part,p=yg(e,a);if(!Vt(r)||r===""){const v=new Intl.DateTimeFormat(p.replace(/!/g,""),c);return f?v.formatToParts(l):v.format(l)}const h=cE(e,r,p,n,u,d,"datetime format");if(!Vt(h))return o?vp:r;const m=n[h][r],k=uE(h,r,c);let x=i.get(k);return x||(x=new Intl.DateTimeFormat(h,hs({},m,c)),i.set(k,x)),f?x.formatToParts(l):x.format(l)}const pE=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function h8(...e){const[t]=e,n=ko(),o=ko();let s;if(Vt(t)){const r=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!r)throw Zl(Ul.INVALID_ISO_DATE_ARGUMENT);const l=r[3]?r[3].trim().startsWith("T")?`${r[1].trim()}${r[3].trim()}`:`${r[1].trim()}T${r[3].trim()}`:r[1].trim();s=new Date(l);try{s.toISOString()}catch{throw Zl(Ul.INVALID_ISO_DATE_ARGUMENT)}}else if(UA(t)){if(isNaN(t.getTime()))throw Zl(Ul.INVALID_DATE_ARGUMENT);s=t}else if(fs(t))s=t;else throw Zl(Ul.INVALID_ARGUMENT);const i=fE(e,n,o,pE);return[n.key||"",s,n,i]}function Ky(e,t,n){dE(e.__datetimeFormatters,t,n)}function Gy(e,...t){const{numberFormats:n,unresolving:o,onWarn:s}=e,{__numberFormatters:i}=e;if(!fs(t[0]))return K4;const[r,l,a,c]=m8(...t),u=Kn(a.missingWarn)?a.missingWarn:e.missingWarn,d=Kn(a.fallbackWarn)?a.fallbackWarn:e.fallbackWarn,f=!!a.part,p=yg(e,a);if(!Vt(r)||r===""){const v=new Intl.NumberFormat(p.replace(/!/g,""),c);return f?v.formatToParts(l):v.format(l)}const h=cE(e,r,p,n,u,d,"number format");if(!Vt(h))return o?vp:r;const m=n[h][r],k=uE(h,r,c);let x=i.get(k);return x||(x=new Intl.NumberFormat(h,hs({},m,c)),i.set(k,x)),f?x.formatToParts(l):x.format(l)}const hE=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function m8(...e){const[t]=e,n=ko(),o=ko();if(!fs(t))throw Zl(Ul.INVALID_ARGUMENT);const s=t,i=fE(e,n,o,hE);return[n.key||"",s,n,i]}function Yy(e,t,n){dE(e.__numberFormatters,t,n)}const sP=e=>e,iP=e=>"",rP="text",lP=e=>e.length===0?"":mg(e),aP=Nj;function dh(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function cP(e){const t=fs(e.pluralIndex)?e.pluralIndex:-1;return fs(e.named?.count)?e.named.count:fs(e.named?.n)?e.named.n:t}function uP(e={}){const t=e.locale,n=cP(e),o=Vt(t)&&No(e.pluralRules?.[t])?e.pluralRules[t]:dh,s=o===dh?void 0:dh,i=x=>x[o(n,x.length,s)],r=e.list||[],l=x=>r[x],a=e.named||ko();fs(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=x=>a[x];function u(x,v){const w=No(e.messages)?e.messages(x,!!v):Gn(e.messages)?e.messages[x]:!1;return w||(e.parent?e.parent.message(x):iP)}const d=x=>e.modifiers?e.modifiers[x]:sP,f=No(e.processor?.normalize)?e.processor.normalize:lP,p=No(e.processor?.interpolate)?e.processor.interpolate:aP,h=Vt(e.processor?.type)?e.processor.type:rP,k={list:l,named:c,plural:i,linked:(x,...v)=>{const[w,b]=v;let M="text",R="";v.length===1?Gn(w)?(R=w.modifier||R,M=w.type||M):Vt(w)&&(R=w||R):v.length===2&&(Vt(w)&&(R=w||R),Vt(b)&&(M=b||M));const z=u(x,!0)(k),$=z===""||z===void 0?x:z,E=M==="vnode"&&Uo($)&&R?$[0]:$;return R?d(R)(E,M):E},message:u,type:h,interpolate:p,normalize:f,values:hs(ko(),r,a)};return k}const Xy=()=>"",hr=e=>No(e);function Jy(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=g8(...t),u=Kn(c.missingWarn)?c.missingWarn:e.missingWarn,d=Kn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=Kn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,p=!!c.resolvedMessage,h=Vt(c.default)||Kn(c.default)?Kn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||h!=null&&(Vt(h)||No(h)),k=yg(e,c);f&&dP(c);let[x,v,w]=p?[a,k,l[k]||ko()]:mE(e,a,k,r,d,u),b=x,M=a;if(!p&&!(Vt(b)||vl(b)||hr(b))&&m&&(b=h,M=b),!p&&(!(Vt(b)||vl(b)||hr(b))||!Vt(v)))return s?vp:a;let R=!1;const z=()=>{R=!0},$=hr(b)?b:gE(e,a,v,b,M,z);if(R)return b;const E=hP(e,v,w,c),T=uP(E),N=fP(e,$,T);let C=o?o(N,a):N;if(f&&Vt(C)&&(C=Zj(C)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:Vt(a)?a:hr(b)?b.key:"",locale:v||(hr(b)?b.locale:""),format:Vt(b)?b:hr(b)?b.source:"",message:C};O.meta=hs({},e.__meta,QO()||{}),NO(O)}return C}function dP(e){Uo(e.list)?e.list=e.list.map(t=>Vt(t)?By(t):t):Gn(e.named)&&Object.keys(e.named).forEach(t=>{Vt(e.named[t])&&(e.named[t]=By(e.named[t]))})}function mE(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=ko(),f,p=null;const h="translate";for(let m=0;mo);return c.locale=n,c.key=t,c}const a=r(o,pP(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function fP(e,t,n){return t(n)}function g8(...e){const[t,n,o]=e,s=ko();if(!Vt(t)&&!fs(t)&&!hr(t)&&!vl(t))throw Zl(Ul.INVALID_ARGUMENT);const i=fs(t)?String(t):(hr(t),t);return fs(n)?s.plural=n:Vt(n)?s.default=n:ho(n)&&!pg(n)?s.named=n:Uo(n)&&(s.list=n),fs(o)?s.plural=o:Vt(o)?s.default=o:ho(o)&&hs(s,o),[i,s]}function pP(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>Ej(t,n,r)}}function hP(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(p,h)=>{let m=r(n,p);if(m==null&&(u||h)){const[k,,x]=mE(u||e,p,t,l,a,c);m=k??r(x,p)}if(Vt(m)||vl(m)){let k=!1;const v=gE(e,p,t,m,p,()=>{k=!0});return k?Xy:v}else return hr(m)?m:Xy}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),fs(o.plural)&&(f.pluralIndex=o.plural),f}kO();/*! * vue-i18n v11.4.8 * (c) 2026 kazuya kawaguchi * Released under the MIT License. - */const dP="11.4.8";function fP(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(t0().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(t0().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(t0().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(t0().__INTLIFY_PROD_DEVTOOLS__=!1)}const pr={UNEXPECTED_RETURN_TYPE:LO,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function $r(e,...t){return mp(e,null,void 0)}const g8=u1("__translateVNode"),v8=u1("__datetimeParts"),w8=u1("__numberParts"),hT=u1("__setPluralRules"),mT=u1("__injectWithOption"),bc=u1("__dispose");function wd(e){if(!Gn(e)||vl(e))return e;for(const t in e)if(vi(e,t))if(!t.includes("."))Gn(e[t])&&wd(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,r=!1;for(let i=0;i{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(i[a]=i[a]||ko(),J3(c,i[a])):J3(c,i)}else Vt(l)&&J3(JSON.parse(l),i)}),s==null&&r)for(const l in i)vi(i,l)&&wd(i[l]);return i}function gT(e){return e.type}function vT(e,t,n){let o=Gn(t.messages)?t.messages:ko();"__i18nGlobal"in n&&(o=yg(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(r=>{e.mergeLocaleMessage(r,o[r])});{if(Gn(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(i=>{e.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(Gn(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(i=>{e.mergeNumberFormat(i,t.numberFormats[i])})}}}function Jy(e){return Z(Za,null,e,0)}function yd(){return gs()}const Qy="__INTLIFY_META__",ek=()=>[],pP=()=>!1;let tk=0;function nk(e){return((t,n,o,s)=>e(n,o,yd()||void 0,s))}const hP=()=>{const e=yd();let t=null;return e&&(t=gT(e)[Qy])?{[Qy]:t}:null};function K4(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,r=U4?U:jo;let i=Kn(e.inheritLocale)?e.inheritLocale:!0;const l=r(t&&i?t.locale.value:Vt(e.locale)?e.locale:vd),a=r(t&&i?t.fallbackLocale.value:Vt(e.fallbackLocale)||Uo(e.fallbackLocale)||ho(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=r(yg(l.value,e)),u=r(ho(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=r(ho(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:Kn(e.missingWarn)||Jc(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:Kn(e.fallbackWarn)||Jc(e.fallbackWarn)?e.fallbackWarn:!0,h=t?t.fallbackRoot:Kn(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,k=No(e.missing)?e.missing:null,x=No(e.missing)?nk(e.missing):null,w=No(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Kn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const M=t?t.modifiers:ho(e.modifiers)?e.modifiers:{};let R=e.pluralRules||t&&t.pluralRules,z;z=(()=>{o&&Wy(null);const re={version:dP,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:M,pluralRules:R,missing:x===null?void 0:x,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:v,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};re.datetimeFormats=u.value,re.numberFormats=d.value,re.__datetimeFormatters=ho(z)?z.__datetimeFormatters:void 0,re.__numberFormatters=ho(z)?z.__numberFormatters:void 0;const ke=XO(re);return o&&Wy(ke),ke})(),e2(z,l.value,a.value);function T(){return[l.value,a.value,c.value,u.value,d.value]}const E=B({get:()=>l.value,set:re=>{z.locale=re,l.value=re}}),N=B({get:()=>a.value,set:re=>{z.fallbackLocale=re,a.value=re,e2(z,l.value,re)}}),C=B(()=>c.value),O=B(()=>u.value),H=B(()=>d.value);function V(){return No(w)?w:null}function A(re){w=re,z.postTranslation=re}function F(){return k}function j(re){re!==null&&(x=nk(re)),k=re,z.missing=x}const q=(re,ke,Fe,at,dt,$t)=>{T();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,o||(z.fallbackContext=t?YO():void 0),Tt=re(z)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(z.fallbackContext=void 0)}if(Fe!=="translate exists"&&fs(Tt)&&Tt===gp||Fe==="translate exists"&&!Tt){const[Qt,Dt]=ke();return t&&h?at(t):dt(Qt)}else{if($t(Tt))return Tt;throw $r(pr.UNEXPECTED_RETURN_TYPE)}};function P(...re){return q(ke=>Reflect.apply(Xy,null,[ke,...re]),()=>m8(...re),"translate",ke=>Reflect.apply(ke.t,ke,[...re]),ke=>ke,ke=>Vt(ke))}function W(...re){const[ke,Fe,at]=re;if(at&&!Gn(at))throw $r(pr.INVALID_ARGUMENT);return P(ke,Fe,hs({resolvedMessage:!0},at||{}))}function G(...re){return q(ke=>Reflect.apply(Uy,null,[ke,...re]),()=>p8(...re),"datetime format",ke=>Reflect.apply(ke.d,ke,[...re]),()=>Z4,ke=>Vt(ke)||Uo(ke))}function ee(...re){return q(ke=>Reflect.apply(Ky,null,[ke,...re]),()=>h8(...re),"number format",ke=>Reflect.apply(ke.n,ke,[...re]),()=>Z4,ke=>Vt(ke)||Uo(ke))}function se(re){return re.map(ke=>Vt(ke)||fs(ke)||Kn(ke)?Jy(String(ke)):ke)}const Q={normalize:se,interpolate:re=>re,type:"vnode"};function ge(...re){return q(ke=>{let Fe;const at=ke;try{at.processor=Q,Fe=Reflect.apply(Xy,null,[at,...re])}finally{at.processor=null}return Fe},()=>m8(...re),"translate",ke=>ke[g8](...re),ke=>[Jy(ke)],ke=>Uo(ke))}function xe(...re){return q(ke=>Reflect.apply(Ky,null,[ke,...re]),()=>h8(...re),"number format",ke=>ke[w8](...re),ek,ke=>Vt(ke)||Uo(ke))}function Ke(...re){return q(ke=>Reflect.apply(Uy,null,[ke,...re]),()=>p8(...re),"datetime format",ke=>ke[v8](...re),ek,ke=>Vt(ke)||Uo(ke))}function et(re){R=re,z.pluralRules=R}function Y(re,ke){return q(()=>{if(!re)return!1;const Fe=Vt(ke)?ke:l.value,at=Vt(ke)?[Fe]:f8(z,a.value,Fe);for(let dt=0;dt[re],"translate exists",Fe=>Reflect.apply(Fe.te,Fe,[re,ke]),pP,Fe=>Kn(Fe))}function ne(re){let ke=null;const Fe=f8(z,a.value,l.value);for(let at=0;at{i&&(l.value=re,z.locale=re,e2(z,l.value,a.value))}),Ue(t.fallbackLocale,re=>{i&&(a.value=re,z.fallbackLocale=re,e2(z,l.value,a.value))}));const be={id:tk,locale:E,fallbackLocale:N,get inheritLocale(){return i},set inheritLocale(re){i=re,re&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,e2(z,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:C,get modifiers(){return M},get pluralRules(){return R||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(re){f=re,z.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(re){p=re,z.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(re){h=re},get fallbackFormat(){return m},set fallbackFormat(re){m=re,z.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(re){v=re,z.warnHtmlMessage=re},get escapeParameter(){return b},set escapeParameter(re){b=re,z.escapeParameter=re},t:P,getLocaleMessage:X,setLocaleMessage:ve,mergeLocaleMessage:fe,getPostTranslationHandler:V,setPostTranslationHandler:A,getMissingHandler:F,setMissingHandler:j,[hT]:et};return be.datetimeFormats=O,be.numberFormats=H,be.rt=W,be.te=Y,be.tm=D,be.d=G,be.n=ee,be.getDateTimeFormat=pe,be.setDateTimeFormat=te,be.mergeDateTimeFormat=de,be.getNumberFormat=ye,be.setNumberFormat=Ce,be.mergeNumberFormat=me,be[mT]=n,be[g8]=ge,be[v8]=Ke,be[w8]=xe,be}function mP(e){const t=Vt(e.locale)?e.locale:vd,n=Vt(e.fallbackLocale)||Uo(e.fallbackLocale)||ho(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=No(e.missing)?e.missing:void 0,s=Kn(e.silentTranslationWarn)||Jc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=Kn(e.silentFallbackWarn)||Jc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,i=Kn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=ho(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=No(e.postTranslation)?e.postTranslation:void 0,d=Vt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,p=Kn(e.sync)?e.sync:!0;let h=e.messages;if(ho(e.sharedMessages)){const M=e.sharedMessages;h=Object.keys(M).reduce((z,$)=>{const T=z[$]||(z[$]={});return hs(T,M[$]),z},h||{})}const{__i18n:m,__root:k,__injectWithOption:x}=e,w=e.datetimeFormats,v=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:h,flatJson:b,datetimeFormats:w,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:r,fallbackRoot:i,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:p,__i18n:m,__root:k,__injectWithOption:x}}function y8(e={}){const t=K4(mP(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return Kn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=Kn(s)?!s:s},get silentFallbackWarn(){return Kn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=Kn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,r){return t.te(s,r)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,r){t.setLocaleMessage(s,r)},mergeLocaleMessage(s,r){t.mergeLocaleMessage(s,r)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,r){t.setDateTimeFormat(s,r)},mergeDateTimeFormat(s,r){t.mergeDateTimeFormat(s,r)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,r){t.setNumberFormat(s,r)},mergeNumberFormat(s,r){t.mergeNumberFormat(s,r)}};return o.__extender=n,o}function gP(e,t,n){return{beforeCreate(){const o=yd();if(!o)throw $r(pr.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const r=s.i18n;if(s.__i18n&&(r.__i18n=s.__i18n),r.__root=t,this===this.$root)this.$i18n=ok(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=y8(r);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=ok(e,s);else{this.$i18n=y8({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&vT(t,s,s),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$te=(r,i)=>this.$i18n.te(r,i),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=yd();if(!o)throw $r(pr.UNEXPECTED_ERROR);const s=this.$i18n;s&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s?.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n)}}}function ok(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[hT](t.pluralizationRules||e.pluralizationRules);const n=yg(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const kg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function vP({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Me?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},ko())}function wT(){return Me}const wP=Ge({name:"i18n-t",props:hs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>fs(e)||!isNaN(e)}},kg),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return()=>{const r=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=ko();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=Vt(e.plural)?+e.plural:e.plural);const u=vP(t,a);return s[g8](e.keypath,u,c)},i=hs(ko(),o),l=Vt(e.tag)||Gn(e.tag)?e.tag:wT();return Gn(l)?hn(l,i,{default:r}):hn(l,i,r())}}}),sk=wP;function yP(e){return Uo(e)&&!Vt(e[0])}function yT(e,t,n,o){const{slots:s,attrs:r}=t;return()=>{const i=()=>{const c={part:!0};let u=ko();e.locale&&(c.locale=e.locale),Vt(e.format)?c.key=e.format:Gn(e.format)&&(Vt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((p,h)=>n.includes(h)?hs(ko(),p,{[h]:e.format[h]}):p,ko()));const d=o(e.value,c,u);let f=[c.key];return Uo(d)?f=d.map((p,h)=>{const m=s[p.type],k=m?m({[p.type]:p.value,index:h,parts:d}):[p.value];return yP(k)&&(k[0].key=`${p.type}-${h}`),k}):Vt(d)&&(f=[d]),f},l=hs(ko(),r),a=Vt(e.tag)||Gn(e.tag)?e.tag:wT();return Gn(a)?hn(a,l,{default:i}):hn(a,l,i())}}const kP=Ge({name:"i18n-n",props:hs({value:{type:Number,required:!0},format:{type:[String,Object]}},kg),setup(e,t){const n=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return yT(e,t,dT,(...o)=>n[w8](...o))}}),rk=kP;function bP(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function _P(e){const t=i=>{const{instance:l,value:a}=i;if(!l||!l.$)throw $r(pr.UNEXPECTED_ERROR);const c=bP(e,l.$),u=ik(a);return[Reflect.apply(c.t,c,[...lk(u)]),c]};return{created:(i,l)=>{const[a,c]=t(l);U4&&(i.__i18nWatcher=Ue(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),i.__composer=c,i.textContent=a},unmounted:i=>{U4&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:l})=>{if(i.__composer){const a=i.__composer,c=ik(l);i.textContent=Reflect.apply(a.t,a,[...lk(c)])}},getSSRProps:i=>{const[l]=t(i);return{textContent:l}}}}function ik(e){if(Vt(e))return{path:e};if(ho(e)){if(!("path"in e))throw $r(pr.REQUIRED_VALUE,"path");return e}else throw $r(pr.INVALID_VALUE)}function lk(e){const{path:t,locale:n,args:o,choice:s,plural:r}=e,i={},l=o||{};return Vt(n)&&(i.locale=n),fs(s)&&(i.plural=s),fs(r)&&(i.plural=r),[t,l,i]}function xP(e,t,...n){const o=ho(n[0])?n[0]:{};(Kn(o.globalInstall)?o.globalInstall:!0)&&([sk.name,"I18nT"].forEach(r=>e.component(r,sk)),[rk.name,"I18nN"].forEach(r=>e.component(r,rk)),[uk.name,"I18nD"].forEach(r=>e.component(r,uk))),e.directive("t",_P(t))}const SP=u1("global-vue-i18n");function CP(e={}){const t=__VUE_I18N_LEGACY_API__&&Kn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Kn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,r]=MP(e,t),i=u1("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=i,d.provide(d.__VUE_I18N_SYMBOL__,u),ho(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!t&&n&&(p=NP(d,u.global)),__VUE_I18N_FULL_INSTALL__&&xP(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(gP(r,r.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return r},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Lt(e={}){const t=yd();if(t==null)throw $r(pr.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw $r(pr.NOT_INSTALLED);const n=AP(t),o=EP(n),s=gT(t),r=TP(e,s);if(r==="global")return vT(o,e,s),o;if(r==="parent"){let a=ak(n,t,e.__useComponent);return a==null&&(a=o),a}if(r==="isolated"){if(n.mode!=="composition")throw $r(pr.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=hs({},e),u=ak(n,t);c.__root=u||o;const d=K4(c);return a.__composerExtend&&(d[bc]=a.__composerExtend(d)),G7()&&du(()=>{const p=d[bc];p&&(p(),delete d[bc])}),d}const i=n;let l=i.__getInstance(t);if(l==null){const a=hs({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=K4(a),i.__composerExtend&&(l[bc]=i.__composerExtend(l)),LP(i,t,l),i.__setInstance(t,l)}return l}function MP(e,t){const n=UB(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>y8(e)):n.run(()=>K4(e));if(o==null)throw $r(pr.UNEXPECTED_ERROR);return[n,o]}function AP(e){const t=pn(e.isCE?SP:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw $r(e.isCE?pr.NOT_INSTALLED_WITH_PROVIDE:pr.UNEXPECTED_ERROR);return t}function TP(e,t){return fg(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function EP(e){return e.mode==="composition"?e.global:e.global.__composer}function ak(e,t,n=!1){let o=null;const s=t.root;let r=IP(t,n);for(;r!=null;){const i=e;if(e.mode==="composition")o=i.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const l=i.__getInstance(r);l!=null&&(o=l.__composer,n&&o&&!o[mT]&&(o=null))}if(o!=null||s===r)break;r=r.parent}return o}function IP(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function LP(e,t,n){xn(()=>{},t),An(()=>{const o=n;e.__deleteInstance(t);const s=o[bc];s&&(s(),delete o[bc])},t)}const $P=["locale","fallbackLocale","availableLocales"],ck=["t","rt","d","n","tm","te"];function NP(e,t){const n=Object.create(null);return $P.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r)throw $r(pr.UNEXPECTED_ERROR);const i=rs(r.value)?{get(){return r.value.value},set(l){r.value.value=l}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,s,i)}),e.config.globalProperties.$i18n=n,ck.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r||!r.value)throw $r(pr.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,r)}),()=>{delete e.config.globalProperties.$i18n,ck.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const zP=Ge({name:"i18n-d",props:hs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},kg),setup(e,t){const n=e.i18n||Lt({useScope:e.scope,__useComponent:!0});return yT(e,t,uT,(...o)=>n[v8](...o))}}),uk=zP;fP();qO(MO);UO(DO);ZO(f8);if(__INTLIFY_PROD_DEVTOOLS__){const e=t0();e.__INTLIFY__=!0,AO(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const BP="modulepreload",RP=function(e){return"/"+e},dk={},ps=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let i=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=i(n.map(c=>{if(c=RP(c),c in dk)return;dk[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":BP,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},FP="/brand/pythinker_banner_dark.svg";async function ss(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return OP(e)}function jP(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||ss(e)}function OP(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const ln={permission:"pythinker-web.permission",activeWorkspace:"pythinker-active-workspace",planMode:"pythinker-web.plan-mode",planArmed:"pythinker-web.plan-armed",dynamicWorkflowMode:"pythinker-web.dynamic-workflow-mode",goalMode:"pythinker-web.goal-mode",uiFontSize:"pythinker-web.ui-font-size",starredModels:"pythinker-web.starred-models",unread:"pythinker-web.unread",onboarded:"pythinker-web.onboarded",accent:"pythinker-web.accent",colorScheme:"pythinker-web.color-scheme",hiddenWorkspaces:"pythinker-web.hidden-workspaces",collapsedWorkspaces:"pythinker-web.collapsed-workspaces",workspaceOrder:"pythinker-web.workspace-order",workspaceNameOverrides:"pythinker-web.workspace-name-overrides",workspaceSort:"pythinker-web.workspace-sort",pinnedSessions:"pythinker-web.pinned-sessions",pinnedCollapsed:"pythinker-web.pinned-collapsed",recentEmojis:"pythinker-web.recent-emojis",conversationToc:"pythinker-web.beta-toc",notifyOnComplete:"pythinker-web.notify-on-complete",notifyOnQuestion:"pythinker-web.notify-on-question",notifyOnApproval:"pythinker-web.notify-on-approval",soundOnComplete:"pythinker-web.sound-on-complete",inputHistory:"pythinker-web.input-history",clientId:"pythinker-web.client-id",debug:"pythinker-web.debug",openInLastTarget:"pythinker-web.open-in.last-target",sidebarCollapsed:"pythinker-web.sidebar-collapsed",sidebarPinnedHeight:"pythinker-web.sidebar-pinned-height",sidebarWidth:"pythinker-web.sidebar-width",codeFont:"pythinker-web.code-font",contentAlign:"pythinker-web.content-align",theme:"pythinker-web.theme",thinking:"pythinker-web.thinking"};function fk(e){return`pythinker-web.draft.${e&&e.length>0?e:"__new__"}`}function Yo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function vs(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function w0(e){try{globalThis.localStorage.removeItem(e)}catch{}}function hu(e){const t=Yo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function p1(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function bg(){const e=Yo(ln.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function _g(e){const n={...bg()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];vs(ln.unread,JSON.stringify(n))}function PP(){const e=hu(ln.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function dh(e){p1(ln.collapsedWorkspaces,Array.from(e))}function HP(){const e=hu(ln.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kT(e){p1(ln.workspaceOrder,Array.from(e))}function o3(){const e=hu(ln.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function pk(e){p1(ln.workspaceNameOverrides,e)}function DP(){return Yo(ln.workspaceSort)}function bT(e){vs(ln.workspaceSort,e)}function VP(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(r=>n.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:[...s,...o]}function WP(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function qP(e,t,n,o="before"){const s=e.indexOf(t),r=e.indexOf(n);if(s===-1||r===-1||s===r)return e;const i=[...e];i.splice(s,1);const l=s(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const ZP={"&":"&","<":"<",">":">",'"':""","'":"'"};function hk(e){return e.replace(/[&<>"']/g,t=>ZP[t]??t)}function KP(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GP(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return mk(o,n*2);const r=o.toLowerCase().indexOf(s.toLowerCase());if(r<0)return mk(o,n*2);const i=Math.max(0,r-n),l=Math.min(o.length,r+s.length+n),a=i>0,c=l`${r}`)}const G1=U(0),YP=["type","disabled","aria-label"],XP=Ge({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=U();return t({el:n}),(o,s)=>(g(),S("button",{ref_key:"el",ref:n,class:Be(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Tn(o.$slots,"default",{},void 0,!0)],10,YP))}}),mt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Zt=mt(XP,[["__scopeId","data-v-4b23513f"]]),s3=U(!1);let gk=!1;function fh(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function vp(){return!gk&&typeof window<"u"&&typeof document<"u"&&(gk=!0,s3.value=fh(),new MutationObserver(()=>{s3.value=fh()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia?.("(prefers-color-scheme: dark)")?.addEventListener("change",()=>{s3.value=fh()})),s3}const _T="file",JP="folder",r3={"._sc_":"godot-assets",".adonisrc.json":"adonis",".aiexclude":"gemini-ai",".angular-cli.json":"angular",".appveyor.yml":"appveyor",".astylerc":"astyle",".autorc":"auto",".babel-plugin-macrosrc":"babel",".babel-plugin-macrosrc.cjs":"babel",".babel-plugin-macrosrc.cts":"babel",".babel-plugin-macrosrc.js":"babel",".babel-plugin-macrosrc.json":"babel",".babel-plugin-macrosrc.json5":"babel",".babel-plugin-macrosrc.jsonc":"babel",".babel-plugin-macrosrc.mjs":"babel",".babel-plugin-macrosrc.mts":"babel",".babel-plugin-macrosrc.toml":"babel",".babel-plugin-macrosrc.ts":"babel",".babel-plugin-macrosrc.yaml":"babel",".babel-plugin-macrosrc.yml":"babel",".babelrc":"babel",".babelrc.cjs":"babel",".babelrc.cts":"babel",".babelrc.js":"babel",".babelrc.json":"babel",".babelrc.json5":"babel",".babelrc.jsonc":"babel",".babelrc.mjs":"babel",".babelrc.mts":"babel",".babelrc.toml":"babel",".babelrc.ts":"babel",".babelrc.yaml":"babel",".babelrc.yml":"babel",".bazelignore":"bazel",".bazelrc":"bazel",".bazelversion":"bazel",".biome.json":"biome",".biome.jsonc":"biome",".bithoundrc":"bithound",".blitz.config.compiled.js":"blitz",".bowerrc":"bower",".browserslistrc":"browserlist",".buckconfig":"buck",".buildignore":"settings",".bun-version":"bun",".cfignore":"cloudfoundry",".clang-format":"settings",".clang-format-ignore":"settings",".clang-tidy":"settings",".clangd":"clangd",".clinerules":"cline",".codeclimate.yml":"code-climate",".codecov.yaml":"codecov",".codecov.yml":"codecov",".coderabbit.yaml":"coderabbit-ai",".coderabbit.yml":"coderabbit-ai",".commitlint.yaml":"commitlint",".commitlint.yml":"commitlint",".commitlintrc":"commitlint",".commitlintrc.cjs":"commitlint",".commitlintrc.cts":"commitlint",".commitlintrc.js":"commitlint",".commitlintrc.json":"commitlint",".commitlintrc.json5":"commitlint",".commitlintrc.jsonc":"commitlint",".commitlintrc.mjs":"commitlint",".commitlintrc.mts":"commitlint",".commitlintrc.toml":"commitlint",".commitlintrc.ts":"commitlint",".commitlintrc.yaml":"commitlint",".commitlintrc.yml":"commitlint",".conf":"settings",".config/babel-plugin-macrosrc":"babel",".config/babel-plugin-macrosrc.cjs":"babel",".config/babel-plugin-macrosrc.cts":"babel",".config/babel-plugin-macrosrc.js":"babel",".config/babel-plugin-macrosrc.json":"babel",".config/babel-plugin-macrosrc.json5":"babel",".config/babel-plugin-macrosrc.jsonc":"babel",".config/babel-plugin-macrosrc.mjs":"babel",".config/babel-plugin-macrosrc.mts":"babel",".config/babel-plugin-macrosrc.toml":"babel",".config/babel-plugin-macrosrc.ts":"babel",".config/babel-plugin-macrosrc.yaml":"babel",".config/babel-plugin-macrosrc.yml":"babel",".config/babelrc":"babel",".config/babelrc.cjs":"babel",".config/babelrc.cts":"babel",".config/babelrc.js":"babel",".config/babelrc.json":"babel",".config/babelrc.json5":"babel",".config/babelrc.jsonc":"babel",".config/babelrc.mjs":"babel",".config/babelrc.mts":"babel",".config/babelrc.toml":"babel",".config/babelrc.ts":"babel",".config/babelrc.yaml":"babel",".config/babelrc.yml":"babel",".config/commitlintrc":"commitlint",".config/commitlintrc.cjs":"commitlint",".config/commitlintrc.cts":"commitlint",".config/commitlintrc.js":"commitlint",".config/commitlintrc.json":"commitlint",".config/commitlintrc.json5":"commitlint",".config/commitlintrc.jsonc":"commitlint",".config/commitlintrc.mjs":"commitlint",".config/commitlintrc.mts":"commitlint",".config/commitlintrc.toml":"commitlint",".config/commitlintrc.ts":"commitlint",".config/commitlintrc.yaml":"commitlint",".config/commitlintrc.yml":"commitlint",".config/cracorc":"craco",".config/cracorc.cjs":"craco",".config/cracorc.cts":"craco",".config/cracorc.js":"craco",".config/cracorc.json":"craco",".config/cracorc.json5":"craco",".config/cracorc.jsonc":"craco",".config/cracorc.mjs":"craco",".config/cracorc.mts":"craco",".config/cracorc.toml":"craco",".config/cracorc.ts":"craco",".config/cracorc.yaml":"craco",".config/cracorc.yml":"craco",".config/eslintrc":"eslint",".config/eslintrc.cjs":"eslint",".config/eslintrc.cts":"eslint",".config/eslintrc.js":"eslint",".config/eslintrc.json":"eslint",".config/eslintrc.json5":"eslint",".config/eslintrc.jsonc":"eslint",".config/eslintrc.mjs":"eslint",".config/eslintrc.mts":"eslint",".config/eslintrc.toml":"eslint",".config/eslintrc.ts":"eslint",".config/eslintrc.yaml":"eslint",".config/eslintrc.yml":"eslint",".config/graphqlrc":"graphql",".config/graphqlrc.cjs":"graphql",".config/graphqlrc.cts":"graphql",".config/graphqlrc.js":"graphql",".config/graphqlrc.json":"graphql",".config/graphqlrc.json5":"graphql",".config/graphqlrc.jsonc":"graphql",".config/graphqlrc.mjs":"graphql",".config/graphqlrc.mts":"graphql",".config/graphqlrc.toml":"graphql",".config/graphqlrc.ts":"graphql",".config/graphqlrc.yaml":"graphql",".config/graphqlrc.yml":"graphql",".config/huskyrc":"husky",".config/huskyrc.cjs":"husky",".config/huskyrc.cts":"husky",".config/huskyrc.js":"husky",".config/huskyrc.json":"husky",".config/huskyrc.json5":"husky",".config/huskyrc.jsonc":"husky",".config/huskyrc.mjs":"husky",".config/huskyrc.mts":"husky",".config/huskyrc.toml":"husky",".config/huskyrc.ts":"husky",".config/huskyrc.yaml":"husky",".config/huskyrc.yml":"husky",".config/postcssrc":"postcss",".config/postcssrc.cjs":"postcss",".config/postcssrc.cts":"postcss",".config/postcssrc.js":"postcss",".config/postcssrc.json":"postcss",".config/postcssrc.json5":"postcss",".config/postcssrc.jsonc":"postcss",".config/postcssrc.mjs":"postcss",".config/postcssrc.mts":"postcss",".config/postcssrc.toml":"postcss",".config/postcssrc.ts":"postcss",".config/postcssrc.yaml":"postcss",".config/postcssrc.yml":"postcss",".config/posthtmlrc":"posthtml",".config/posthtmlrc.cjs":"posthtml",".config/posthtmlrc.cts":"posthtml",".config/posthtmlrc.js":"posthtml",".config/posthtmlrc.json":"posthtml",".config/posthtmlrc.json5":"posthtml",".config/posthtmlrc.jsonc":"posthtml",".config/posthtmlrc.mjs":"posthtml",".config/posthtmlrc.mts":"posthtml",".config/posthtmlrc.toml":"posthtml",".config/posthtmlrc.ts":"posthtml",".config/posthtmlrc.yaml":"posthtml",".config/posthtmlrc.yml":"posthtml",".config/prettierrc":"prettier",".config/prettierrc.cjs":"prettier",".config/prettierrc.cts":"prettier",".config/prettierrc.js":"prettier",".config/prettierrc.json":"prettier",".config/prettierrc.json5":"prettier",".config/prettierrc.jsonc":"prettier",".config/prettierrc.mjs":"prettier",".config/prettierrc.mts":"prettier",".config/prettierrc.toml":"prettier",".config/prettierrc.ts":"prettier",".config/prettierrc.yaml":"prettier",".config/prettierrc.yml":"prettier",".config/puppeteerrc":"puppeteer",".config/puppeteerrc.cjs":"puppeteer",".config/puppeteerrc.cts":"puppeteer",".config/puppeteerrc.js":"puppeteer",".config/puppeteerrc.json":"puppeteer",".config/puppeteerrc.json5":"puppeteer",".config/puppeteerrc.jsonc":"puppeteer",".config/puppeteerrc.mjs":"puppeteer",".config/puppeteerrc.mts":"puppeteer",".config/puppeteerrc.toml":"puppeteer",".config/puppeteerrc.ts":"puppeteer",".config/puppeteerrc.yaml":"puppeteer",".config/puppeteerrc.yml":"puppeteer",".config/releaserc":"semantic-release",".config/releaserc.cjs":"semantic-release",".config/releaserc.cts":"semantic-release",".config/releaserc.js":"semantic-release",".config/releaserc.json":"semantic-release",".config/releaserc.json5":"semantic-release",".config/releaserc.jsonc":"semantic-release",".config/releaserc.mjs":"semantic-release",".config/releaserc.mts":"semantic-release",".config/releaserc.toml":"semantic-release",".config/releaserc.ts":"semantic-release",".config/releaserc.yaml":"semantic-release",".config/releaserc.yml":"semantic-release",".config/stylelintrc":"stylelint",".config/stylelintrc.cjs":"stylelint",".config/stylelintrc.cts":"stylelint",".config/stylelintrc.js":"stylelint",".config/stylelintrc.json":"stylelint",".config/stylelintrc.json5":"stylelint",".config/stylelintrc.jsonc":"stylelint",".config/stylelintrc.mjs":"stylelint",".config/stylelintrc.mts":"stylelint",".config/stylelintrc.toml":"stylelint",".config/stylelintrc.ts":"stylelint",".config/stylelintrc.yaml":"stylelint",".config/stylelintrc.yml":"stylelint",".config/svgrrc":"svgr",".config/svgrrc.cjs":"svgr",".config/svgrrc.cts":"svgr",".config/svgrrc.js":"svgr",".config/svgrrc.json":"svgr",".config/svgrrc.json5":"svgr",".config/svgrrc.jsonc":"svgr",".config/svgrrc.mjs":"svgr",".config/svgrrc.mts":"svgr",".config/svgrrc.toml":"svgr",".config/svgrrc.ts":"svgr",".config/svgrrc.yaml":"svgr",".config/svgrrc.yml":"svgr",".config/syncpackrc":"syncpack",".config/syncpackrc.cjs":"syncpack",".config/syncpackrc.cts":"syncpack",".config/syncpackrc.js":"syncpack",".config/syncpackrc.json":"syncpack",".config/syncpackrc.json5":"syncpack",".config/syncpackrc.jsonc":"syncpack",".config/syncpackrc.mjs":"syncpack",".config/syncpackrc.mts":"syncpack",".config/syncpackrc.toml":"syncpack",".config/syncpackrc.ts":"syncpack",".config/syncpackrc.yaml":"syncpack",".config/syncpackrc.yml":"syncpack",".copilotignore":"copilot",".coverage":"python-misc",".coveragerc":"python-misc",".cracorc":"craco",".cracorc.cjs":"craco",".cracorc.cts":"craco",".cracorc.js":"craco",".cracorc.json":"craco",".cracorc.json5":"craco",".cracorc.jsonc":"craco",".cracorc.mjs":"craco",".cracorc.mts":"craco",".cracorc.toml":"craco",".cracorc.ts":"craco",".cracorc.yaml":"craco",".cracorc.yml":"craco",".cursor":"cursor",".cursor.json":"cursor",".cursorignore":"cursor",".cursorindexingignore":"cursor",".cursorrc":"cursor",".cursorrules":"cursor",".cz.json":"commitizen",".cz.toml":"commitizen",".cz.yaml":"commitizen",".cz.yml":"commitizen",".czrc":"commitizen",".deepsource.toml":"deepsource",".dev.vars":"tune",".drone.yml":"drone",".easignore":"expo",".ecrc":"editorconfig",".editorconfig":"editorconfig",".editorconfig-checker.json":"editorconfig",".ember-cli":"ember",".ember-cli.js":"ember",".env.alpha":"tune",".env.defaults":"tune",".env.dev":"tune",".env.dev.local":"tune",".env.development":"tune",".env.development.local":"tune",".env.dist":"tune",".env.e2e":"tune",".env.example":"tune",".env.local":"tune",".env.preview":"tune",".env.prod":"tune",".env.prod.example":"tune",".env.prod.local":"tune",".env.production":"tune",".env.production.example":"tune",".env.production.local":"tune",".env.qa":"tune",".env.qa.local":"tune",".env.sample":"tune",".env.schema":"tune",".env.sentry-build-plugin":"sentry",".env.stage":"tune",".env.staging":"tune",".env.staging.local":"tune",".env.stg":"tune",".env.stg.local":"tune",".env.template":"tune",".env.test":"tune",".env.test.local":"tune",".env.testing":"tune",".env.uat":"tune",".envrc":"console",".esformatter":"json",".eslintcache":"eslint",".eslintignore":"eslint",".eslintrc":"eslint",".eslintrc-jsdoc.js":"eslint",".eslintrc-md.js":"eslint",".eslintrc.base.json":"eslint",".eslintrc.cjs":"eslint",".eslintrc.cts":"eslint",".eslintrc.js":"eslint",".eslintrc.json":"eslint",".eslintrc.json5":"eslint",".eslintrc.jsonc":"eslint",".eslintrc.mjs":"eslint",".eslintrc.mts":"eslint",".eslintrc.toml":"eslint",".eslintrc.ts":"eslint",".eslintrc.yaml":"eslint",".eslintrc.yml":"eslint",".esmrc":"nodejs",".firebaserc":"firebase",".flowconfig":"flow",".gardenignore":"garden",".gcloudignore":"gcp",".gdignore":"godot-assets",".git":"git",".git-blame-ignore":"git",".git-blame-ignore-revs":"git",".git-for-windows-updater":"git",".gitattributes":"git",".gitattributes-global":"git",".gitattributes_global":"git",".gitconfig":"git",".github/funding.yml":"github-sponsors",".github/labeler.yaml":"label",".github/labeler.yml":"label",".gitignore":"git",".gitignore-global":"git",".gitignore_global":"git",".gitinclude":"git",".gitkeep":"git",".gitmessage":"git",".gitmodules":"git",".gitpod.yml":"gitpod",".gitpreserve":"git",".graphqlconfig":"graphql",".graphqlrc":"graphql",".graphqlrc.cjs":"graphql",".graphqlrc.cts":"graphql",".graphqlrc.js":"graphql",".graphqlrc.json":"graphql",".graphqlrc.json5":"graphql",".graphqlrc.jsonc":"graphql",".graphqlrc.mjs":"graphql",".graphqlrc.mts":"graphql",".graphqlrc.toml":"graphql",".graphqlrc.ts":"graphql",".graphqlrc.yaml":"graphql",".graphqlrc.yml":"graphql",".hadolint.yaml":"hadolint",".hadolint.yml":"hadolint",".happo.cjs":"happo",".happo.js":"happo",".happo.mjs":"happo",".helmignore":"helm",".hg":"mercurial",".hgflow":"mercurial",".hgignore":"mercurial",".hgrc":"mercurial",".hgtags":"mercurial",".hhconfig":"hack",".hintrc":"webhint",".histoire.cjs":"histoire",".histoire.cts":"histoire",".histoire.js":"histoire",".histoire.mjs":"histoire",".histoire.mts":"histoire",".histoire.ts":"histoire",".htaccess":"xml",".htpasswd":"key",".hushlogin":"console",".huskyrc":"husky",".huskyrc.cjs":"husky",".huskyrc.cts":"husky",".huskyrc.js":"husky",".huskyrc.json":"husky",".huskyrc.json5":"husky",".huskyrc.jsonc":"husky",".huskyrc.mjs":"husky",".huskyrc.mts":"husky",".huskyrc.toml":"husky",".huskyrc.ts":"husky",".huskyrc.yaml":"husky",".huskyrc.yml":"husky",".io-config.json":"ionic",".istanbul.yml":"istanbul",".jestrc":"jest",".jestrc.js":"jest",".jestrc.json":"jest",".jsbeautifyrc":"json",".jscsrc":"json",".jshintignore":"settings",".jshintrc":"json",".justfile":"just",".k8s.yaml":"kubernetes",".k8s.yml":"kubernetes",".keep":"git",".kl":"kl",".knip.json":"knip",".knip.jsonc":"knip",".latexmkrc":"latexmk",".lefthook-local.json":"lefthook",".lefthook-local.toml":"lefthook",".lefthook-local.yaml":"lefthook",".lefthook-local.yml":"lefthook",".lefthook.json":"lefthook",".lefthook.toml":"lefthook",".lefthook.yaml":"lefthook",".lefthook.yml":"lefthook",".lefthookrc":"lefthook",".liaraignore":"liara",".lighthouserc.cjs":"lighthouse",".lighthouserc.js":"lighthouse",".lighthouserc.json":"lighthouse",".lighthouserc.yaml":"lighthouse",".lighthouserc.yml":"lighthouse",".lintstagedrc":"lintstaged",".lintstagedrc.cjs":"lintstaged",".lintstagedrc.js":"lintstaged",".lintstagedrc.json":"lintstaged",".lintstagedrc.mjs":"lintstaged",".lintstagedrc.yaml":"lintstaged",".lintstagedrc.yml":"lintstaged",".luacheckrc":"lua",".luaurc":"luau",".mailmap":"email",".markdownlint-cli2.cjs":"markdownlint",".markdownlint-cli2.jsonc":"markdownlint",".markdownlint-cli2.mjs":"markdownlint",".markdownlint-cli2.yaml":"markdownlint",".markdownlint.json":"markdownlint",".markdownlint.jsonc":"markdownlint",".markdownlint.yaml":"markdownlint",".markdownlint.yml":"markdownlint",".markdownlintignore":"markdownlint",".mcattributes":"minecraft",".mcdefinitions":"minecraft",".mcignore":"minecraft",".mincloudrc":"ifanr-cloud",".mjmlconfig":"mjml",".mocharc.cjs":"mocha",".mocharc.js":"mocha",".mocharc.json":"mocha",".mocharc.jsonc":"mocha",".mocharc.yaml":"mocha",".mocharc.yml":"mocha",".modernizrrc":"modernizr",".modernizrrc.js":"modernizr",".modernizrrc.json":"modernizr",".mrconfig":"settings",".nano-staged.cjs":"nano-staged",".nano-staged.js":"nano-staged",".nano-staged.json":"nano-staged",".nano-staged.mjs":"nano-staged",".nanostagedrc":"nano-staged",".nest-cli.json":"nest",".nestconfig.json":"nest",".node-version":"nodejs",".nowignore":"vercel",".npmignore":"npm",".npmrc":"npm",".nuspec":"nuget",".nuxtignore":"nuxt",".nuxtrc":"nuxt",".nvmrc":"nodejs",".nxignore":"nx",".nycrc":"istanbul",".nycrc.json":"istanbul",".nycrc.yaml":"istanbul",".nycrc.yml":"istanbul",".oxfmtrc.json":"oxc",".oxfmtrc.jsonc":"oxc",".oxlintrc.json":"oxc",".oxlintrc.jsonc":"oxc",".packshiprc":"packship",".packshiprc.js":"packship",".packshiprc.json":"packship",".packshiprc.ts":"packship",".parcelrc":"parcel",".pdm-python":"pdm",".percy.yml":"percy",".php-cs-fixer.dist.php":"php-cs-fixer",".php-cs-fixer.php":"php-cs-fixer",".php_cs":"php-cs-fixer",".php_cs.dist":"php-cs-fixer",".php_cs.dist.php":"php-cs-fixer",".php_cs.php":"php-cs-fixer",".phpunit-watcher.yml":"phpunit",".phpunit.result.cache":"phpunit",".pnpmfile.cjs":"pnpm",".postcssrc":"postcss",".postcssrc.cjs":"postcss",".postcssrc.cts":"postcss",".postcssrc.js":"postcss",".postcssrc.json":"postcss",".postcssrc.json5":"postcss",".postcssrc.jsonc":"postcss",".postcssrc.mjs":"postcss",".postcssrc.mts":"postcss",".postcssrc.toml":"postcss",".postcssrc.ts":"postcss",".postcssrc.yaml":"postcss",".postcssrc.yml":"postcss",".posthtmlrc":"posthtml",".posthtmlrc.cjs":"posthtml",".posthtmlrc.cts":"posthtml",".posthtmlrc.js":"posthtml",".posthtmlrc.json":"posthtml",".posthtmlrc.json5":"posthtml",".posthtmlrc.jsonc":"posthtml",".posthtmlrc.mjs":"posthtml",".posthtmlrc.mts":"posthtml",".posthtmlrc.toml":"posthtml",".posthtmlrc.ts":"posthtml",".posthtmlrc.yaml":"posthtml",".posthtmlrc.yml":"posthtml",".pre-commit-config.yaml":"pre-commit",".pre-commit-hooks.yaml":"pre-commit",".prettierignore":"prettier",".prettierrc":"prettier",".prettierrc.cjs":"prettier",".prettierrc.cts":"prettier",".prettierrc.js":"prettier",".prettierrc.json":"prettier",".prettierrc.json5":"prettier",".prettierrc.jsonc":"prettier",".prettierrc.mjs":"prettier",".prettierrc.mts":"prettier",".prettierrc.toml":"prettier",".prettierrc.ts":"prettier",".prettierrc.yaml":"prettier",".prettierrc.yml":"prettier",".pubignore":"dart",".pug-lintrc":"pug",".pug-lintrc.js":"pug",".pug-lintrc.json":"pug",".puppeteerrc":"puppeteer",".puppeteerrc.cjs":"puppeteer",".puppeteerrc.cts":"puppeteer",".puppeteerrc.js":"puppeteer",".puppeteerrc.json":"puppeteer",".puppeteerrc.json5":"puppeteer",".puppeteerrc.jsonc":"puppeteer",".puppeteerrc.mjs":"puppeteer",".puppeteerrc.mts":"puppeteer",".puppeteerrc.toml":"puppeteer",".puppeteerrc.ts":"puppeteer",".puppeteerrc.yaml":"puppeteer",".puppeteerrc.yml":"puppeteer",".pylintrc":"python-misc",".python-version":"python-misc",".qa-mincloudrc":"ifanr-cloud",".release-it.cjs":"rocket",".release-it.js":"rocket",".release-it.json":"rocket",".release-it.toml":"rocket",".release-it.ts":"rocket",".release-it.yaml":"rocket",".release-it.yml":"rocket",".release-plz.toml":"rocket",".releaserc":"semantic-release",".releaserc.cjs":"semantic-release",".releaserc.cts":"semantic-release",".releaserc.js":"semantic-release",".releaserc.json":"semantic-release",".releaserc.json5":"semantic-release",".releaserc.jsonc":"semantic-release",".releaserc.mjs":"semantic-release",".releaserc.mts":"semantic-release",".releaserc.toml":"semantic-release",".releaserc.ts":"semantic-release",".releaserc.yaml":"semantic-release",".releaserc.yml":"semantic-release",".remarkignore":"remark",".remarkrc":"remark",".remarkrc.cjs":"remark",".remarkrc.js":"remark",".remarkrc.json":"remark",".remarkrc.mjs":"remark",".remarkrc.yaml":"remark",".remarkrc.yml":"remark",".renovaterc":"renovate",".renovaterc.json":"renovate",".replit":"replit",".rhistory":"r",".rspec":"rspec",".rubocop-todo.yml":"rubocop",".rubocop.yml":"rubocop",".rubocop_todo.yml":"rubocop",".ruby-version":"ruby",".ruff.toml":"ruff",".scrapy":"python-misc",".secrets":"key",".semgrepignore":"semgrep",".sentryclirc":"sentry",".sequelizerc":"sequelize",".shellcheckrc":"shellcheck",".slugignore":"slug",".snyk":"snyk",".sonarcloud.properties":"sonarcloud",".stackblitzrc":"stackblitz",".steadybit.yaml":"steadybit",".steadybit.yml":"steadybit",".stryker.conf.cjs":"stryker",".stryker.conf.js":"stryker",".stryker.conf.json":"stryker",".stryker.conf.mjs":"stryker",".stryker.config.cjs":"stryker",".stryker.config.js":"stryker",".stryker.config.json":"stryker",".stryker.config.mjs":"stryker",".stylelintcache":"stylelint",".stylelintignore":"stylelint",".stylelintrc":"stylelint",".stylelintrc.cjs":"stylelint",".stylelintrc.cts":"stylelint",".stylelintrc.js":"stylelint",".stylelintrc.json":"stylelint",".stylelintrc.json5":"stylelint",".stylelintrc.jsonc":"stylelint",".stylelintrc.mjs":"stylelint",".stylelintrc.mts":"stylelint",".stylelintrc.toml":"stylelint",".stylelintrc.ts":"stylelint",".stylelintrc.yaml":"stylelint",".stylelintrc.yml":"stylelint",".svgrrc":"svgr",".svgrrc.cjs":"svgr",".svgrrc.cts":"svgr",".svgrrc.js":"svgr",".svgrrc.json":"svgr",".svgrrc.json5":"svgr",".svgrrc.jsonc":"svgr",".svgrrc.mjs":"svgr",".svgrrc.mts":"svgr",".svgrrc.toml":"svgr",".svgrrc.ts":"svgr",".svgrrc.yaml":"svgr",".svgrrc.yml":"svgr",".swift-format":"swift",".swift-version":"swift",".swiftformat":"swift",".syncpackrc":"syncpack",".syncpackrc.cjs":"syncpack",".syncpackrc.cts":"syncpack",".syncpackrc.js":"syncpack",".syncpackrc.json":"syncpack",".syncpackrc.json5":"syncpack",".syncpackrc.jsonc":"syncpack",".syncpackrc.mjs":"syncpack",".syncpackrc.mts":"syncpack",".syncpackrc.toml":"syncpack",".syncpackrc.ts":"syncpack",".syncpackrc.yaml":"syncpack",".syncpackrc.yml":"syncpack",".taskrc.yaml":"taskfile",".taskrc.yml":"taskfile",".taurignore":"tauri",".tazerc":"taze",".tazerc.json":"taze",".textlintignore":"textlint",".textlintrc":"textlint",".textlintrc.cjs":"textlint",".textlintrc.js":"textlint",".textlintrc.json":"textlint",".textlintrc.yaml":"textlint",".textlintrc.yml":"textlint",".tobimake":"tobimake",".travis.yml":"travis",".umirc.cjs":"umi",".umirc.cts":"umi",".umirc.js":"umi",".umirc.mjs":"umi",".umirc.mts":"umi",".umirc.ts":"umi",".uv.toml":"uv",".vars":"tune",".vercelignore":"vercel",".vfl":"vfl",".vsconfig":"visualstudio",".vuerc":"vue-config",".wakatime-project":"wakatime",".watchmanconfig":"watchman",".whitesource":"json",".yardopts":"settings",".yarn-integrity":"yarn",".yarnclean":"yarn",".yarnrc":"yarn",".yarnrc.yaml":"yarn",".yarnrc.yml":"yarn",_sc_:"godot-assets",ace:"adonis","amplify.yml":"amplify","androidmanifest.xml":"android","angular-cli.json":"angular","angular.json":"angular",apkbuild:"console","apollo.config.js":"apollo",appfile:"fastlane",appraisals:"ruby","appveyor.yml":"appveyor","appwrite.js":"appwrite","appwrite.json":"appwrite","appwrite.ts":"appwrite",architecture:"architecture","architecture.md":"architecture","architecture.rst":"architecture","architecture.txt":"architecture",artisan:"laravel","astro.config.cjs":"astro-config","astro.config.cts":"astro-config","astro.config.js":"astro-config","astro.config.mjs":"astro-config","astro.config.mts":"astro-config","astro.config.ts":"astro-config","aurelia.json":"aurelia",authors:"authors","authors.md":"authors","authors.rst":"authors","authors.txt":"authors","auto-config.js":"auto","auto-config.json":"auto","auto-config.ts":"auto","auto-config.yaml":"auto","auto-config.yml":"auto","auto.config.js":"auto","auto.config.ts":"auto","azure-pipelines-main.yaml":"azure-pipelines","azure-pipelines-main.yml":"azure-pipelines","azure-pipelines.yaml":"azure-pipelines","azure-pipelines.yml":"azure-pipelines","babel-plugin-macros.config.cjs":"babel","babel-plugin-macros.config.cts":"babel","babel-plugin-macros.config.js":"babel","babel-plugin-macros.config.json":"babel","babel-plugin-macros.config.json5":"babel","babel-plugin-macros.config.jsonc":"babel","babel-plugin-macros.config.mjs":"babel","babel-plugin-macros.config.mts":"babel","babel-plugin-macros.config.toml":"babel","babel-plugin-macros.config.ts":"babel","babel-plugin-macros.config.yaml":"babel","babel-plugin-macros.config.yml":"babel","babel-transform.js":"babel","babel.config.cjs":"babel","babel.config.cts":"babel","babel.config.js":"babel","babel.config.json":"babel","babel.config.json5":"babel","babel.config.jsonc":"babel","babel.config.mjs":"babel","babel.config.mts":"babel","babel.config.toml":"babel","babel.config.ts":"babel","babel.config.yaml":"babel","babel.config.yml":"babel",bashrc_apple_terminal:"console",berksfile:"ruby","berksfile.lock":"ruby","biome.json":"biome","biome.jsonc":"biome","bitbucket-pipelines.yaml":"bitbucket","bitbucket-pipelines.yml":"bitbucket","blitz.config.js":"blitz","blitz.config.ts":"blitz","bower.json":"bower",brewfile:"ruby",browserslist:"browserlist","buildkite.yaml":"buildkite","buildkite.yml":"buildkite","bun.lock":"bun","bun.lockb":"bun","bunfig.toml":"bun","cabal.project":"cabal","cabal.project.freeze":"cabal","cabal.project.local":"cabal",caddyfile:"caddy","capacitor.config.json":"capacitor","capacitor.config.ts":"capacitor",capfile:"ruby","cdp.pid":"json","celerybeat-schedule":"python-misc","celerybeat.pid":"python-misc",changelog:"changelog","changelog.md":"changelog","changelog.rst":"changelog","changelog.txt":"changelog",changes:"changelog","changes.md":"changelog","changes.rst":"changelog","changes.txt":"changelog",cheffile:"ruby","chromatic.config.json":"chromatic","circle.yml":"circleci","citation.cff":"citation","claude.local.md":"claude","claude.md":"claude","cmakecache.txt":"cmake","cmakelists.txt":"cmake","cmakepresets.json":"cmake",cname:"http",code_of_conduct:"conduct","code_of_conduct.md":"conduct","code_of_conduct.txt":"conduct","codecov.yaml":"codecov","codecov.yml":"codecov",codeowners:"codeowners","commit-msg":"console",commit_editmsg:"git","commitlint.config.cjs":"commitlint","commitlint.config.cts":"commitlint","commitlint.config.js":"commitlint","commitlint.config.json":"commitlint","commitlint.config.json5":"commitlint","commitlint.config.jsonc":"commitlint","commitlint.config.mjs":"commitlint","commitlint.config.mts":"commitlint","commitlint.config.toml":"commitlint","commitlint.config.ts":"commitlint","commitlint.config.yaml":"commitlint","commitlint.config.yml":"commitlint","compile_flags.txt":"settings","compose.alpha.yaml":"docker","compose.alpha.yml":"docker","compose.beta.yaml":"docker","compose.beta.yml":"docker","compose.ci.yaml":"docker","compose.ci.yml":"docker","compose.dev.yaml":"docker","compose.dev.yml":"docker","compose.development.yaml":"docker","compose.development.yml":"docker","compose.local.yaml":"docker","compose.local.yml":"docker","compose.override.yaml":"docker","compose.override.yml":"docker","compose.prod.yaml":"docker","compose.prod.yml":"docker","compose.production.yaml":"docker","compose.production.yml":"docker","compose.stage.yaml":"docker","compose.stage.yml":"docker","compose.staging.yaml":"docker","compose.staging.yml":"docker","compose.test.yaml":"docker","compose.test.yml":"docker","compose.testing.yaml":"docker","compose.testing.yml":"docker","compose.web.yaml":"docker","compose.web.yml":"docker","compose.worker.yaml":"docker","compose.worker.yml":"docker","compose.yaml":"docker","compose.yml":"docker","composer.lock":"json","concourse.yml":"concourse",containerfile:"docker","containerfile.alpha":"docker","containerfile.beta":"docker","containerfile.ci":"docker","containerfile.dev":"docker","containerfile.development":"docker","containerfile.local":"docker","containerfile.prod":"docker","containerfile.production":"docker","containerfile.stage":"docker","containerfile.staging":"docker","containerfile.test":"docker","containerfile.testing":"docker","containerfile.web":"docker","containerfile.worker":"docker","contentlayer.config.cjs":"contentlayer","contentlayer.config.cts":"contentlayer","contentlayer.config.js":"contentlayer","contentlayer.config.mjs":"contentlayer","contentlayer.config.mts":"contentlayer","contentlayer.config.ts":"contentlayer",contributing:"contributing","contributing.md":"contributing","contributing.rst":"contributing","contributing.txt":"contributing",contributors:"authors","contributors.md":"authors","contributors.rst":"authors","contributors.txt":"authors","copilot-instructions.md":"copilot",copying:"license","copying.md":"license","copying.rst":"license","copying.txt":"license",copyright:"license","copyright.md":"license","copyright.rst":"license","copyright.txt":"license","craco.config.cjs":"craco","craco.config.cts":"craco","craco.config.js":"craco","craco.config.json":"craco","craco.config.json5":"craco","craco.config.jsonc":"craco","craco.config.mjs":"craco","craco.config.mts":"craco","craco.config.toml":"craco","craco.config.ts":"craco","craco.config.yaml":"craco","craco.config.yml":"craco",credits:"credits","credits.md":"credits","credits.rst":"credits","credits.txt":"credits","cypress.config.cjs":"cypress","cypress.config.cts":"cypress","cypress.config.js":"cypress","cypress.config.mjs":"cypress","cypress.config.mts":"cypress","cypress.config.ts":"cypress","cypress.env.json":"cypress","cypress.json":"cypress","cz.json":"commitizen","cz.toml":"commitizen","cz.yaml":"commitizen","cz.yml":"commitizen",dangerfile:"ruby",deliverfile:"ruby","deno.json":"deno","deno.jsonc":"deno","deno.lock":"deno","dependabot.yaml":"dependabot","dependabot.yml":"dependabot","docker-compose.alpha.yaml":"docker","docker-compose.alpha.yml":"docker","docker-compose.beta.yaml":"docker","docker-compose.beta.yml":"docker","docker-compose.ci.yaml":"docker","docker-compose.ci.yml":"docker","docker-compose.dev.yaml":"docker","docker-compose.dev.yml":"docker","docker-compose.development.yaml":"docker","docker-compose.development.yml":"docker","docker-compose.local.yaml":"docker","docker-compose.local.yml":"docker","docker-compose.override.yaml":"docker","docker-compose.override.yml":"docker","docker-compose.prod.yaml":"docker","docker-compose.prod.yml":"docker","docker-compose.production.yaml":"docker","docker-compose.production.yml":"docker","docker-compose.stage.yaml":"docker","docker-compose.stage.yml":"docker","docker-compose.staging.yaml":"docker","docker-compose.staging.yml":"docker","docker-compose.test.yaml":"docker","docker-compose.test.yml":"docker","docker-compose.testing.yaml":"docker","docker-compose.testing.yml":"docker","docker-compose.web.yaml":"docker","docker-compose.web.yml":"docker","docker-compose.worker.yaml":"docker","docker-compose.worker.yml":"docker","docker-compose.yaml":"docker","docker-compose.yml":"docker",dockerfile:"docker","dockerfile.alpha":"docker","dockerfile.beta":"docker","dockerfile.ci":"docker","dockerfile.dev":"docker","dockerfile.development":"docker","dockerfile.local":"docker","dockerfile.prod":"docker","dockerfile.production":"docker","dockerfile.stage":"docker","dockerfile.staging":"docker","dockerfile.test":"docker","dockerfile.testing":"docker","dockerfile.web":"docker","dockerfile.windows":"docker","dockerfile.worker":"docker","drizzle.config.dev.js":"drizzle","drizzle.config.dev.json":"drizzle","drizzle.config.dev.ts":"drizzle","drizzle.config.js":"drizzle","drizzle.config.json":"drizzle","drizzle.config.prod.js":"drizzle","drizzle.config.prod.json":"drizzle","drizzle.config.prod.ts":"drizzle","drizzle.config.ts":"drizzle","duc.fbs":"duc",dune:"dune","dune-project":"dune","dune-workspace":"dune","dune-workspace.dev":"dune","eas.json":"expo","ecosystem.config.cjs":"pm2-ecosystem","ecosystem.config.cts":"pm2-ecosystem","ecosystem.config.js":"pm2-ecosystem","ecosystem.config.mjs":"pm2-ecosystem","ecosystem.config.mts":"pm2-ecosystem","ecosystem.config.ts":"pm2-ecosystem","ember-cli-builds.js":"ember","esbuild.cjs":"esbuild","esbuild.config.cjs":"esbuild","esbuild.config.cts":"esbuild","esbuild.config.js":"esbuild","esbuild.config.mjs":"esbuild","esbuild.config.mts":"esbuild","esbuild.config.ts":"esbuild","esbuild.cts":"esbuild","esbuild.dev.cjs":"esbuild","esbuild.dev.cts":"esbuild","esbuild.dev.js":"esbuild","esbuild.dev.mjs":"esbuild","esbuild.dev.mts":"esbuild","esbuild.dev.ts":"esbuild","esbuild.js":"esbuild","esbuild.mjs":"esbuild","esbuild.mts":"esbuild","esbuild.prod.cjs":"esbuild","esbuild.prod.cts":"esbuild","esbuild.prod.js":"esbuild","esbuild.prod.mjs":"esbuild","esbuild.prod.mts":"esbuild","esbuild.prod.ts":"esbuild","esbuild.stage.cjs":"esbuild","esbuild.stage.cts":"esbuild","esbuild.stage.js":"esbuild","esbuild.stage.mjs":"esbuild","esbuild.stage.mts":"esbuild","esbuild.stage.ts":"esbuild","esbuild.test.cjs":"esbuild","esbuild.test.cts":"esbuild","esbuild.test.js":"esbuild","esbuild.test.mjs":"esbuild","esbuild.test.mts":"esbuild","esbuild.test.ts":"esbuild","esbuild.ts":"esbuild","eslint-options.js":"eslint","eslint.config.cjs":"eslint","eslint.config.cts":"eslint","eslint.config.js":"eslint","eslint.config.json":"eslint","eslint.config.json5":"eslint","eslint.config.jsonc":"eslint","eslint.config.mjs":"eslint","eslint.config.mts":"eslint","eslint.config.toml":"eslint","eslint.config.ts":"eslint","eslint.config.yaml":"eslint","eslint.config.yml":"eslint",excalidraw:"excalidraw","excalidraw.json":"excalidraw","excalidraw.png":"excalidraw","excalidraw.svg":"excalidraw","fabric.mod.json":"minecraft-fabric",fastfile:"fastlane","favicon.ico":"favicon","firebase.config.js":"firebase","firebase.json":"firebase","firestore.indexes.json":"firebase","firestore.rules":"firebase","fuse.js":"fusebox","garden.yaml":"garden","garden.yml":"garden","gatsby-browser.js":"gatsby","gatsby-browser.tsx":"gatsby","gatsby-config.js":"gatsby","gatsby-config.mjs":"gatsby","gatsby-config.ts":"gatsby","gatsby-node.js":"gatsby","gatsby-node.mjs":"gatsby","gatsby-node.ts":"gatsby","gatsby-ssr.js":"gatsby","gatsby-ssr.tsx":"gatsby",gemfile:"gemfile","gemini.md":"gemini-ai","git-history":"git","git-rebase-todo":"git","gleam.toml":"gleam",gnumakefile:"makefile","go.mod":"go-mod","go.sum":"go-mod","go.work":"go-mod","go.work.sum":"go-mod","google-services.json":"google","googleservice-info.plist":"google","gradle-wrapper.properties":"gradle","gradle.properties":"gradle",gradlew:"gradle","gradlew.bat":"gradle","graphql.config.cjs":"graphql","graphql.config.cts":"graphql","graphql.config.js":"graphql","graphql.config.json":"graphql","graphql.config.json5":"graphql","graphql.config.jsonc":"graphql","graphql.config.mjs":"graphql","graphql.config.mts":"graphql","graphql.config.toml":"graphql","graphql.config.ts":"graphql","graphql.config.yaml":"graphql","graphql.config.yml":"graphql","gridsome.config.js":"gridsome","gridsome.server.js":"gridsome","gruntfile.babel.coffee":"grunt","gruntfile.babel.js":"grunt","gruntfile.babel.ts":"grunt","gruntfile.cjs":"grunt","gruntfile.coffee":"grunt","gruntfile.cts":"grunt","gruntfile.js":"grunt","gruntfile.ts":"grunt",guardfile:"ruby","gulpfile.babel.js":"gulp","gulpfile.cjs":"gulp","gulpfile.cts":"gulp","gulpfile.js":"gulp","gulpfile.mjs":"gulp","gulpfile.mts":"gulp","gulpfile.ts":"gulp",gymfile:"ruby","hadolint.yaml":"hadolint","hadolint.yml":"hadolint","hardhat.config.js":"hardhat","hardhat.config.ts":"hardhat","harmonix.config.js":"harmonix","harmonix.config.ts":"harmonix",hgrc:"mercurial","histoire.config.cjs":"histoire","histoire.config.cts":"histoire","histoire.config.js":"histoire","histoire.config.mjs":"histoire","histoire.config.mts":"histoire","histoire.config.ts":"histoire",hobofile:"ruby","horusec-config.json":"horusec",hosts:"hosts","husky.config.cjs":"husky","husky.config.cts":"husky","husky.config.js":"husky","husky.config.json":"husky","husky.config.json5":"husky","husky.config.jsonc":"husky","husky.config.mjs":"husky","husky.config.mts":"husky","husky.config.toml":"husky","husky.config.ts":"husky","husky.config.yaml":"husky","husky.config.yml":"husky",install:"installation",installation:"installation","ionic.config.json":"ionic",jakefile:"javascript",jenkinsfile:"jenkins","jest-e2e.config.cjs":"jest","jest-e2e.config.cts":"jest","jest-e2e.config.js":"jest","jest-e2e.config.json":"jest","jest-e2e.config.mjs":"jest","jest-e2e.config.mts":"jest","jest-e2e.config.ts":"jest","jest-e2e.json":"jest","jest-github-actions-reporter.js":"jest","jest-preset.cjs":"jest","jest-preset.js":"jest","jest-preset.json":"jest","jest-preset.mjs":"jest","jest-unit.config.js":"jest","jest.config.cjs":"jest","jest.config.cts":"jest","jest.config.js":"jest","jest.config.json":"jest","jest.config.mjs":"jest","jest.config.mts":"jest","jest.config.ts":"jest","jest.e2e.config.cjs":"jest","jest.e2e.config.cts":"jest","jest.e2e.config.js":"jest","jest.e2e.config.json":"jest","jest.e2e.config.mjs":"jest","jest.e2e.config.mts":"jest","jest.e2e.config.ts":"jest","jest.e2e.json":"jest","jest.json":"jest","jest.preset.cjs":"jest","jest.preset.js":"jest","jest.preset.json":"jest","jest.preset.mjs":"jest","jest.setup.js":"jest","jest.setup.ts":"jest","jest.teardown.js":"jest","jsconfig.json":"jsconfig","jsr.json":"jsr","jsr.jsonc":"jsr",justfile:"just","jvm.config":"maven","k8s.yaml":"kubernetes","k8s.yml":"kubernetes","karma-main.js":"karma","karma-main.ts":"karma","karma.conf.coffee":"karma","karma.conf.js":"karma","karma.conf.ts":"karma","karma.config.js":"karma","karma.config.ts":"karma",kbuild:"makefile","kcl.mod":"kcl","kcl.yaml":"kcl","kcl.yml":"kcl","keystatic.config.js":"keystatic","keystatic.config.jsx":"keystatic","keystatic.config.ts":"keystatic","keystatic.config.tsx":"keystatic","knip.config.js":"knip","knip.config.ts":"knip","knip.js":"knip","knip.json":"knip","knip.jsonc":"knip","knip.ts":"knip","kubernetes.yaml":"kubernetes","kubernetes.yml":"kubernetes",latexmkrc:"latexmk","lefthook-local.json":"lefthook","lefthook-local.toml":"lefthook","lefthook-local.yaml":"lefthook","lefthook-local.yml":"lefthook","lefthook.json":"lefthook","lefthook.toml":"lefthook","lefthook.yaml":"lefthook","lefthook.yml":"lefthook",lefthookrc:"lefthook","lerna.json":"lerna","liara.json":"liara",licence:"license","licence-agpl":"license","licence-apache":"license","licence-bsd":"license","licence-gpl":"license","licence-lgpl":"license","licence-mit":"license","licence.md":"license","licence.rst":"license","licence.txt":"license",license:"license","license-agpl":"license","license-apache":"license","license-bsd":"license","license-gpl":"license","license-lgpl":"license","license-mit":"license","license.md":"license","license.rst":"license","license.txt":"license","lighthouserc.cjs":"lighthouse","lighthouserc.js":"lighthouse","lighthouserc.json":"lighthouse","lighthouserc.yaml":"lighthouse","lighthouserc.yml":"lighthouse","lint-staged.config.cjs":"lintstaged","lint-staged.config.js":"lintstaged","lint-staged.config.mjs":"lintstaged","lynx.config.cjs":"lynx","lynx.config.cts":"lynx","lynx.config.js":"lynx","lynx.config.mjs":"lynx","lynx.config.mts":"lynx","lynx.config.ts":"lynx",makefile:"makefile","manifest.in":"python-misc","manifest.mf":"settings","markdoc.config.cjs":"markdoc-config","markdoc.config.cts":"markdoc-config","markdoc.config.js":"markdoc-config","markdoc.config.mjs":"markdoc-config","markdoc.config.mts":"markdoc-config","markdoc.config.ts":"markdoc-config",matchfile:"ruby","maven.config":"maven","mercurial.ini":"mercurial",merge_msg:"git","meson.build":"meson","meson.options":"meson","meson_options.txt":"meson","metro.config.cjs":"metro","metro.config.cts":"metro","metro.config.js":"metro","metro.config.json":"metro","metro.config.mjs":"metro","metro.config.mts":"metro","metro.config.ts":"metro","milestones.md":"roadmap","milestones.txt":"roadmap","mocha.opts":"mocha","moon.yml":"moon","nano-staged.cjs":"nano-staged","nano-staged.js":"nano-staged","nano-staged.json":"nano-staged","nano-staged.mjs":"nano-staged","nest-cli.json":"nest","nestconfig.json":"nest","netlify.json":"netlify","netlify.toml":"netlify","netlify.yaml":"netlify","netlify.yml":"netlify","next.config.js":"next","next.config.mjs":"next","next.config.mts":"next","next.config.ts":"next","ng-package.json":"angular","nginx.conf":"nginx","nodemon-debug.json":"nodemon","nodemon.json":"nodemon","now.json":"vercel","nuget.config":"nuget","nuget.exe":"nuget","nuxt.config.js":"nuxt","nuxt.config.ts":"nuxt","nx.json":"nx","nyc.config.cjs":"istanbul","nyc.config.js":"istanbul","openapi.json":"openapi","openapi.yaml":"openapi","openapi.yml":"openapi","opencode.json":"opencode","opencode.jsonc":"opencode",owners:"codeowners","oxfmt.config.ts":"oxc","oxlint.config.ts":"oxc","package-lock.json":"nodejs","package.json":"nodejs","packship.config.js":"packship","packship.config.json":"packship","packship.config.mjs":"packship","packship.config.mts":"packship","packship.config.ts":"packship","panda.config.cjs":"panda","panda.config.cts":"panda","panda.config.js":"panda","panda.config.mjs":"panda","panda.config.mts":"panda","panda.config.ts":"panda","payload.config.js":"payload","payload.config.mjs":"payload","payload.config.mts":"payload","payload.config.ts":"payload","pdm.lock":"pdm","pdm.toml":"pdm","phpstan.dist.neon":"phpstan","phpstan.neon":"phpstan","phpstan.neon.dist":"phpstan","phpunit-watcher.yml":"phpunit","phpunit-watcher.yml.dist":"phpunit","phpunit.xml":"phpunit","phpunit.xml.dist":"phpunit",pipfile:"python-misc",pkgbuild:"console",pklproject:"pkl","pklproject.deps.json":"pkl","plastic.branchexplorer":"plastic","plastic.selector":"plastic","plastic.wktree":"plastic","plastic.workspace":"plastic","plastic.workspaces":"plastic","playwright-ct.config.cjs":"playwright","playwright-ct.config.cts":"playwright","playwright-ct.config.js":"playwright","playwright-ct.config.mjs":"playwright","playwright-ct.config.mts":"playwright","playwright-ct.config.ts":"playwright","playwright.config.base.cjs":"playwright","playwright.config.base.cts":"playwright","playwright.config.base.js":"playwright","playwright.config.base.mjs":"playwright","playwright.config.base.mts":"playwright","playwright.config.base.ts":"playwright","playwright.config.cjs":"playwright","playwright.config.cts":"playwright","playwright.config.js":"playwright","playwright.config.mjs":"playwright","playwright.config.mts":"playwright","playwright.config.ts":"playwright","plopfile.cjs":"plop","plopfile.js":"plop","plopfile.mjs":"plop","plopfile.ts":"plop","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm",podfile:"ruby","poetry.lock":"poetry","pom.xml":"maven","post-merge":"console","postcss.config.cjs":"postcss","postcss.config.cts":"postcss","postcss.config.js":"postcss","postcss.config.json":"postcss","postcss.config.json5":"postcss","postcss.config.jsonc":"postcss","postcss.config.mjs":"postcss","postcss.config.mts":"postcss","postcss.config.toml":"postcss","postcss.config.ts":"postcss","postcss.config.yaml":"postcss","postcss.config.yml":"postcss","posthtml.config.cjs":"posthtml","posthtml.config.cts":"posthtml","posthtml.config.js":"posthtml","posthtml.config.json":"posthtml","posthtml.config.json5":"posthtml","posthtml.config.jsonc":"posthtml","posthtml.config.mjs":"posthtml","posthtml.config.mts":"posthtml","posthtml.config.toml":"posthtml","posthtml.config.ts":"posthtml","posthtml.config.yaml":"posthtml","posthtml.config.yml":"posthtml","pre-commit":"console","pre-push":"console","prettier.config.cjs":"prettier","prettier.config.cts":"prettier","prettier.config.js":"prettier","prettier.config.json":"prettier","prettier.config.json5":"prettier","prettier.config.jsonc":"prettier","prettier.config.mjs":"prettier","prettier.config.mts":"prettier","prettier.config.toml":"prettier","prettier.config.ts":"prettier","prettier.config.yaml":"prettier","prettier.config.yml":"prettier","prisma.config.ts":"prisma","prisma.yml":"prisma",procfile:"heroku","procfile.windows":"heroku","project.garden.yaml":"garden","project.garden.yml":"garden","project.graphcool":"graphcool","protractor.conf.coffee":"protractor","protractor.conf.js":"protractor","protractor.conf.ts":"protractor","protractor.config.js":"protractor","protractor.config.ts":"protractor","puppeteer.config.cjs":"puppeteer","puppeteer.config.cts":"puppeteer","puppeteer.config.js":"puppeteer","puppeteer.config.json":"puppeteer","puppeteer.config.json5":"puppeteer","puppeteer.config.jsonc":"puppeteer","puppeteer.config.mjs":"puppeteer","puppeteer.config.mts":"puppeteer","puppeteer.config.toml":"puppeteer","puppeteer.config.ts":"puppeteer","puppeteer.config.yaml":"puppeteer","puppeteer.config.yml":"puppeteer",puppetfile:"ruby","py.typed":"python-misc",pylintrc:"python-misc","pyproject.toml":"python-misc","quasar.conf.js":"quasar","quasar.conf.ts":"quasar","quasar.config.cjs":"quasar","quasar.config.js":"quasar","quasar.config.ts":"quasar",rakefile:"ruby",rantfile:"ruby",readme:"readme","readme.md":"readme","readme.rst":"readme","readme.txt":"readme","release-plz.toml":"rocket","release.config.cjs":"semantic-release","release.config.cts":"semantic-release","release.config.js":"semantic-release","release.config.json":"semantic-release","release.config.json5":"semantic-release","release.config.jsonc":"semantic-release","release.config.mjs":"semantic-release","release.config.mts":"semantic-release","release.config.toml":"semantic-release","release.config.ts":"semantic-release","release.config.yaml":"semantic-release","release.config.yml":"semantic-release","release.toml":"rocket","remix.config.js":"remix","remix.config.ts":"remix","renovate-config.json":"renovate","renovate.json":"renovate","renovate.json5":"renovate","requirements.txt":"python-misc","roadmap.md":"roadmap","roadmap.txt":"roadmap","robots.txt":"robots","rolldown.config.cjs":"rolldown","rolldown.config.cts":"rolldown","rolldown.config.js":"rolldown","rolldown.config.mjs":"rolldown","rolldown.config.mts":"rolldown","rolldown.config.ts":"rolldown","rollup-config.js":"rollup","rollup-config.mjs":"rollup","rollup-config.ts":"rollup","rollup.config.base.js":"rollup","rollup.config.base.mjs":"rollup","rollup.config.base.ts":"rollup","rollup.config.common.js":"rollup","rollup.config.common.mjs":"rollup","rollup.config.common.ts":"rollup","rollup.config.dev.js":"rollup","rollup.config.dev.mjs":"rollup","rollup.config.dev.ts":"rollup","rollup.config.js":"rollup","rollup.config.mjs":"rollup","rollup.config.prod.js":"rollup","rollup.config.prod.mjs":"rollup","rollup.config.prod.ts":"rollup","rollup.config.prod.vendor.js":"rollup","rollup.config.prod.vendor.mjs":"rollup","rollup.config.prod.vendor.ts":"rollup","rollup.config.ts":"rollup","rome.json":"rome","route.js":"routing","route.jsx":"routing","route.ts":"routing","route.tsx":"routing","router.js":"routing","router.jsx":"routing","router.ts":"routing","router.tsx":"routing","routes.js":"routing","routes.jsx":"routing","routes.ts":"routing","routes.tsx":"routing","rsbuild.config.cjs":"rstack","rsbuild.config.cts":"rstack","rsbuild.config.js":"rstack","rsbuild.config.mjs":"rstack","rsbuild.config.mts":"rstack","rsbuild.config.ts":"rstack","rslib.config.cjs":"rstack","rslib.config.cts":"rstack","rslib.config.js":"rstack","rslib.config.mjs":"rstack","rslib.config.mts":"rstack","rslib.config.ts":"rstack","rslint.config.cjs":"rstack","rslint.config.cts":"rstack","rslint.config.js":"rstack","rslint.config.mjs":"rstack","rslint.config.mts":"rstack","rslint.config.ts":"rstack","rslint.json":"rstack","rslint.jsonc":"rstack","rspack.config.cjs":"rstack","rspack.config.cts":"rstack","rspack.config.js":"rstack","rspack.config.mjs":"rstack","rspack.config.mts":"rstack","rspack.config.ts":"rstack","rspress.config.cjs":"rstack","rspress.config.cts":"rstack","rspress.config.js":"rstack","rspress.config.mjs":"rstack","rspress.config.mts":"rstack","rspress.config.ts":"rstack","rstest.config.cjs":"rstack","rstest.config.cts":"rstack","rstest.config.js":"rstack","rstest.config.mjs":"rstack","rstest.config.mts":"rstack","rstest.config.ts":"rstack","ruff.toml":"ruff",scanfile:"ruby",sconscript:"scons",sconstruct:"scons","screwdriver.yaml":"screwdriver","screwdriver.yml":"screwdriver",scsub:"scons",security:"lock","security.md":"lock","security.txt":"lock","semgrep.yml":"semgrep","sentry.client.config.cjs":"sentry","sentry.client.config.cts":"sentry","sentry.client.config.js":"sentry","sentry.client.config.mjs":"sentry","sentry.client.config.mts":"sentry","sentry.client.config.ts":"sentry","sentry.edge.config.cjs":"sentry","sentry.edge.config.cts":"sentry","sentry.edge.config.js":"sentry","sentry.edge.config.mjs":"sentry","sentry.edge.config.mts":"sentry","sentry.edge.config.ts":"sentry","sentry.server.config.cjs":"sentry","sentry.server.config.cts":"sentry","sentry.server.config.js":"sentry","sentry.server.config.mjs":"sentry","sentry.server.config.mts":"sentry","sentry.server.config.ts":"sentry","serverless.js":"serverless","serverless.json":"serverless","serverless.ts":"serverless","serverless.yaml":"serverless","serverless.yml":"serverless",sha256sums:"key",shellcheckrc:"shellcheck","skill.md":"skill",snakefile:"snakemake","snapcraft.yaml":"snapcraft","snapcraft.yml":"snapcraft",snapfile:"ruby","snowpack.config.cjs":"snowpack","snowpack.config.cts":"snowpack","snowpack.config.js":"snowpack","snowpack.config.json":"snowpack","snowpack.config.mjs":"snowpack","snowpack.config.mts":"snowpack","snowpack.config.ts":"snowpack","snowpack.deps.json":"snowpack","sonar-project.properties":"sonarcloud","sonarcloud.yaml":"sonarcloud","sonarqube.analysis.xml":"sonarcloud","src/bashly.yaml":"bashly","src/bashly.yml":"bashly","steadybit.yaml":"steadybit","steadybit.yml":"steadybit","stencil.config.js":"stencil","stencil.config.ts":"stencil","stitches.config.js":"stitches","stitches.config.ts":"stitches","stryker.conf.cjs":"stryker","stryker.conf.js":"stryker","stryker.conf.json":"stryker","stryker.conf.mjs":"stryker","stryker.config.cjs":"stryker","stryker.config.js":"stryker","stryker.config.json":"stryker","stryker.config.mjs":"stryker","stylelint.config.cjs":"stylelint","stylelint.config.cts":"stylelint","stylelint.config.js":"stylelint","stylelint.config.json":"stylelint","stylelint.config.json5":"stylelint","stylelint.config.jsonc":"stylelint","stylelint.config.mjs":"stylelint","stylelint.config.mts":"stylelint","stylelint.config.toml":"stylelint","stylelint.config.ts":"stylelint","stylelint.config.yaml":"stylelint","stylelint.config.yml":"stylelint","supabase.js":"supabase","supabase.py":"supabase","supabase.ts":"supabase","svelte.config.cjs":"svelte","svelte.config.cts":"svelte","svelte.config.js":"svelte","svelte.config.mjs":"svelte","svelte.config.mts":"svelte","svelte.config.ts":"svelte","svgo.config.cjs":"svgo","svgo.config.js":"svgo","svgo.config.mjs":"svgo","svgr.config.cjs":"svgr","svgr.config.cts":"svgr","svgr.config.js":"svgr","svgr.config.json":"svgr","svgr.config.json5":"svgr","svgr.config.jsonc":"svgr","svgr.config.mjs":"svgr","svgr.config.mts":"svgr","svgr.config.toml":"svgr","svgr.config.ts":"svgr","svgr.config.yaml":"svgr","svgr.config.yml":"svgr","swagger.json":"swagger","swagger.yaml":"swagger","swagger.yml":"swagger","syncpack.config.cjs":"syncpack","syncpack.config.cts":"syncpack","syncpack.config.js":"syncpack","syncpack.config.json":"syncpack","syncpack.config.json5":"syncpack","syncpack.config.jsonc":"syncpack","syncpack.config.mjs":"syncpack","syncpack.config.mts":"syncpack","syncpack.config.toml":"syncpack","syncpack.config.ts":"syncpack","syncpack.config.yaml":"syncpack","syncpack.config.yml":"syncpack",tags:"label","tailwind.config.cjs":"tailwindcss","tailwind.config.cts":"tailwindcss","tailwind.config.js":"tailwindcss","tailwind.config.mjs":"tailwindcss","tailwind.config.mts":"tailwindcss","tailwind.config.ts":"tailwindcss","tailwind.js":"tailwindcss","tailwind.ts":"tailwindcss","taskfile.dist.yaml":"taskfile","taskfile.dist.yml":"taskfile","taskfile.yaml":"taskfile","taskfile.yml":"taskfile","tauri.conf.json":"tauri","tauri.config.json":"tauri","tauri.linux.conf.json":"tauri","tauri.macos.conf.json":"tauri","tauri.windows.conf.json":"tauri","taze.config.cjs":"taze","taze.config.cts":"taze","taze.config.js":"taze","taze.config.mjs":"taze","taze.config.mts":"taze","taze.config.ts":"taze",thorfile:"ruby",tiltfile:"tilt","timeline.md":"roadmap","timeline.txt":"roadmap","todo.md":"todo","todos.md":"todo","trigger.config.cjs":"trigger","trigger.config.cts":"trigger","trigger.config.js":"trigger","trigger.config.mjs":"trigger","trigger.config.mts":"trigger","trigger.config.ts":"trigger","tsconfig.app.json":"tsconfig","tsconfig.base.json":"tsconfig","tsconfig.build.json":"tsconfig","tsconfig.cjs.json":"tsconfig","tsconfig.client.json":"tsconfig","tsconfig.config.json":"tsconfig","tsconfig.declaration.json":"tsconfig","tsconfig.doc.json":"tsconfig","tsconfig.e2e.json":"tsconfig","tsconfig.editor.json":"tsconfig","tsconfig.eslint.json":"tsconfig","tsconfig.esm.json":"tsconfig","tsconfig.json":"tsconfig","tsconfig.lib.json":"tsconfig","tsconfig.lib.prod.json":"tsconfig","tsconfig.main.json":"tsconfig","tsconfig.mjs.json":"tsconfig","tsconfig.node.json":"tsconfig","tsconfig.paths.json":"tsconfig","tsconfig.renderer.json":"tsconfig","tsconfig.server.json":"tsconfig","tsconfig.spec.json":"tsconfig","tsconfig.test.json":"tsconfig","tsconfig.vitest.json":"tsconfig","tsconfig.web.json":"tsconfig","tsconfig.webworker.json":"tsconfig","tsconfig.worker.json":"tsconfig","tsdoc.json":"tsdoc","tsdown.config":"tsdown","tsdown.config.cjs":"tsdown","tsdown.config.cts":"tsdown","tsdown.config.js":"tsdown","tsdown.config.json":"tsdown","tsdown.config.mjs":"tsdown","tsdown.config.mts":"tsdown","tsdown.config.ts":"tsdown","turbo.json":"turborepo","turbo.jsonc":"turborepo","typedoc.js":"typedoc","typedoc.json":"typedoc","typst.toml":"typst",unlicense:"unlicense","unlicense.txt":"unlicense","uno.config.js":"unocss","uno.config.mjs":"unocss","uno.config.mts":"unocss","uno.config.ts":"unocss","unocss.config.js":"unocss","unocss.config.mjs":"unocss","unocss.config.mts":"unocss","unocss.config.ts":"unocss","uv.lock":"uv","uv.toml":"uv","v.mod":"vlang",vagrantfile:"vagrant","velite.config.cjs":"velite","velite.config.cts":"velite","velite.config.js":"velite","velite.config.mjs":"velite","velite.config.mts":"velite","velite.config.ts":"velite","vercel.json":"vercel","vercel.ts":"vercel","verdaccio.yml":"verdaccio","vetur.config.js":"vue-config","vetur.config.ts":"vue-config","vite.config.cjs":"vite","vite.config.cts":"vite","vite.config.js":"vite","vite.config.mjs":"vite","vite.config.mts":"vite","vite.config.ts":"vite","vitest.config.cjs":"vitest","vitest.config.cts":"vitest","vitest.config.js":"vitest","vitest.config.mjs":"vitest","vitest.config.mts":"vitest","vitest.config.ts":"vitest","vitest.e2e.config.cjs":"vitest","vitest.e2e.config.cts":"vitest","vitest.e2e.config.js":"vitest","vitest.e2e.config.mjs":"vitest","vitest.e2e.config.mts":"vitest","vitest.e2e.config.ts":"vitest","vitest.unit.config.cjs":"vitest","vitest.unit.config.cts":"vitest","vitest.unit.config.js":"vitest","vitest.unit.config.mjs":"vitest","vitest.unit.config.mts":"vitest","vitest.unit.config.ts":"vitest","vitest.workspace.cjs":"vitest","vitest.workspace.cts":"vitest","vitest.workspace.js":"vitest","vitest.workspace.mjs":"vitest","vitest.workspace.mts":"vitest","vitest.workspace.ts":"vitest","volar.config.js":"vue-config","vpkg.json":"vlang","vue.config.cjs":"vue-config","vue.config.js":"vue-config","vue.config.mjs":"vue-config","vue.config.ts":"vue-config","wallaby.conf.js":"wallaby","wallaby.js":"wallaby","wally.toml":"wally","warp.md":"warp","webpack.base.cjs":"webpack","webpack.base.cts":"webpack","webpack.base.js":"webpack","webpack.base.mjs":"webpack","webpack.base.mts":"webpack","webpack.base.ts":"webpack","webpack.cjs":"webpack","webpack.client.cjs":"webpack","webpack.client.cts":"webpack","webpack.client.js":"webpack","webpack.client.mjs":"webpack","webpack.client.mts":"webpack","webpack.client.ts":"webpack","webpack.common.cjs":"webpack","webpack.common.cts":"webpack","webpack.common.js":"webpack","webpack.common.mjs":"webpack","webpack.common.mts":"webpack","webpack.common.ts":"webpack","webpack.config.babel.cjs":"webpack","webpack.config.babel.cts":"webpack","webpack.config.babel.js":"webpack","webpack.config.babel.mjs":"webpack","webpack.config.babel.mts":"webpack","webpack.config.babel.ts":"webpack","webpack.config.base.babel.cjs":"webpack","webpack.config.base.babel.cts":"webpack","webpack.config.base.babel.js":"webpack","webpack.config.base.babel.mjs":"webpack","webpack.config.base.babel.mts":"webpack","webpack.config.base.babel.ts":"webpack","webpack.config.base.cjs":"webpack","webpack.config.base.cts":"webpack","webpack.config.base.js":"webpack","webpack.config.base.mjs":"webpack","webpack.config.base.mts":"webpack","webpack.config.base.ts":"webpack","webpack.config.cjs":"webpack","webpack.config.client.cjs":"webpack","webpack.config.client.cts":"webpack","webpack.config.client.js":"webpack","webpack.config.client.mjs":"webpack","webpack.config.client.mts":"webpack","webpack.config.client.ts":"webpack","webpack.config.coffee":"webpack","webpack.config.common.babel.cjs":"webpack","webpack.config.common.babel.cts":"webpack","webpack.config.common.babel.js":"webpack","webpack.config.common.babel.mjs":"webpack","webpack.config.common.babel.mts":"webpack","webpack.config.common.babel.ts":"webpack","webpack.config.common.cjs":"webpack","webpack.config.common.cts":"webpack","webpack.config.common.js":"webpack","webpack.config.common.mjs":"webpack","webpack.config.common.mts":"webpack","webpack.config.common.ts":"webpack","webpack.config.cts":"webpack","webpack.config.dev.babel.cjs":"webpack","webpack.config.dev.babel.cts":"webpack","webpack.config.dev.babel.js":"webpack","webpack.config.dev.babel.mjs":"webpack","webpack.config.dev.babel.mts":"webpack","webpack.config.dev.babel.ts":"webpack","webpack.config.dev.cjs":"webpack","webpack.config.dev.cts":"webpack","webpack.config.dev.js":"webpack","webpack.config.dev.mjs":"webpack","webpack.config.dev.mts":"webpack","webpack.config.dev.ts":"webpack","webpack.config.js":"webpack","webpack.config.main.cjs":"webpack","webpack.config.main.cts":"webpack","webpack.config.main.js":"webpack","webpack.config.main.mjs":"webpack","webpack.config.main.mts":"webpack","webpack.config.main.ts":"webpack","webpack.config.mjs":"webpack","webpack.config.mts":"webpack","webpack.config.prod.babel.cjs":"webpack","webpack.config.prod.babel.cts":"webpack","webpack.config.prod.babel.js":"webpack","webpack.config.prod.babel.mjs":"webpack","webpack.config.prod.babel.mts":"webpack","webpack.config.prod.babel.ts":"webpack","webpack.config.prod.cjs":"webpack","webpack.config.prod.cts":"webpack","webpack.config.prod.js":"webpack","webpack.config.prod.mjs":"webpack","webpack.config.prod.mts":"webpack","webpack.config.prod.ts":"webpack","webpack.config.production.babel.cjs":"webpack","webpack.config.production.babel.cts":"webpack","webpack.config.production.babel.js":"webpack","webpack.config.production.babel.mjs":"webpack","webpack.config.production.babel.mts":"webpack","webpack.config.production.babel.ts":"webpack","webpack.config.production.cjs":"webpack","webpack.config.production.cts":"webpack","webpack.config.production.js":"webpack","webpack.config.production.mjs":"webpack","webpack.config.production.mts":"webpack","webpack.config.production.ts":"webpack","webpack.config.renderer.cjs":"webpack","webpack.config.renderer.cts":"webpack","webpack.config.renderer.js":"webpack","webpack.config.renderer.mjs":"webpack","webpack.config.renderer.mts":"webpack","webpack.config.renderer.ts":"webpack","webpack.config.server.cjs":"webpack","webpack.config.server.cts":"webpack","webpack.config.server.js":"webpack","webpack.config.server.mjs":"webpack","webpack.config.server.mts":"webpack","webpack.config.server.ts":"webpack","webpack.config.staging.babel.cjs":"webpack","webpack.config.staging.babel.cts":"webpack","webpack.config.staging.babel.js":"webpack","webpack.config.staging.babel.mjs":"webpack","webpack.config.staging.babel.mts":"webpack","webpack.config.staging.babel.ts":"webpack","webpack.config.staging.cjs":"webpack","webpack.config.staging.cts":"webpack","webpack.config.staging.js":"webpack","webpack.config.staging.mjs":"webpack","webpack.config.staging.mts":"webpack","webpack.config.staging.ts":"webpack","webpack.config.test.cjs":"webpack","webpack.config.test.cts":"webpack","webpack.config.test.js":"webpack","webpack.config.test.mjs":"webpack","webpack.config.test.mts":"webpack","webpack.config.test.ts":"webpack","webpack.config.ts":"webpack","webpack.config.vendor.cjs":"webpack","webpack.config.vendor.cts":"webpack","webpack.config.vendor.js":"webpack","webpack.config.vendor.mjs":"webpack","webpack.config.vendor.mts":"webpack","webpack.config.vendor.production.cjs":"webpack","webpack.config.vendor.production.cts":"webpack","webpack.config.vendor.production.js":"webpack","webpack.config.vendor.production.mjs":"webpack","webpack.config.vendor.production.mts":"webpack","webpack.config.vendor.production.ts":"webpack","webpack.config.vendor.ts":"webpack","webpack.cts":"webpack","webpack.dev.cjs":"webpack","webpack.dev.cts":"webpack","webpack.dev.js":"webpack","webpack.dev.mjs":"webpack","webpack.dev.mts":"webpack","webpack.dev.ts":"webpack","webpack.development.cjs":"webpack","webpack.development.cts":"webpack","webpack.development.js":"webpack","webpack.development.mjs":"webpack","webpack.development.mts":"webpack","webpack.development.ts":"webpack","webpack.dist.cjs":"webpack","webpack.dist.cts":"webpack","webpack.dist.js":"webpack","webpack.dist.mjs":"webpack","webpack.dist.mts":"webpack","webpack.dist.ts":"webpack","webpack.js":"webpack","webpack.mix.cjs":"webpack","webpack.mix.cts":"webpack","webpack.mix.js":"webpack","webpack.mix.mjs":"webpack","webpack.mix.mts":"webpack","webpack.mix.ts":"webpack","webpack.mjs":"webpack","webpack.mts":"webpack","webpack.prod.cjs":"webpack","webpack.prod.config.cjs":"webpack","webpack.prod.config.cts":"webpack","webpack.prod.config.js":"webpack","webpack.prod.config.mjs":"webpack","webpack.prod.config.mts":"webpack","webpack.prod.config.ts":"webpack","webpack.prod.cts":"webpack","webpack.prod.js":"webpack","webpack.prod.mjs":"webpack","webpack.prod.mts":"webpack","webpack.prod.ts":"webpack","webpack.production.cjs":"webpack","webpack.production.cts":"webpack","webpack.production.js":"webpack","webpack.production.mjs":"webpack","webpack.production.mts":"webpack","webpack.production.ts":"webpack","webpack.server.cjs":"webpack","webpack.server.cts":"webpack","webpack.server.js":"webpack","webpack.server.mjs":"webpack","webpack.server.mts":"webpack","webpack.server.ts":"webpack","webpack.test.cjs":"webpack","webpack.test.cts":"webpack","webpack.test.js":"webpack","webpack.test.mjs":"webpack","webpack.test.mts":"webpack","webpack.test.ts":"webpack","webpack.ts":"webpack","webpackfile.cjs":"webpack","webpackfile.cts":"webpack","webpackfile.js":"webpack","webpackfile.mjs":"webpack","webpackfile.mts":"webpack","webpackfile.ts":"webpack","werf-giterminism.yaml":"werf","werf-giterminism.yml":"werf","werf-includes.lock":"werf","werf-includes.yaml":"werf","werf-includes.yml":"werf","werf.yaml":"werf","werf.yml":"werf","windi.config.cjs":"windicss","windi.config.cts":"windicss","windi.config.js":"windicss","windi.config.json":"windicss","windi.config.ts":"windicss","wrangler.json":"wrangler","wrangler.jsonc":"wrangler","wrangler.toml":"wrangler","wxt.config.cjs":"wxt","wxt.config.cts":"wxt","wxt.config.js":"wxt","wxt.config.mjs":"wxt","wxt.config.mts":"wxt","wxt.config.ts":"wxt","xamlstyler.json":"xaml",xmake:"xmake","xmake.lua":"xmake","yarn-error.log":"yarn","yarn.lock":"yarn","zeabur.json":"zeabur","zeabur.json5":"zeabur","zeabur.jsonc":"zeabur","zeabur.toml":"zeabur","zeabur.yaml":"zeabur","zeabur.yml":"zeabur",zlogin:"console",zlogout:"console",zprofile:"console",zshenv:"console",zshrc:"console",zshrc_apple_terminal:"console"},vk={60:"slint",".ncurc.js":"dependencies-update",".ncurc.json":"dependencies-update",".ncurc.yml":"dependencies-update",".wakatime-project":"wakatime","001":"zip","123dx":"3d","3dm":"3d","3ds":"3d","3fr":"image","3mf":"3d","4th":"forth","7z":"zip","8svx":"audio",a:"lib",a51:"assembly",aa:"audio",aac:"audio",aax:"audio",abap:"abap",abc:"abc",ac:"3d",ac3:"audio",accdb:"database",accde:"database",acds:"abap",act:"palette",ad:"asciidoc",ada:"ada",adb:"ada",adoc:"asciidoc",adp:"database",ads:"ada",aea:"assembly",afphoto:"image",agc:"assembly",ags:"assembly",ahk:"autohotkey",ai:"adobe-illustrator",aif:"audio",aiff:"audio",ait:"adobe-illustrator",alac:"audio",ali:"ada",alloy:"grafana-alloy",ami:"image",amr:"audio",amx:"pawn",ape:"audio",apfs:"zip",apib:"apiblueprint",apiblueprint:"apiblueprint",apk:"android",applescript:"applescript",apx:"image",argus:"assembly",ari:"image",arj:"zip",arw:"image",as:"actionscript",asc:"key",asciidoc:"asciidoc",ascx:"xml",asddls:"abap",ase:"image",aseprite:"image",asm:"assembly",asp:"html",aspx:"html",ass:"subtitles",ast:"sas",astore:"sas",astro:"astro",atom:"xml",au3:"autoit",aux:"tex",avi:"video",avif:"image",awk:"console",axaml:"xml",axml:"xml",azcli:"azure","azure-pipelines-main.yaml":"azure-pipelines","azure-pipelines-main.yml":"azure-pipelines","azure-pipelines.yaml":"azure-pipelines","azure-pipelines.yml":"azure-pipelines",b:"brainfuck",bak:"database",bal:"ballerina",balx:"ballerina",bas:"visualstudio",bash:"console",bash_aliases:"console",bash_login:"console",bash_logout:"console",bash_profile:"console",bashrc:"console",bat:"console",bay:"image",bazel:"bazel",bbl:"bibliography",bbx:"bbx",bcf:"bibliography",bdb:"database",bean:"beancount",beancount:"beancount","bench.cjs":"bench-js","bench.cts":"bench-ts","bench.js":"bench-js","bench.jsx":"bench-jsx","bench.mjs":"bench-js","bench.mts":"bench-ts","bench.ts":"bench-ts","bench.tsx":"bench-jsx",bf:"brainfuck",bib:"bibliography",bicep:"bicep",bin:"hex",binsource:"assembly","blade.php":"laravel",blend:"blender",blend1:"blender",blend2:"blender",blg:"bibliography",blink:"blink",bmap:"font",bmp:"image",bpg:"image",bpmn:"xml",br:"zip",braw:"image",brk:"image",brotli:"zip",brs:"visualstudio",bru:"bruno",bst:"bibtex-style",bubble:"dinophp",bz2:"zip",bzip2:"zip",bzl:"bazel",c:"c","c++":"cpp","c++m":"cpp",c3:"c3",cab:"zip",cabal:"cabal",caf:"audio",cairo:"cairo",cake:"cake",cap:"image",capnp:"capnp",catpart:"3d",catproduct:"3d",cbl:"cobol",cbx:"cbx",cc:"cpp",ccm:"cpp",cda:"audio",cdc:"cadence",cdr:"audio",cds:"cds",cer:"certificate",cert:"certificate",cfc:"coldfusion",cff:"yaml",cfg:"settings",cfm:"coldfusion",cfml:"coldfusion",cginc:"shader",cjs:"javascript","cjs.map":"javascript-map",cl:"lisp",class:"javaclass",clip:"image",clj:"clojure",cljc:"clojure",cljs:"clojure",cljx:"clojure",clo:"tex",clojure:"clojure",cls:"tex",cm:"sml",cmake:"cmake",cmd:"console",cmj:"bucklescript",cmx:"ocaml",cnf:"settings",coafile:"coala",coarc:"coala",cob:"cobol",coco:"coconut","code-profile":"vscode","code-search":"search","code-snippets":"vscode","code-workplace":"vscode","code-workspace":"vscode",coffee:"coffee",command:"command",comp:"shader","comp.glsl":"shader","comp.hlsl":"shader","compose.yaml":"docker","compose.yml":"docker",compute:"shader","compute.glsl":"shader","compute.hlsl":"shader",computeshader:"shader",conf:"settings",config:"settings",containerfile:"docker",containerignore:"docker","controller.js":"controller","controller.ts":"controller",copilotmd:"markdown",cp:"cpp",cpio:"zip",cpn:"coloredpetrinets",cpp:"cpp",cppm:"cpp",cpt:"image",cpy:"python",cr:"crystal",cr2:"image",cr3:"image",crt:"certificate",crw:"image",crx:"chrome",cs:"csharp",csh:"console",csharp:"csharp",cshrc:"console",cshtml:"razor",csl:"xml",cson:"coffee",csproj:"visualstudio","csproj.user":"xml",css:"css","css.cjs":"vanilla-extract","css.js":"vanilla-extract","css.jsx":"vanilla-extract","css.map":"css-map","css.mjs":"vanilla-extract","css.ts":"vanilla-extract","css.tsx":"vanilla-extract",csv:"table",csx:"csharp",ctp:"php",cts:"typescript",ctx:"context",cu:"cuda",cue:"cue",cuh:"cuda",cur:"image",cxx:"cpp",cxxm:"cpp","cy.js":"test-js","cy.jsx":"test-jsx","cy.ts":"test-ts","cy.tsx":"test-jsx",d:"d","d.cts":"typescript-def","d.ets":"typescript-def","d.mts":"typescript-def","d.ts":"typescript-def",dae:"3d",dart:"dart",dat:"hex",data:"image",db:"database",db3:"database",dbf:"database",dblite:"database",dblite3:"database",dcr:"image",dcs:"image",dds:"image",deb:"zip",debugsymbols:"database",def:"dotjs",dex:"android",dfxp:"subtitles",dhall:"dhall",dhallb:"dhall",diff:"diff",dio:"drawio",directory:"settings",dita:"xml",ditamap:"xml",djt:"django",dlc:"settings",dll:"dll",dmg:"disc",dmn:"xml",dng:"image",do:"tcl",doc:"word","docker-compose.yaml":"docker","docker-compose.yml":"docker",dockerfile:"docker",dockerignore:"docker",docx:"word",dot:"dotjs",drawio:"drawio",drf:"image","drone.yml":"drone",dsc:"denizenscript",dsql:"database",dss:"audio",dtd:"xml",dtml:"xml",duc:"duc",dwg:"3d",dxf:"3d","e2e-spec.cjs":"test-js","e2e-spec.cts":"test-ts","e2e-spec.js":"test-js","e2e-spec.mjs":"test-js","e2e-spec.mts":"test-ts","e2e-spec.ts":"test-ts",ebuild:"console",ec3:"audio",eclass:"console",ecr:"crystal",edb:"email",edge:"edge",edn:"clojure",eex:"elixir",efs:"audio",egg:"python-misc",eip:"image",ejs:"ejs",elm:"elm",eml:"email",emlx:"email",enc:"audio",ent:"xml",env:"tune",eot:"font",eps:"image",epub:"epub",erb:"ruby",erf:"image",erl:"erlang",es6:"javascript",esd:"zip",esx:"javascript",ex:"elixir",excalidraw:"excalidraw","excalidraw.json":"excalidraw","excalidraw.png":"excalidraw","excalidraw.svg":"excalidraw",exe:"exe",exp:"console",exr:"image",exrc:"vim",exs:"elixir",eyaml:"yaml",eyml:"yaml",f:"fortran",f03:"fortran",f08:"fortran",f3d:"3d",f77:"fortran",f90:"fortran",f95:"fortran",far:"zip",fast:"lisp",fat:"zip",fbx:"3d",fdb:"database",feather:"database",feature:"cucumber",features:"cucumber",fen:"chess",fff:"image",fhtml:"velocity",fig:"figma",fish:"console",flac:"audio",flp:"audio",flv:"video",fnt:"font",font:"font",fonts:"font",fpx:"image",frag:"shader","frag.glsl":"shader","fragment.glsl":"shader",fragmentshader:"shader","freezed.dart":"dart_generated",frm:"database",frt:"forth",fs:"fsharp","fs.glsl":"shader",fsi:"fsharp",fsproj:"fsharp",fsscript:"fsharp",fsx:"fsharp",fth:"forth",ftl:"freemarker",fun:"sml",fx:"shader",fxh:"shader",fxml:"xml",fxp:"foxpro","g.dart":"dart_generated",g4:"antlr","garden.yaml":"garden","garden.yml":"garden",gbr:"image",gd:"godot",gdb:"database",gdextension:"godot-assets",gdnlib:"godot-assets",gdns:"godot-assets",gdshader:"godot-assets",gdshaderinc:"godot-assets",gemini:"gemini",gemspec:"ruby",geojson:"json",geom:"shader","geom.glsl":"shader","geom.hlsl":"shader","geometry.glsl":"shader","geometry.hlsl":"shader",geometryshader:"shader",gif:"image",gifv:"video","gitlab-ci.yml":"gitlab",glb:"3d",gleam:"gleam",glsl:"shader",gltf:"3d",gmi:"gemini",gml:"gamemaker",gnu:"gnuplot",go:"go",godot:"godot-assets",gp:"audio",gpg:"key",gpl:"palette",gpr:"image",gql:"graphql",gr:"grain",gradle:"gradle",graphcool:"graphcool",graphql:"graphql",grm:"sml",groovy:"groovy",gs:"apps-script","gs.glsl":"shader",gsm:"audio",gvimrc:"vim",gvy:"groovy",gyp:"python",gypi:"python",gz:"zip",gzip:"zip",h:"h","h++":"hpp","h.in":"cpp",haml:"haml",handlebars:"handlebars",har:"json",hbs:"handlebars",hcl:"hcl",hdd:"disc",heex:"elixir",heic:"image",heif:"image",hex:"hex",hfs:"zip",hh:"hpp",hip:"hip",hjs:"handlebars",hjson:"hjson",hlsl:"shader",hlsli:"shader","horusec-config.json":"horusec",hp:"hpp",hpp:"hpp","hpp.in":"cpp",hs:"haskell",htm:"html",html:"html","html.bubble":"dinophp",html_vm:"html",http:"http",huff:"huff",hurl:"hurl",hx:"haxe",hxx:"hpp",i:"c",iam:"3d",ibc:"idris",ibd:"database",iced:"coffee",icns:"image",ico:"image",ics:"email",idr:"idris",ige:"3d",iges:"3d",igs:"3d",ii:"cpp",iiq:"image",ilk:"dll",imba:"imba",img:"image",iml:"xml",inc:"assembly",ini:"settings","inky.php":"laravel",inl:"hpp",ino:"arduino",ins:"doctex-installer",ipa:"applescript",ipp:"cpp",ipt:"3d",ipy:"python",ipynb:"jupyter",isml:"xml",iso:"disc",it:"audio",iuml:"uml",ixx:"cpp",j2:"jinja",jade:"pug",jar:"jar",jav:"java",java:"java",jb2:"image",jbig2:"image",jenkins:"jenkins",jenkinsfile:"jenkins",jfif:"image",jinja:"jinja","jinja-html":"jinja",jinja2:"jinja",jl:"julia",jmx:"xml",jng:"image",jpeg:"image",jpg:"image",jrxml:"xml",js:"javascript","js.map":"javascript-map","js.snap":"test-js","jsconfig.json":"jsconfig",jshtm:"html",json:"json",json5:"json",jsonc:"json",jsonl:"json",jsonld:"json",jsp:"java",jst:"dotjs",jsx:"react","jsx.snap":"test-jsx",jt:"3d",jxl:"image",jxr:"image",k:"kcl",k25:"image",kdbx:"database",kdc:"image",key:"key",kl:"kl",kql:"kusto",kra:"image",ksh:"console",kt:"kotlin",kts:"kotlin",ktx:"image",ktx2:"image",kv:"kivy",lang:"i18n",latex:"tex",launch:"xml",lbx:"lbx",ldf:"database",lean:"lean",leex:"elixir",less:"less",lex:"sml",lha:"zip",lhs:"haskell",lib:"lib",liquid:"liquid",lisp:"lisp",litcoffee:"markdown",liz:"zip",lock:"lock",log:"log",lol:"lolcode",lottie:"lottie",lrc:"lyric",ls:"livescript",lsp:"lisp",ltx:"tex",lua:"lua",luau:"luau",lucee:"coldfusion",ly:"lilypond",lz:"zip",lz4:"zip",lz5:"zip",lzh:"zip",lzma:"zip",lzma2:"zip",m:"objective-c",m2:"macaulay2",m2v:"video",m3u:"audio",m3u8:"audio",m4a:"audio",m4b:"audio",m4p:"audio",m4r:"audio",m4v:"video",mak:"settings",manifest:"xml",markdn:"markdown",markdoc:"markdoc","markdoc.md":"markdoc",markdown:"markdown",marko:"markojs",mbox:"email",mca:"minecraft",mcaddon:"minecraft",mcfunction:"minecraft",mcgame:"minecraft",mclevel:"minecraft",mcmeta:"minecraft",mcpack:"minecraft",mcproject:"minecraft",mcr:"minecraft",mcstructure:"minecraft",mctemplate:"minecraft",mcworld:"minecraft",md:"markdown",mdb:"database",mdc:"image",mde:"database",mdf:"database",mdoc:"markdoc",mdown:"markdown",mdp:"image",mdtext:"markdown",mdtxt:"markdown",mdwn:"markdown",mdx:"mdx",mef:"image",menu:"xml",merlin:"merlin",mermaid:"mermaid",mesh:"3d",mi:"c",mid:"audio",mii:"cpp",mine:"minecraft",mint:"mint",mitigus:"assembly",mjml:"mjml",mjs:"javascript","mjs.map":"javascript-map",mk:"makefile",mka:"audio",mkd:"markdown",mkdn:"markdown",mkv:"video",ml:"ocaml",mlb:"sml",mli:"ocaml",mlton:"sml",mm:"objective-cpp",mmd:"mermaid",mmf:"audio",mo:"i18n",mod:"audio","module.js":"angular","module.ts":"angular",mojo:"mojo",moon:"moonscript",mos:"image",mov:"video",mp2:"video",mp3:"audio",mp4:"video",mpc:"audio",mpe:"video",mpeg:"video",mpg:"video",mpv:"video",mqo:"3d",mrf:"font",mrpack:"mrpack",mrw:"image",ms:"assembly",mscz:"audio",msg:"email",msi:"exe",mtm:"audio",mts:"typescript",mui:"audio",mus:"minecraft",mustache:"handlebars",musx:"audio",mxl:"audio",mxml:"mxml",myd:"database",myi:"database",nasm:"assembly",nb:"mathematica",ndf:"database",ndjson:"json","ndst.json":"ndst","ndst.yaml":"ndst","ndst.yml":"ndst",nef:"image",nf:"groovy","ng-template":"angular",nginx:"nginx",nginxconf:"nginx",nginxconfig:"nginx",nim:"nim",nimble:"nim",nix:"nix",njk:"nunjucks",npmrc:"settings",nrw:"image",nsa:"audio",ntf:"font",ntfs:"zip",nu:"console",nunjucks:"nunjucks",nupkg:"nuget",nuspec:"nuget",o:"3d",obj:"3d",obm:"image",odb:"database",odin:"odin",odp:"powerpoint",ods:"table",odt:"word",odttf:"font",oft:"email",ogg:"video",ogv:"video",olm:"email",onnx:"onnx",opam:"opam","openapi.json":"openapi","openapi.yaml":"openapi","openapi.yml":"openapi",opml:"xml",option:"settings",opus:"audio",ora:"image",orc:"database",orf:"image",ost:"email",otf:"font",otne:"otne",owl:"xml",p:"prolog",p7s:"email",pac:"javascript",pal:"palette",parquet:"database",pas:"pascal",passwd:"key",patch:"git",pbm:"image",pcss:"postcss",pdb:"database",pde:"processing",pdf:"pdf","pdm.lock":"pdm","pdm.toml":"pdm",pdn:"image",pef:"image",pem:"key",pgf:"image",pgm:"image",pgn:"chess",pgsql:"database",php:"php","php.bubble":"dinophp",php4:"php",php5:"php",phtml:"php",pic:"image",pine:"pinejs",pipeline:"pipeline","pixel.hlsl":"shader",pkb:"database",pkf:"audio",pkl:"pkl",pks:"database",pl:"prolog",plantuml:"uml",plist:"xml",plpgsql:"database",ply:"3d",pm:"perl",pmd:"3d",pmx:"3d",png:"image",pnm:"image",pnml:"coloredpetrinets",po:"i18n",pod:"perl",podspec:"ruby",postgres:"database",pot:"i18n",potm:"powerpoint",potx:"powerpoint",pp:"puppet",ppa:"powerpoint",ppam:"powerpoint",ppm:"image",pps:"powerpoint",ppsm:"powerpoint",ppsx:"powerpoint",ppt:"powerpoint",pptm:"powerpoint",pptx:"powerpoint",prefs:"settings",prg:"foxpro",prisma:"prisma",pro:"prolog",profile:"console",proj:"xml",project:"xml","prompt.md":"prompt","prompts.md":"prompt",prop:"settings",properties:"settings",props:"settings",proto:"proto",prt:"3d",prw:"advpl",prx:"advpl",ps1:"powershell",ps1xml:"powershell",psb:"adobe-photoshop",psc1:"powershell",psd:"adobe-photoshop",psd1:"powershell",psdt:"adobe-photoshop",psgi:"perl",psh:"shader",psm1:"powershell",psql:"database",psrc:"powershell",pssc:"powershell",pst:"email",psv:"table",pt:"pytorch",pth:"pytorch",ptx:"image",pu:"uml",pub:"key",publishsettings:"xml",pubxml:"xml","pubxml.user":"xml",pug:"pug",puml:"uml",pure:"purescript",purs:"purescript",pwf:"pytorch",pwn:"pawn","px.hlsl":"shader",pxn:"image",py:"python",pyc:"python-misc",pyi:"python",pyt:"python",pyw:"python",qcow:"disc",qcow2:"disc",qcp:"audio",qed:"disc",qmd:"quarto",qs:"qsharp",qt:"video","quokka.js":"quokka","quokka.jsx":"quokka","quokka.ts":"quokka","quokka.tsx":"quokka",r:"r",r3d:"image",ra:"audio",raf:"image",rahit:"shader","rahit.glsl":"shader",rake:"ruby",raku:"perl",raml:"raml",rar:"zip",raw:"image",razor:"razor",rb:"ruby",rbi:"ruby",rbs:"ruby",rbx:"ruby",rbxl:"roblox",rbxlx:"roblox",rbxm:"roblox","rbxmk.lua":"rbxmk","rbxmk.luau":"rbxmk",rbxmx:"roblox",rc:"rc",rcall:"shader","rcall.glsl":"shader",rchit:"shader","rchit.glsl":"shader",rdf:"xml",re:"reason",reb:"image",red:"red",reg:"regedit",rego:"opa",rei:"reason",rej:"diff",repo:"settings",res:"rescript",resi:"rescript-interface",rest:"http",restql:"restql",resx:"xml",rf64:"audio",rgen:"shader","rgen.glsl":"shader",rhistory:"r",rhtml:"html",rint:"shader","rint.glsl":"shader",riot:"riot",rip:"audio",rjs:"ruby",rkt:"racket",rm:"video",rmd:"r",rmiss:"shader","rmiss.glsl":"shader",rmvb:"video",rng:"xml",robot:"robot",ron:"rust",ronn:"markdown","route.js":"routing","route.jsx":"routing","route.ts":"routing","route.tsx":"routing","routes.js":"routing","routes.jsx":"routing","routes.ts":"routing","routes.tsx":"routing","routing.js":"routing","routing.jsx":"routing","routing.ts":"routing","routing.tsx":"routing",rpm:"zip",rpmsg:"email",rprofile:"r",rpy:"python",rql:"restql",rs:"rust",rss:"xml",rst:"markdown",rt:"r",rtf:"word",ru:"ruby",ruleset:"visualstudio",rw2:"image",rwl:"image",rwz:"image",s:"assembly",sab:"3d",sai:"image",san:"san",sas:"sas",sas7bdat:"sas",sashdat:"sas",sass:"sass",sast:"sas",sat:"3d",sbt:"sbt",sbv:"subtitles",sc:"scala",scala:"scala","schema.json":"json_schema",scm:"scheme",scss:"sass",sdf:"database",sdt:"audio",secret:"key",sesx:"audio",settings:"settings",sf2:"audio",sh:"console",sha256:"key",sha256sum:"key",sha256sums:"key",shader:"shader",shasum:"key",shproj:"xml",shtml:"html",sig:"sml","sigstore.json":"verified",sketch:"sketch","skill.md":"skill","skills.md":"skill",skp:"3d",slang:"shader",sldasm:"3d",slddrw:"3d",sldprt:"3d",slim:"slim",slint:"slint",sln:"visualstudio","sln.dotsettings":"settings","sln.dotsettings.user":"settings",slnf:"visualstudio",slnx:"visualstudio",sls:"salt",slx:"simulink",smali:"android",smb:"3d",smk:"snakemake",sml:"sml",smt:"3d",snakemake:"snakemake",so:"dll",sol:"solidity","spec-d.ts":"test-ts","spec-d.tsx":"test-jsx","spec.cjs":"test-js","spec.cts":"test-ts","spec.js":"test-js","spec.jsx":"test-jsx","spec.mjs":"test-js","spec.mts":"test-ts","spec.ts":"test-ts","spec.tsx":"test-jsx",spv:"shader",spwn:"spwn",sql:"database",sqlite:"database",sqlite3:"database",squashfs:"zip",sr2:"image",srf:"image",srt:"subtitles",srw:"image",ss:"scheme",ssa:"subtitles",sss:"postcss","st.css":"stylable",stan:"stan",stap:"audio",ste:"3d","steadybit.yaml":"steadybit","steadybit.yml":"steadybit",step:"3d",stl:"3d","stories.js":"storybook","stories.jsx":"storybook","stories.mdx":"storybook","stories.svelte":"storybook","stories.ts":"storybook","stories.tsx":"storybook","stories.vue":"storybook","story.js":"storybook","story.jsx":"storybook","story.mdx":"storybook","story.ts":"storybook","story.tsx":"storybook",storyboard:"xml",stp:"3d",styl:"stylus",sub:"subtitles","sublime-project":"sublime","sublime-workspace":"sublime",sui:"font",suit:"font",suo:"visualstudio",sv:"verilog",svelte:"svelte",svg:"svg",svh:"verilog",svx:"mdsvex",sw:"sway","swagger.json":"swagger","swagger.yaml":"swagger","swagger.yml":"swagger",swc:"adobe-swc",swcrc:"swc",swf:"flash",swift:"swift",swiftdeps:"swift",swiftdoc:"swift",swiftmodule:"swift",swiftsourceinfo:"swift",swm:"zip",sy:"siyuan",synctex:"tex","synctex.gz":"tex",t:"perl",tag:"riot",tar:"zip",targets:"xml","taskfile.yaml":"taskfile","taskfile.yml":"taskfile",tauri:"tauri",taz:"zip",tbz:"zip",tbz2:"zip",tcc:"hpp",tcl:"tcl",tcsh:"console",tcshrc:"console",templ:"templ",template:"template",terraformignore:"terraform",tesc:"shader","tesc.glsl":"shader",tese:"shader","tese.glsl":"shader","tess.hlsl":"shader","tessellation.hlsl":"shader","test-d.ts":"test-ts","test-d.tsx":"test-jsx","test.cjs":"test-js","test.cts":"test-ts","test.js":"test-js","test.jsx":"test-jsx","test.mjs":"test-js","test.mts":"test-ts","test.ts":"test-ts","test.tsx":"test-jsx",tex:"tex",tf:"terraform","tf.json":"terraform",tfbackend:"terraform",tfstate:"terraform",tfvars:"terraform",tg:"audio",tga:"image",tgz:"zip",tif:"image",tiff:"image",tikz:"tex",tl:"teal",tld:"xml",tldr:"tldraw",tlz:"zip",tmlanguage:"xml",tmx:"xml",tnef:"email",tobi:"tobi",toc:"toc",todo:"todo",tofu:"opentofu",toml:"toml","tool-versions":"settings",toon:"toon",tpl:"smarty",tpp:"cpp",tpz:"zip",tree:"tree",tres:"godot-assets",ts:"typescript","ts.glsl":"shader","ts.map":"json","ts.snap":"test-ts",tsbuildinfo:"json",tscn:"godot-assets","tsconfig.json":"tsconfig",tsv:"table",tsx:"react_ts","tsx.snap":"test-jsx",ttc:"font",ttf:"font",ttml:"subtitles",tw:"twine",twee:"twine",twig:"twig",txt:"document",txx:"cpp",txz:"zip",typ:"typst",tz:"zip",tzst:"zip",tzstd:"zip",ua:"uiua",unity:"unity",unitypackage:"unity",url:"url",usd:"3d",usdz:"3d",use:"sml",v:"vlang",vac:"3d",vagrantfile:"vagrant",vala:"vala",vb:"visualstudio",vba:"visualstudio",vbhtml:"razor",vbox:"virtual","vbox-prev":"virtual",vbproj:"xml","vbproj.user":"xml",vbs:"visualstudio",vcl:"varnish",vcxitems:"visualstudio","vcxitems.filters":"visualstudio",vcxproj:"visualstudio","vcxproj.filters":"visualstudio",vdi:"virtual",vdp:"3d",ved:"vedic",veda:"vedic",vedic:"vedic",verse:"verse",vert:"shader","vert.glsl":"shader","vertex.glsl":"shader",vertexshader:"shader",vfl:"vfl",vhd:"verilog",vhdl:"verilog",vhdx:"verilog",vim:"vim",viminfo:"vim",vimrc:"vim",vm:"velocity",vmdk:"disc",vob:"video",voc:"audio",volt:"html",vox:"3d",vqf:"audio","vs.glsl":"shader",vscodeignore:"vscode",vsh:"shader",vsix:"vscode",vsixmanifest:"vscode",vtl:"velocity",vtt:"subtitles",vue:"vue",wasm:"webassembly",wat:"webassembly",wav:"audio",weba:"audio",webm:"video",webmanifest:"json",webp:"image",wfp:"audio",wgsl:"shader",whl:"python-misc",wim:"zip",windi:"windicss",winget:"yaml",wire:"3d",wixproj:"visualstudio",wl:"wolframlanguage",wls:"wolframlanguage",wma:"audio",wmv:"video",woff:"font",woff2:"font",workbook:"markdown",wpl:"audio",wproj:"audio",wpy:"wepy",wrap:"meson",wrl:"3d",wsd:"uml",wsdl:"xml",wv:"audio",wxi:"xml",wxl:"xml",wxs:"xml",x3f:"image",x_b:"3d",x_t:"3d",xaml:"xaml",xar:"zip",xbl:"xml",xcf:"image",xcplayground:"swift",xht:"html",xhtml:"html",xib:"xml",xlf:"i18n",xliff:"xml",xls:"table",xlsm:"table",xlsx:"table",xml:"xml","xml.dist":"xml","xml.dist.sample":"xml",xmp:"xml",xoml:"xml",xpdl:"xml",xprofile:"console",xquery:"xml",xsd:"xml",xsession:"console",xsessionrc:"console",xsh:"console",xsl:"xml",xslt:"xml",xul:"xml",xz:"zip",yaml:"yaml","yaml-tmlanguage":"yaml","yaml-tmpreferences":"yaml","yaml-tmtheme":"yaml","yaml.dist":"yaml",yang:"yang",yash_profile:"console",yashrc:"console",yml:"yaml","yml.dist":"yaml",yuv:"video",yy:"gamemaker",yyp:"gamemaker",yyz:"gamemaker",z:"zip",zeabur:"zeabur",zig:"zig",zip:"zip",zlogin:"console",zlogout:"console",zon:"zig",zprofile:"console",zsh:"console","zsh-theme":"console",zshenv:"console",zshrc:"console",zst:"zip",zstd:"zip",ц:"tsil","🔥":"mojo"},i3={"-@types":"folder-typescript","-addin":"folder-plugin","-addins":"folder-plugin","-addon":"folder-plugin","-addons":"folder-plugin","-admin":"folder-admin","-admins":"folder-admin","-agent":"folder-robot","-agents":"folder-robot","-android":"folder-android","-angular":"folder-angular","-anim":"folder-animation","-animated":"folder-animation","-animation":"folder-animation","-animations":"folder-animation","-anims":"folder-animation","-ansible":"folder-ansible","-api":"folder-api","-apis":"folder-api","-apollo":"folder-apollo","-apollo-cache":"folder-apollo","-apollo-client":"folder-apollo","-apollo-config":"folder-apollo","-app":"folder-app","-apple":"folder-macos","-application":"folder-app","-applications":"folder-app","-apps":"folder-app","-appwrite":"folder-appwrite","-arc":"folder-archive","-archival":"folder-archive","-archive":"folder-archive","-archives":"folder-archive","-arcs":"folder-archive","-article":"folder-docs","-articles":"folder-docs","-asm":"folder-assembly","-assembly":"folder-assembly","-asset":"folder-resource","-assets":"folder-resource","-astro":"folder-astro","-atom":"folder-atom","-atoms":"folder-atom","-attachment":"folder-attachment","-attachments":"folder-attachment","-aud":"folder-audio","-audio":"folder-audio","-audios":"folder-audio","-auds":"folder-audio","-aurelia_project":"folder-aurelia","-auth":"folder-secure","-authentication":"folder-secure","-auto":"folder-generator","-aws":"folder-aws","-azure":"folder-aws","-azure-pipelines":"folder-azure-pipelines","-azure-pipelines-ci":"folder-azure-pipelines","-back-up":"folder-backup","-back-ups":"folder-backup","-backend":"folder-server","-backends":"folder-server","-backup":"folder-backup","-backups":"folder-backup","-bak":"folder-backup","-baks":"folder-backup","-base":"folder-base","-bases":"folder-base","-batch":"folder-batch","-batches":"folder-batch","-batchs":"folder-batch","-bench":"folder-benchmark","-benches":"folder-benchmark","-benchmark":"folder-benchmark","-benchmarks":"folder-benchmark","-bibliographies":"folder-bibliography","-bibliography":"folder-bibliography","-bicep":"folder-bicep","-bin":"folder-dist","-bkp":"folder-backup","-bkps":"folder-backup","-blender":"folder-blender","-blender-assets":"folder-blender","-blender-files":"folder-blender","-blender-models":"folder-blender","-blender-project":"folder-blender","-bloc":"folder-bloc","-blocs":"folder-bloc","-blog":"folder-docs","-book":"folder-bibliography","-books":"folder-bibliography","-bot":"folder-robot","-bots":"folder-robot","-bower_components":"folder-bower","-browser":"folder-public","-browsers":"folder-public","-build":"folder-dist","-buildkite":"folder-buildkite","-builds":"folder-dist","-built":"folder-dist","-bull":"folder-queue","-cache":"folder-temp","-cached":"folder-temp","-calc":"folder-functions","-calcs":"folder-functions","-calculation":"folder-functions","-calculations":"folder-functions","-cargo":"folder-rust","-cart":"folder-cart","-centos":"folder-linux","-cert":"folder-secure","-certificate":"folder-secure","-certificates":"folder-secure","-certs":"folder-secure","-cfg":"folder-config","-cfgs":"folder-config","-cfn-gen":"folder-generator","-changes":"folder-delta","-changeset":"folder-changesets","-changesets":"folder-changesets","-chat":"folder-messages","-chats":"folder-messages","-ci":"folder-ci","-cipher":"folder-secure","-circleci":"folder-circleci","-cjs":"folder-javascript","-class":"folder-class","-classes":"folder-class","-claude":"folder-claude","-cli":"folder-command","-client":"folder-client","-clients":"folder-client","-cline_docs":"folder-cline","-clis":"folder-command","-cloud-firestore":"folder-firestore","-cloud-functions":"folder-cloud-functions","-cloudflare":"folder-cloudflare","-cloudfunctions":"folder-cloud-functions","-cluster":"folder-cluster","-clusters":"folder-cluster","-cmd":"folder-command","-cobol":"folder-cobol","-code":"folder-src","-color":"folder-theme","-colors":"folder-theme","-colour":"folder-theme","-colours":"folder-theme","-command":"folder-command","-commandline":"folder-command","-commands":"folder-command","-common":"folder-shared","-compiled":"folder-dist","-components":"folder-components","-composable":"folder-functions","-composables":"folder-functions","-concept":"folder-mock","-concepts":"folder-mock","-conf":"folder-config","-config":"folder-config","-configs":"folder-config","-configuration":"folder-config","-configurations":"folder-config","-confs":"folder-config","-connection":"folder-connection","-connections":"folder-connection","-console":"folder-console","-const":"folder-constant","-constant":"folder-constant","-constants":"folder-constant","-consts":"folder-constant","-container":"folder-container","-containers":"folder-container","-content":"folder-content","-contents":"folder-content","-context":"folder-context","-contexts":"folder-context","-contract":"folder-contract","-contract-test":"folder-contract","-contract-testing":"folder-contract","-contract-tests":"folder-contract","-contracts":"folder-contract","-controller":"folder-controller","-controllers":"folder-controller","-controls":"folder-controller","-conversation":"folder-messages","-conversations":"folder-messages","-core":"folder-core","-coverage":"folder-coverage","-crash":"folder-error","-crashes":"folder-error","-crates":"folder-lib","-css":"folder-css","-cts":"folder-typescript","-cubit":"folder-bloc","-cubits":"folder-bloc","-cue":"folder-cue","-cues":"folder-cue","-cursor":"folder-cursor","-custom":"folder-custom","-customs":"folder-custom","-cypher":"folder-secure","-cypress":"folder-cypress","-dal":"folder-dal","-dart":"folder-dart","-dart_tool":"folder-dart","-dart_tools":"folder-dart","-data":"folder-database","-data-access":"folder-dal","-data-access-layer":"folder-dal","-database":"folder-database","-databases":"folder-database","-db":"folder-database","-deb":"folder-linux","-debian":"folder-linux","-debug":"folder-debug","-debugger":"folder-debug","-debugging":"folder-debug","-decorator":"folder-decorators","-decorators":"folder-decorators","-deepin":"folder-linux","-delta":"folder-delta","-deltas":"folder-delta","-demo":"folder-examples","-demos":"folder-examples","-dependencies":"folder-packages","-design":"folder-theme","-designs":"folder-theme","-desktop":"folder-desktop","-devcontainer":"folder-container","-devpackages":"folder-packages","-devtools":"folder-tools","-dialog":"folder-messages","-dialogs":"folder-messages","-diary":"folder-docs","-directive":"folder-directive","-directives":"folder-directive","-display":"folder-desktop","-dist":"folder-dist","-distribution":"folder-dist","-doc":"folder-docs","-docker":"folder-docker","-dockerfiles":"folder-docker","-dockerhub":"folder-docker","-docs":"folder-docs","-document":"folder-docs","-documentation":"folder-docs","-documents":"folder-docs","-download":"folder-download","-downloader":"folder-download","-downloaders":"folder-download","-downloads":"folder-download","-draft":"folder-mock","-drafts":"folder-mock","-drizzle":"folder-drizzle","-ds_store":"folder-macos","-dump":"folder-dump","-dumps":"folder-dump","-e2e":"folder-coverage","-easing":"folder-animation","-easings":"folder-animation","-element":"folder-element","-elements":"folder-element","-email":"folder-mail","-emails":"folder-mail","-enum":"folder-enum","-enums":"folder-enum","-env":"folder-environment","-environment":"folder-environment","-environments":"folder-environment","-envs":"folder-environment","-err":"folder-error","-error":"folder-error","-errors":"folder-error","-errs":"folder-error","-eslint":"folder-eslint","-eslint-config":"folder-eslint","-eslint-configs":"folder-eslint","-eslint-plugin":"folder-eslint","-eslint-plugins":"folder-eslint","-etc":"folder-other","-event":"folder-event","-events":"folder-event","-example":"folder-examples","-examples":"folder-examples","-expo":"folder-expo","-expo-shared":"folder-expo","-export":"folder-export","-exported":"folder-export","-exports":"folder-export","-extension":"folder-plugin","-extensions":"folder-plugin","-external":"folder-lib","-externals":"folder-lib","-extra":"folder-other","-extras":"folder-other","-fastlane":"folder-fastlane","-favicon":"folder-favicon","-favicons":"folder-favicon","-feat":"folder-features","-feats":"folder-features","-feature":"folder-features","-features":"folder-features","-fig":"folder-images","-figs":"folder-images","-figure":"folder-images","-figures":"folder-images","-filter":"folder-filter","-filters":"folder-filter","-firebase":"folder-firebase","-firebase-cloud-functions":"folder-cloud-functions","-firebase-cloudfunctions":"folder-cloud-functions","-firebase-firestore":"folder-firestore","-firestore":"folder-firestore","-fixture":"folder-mock","-fixtures":"folder-mock","-flow-typed":"folder-flow","-flutter":"folder-flutter","-font":"folder-font","-fonts":"folder-font","-forgejo":"folder-forgejo","-form":"folder-form","-forms":"folder-form","-forum":"folder-messages","-fragments":"folder-components","-frontend":"folder-client","-frontends":"folder-client","-func":"folder-functions","-funcs":"folder-functions","-function":"folder-functions","-functions":"folder-functions","-game":"folder-console","-gamemaker":"folder-gamemaker","-gamemaker2":"folder-gamemaker","-games":"folder-console","-gcp":"folder-aws","-gemini":"folder-gemini-ai","-gemini-ai":"folder-gemini-ai","-geminiai":"folder-gemini-ai","-gen":"folder-generator","-generated":"folder-generator","-generator":"folder-generator","-generators":"folder-generator","-gens":"folder-generator","-git":"folder-git","-gitea":"folder-gitea","-githooks":"folder-git","-github":"folder-github","-github/issue_template":"folder-template","-github/pull_request_template":"folder-template","-github/workflows":"folder-gh-workflows","-gitlab":"folder-gitlab","-global":"folder-global","-glsl":"folder-shader","-go":"folder-go","-godot":"folder-godot","-godot-cpp":"folder-godot","-golang":"folder-go","-gql":"folder-graphql","-gradle":"folder-gradle","-graphql":"folder-graphql","-guard":"folder-guard","-guards":"folder-guard","-gui":"folder-ui","-gulp":"folder-gulp","-gulp-tasks":"folder-gulp","-gulpfile.babel.js":"folder-gulp","-gulpfile.js":"folder-gulp","-gulpfile.mjs":"folder-gulp","-gulpfile.ts":"folder-gulp","-gulpfiles":"folder-gulp","-handler":"folder-controller","-handlers":"folder-controller","-helm":"folder-helm","-helmchart":"folder-helm","-helmcharts":"folder-helm","-helper":"folder-helper","-helpers":"folder-helper","-hg":"folder-mercurial","-hgext":"folder-mercurial","-hghooks":"folder-mercurial","-histories":"folder-backup","-history":"folder-backup","-hlsl":"folder-shader","-home":"folder-home","-hook":"folder-hook","-hooks":"folder-hook","-html":"folder-views","-husky":"folder-husky","-i18n":"folder-i18n","-ico":"folder-images","-icon":"folder-images","-icons":"folder-images","-icos":"folder-images","-idea":"folder-intellij","-image":"folder-images","-images":"folder-images","-img":"folder-images","-imgs":"folder-images","-import":"folder-import","-imported":"folder-import","-imports":"folder-import","-in":"folder-input","-inc":"folder-include","-inc64":"folder-include","-include":"folder-include","-includes":"folder-include","-infra":"folder-server","-infrastructure":"folder-server","-input":"folder-input","-inputs":"folder-input","-integration":"folder-connection","-integration-test":"folder-coverage","-integration-tests":"folder-coverage","-integrations":"folder-connection","-interceptor":"folder-interceptor","-interceptors":"folder-interceptor","-interface":"folder-interface","-interfaces":"folder-interface","-internationalization":"folder-i18n","-inventories":"folder-server","-inventory":"folder-server","-io":"folder-input","-ios":"folder-ios","-ipad":"folder-macos","-iphone":"folder-macos","-ipod":"folder-macos","-ipynb":"folder-jupyter","-it":"folder-coverage","-j2":"folder-jinja","-java":"folder-java","-javascript":"folder-javascript","-javascripts":"folder-javascript","-jinja":"folder-jinja","-jinja2":"folder-jinja","-job":"folder-job","-jobs":"folder-job","-js":"folder-javascript","-json":"folder-json","-jsonc":"folder-json","-jsonl":"folder-json","-jsons":"folder-json","-jupyter":"folder-jupyter","-jwt":"folder-keys","-k8s":"folder-kubernetes","-key":"folder-keys","-keys":"folder-keys","-kit":"folder-tools","-kits":"folder-tools","-knowledge":"folder-docs","-kotlin":"folder-kotlin","-kql":"folder-kusto","-kubernetes":"folder-kubernetes","-kusto":"folder-kusto","-l10n":"folder-i18n","-lambda":"folder-functions","-lambdas":"folder-functions","-landing":"folder-home","-lang":"folder-i18n","-langs":"folder-i18n","-language":"folder-i18n","-languages":"folder-i18n","-layout":"folder-layout","-layouts":"folder-layout","-lefthook":"folder-lefthook","-lefthook-local":"folder-lefthook","-less":"folder-less","-lib":"folder-lib","-lib64":"folder-lib","-libraries":"folder-lib","-library":"folder-lib","-libs":"folder-lib","-license":"folder-license","-licenses":"folder-license","-link":"folder-link","-links":"folder-link","-linux":"folder-linux","-linuxbsd":"folder-linux","-liquibase":"folder-liquibase","-locale":"folder-i18n","-locales":"folder-i18n","-localization":"folder-i18n","-log":"folder-log","-logging":"folder-log","-logic":"folder-functions","-logs":"folder-log","-lottie":"folder-lottie","-lottiefiles":"folder-lottie","-lotties":"folder-lottie","-lua":"folder-lua","-luau":"folder-luau","-mac":"folder-macos","-macbook":"folder-macos","-macbook-air":"folder-macos","-macos":"folder-macos","-macosx":"folder-macos","-mail":"folder-mail","-mailers":"folder-mail","-mails":"folder-mail","-main":"folder-home","-manager":"folder-admin","-managers":"folder-admin","-mapping":"folder-mappings","-mappings":"folder-mappings","-markdown":"folder-markdown","-math":"folder-functions","-maths":"folder-functions","-md":"folder-markdown","-measure":"folder-benchmark","-measurement":"folder-benchmark","-measures":"folder-benchmark","-media":"folder-video","-messages":"folder-messages","-messaging":"folder-messages","-meta":"folder-meta","-meta-inf":"folder-config","-metadata":"folder-meta","-metro":"folder-metro","-middleware":"folder-middleware","-middlewares":"folder-middleware","-migration":"folder-migrations","-migrations":"folder-migrations","-mint":"folder-linux","-misc":"folder-other","-miscellaneous":"folder-other","-mjml":"folder-mjml","-mjs":"folder-javascript","-mobile":"folder-mobile","-mobiles":"folder-mobile","-mock":"folder-mock","-mocks":"folder-mock","-mod":"folder-plugin","-modding":"folder-plugin","-model":"folder-class","-models":"folder-class","-moderator":"folder-admin","-moderators":"folder-admin","-mods":"folder-plugin","-module":"folder-plugin","-modules":"folder-plugin","-mojo":"folder-mojo","-molecule":"folder-molecule","-molecules":"folder-molecule","-moon":"folder-moon","-motion":"folder-animation","-motions":"folder-animation","-movie":"folder-video","-movies":"folder-video","-mq":"folder-queue","-mts":"folder-typescript","-music":"folder-audio","-navigation":"folder-routes","-navigations":"folder-routes","-netlify":"folder-netlify","-news":"folder-docs","-next":"folder-next","-nginx":"folder-nginx","-node":"folder-node","-node_modules":"folder-node","-nodejs":"folder-node","-note":"folder-docs","-notebook":"folder-jupyter","-notebooks":"folder-jupyter","-notes":"folder-docs","-now":"folder-vercel","-nuxt":"folder-nuxt","-nyc-output":"folder-coverage","-nyc_output":"folder-coverage","-obsidian":"folder-obsidian","-opencode":"folder-opencode","-option":"folder-config","-options":"folder-config","-organism":"folder-organism","-organisms":"folder-organism","-osx":"folder-macos","-other":"folder-other","-others":"folder-other","-out":"folder-dist","-output":"folder-dist","-outputs":"folder-dist","-package":"folder-packages","-packages":"folder-packages","-pact":"folder-contract","-pacts":"folder-contract","-page":"folder-views","-pages":"folder-views","-palette":"folder-theme","-palettes":"folder-theme","-partial":"folder-include","-partials":"folder-include","-patches":"folder-git","-pdf":"folder-pdf","-pdfs":"folder-pdf","-pdm-build":"folder-pdm","-pdm-plugins":"folder-pdm","-perf":"folder-benchmark","-performance":"folder-benchmark","-phone":"folder-mobile","-phones":"folder-mobile","-photo":"folder-images","-photograph":"folder-images","-photographs":"folder-images","-photos":"folder-images","-php":"folder-php","-phpmailer":"folder-phpmailer","-pic":"folder-images","-pics":"folder-images","-picture":"folder-images","-pictures":"folder-images","-pipe":"folder-pipe","-pipeline":"folder-pipe","-pipelines":"folder-pipe","-pipes":"folder-pipe","-pkg":"folder-packages","-pkgs":"folder-packages","-plastic":"folder-plastic","-playground":"folder-sandbox","-playgrounds":"folder-sandbox","-playlist":"folder-audio","-playlists":"folder-audio","-plugin":"folder-plugin","-plugins":"folder-plugin","-policies":"folder-policy","-policy":"folder-policy","-popos":"folder-linux","-portability":"folder-mobile","-portable":"folder-mobile","-post":"folder-docs","-postman":"folder-postman","-posts":"folder-docs","-powershell":"folder-powershell","-pref":"folder-config","-preference":"folder-config","-preferences":"folder-config","-prefs":"folder-config","-presentation":"folder-ui","-preview":"folder-review","-previews":"folder-review","-prisma":"folder-prisma","-prisma/schema":"folder-prisma","-private":"folder-private","-profiling":"folder-benchmark","-proj":"folder-project","-project":"folder-project","-projects":"folder-project","-projs":"folder-project","-prompt":"folder-prompts","-prompts":"folder-prompts","-properties":"folder-config","-props":"folder-config","-proto":"folder-proto","-protobuf":"folder-proto","-protobufs":"folder-proto","-protos":"folder-proto","-provider":"folder-controller","-providers":"folder-controller","-proxy":"folder-public","-ps":"folder-powershell","-ps1":"folder-powershell","-ps4":"folder-console","-ps5":"folder-console","-public":"folder-public","-public_html":"folder-views","-pwa":"folder-client","-pycache":"folder-python","-pytest_cache":"folder-python","-python":"folder-python","-pytorch":"folder-pytorch","-quasar":"folder-quasar","-queue":"folder-queue","-queues":"folder-queue","-r":"folder-r","-recordings":"folder-audio","-release":"folder-dist","-remote":"folder-connection","-remotes":"folder-connection","-repo":"folder-repository","-report":"folder-resource","-reports":"folder-resource","-repos":"folder-repository","-repositories":"folder-repository","-repository":"folder-repository","-res":"folder-resource","-resolver":"folder-resolver","-resolvers":"folder-resolver","-resource":"folder-resource","-resources":"folder-resource","-restapi":"folder-api","-review":"folder-review","-reviewed":"folder-review","-reviews":"folder-review","-revisal":"folder-review","-revisals":"folder-review","-robot":"folder-robot","-robots":"folder-robot","-router":"folder-routes","-routers":"folder-routes","-routes":"folder-routes","-routing":"folder-routes","-rule":"folder-rules","-rules":"folder-rules","-rust":"folder-rust","-salt":"folder-salt","-saltstack":"folder-salt","-sample":"folder-examples","-sample-data":"folder-examples","-samples":"folder-examples","-sandbox":"folder-sandbox","-sandboxes":"folder-sandbox","-sass":"folder-sass","-scala":"folder-scala","-schema":"folder-class","-schemas":"folder-class","-sconf_temp":"folder-scons","-scons":"folder-scons","-scons_cache":"folder-scons","-screen":"folder-views","-screengrab":"folder-images","-screengrabs":"folder-images","-screens":"folder-views","-screenshot":"folder-images","-screenshots":"folder-images","-script":"folder-scripts","-scripting":"folder-scripts","-scripts":"folder-scripts","-scss":"folder-sass","-secret":"folder-keys","-secrets":"folder-keys","-secure":"folder-secure","-security":"folder-secure","-seed":"folder-seeders","-seeders":"folder-seeders","-seeding":"folder-seeders","-seeds":"folder-seeders","-server":"folder-server","-serverless":"folder-serverless","-serverpackages":"folder-packages","-servers":"folder-server","-service":"folder-controller","-services":"folder-controller","-setting":"folder-config","-settings":"folder-config","-shader":"folder-shader","-shaders":"folder-shader","-shared":"folder-shared","-shop":"folder-cart","-shopping":"folder-cart","-shopping-cart":"folder-cart","-sim":"folder-simulations","-sims":"folder-simulations","-simulation":"folder-simulations","-simulations":"folder-simulations","-site":"folder-public","-sketch":"folder-mock","-sketches":"folder-mock","-skill":"folder-skills","-skills":"folder-skills","-smtp":"folder-mail","-snap":"folder-snapcraft","-snapcraft":"folder-snapcraft","-snapshots":"folder-test","-snippet":"folder-snippet","-snippets":"folder-snippet","-song":"folder-audio","-songs":"folder-audio","-sound":"folder-audio","-sounds":"folder-audio","-source":"folder-src","-sources":"folder-src","-spa":"folder-client","-spec":"folder-test","-specs":"folder-test","-spellcheck":"folder-syntax","-spellcheckers":"folder-syntax","-sql":"folder-database","-src":"folder-src","-src-tauri":"folder-src-tauri","-srcs":"folder-src","-ssl":"folder-secure","-stack":"folder-stack","-stacks":"folder-stack","-start":"folder-home","-static":"folder-resource","-stencil":"folder-stencil","-store":"folder-store","-stores":"folder-store","-stories":"folder-storybook","-storybook":"folder-storybook","-style":"folder-css","-styles":"folder-css","-stylesheet":"folder-css","-stylesheets":"folder-css","-stylus":"folder-stylus","-sublime":"folder-sublime","-submodules":"folder-git","-supabase":"folder-supabase","-svelte":"folder-svelte","-svelte-kit":"folder-svelte","-svg":"folder-svg","-svgs":"folder-svg","-switch":"folder-console","-syntax":"folder-syntax","-syntaxes":"folder-syntax","-table-of-contents":"folder-toc","-target":"folder-target","-taskfile":"folder-taskfile","-taskfiles":"folder-taskfile","-tasks":"folder-tasks","-television":"folder-television","-temp":"folder-temp","-template":"folder-template","-templates":"folder-template","-terraform":"folder-terraform","-test":"folder-test","-testfiles":"folder-test","-testing":"folder-test","-tests":"folder-test","-texture":"folder-images","-textures":"folder-images","-theme":"folder-theme","-themes":"folder-theme","-third-party":"folder-lib","-thirdparty":"folder-lib","-tickets":"folder-tasks","-tls":"folder-secure","-tmp":"folder-temp","-toc":"folder-toc","-token":"folder-keys","-tokens":"folder-keys","-toolbox":"folder-tools","-toolboxes":"folder-tools","-tooling":"folder-tools","-toolkit":"folder-tools","-toolkits":"folder-tools","-tools":"folder-tools","-torch":"folder-pytorch","-transition":"folder-animation","-transitions":"folder-animation","-translate":"folder-i18n","-translation":"folder-i18n","-translations":"folder-i18n","-trash":"folder-trash","-trigger":"folder-trigger","-triggers":"folder-trigger","-ts":"folder-typescript","-turbo":"folder-turborepo","-tv":"folder-television","-tx":"folder-i18n","-typeface":"folder-font","-typefaces":"folder-font","-types":"folder-typescript","-typescript":"folder-typescript","-typings":"folder-typescript","-ubuntu":"folder-linux","-ui":"folder-ui","-unity":"folder-unity","-unix":"folder-linux","-update":"folder-update","-updates":"folder-update","-upgrade":"folder-update","-upgrades":"folder-update","-upload":"folder-upload","-uploads":"folder-upload","-util":"folder-utils","-utilities":"folder-utils","-utility":"folder-utils","-utils":"folder-utils","-ux":"folder-ui","-validation":"folder-rules","-validations":"folder-rules","-validator":"folder-rules","-validators":"folder-rules","-vector":"folder-svg","-vectors":"folder-svg","-vendor":"folder-lib","-vendors":"folder-lib","-venv":"folder-environment","-vercel":"folder-vercel","-verdaccio":"folder-verdaccio","-vid":"folder-video","-video":"folder-video","-videos":"folder-video","-vids":"folder-video","-view":"folder-views","-views":"folder-views","-vm":"folder-vm","-vms":"folder-vm","-voice":"folder-audio","-voices":"folder-audio","-vscode":"folder-vscode","-vscode-test":"folder-vscode","-vue":"folder-vue","-vuepress":"folder-vuepress","-wakatime":"folder-wakatime","-web":"folder-public","-webpack":"folder-webpack","-website":"folder-public","-websites":"folder-public","-widget":"folder-components","-widgets":"folder-components","-wiki":"folder-docs","-win":"folder-windows","-win10":"folder-windows","-win11":"folder-windows","-win32":"folder-windows","-windows":"folder-windows","-windows10":"folder-windows","-windows11":"folder-windows","-windowsnt":"folder-windows","-windowsxp":"folder-windows","-winnt":"folder-windows","-winxp":"folder-windows","-wordpress-org":"folder-wordpress","-wp-content":"folder-wordpress","-wsl":"folder-linux","-www":"folder-public","-wwwroot":"folder-public","-xbox":"folder-console","-xtask":"folder-scripts","-yarn":"folder-yarn","-zeabur":"folder-zeabur","-zed":"folder-zed",".@types":"folder-typescript",".addin":"folder-plugin",".addins":"folder-plugin",".addon":"folder-plugin",".addons":"folder-plugin",".admin":"folder-admin",".admins":"folder-admin",".agent":"folder-robot",".agents":"folder-robot",".android":"folder-android",".angular":"folder-angular",".anim":"folder-animation",".animated":"folder-animation",".animation":"folder-animation",".animations":"folder-animation",".anims":"folder-animation",".ansible":"folder-ansible",".api":"folder-api",".apis":"folder-api",".apollo":"folder-apollo",".apollo-cache":"folder-apollo",".apollo-client":"folder-apollo",".apollo-config":"folder-apollo",".app":"folder-app",".apple":"folder-macos",".application":"folder-app",".applications":"folder-app",".apps":"folder-app",".appwrite":"folder-appwrite",".arc":"folder-archive",".archival":"folder-archive",".archive":"folder-archive",".archives":"folder-archive",".arcs":"folder-archive",".article":"folder-docs",".articles":"folder-docs",".asm":"folder-assembly",".assembly":"folder-assembly",".asset":"folder-resource",".assets":"folder-resource",".astro":"folder-astro",".atom":"folder-atom",".atoms":"folder-atom",".attachment":"folder-attachment",".attachments":"folder-attachment",".aud":"folder-audio",".audio":"folder-audio",".audios":"folder-audio",".auds":"folder-audio",".aurelia_project":"folder-aurelia",".auth":"folder-secure",".authentication":"folder-secure",".auto":"folder-generator",".aws":"folder-aws",".azure":"folder-aws",".azure-pipelines":"folder-azure-pipelines",".azure-pipelines-ci":"folder-azure-pipelines",".back-up":"folder-backup",".back-ups":"folder-backup",".backend":"folder-server",".backends":"folder-server",".backup":"folder-backup",".backups":"folder-backup",".bak":"folder-backup",".baks":"folder-backup",".base":"folder-base",".bases":"folder-base",".batch":"folder-batch",".batches":"folder-batch",".batchs":"folder-batch",".bench":"folder-benchmark",".benches":"folder-benchmark",".benchmark":"folder-benchmark",".benchmarks":"folder-benchmark",".bibliographies":"folder-bibliography",".bibliography":"folder-bibliography",".bicep":"folder-bicep",".bin":"folder-dist",".bkp":"folder-backup",".bkps":"folder-backup",".blender":"folder-blender",".blender-assets":"folder-blender",".blender-files":"folder-blender",".blender-models":"folder-blender",".blender-project":"folder-blender",".bloc":"folder-bloc",".blocs":"folder-bloc",".blog":"folder-docs",".book":"folder-bibliography",".books":"folder-bibliography",".bot":"folder-robot",".bots":"folder-robot",".bower_components":"folder-bower",".browser":"folder-public",".browsers":"folder-public",".build":"folder-dist",".buildkite":"folder-buildkite",".builds":"folder-dist",".built":"folder-dist",".bull":"folder-queue",".cache":"folder-temp",".cached":"folder-temp",".calc":"folder-functions",".calcs":"folder-functions",".calculation":"folder-functions",".calculations":"folder-functions",".cargo":"folder-rust",".cart":"folder-cart",".centos":"folder-linux",".cert":"folder-secure",".certificate":"folder-secure",".certificates":"folder-secure",".certs":"folder-secure",".cfg":"folder-config",".cfgs":"folder-config",".cfn-gen":"folder-generator",".changes":"folder-delta",".changeset":"folder-changesets",".changesets":"folder-changesets",".chat":"folder-messages",".chats":"folder-messages",".ci":"folder-ci",".cipher":"folder-secure",".circleci":"folder-circleci",".cjs":"folder-javascript",".class":"folder-class",".classes":"folder-class",".claude":"folder-claude",".cli":"folder-command",".client":"folder-client",".clients":"folder-client",".cline_docs":"folder-cline",".clis":"folder-command",".cloud-firestore":"folder-firestore",".cloud-functions":"folder-cloud-functions",".cloudflare":"folder-cloudflare",".cloudfunctions":"folder-cloud-functions",".cluster":"folder-cluster",".clusters":"folder-cluster",".cmd":"folder-command",".cobol":"folder-cobol",".code":"folder-src",".color":"folder-theme",".colors":"folder-theme",".colour":"folder-theme",".colours":"folder-theme",".command":"folder-command",".commandline":"folder-command",".commands":"folder-command",".common":"folder-shared",".compiled":"folder-dist",".components":"folder-components",".composable":"folder-functions",".composables":"folder-functions",".concept":"folder-mock",".concepts":"folder-mock",".conf":"folder-config",".config":"folder-config",".configs":"folder-config",".configuration":"folder-config",".configurations":"folder-config",".confs":"folder-config",".connection":"folder-connection",".connections":"folder-connection",".console":"folder-console",".const":"folder-constant",".constant":"folder-constant",".constants":"folder-constant",".consts":"folder-constant",".container":"folder-container",".containers":"folder-container",".content":"folder-content",".contents":"folder-content",".context":"folder-context",".contexts":"folder-context",".contract":"folder-contract",".contract-test":"folder-contract",".contract-testing":"folder-contract",".contract-tests":"folder-contract",".contracts":"folder-contract",".controller":"folder-controller",".controllers":"folder-controller",".controls":"folder-controller",".conversation":"folder-messages",".conversations":"folder-messages",".core":"folder-core",".coverage":"folder-coverage",".crash":"folder-error",".crashes":"folder-error",".crates":"folder-lib",".css":"folder-css",".cts":"folder-typescript",".cubit":"folder-bloc",".cubits":"folder-bloc",".cue":"folder-cue",".cues":"folder-cue",".cursor":"folder-cursor",".custom":"folder-custom",".customs":"folder-custom",".cypher":"folder-secure",".cypress":"folder-cypress",".dal":"folder-dal",".dart":"folder-dart",".dart_tool":"folder-dart",".dart_tools":"folder-dart",".data":"folder-database",".data-access":"folder-dal",".data-access-layer":"folder-dal",".database":"folder-database",".databases":"folder-database",".db":"folder-database",".deb":"folder-linux",".debian":"folder-linux",".debug":"folder-debug",".debugger":"folder-debug",".debugging":"folder-debug",".decorator":"folder-decorators",".decorators":"folder-decorators",".deepin":"folder-linux",".delta":"folder-delta",".deltas":"folder-delta",".demo":"folder-examples",".demos":"folder-examples",".dependencies":"folder-packages",".design":"folder-theme",".designs":"folder-theme",".desktop":"folder-desktop",".devcontainer":"folder-container",".devpackages":"folder-packages",".devtools":"folder-tools",".dialog":"folder-messages",".dialogs":"folder-messages",".diary":"folder-docs",".directive":"folder-directive",".directives":"folder-directive",".display":"folder-desktop",".dist":"folder-dist",".distribution":"folder-dist",".doc":"folder-docs",".docker":"folder-docker",".dockerfiles":"folder-docker",".dockerhub":"folder-docker",".docs":"folder-docs",".document":"folder-docs",".documentation":"folder-docs",".documents":"folder-docs",".download":"folder-download",".downloader":"folder-download",".downloaders":"folder-download",".downloads":"folder-download",".draft":"folder-mock",".drafts":"folder-mock",".drizzle":"folder-drizzle",".ds_store":"folder-macos",".dump":"folder-dump",".dumps":"folder-dump",".e2e":"folder-coverage",".easing":"folder-animation",".easings":"folder-animation",".element":"folder-element",".elements":"folder-element",".email":"folder-mail",".emails":"folder-mail",".enum":"folder-enum",".enums":"folder-enum",".env":"folder-environment",".environment":"folder-environment",".environments":"folder-environment",".envs":"folder-environment",".err":"folder-error",".error":"folder-error",".errors":"folder-error",".errs":"folder-error",".eslint":"folder-eslint",".eslint-config":"folder-eslint",".eslint-configs":"folder-eslint",".eslint-plugin":"folder-eslint",".eslint-plugins":"folder-eslint",".etc":"folder-other",".event":"folder-event",".events":"folder-event",".example":"folder-examples",".examples":"folder-examples",".expo":"folder-expo",".expo-shared":"folder-expo",".export":"folder-export",".exported":"folder-export",".exports":"folder-export",".extension":"folder-plugin",".extensions":"folder-plugin",".external":"folder-lib",".externals":"folder-lib",".extra":"folder-other",".extras":"folder-other",".fastlane":"folder-fastlane",".favicon":"folder-favicon",".favicons":"folder-favicon",".feat":"folder-features",".feats":"folder-features",".feature":"folder-features",".features":"folder-features",".fig":"folder-images",".figs":"folder-images",".figure":"folder-images",".figures":"folder-images",".filter":"folder-filter",".filters":"folder-filter",".firebase":"folder-firebase",".firebase-cloud-functions":"folder-cloud-functions",".firebase-cloudfunctions":"folder-cloud-functions",".firebase-firestore":"folder-firestore",".firestore":"folder-firestore",".fixture":"folder-mock",".fixtures":"folder-mock",".flow-typed":"folder-flow",".flutter":"folder-flutter",".font":"folder-font",".fonts":"folder-font",".forgejo":"folder-forgejo",".form":"folder-form",".forms":"folder-form",".forum":"folder-messages",".fragments":"folder-components",".frontend":"folder-client",".frontends":"folder-client",".func":"folder-functions",".funcs":"folder-functions",".function":"folder-functions",".functions":"folder-functions",".game":"folder-console",".gamemaker":"folder-gamemaker",".gamemaker2":"folder-gamemaker",".games":"folder-console",".gcp":"folder-aws",".gemini":"folder-gemini-ai",".gemini-ai":"folder-gemini-ai",".geminiai":"folder-gemini-ai",".gen":"folder-generator",".generated":"folder-generator",".generator":"folder-generator",".generators":"folder-generator",".gens":"folder-generator",".git":"folder-git",".gitea":"folder-gitea",".githooks":"folder-git",".github":"folder-github",".github/issue_template":"folder-template",".github/pull_request_template":"folder-template",".github/workflows":"folder-gh-workflows",".gitlab":"folder-gitlab",".global":"folder-global",".glsl":"folder-shader",".go":"folder-go",".godot":"folder-godot",".godot-cpp":"folder-godot",".golang":"folder-go",".gql":"folder-graphql",".gradle":"folder-gradle",".graphql":"folder-graphql",".guard":"folder-guard",".guards":"folder-guard",".gui":"folder-ui",".gulp":"folder-gulp",".gulp-tasks":"folder-gulp",".gulpfile.babel.js":"folder-gulp",".gulpfile.js":"folder-gulp",".gulpfile.mjs":"folder-gulp",".gulpfile.ts":"folder-gulp",".gulpfiles":"folder-gulp",".handler":"folder-controller",".handlers":"folder-controller",".helm":"folder-helm",".helmchart":"folder-helm",".helmcharts":"folder-helm",".helper":"folder-helper",".helpers":"folder-helper",".hg":"folder-mercurial",".hgext":"folder-mercurial",".hghooks":"folder-mercurial",".histories":"folder-backup",".history":"folder-backup",".hlsl":"folder-shader",".home":"folder-home",".hook":"folder-hook",".hooks":"folder-hook",".html":"folder-views",".husky":"folder-husky",".i18n":"folder-i18n",".ico":"folder-images",".icon":"folder-images",".icons":"folder-images",".icos":"folder-images",".idea":"folder-intellij",".image":"folder-images",".images":"folder-images",".img":"folder-images",".imgs":"folder-images",".import":"folder-import",".imported":"folder-import",".imports":"folder-import",".in":"folder-input",".inc":"folder-include",".inc64":"folder-include",".include":"folder-include",".includes":"folder-include",".infra":"folder-server",".infrastructure":"folder-server",".input":"folder-input",".inputs":"folder-input",".integration":"folder-connection",".integration-test":"folder-coverage",".integration-tests":"folder-coverage",".integrations":"folder-connection",".interceptor":"folder-interceptor",".interceptors":"folder-interceptor",".interface":"folder-interface",".interfaces":"folder-interface",".internationalization":"folder-i18n",".inventories":"folder-server",".inventory":"folder-server",".io":"folder-input",".ios":"folder-ios",".ipad":"folder-macos",".iphone":"folder-macos",".ipod":"folder-macos",".ipynb":"folder-jupyter",".it":"folder-coverage",".j2":"folder-jinja",".java":"folder-java",".javascript":"folder-javascript",".javascripts":"folder-javascript",".jinja":"folder-jinja",".jinja2":"folder-jinja",".job":"folder-job",".jobs":"folder-job",".js":"folder-javascript",".json":"folder-json",".jsonc":"folder-json",".jsonl":"folder-json",".jsons":"folder-json",".jupyter":"folder-jupyter",".jwt":"folder-keys",".k8s":"folder-kubernetes",".key":"folder-keys",".keys":"folder-keys",".kit":"folder-tools",".kits":"folder-tools",".knowledge":"folder-docs",".kotlin":"folder-kotlin",".kql":"folder-kusto",".kubernetes":"folder-kubernetes",".kusto":"folder-kusto",".l10n":"folder-i18n",".lambda":"folder-functions",".lambdas":"folder-functions",".landing":"folder-home",".lang":"folder-i18n",".langs":"folder-i18n",".language":"folder-i18n",".languages":"folder-i18n",".layout":"folder-layout",".layouts":"folder-layout",".lefthook":"folder-lefthook",".lefthook-local":"folder-lefthook",".less":"folder-less",".lib":"folder-lib",".lib64":"folder-lib",".libraries":"folder-lib",".library":"folder-lib",".libs":"folder-lib",".license":"folder-license",".licenses":"folder-license",".link":"folder-link",".links":"folder-link",".linux":"folder-linux",".linuxbsd":"folder-linux",".liquibase":"folder-liquibase",".locale":"folder-i18n",".locales":"folder-i18n",".localization":"folder-i18n",".log":"folder-log",".logging":"folder-log",".logic":"folder-functions",".logs":"folder-log",".lottie":"folder-lottie",".lottiefiles":"folder-lottie",".lotties":"folder-lottie",".lua":"folder-lua",".luau":"folder-luau",".mac":"folder-macos",".macbook":"folder-macos",".macbook-air":"folder-macos",".macos":"folder-macos",".macosx":"folder-macos",".mail":"folder-mail",".mailers":"folder-mail",".mails":"folder-mail",".main":"folder-home",".manager":"folder-admin",".managers":"folder-admin",".mapping":"folder-mappings",".mappings":"folder-mappings",".markdown":"folder-markdown",".math":"folder-functions",".maths":"folder-functions",".md":"folder-markdown",".measure":"folder-benchmark",".measurement":"folder-benchmark",".measures":"folder-benchmark",".media":"folder-video",".messages":"folder-messages",".messaging":"folder-messages",".meta":"folder-meta",".meta-inf":"folder-config",".metadata":"folder-meta",".metro":"folder-metro",".middleware":"folder-middleware",".middlewares":"folder-middleware",".migration":"folder-migrations",".migrations":"folder-migrations",".mint":"folder-linux",".misc":"folder-other",".miscellaneous":"folder-other",".mjml":"folder-mjml",".mjs":"folder-javascript",".mobile":"folder-mobile",".mobiles":"folder-mobile",".mock":"folder-mock",".mocks":"folder-mock",".mod":"folder-plugin",".modding":"folder-plugin",".model":"folder-class",".models":"folder-class",".moderator":"folder-admin",".moderators":"folder-admin",".mods":"folder-plugin",".module":"folder-plugin",".modules":"folder-plugin",".mojo":"folder-mojo",".molecule":"folder-molecule",".molecules":"folder-molecule",".moon":"folder-moon",".motion":"folder-animation",".motions":"folder-animation",".movie":"folder-video",".movies":"folder-video",".mq":"folder-queue",".mts":"folder-typescript",".music":"folder-audio",".navigation":"folder-routes",".navigations":"folder-routes",".netlify":"folder-netlify",".news":"folder-docs",".next":"folder-next",".nginx":"folder-nginx",".node":"folder-node",".node_modules":"folder-node",".nodejs":"folder-node",".note":"folder-docs",".notebook":"folder-jupyter",".notebooks":"folder-jupyter",".notes":"folder-docs",".now":"folder-vercel",".nuxt":"folder-nuxt",".nyc-output":"folder-coverage",".nyc_output":"folder-coverage",".obsidian":"folder-obsidian",".opencode":"folder-opencode",".option":"folder-config",".options":"folder-config",".organism":"folder-organism",".organisms":"folder-organism",".osx":"folder-macos",".other":"folder-other",".others":"folder-other",".out":"folder-dist",".output":"folder-dist",".outputs":"folder-dist",".package":"folder-packages",".packages":"folder-packages",".pact":"folder-contract",".pacts":"folder-contract",".page":"folder-views",".pages":"folder-views",".palette":"folder-theme",".palettes":"folder-theme",".partial":"folder-include",".partials":"folder-include",".patches":"folder-git",".pdf":"folder-pdf",".pdfs":"folder-pdf",".pdm-build":"folder-pdm",".pdm-plugins":"folder-pdm",".perf":"folder-benchmark",".performance":"folder-benchmark",".phone":"folder-mobile",".phones":"folder-mobile",".photo":"folder-images",".photograph":"folder-images",".photographs":"folder-images",".photos":"folder-images",".php":"folder-php",".phpmailer":"folder-phpmailer",".pic":"folder-images",".pics":"folder-images",".picture":"folder-images",".pictures":"folder-images",".pipe":"folder-pipe",".pipeline":"folder-pipe",".pipelines":"folder-pipe",".pipes":"folder-pipe",".pkg":"folder-packages",".pkgs":"folder-packages",".plastic":"folder-plastic",".playground":"folder-sandbox",".playgrounds":"folder-sandbox",".playlist":"folder-audio",".playlists":"folder-audio",".plugin":"folder-plugin",".plugins":"folder-plugin",".policies":"folder-policy",".policy":"folder-policy",".popos":"folder-linux",".portability":"folder-mobile",".portable":"folder-mobile",".post":"folder-docs",".postman":"folder-postman",".posts":"folder-docs",".powershell":"folder-powershell",".pref":"folder-config",".preference":"folder-config",".preferences":"folder-config",".prefs":"folder-config",".presentation":"folder-ui",".preview":"folder-review",".previews":"folder-review",".prisma":"folder-prisma",".prisma/schema":"folder-prisma",".private":"folder-private",".profiling":"folder-benchmark",".proj":"folder-project",".project":"folder-project",".projects":"folder-project",".projs":"folder-project",".prompt":"folder-prompts",".prompts":"folder-prompts",".properties":"folder-config",".props":"folder-config",".proto":"folder-proto",".protobuf":"folder-proto",".protobufs":"folder-proto",".protos":"folder-proto",".provider":"folder-controller",".providers":"folder-controller",".proxy":"folder-public",".ps":"folder-powershell",".ps1":"folder-powershell",".ps4":"folder-console",".ps5":"folder-console",".public":"folder-public",".public_html":"folder-views",".pwa":"folder-client",".pycache":"folder-python",".pytest_cache":"folder-python",".python":"folder-python",".pytorch":"folder-pytorch",".quasar":"folder-quasar",".queue":"folder-queue",".queues":"folder-queue",".r":"folder-r",".recordings":"folder-audio",".release":"folder-dist",".remote":"folder-connection",".remotes":"folder-connection",".repo":"folder-repository",".report":"folder-resource",".reports":"folder-resource",".repos":"folder-repository",".repositories":"folder-repository",".repository":"folder-repository",".res":"folder-resource",".resolver":"folder-resolver",".resolvers":"folder-resolver",".resource":"folder-resource",".resources":"folder-resource",".restapi":"folder-api",".review":"folder-review",".reviewed":"folder-review",".reviews":"folder-review",".revisal":"folder-review",".revisals":"folder-review",".robot":"folder-robot",".robots":"folder-robot",".router":"folder-routes",".routers":"folder-routes",".routes":"folder-routes",".routing":"folder-routes",".rule":"folder-rules",".rules":"folder-rules",".rust":"folder-rust",".salt":"folder-salt",".saltstack":"folder-salt",".sample":"folder-examples",".sample-data":"folder-examples",".samples":"folder-examples",".sandbox":"folder-sandbox",".sandboxes":"folder-sandbox",".sass":"folder-sass",".scala":"folder-scala",".schema":"folder-class",".schemas":"folder-class",".sconf_temp":"folder-scons",".scons":"folder-scons",".scons_cache":"folder-scons",".screen":"folder-views",".screengrab":"folder-images",".screengrabs":"folder-images",".screens":"folder-views",".screenshot":"folder-images",".screenshots":"folder-images",".script":"folder-scripts",".scripting":"folder-scripts",".scripts":"folder-scripts",".scss":"folder-sass",".secret":"folder-keys",".secrets":"folder-keys",".secure":"folder-secure",".security":"folder-secure",".seed":"folder-seeders",".seeders":"folder-seeders",".seeding":"folder-seeders",".seeds":"folder-seeders",".server":"folder-server",".serverless":"folder-serverless",".serverpackages":"folder-packages",".servers":"folder-server",".service":"folder-controller",".services":"folder-controller",".setting":"folder-config",".settings":"folder-config",".shader":"folder-shader",".shaders":"folder-shader",".shared":"folder-shared",".shop":"folder-cart",".shopping":"folder-cart",".shopping-cart":"folder-cart",".sim":"folder-simulations",".sims":"folder-simulations",".simulation":"folder-simulations",".simulations":"folder-simulations",".site":"folder-public",".sketch":"folder-mock",".sketches":"folder-mock",".skill":"folder-skills",".skills":"folder-skills",".smtp":"folder-mail",".snap":"folder-snapcraft",".snapcraft":"folder-snapcraft",".snapshots":"folder-test",".snippet":"folder-snippet",".snippets":"folder-snippet",".song":"folder-audio",".songs":"folder-audio",".sound":"folder-audio",".sounds":"folder-audio",".source":"folder-src",".sources":"folder-src",".spa":"folder-client",".spec":"folder-test",".specs":"folder-test",".spellcheck":"folder-syntax",".spellcheckers":"folder-syntax",".sql":"folder-database",".src":"folder-src",".src-tauri":"folder-src-tauri",".srcs":"folder-src",".ssl":"folder-secure",".stack":"folder-stack",".stacks":"folder-stack",".start":"folder-home",".static":"folder-resource",".stencil":"folder-stencil",".store":"folder-store",".stores":"folder-store",".stories":"folder-storybook",".storybook":"folder-storybook",".style":"folder-css",".styles":"folder-css",".stylesheet":"folder-css",".stylesheets":"folder-css",".stylus":"folder-stylus",".sublime":"folder-sublime",".submodules":"folder-git",".supabase":"folder-supabase",".svelte":"folder-svelte",".svelte-kit":"folder-svelte",".svg":"folder-svg",".svgs":"folder-svg",".switch":"folder-console",".syntax":"folder-syntax",".syntaxes":"folder-syntax",".table-of-contents":"folder-toc",".target":"folder-target",".taskfile":"folder-taskfile",".taskfiles":"folder-taskfile",".tasks":"folder-tasks",".television":"folder-television",".temp":"folder-temp",".template":"folder-template",".templates":"folder-template",".terraform":"folder-terraform",".test":"folder-test",".testfiles":"folder-test",".testing":"folder-test",".tests":"folder-test",".texture":"folder-images",".textures":"folder-images",".theme":"folder-theme",".themes":"folder-theme",".third-party":"folder-lib",".thirdparty":"folder-lib",".tickets":"folder-tasks",".tls":"folder-secure",".tmp":"folder-temp",".toc":"folder-toc",".token":"folder-keys",".tokens":"folder-keys",".toolbox":"folder-tools",".toolboxes":"folder-tools",".tooling":"folder-tools",".toolkit":"folder-tools",".toolkits":"folder-tools",".tools":"folder-tools",".torch":"folder-pytorch",".transition":"folder-animation",".transitions":"folder-animation",".translate":"folder-i18n",".translation":"folder-i18n",".translations":"folder-i18n",".trash":"folder-trash",".trigger":"folder-trigger",".triggers":"folder-trigger",".ts":"folder-typescript",".turbo":"folder-turborepo",".tv":"folder-television",".tx":"folder-i18n",".typeface":"folder-font",".typefaces":"folder-font",".types":"folder-typescript",".typescript":"folder-typescript",".typings":"folder-typescript",".ubuntu":"folder-linux",".ui":"folder-ui",".unity":"folder-unity",".unix":"folder-linux",".update":"folder-update",".updates":"folder-update",".upgrade":"folder-update",".upgrades":"folder-update",".upload":"folder-upload",".uploads":"folder-upload",".util":"folder-utils",".utilities":"folder-utils",".utility":"folder-utils",".utils":"folder-utils",".ux":"folder-ui",".validation":"folder-rules",".validations":"folder-rules",".validator":"folder-rules",".validators":"folder-rules",".vector":"folder-svg",".vectors":"folder-svg",".vendor":"folder-lib",".vendors":"folder-lib",".venv":"folder-environment",".vercel":"folder-vercel",".verdaccio":"folder-verdaccio",".vid":"folder-video",".video":"folder-video",".videos":"folder-video",".vids":"folder-video",".view":"folder-views",".views":"folder-views",".vm":"folder-vm",".vms":"folder-vm",".voice":"folder-audio",".voices":"folder-audio",".vscode":"folder-vscode",".vscode-test":"folder-vscode",".vue":"folder-vue",".vuepress":"folder-vuepress",".wakatime":"folder-wakatime",".web":"folder-public",".webpack":"folder-webpack",".website":"folder-public",".websites":"folder-public",".widget":"folder-components",".widgets":"folder-components",".wiki":"folder-docs",".win":"folder-windows",".win10":"folder-windows",".win11":"folder-windows",".win32":"folder-windows",".windows":"folder-windows",".windows10":"folder-windows",".windows11":"folder-windows",".windowsnt":"folder-windows",".windowsxp":"folder-windows",".winnt":"folder-windows",".winxp":"folder-windows",".wordpress-org":"folder-wordpress",".wp-content":"folder-wordpress",".wsl":"folder-linux",".www":"folder-public",".wwwroot":"folder-public",".xbox":"folder-console",".xtask":"folder-scripts",".yarn":"folder-yarn",".zeabur":"folder-zeabur",".zed":"folder-zed","@types":"folder-typescript","_@types":"folder-typescript","__@types__":"folder-typescript",__addin__:"folder-plugin",__addins__:"folder-plugin",__addon__:"folder-plugin",__addons__:"folder-plugin",__admin__:"folder-admin",__admins__:"folder-admin",__agent__:"folder-robot",__agents__:"folder-robot",__android__:"folder-android",__angular__:"folder-angular",__anim__:"folder-animation",__animated__:"folder-animation",__animation__:"folder-animation",__animations__:"folder-animation",__anims__:"folder-animation",__ansible__:"folder-ansible",__api__:"folder-api",__apis__:"folder-api","__apollo-cache__":"folder-apollo","__apollo-client__":"folder-apollo","__apollo-config__":"folder-apollo",__apollo__:"folder-apollo",__app__:"folder-app",__apple__:"folder-macos",__application__:"folder-app",__applications__:"folder-app",__apps__:"folder-app",__appwrite__:"folder-appwrite",__arc__:"folder-archive",__archival__:"folder-archive",__archive__:"folder-archive",__archives__:"folder-archive",__arcs__:"folder-archive",__article__:"folder-docs",__articles__:"folder-docs",__asm__:"folder-assembly",__assembly__:"folder-assembly",__asset__:"folder-resource",__assets__:"folder-resource",__astro__:"folder-astro",__atom__:"folder-atom",__atoms__:"folder-atom",__attachment__:"folder-attachment",__attachments__:"folder-attachment",__aud__:"folder-audio",__audio__:"folder-audio",__audios__:"folder-audio",__auds__:"folder-audio",__aurelia_project__:"folder-aurelia",__auth__:"folder-secure",__authentication__:"folder-secure",__auto__:"folder-generator",__aws__:"folder-aws","__azure-pipelines-ci__":"folder-azure-pipelines","__azure-pipelines__":"folder-azure-pipelines",__azure__:"folder-aws","__back-up__":"folder-backup","__back-ups__":"folder-backup",__backend__:"folder-server",__backends__:"folder-server",__backup__:"folder-backup",__backups__:"folder-backup",__bak__:"folder-backup",__baks__:"folder-backup",__base__:"folder-base",__bases__:"folder-base",__batch__:"folder-batch",__batches__:"folder-batch",__batchs__:"folder-batch",__bench__:"folder-benchmark",__benches__:"folder-benchmark",__benchmark__:"folder-benchmark",__benchmarks__:"folder-benchmark",__bibliographies__:"folder-bibliography",__bibliography__:"folder-bibliography",__bicep__:"folder-bicep",__bin__:"folder-dist",__bkp__:"folder-backup",__bkps__:"folder-backup","__blender-assets__":"folder-blender","__blender-files__":"folder-blender","__blender-models__":"folder-blender","__blender-project__":"folder-blender",__blender__:"folder-blender",__bloc__:"folder-bloc",__blocs__:"folder-bloc",__blog__:"folder-docs",__book__:"folder-bibliography",__books__:"folder-bibliography",__bot__:"folder-robot",__bots__:"folder-robot",__bower_components__:"folder-bower",__browser__:"folder-public",__browsers__:"folder-public",__build__:"folder-dist",__buildkite__:"folder-buildkite",__builds__:"folder-dist",__built__:"folder-dist",__bull__:"folder-queue",__cache__:"folder-temp",__cached__:"folder-temp",__calc__:"folder-functions",__calcs__:"folder-functions",__calculation__:"folder-functions",__calculations__:"folder-functions",__cargo__:"folder-rust",__cart__:"folder-cart",__centos__:"folder-linux",__cert__:"folder-secure",__certificate__:"folder-secure",__certificates__:"folder-secure",__certs__:"folder-secure",__cfg__:"folder-config",__cfgs__:"folder-config","__cfn-gen__":"folder-generator",__changes__:"folder-delta",__changeset__:"folder-changesets",__changesets__:"folder-changesets",__chat__:"folder-messages",__chats__:"folder-messages",__ci__:"folder-ci",__cipher__:"folder-secure",__circleci__:"folder-circleci",__cjs__:"folder-javascript",__class__:"folder-class",__classes__:"folder-class",__claude__:"folder-claude",__cli__:"folder-command",__client__:"folder-client",__clients__:"folder-client",__cline_docs__:"folder-cline",__clis__:"folder-command","__cloud-firestore__":"folder-firestore","__cloud-functions__":"folder-cloud-functions",__cloudflare__:"folder-cloudflare",__cloudfunctions__:"folder-cloud-functions",__cluster__:"folder-cluster",__clusters__:"folder-cluster",__cmd__:"folder-command",__cobol__:"folder-cobol",__code__:"folder-src",__color__:"folder-theme",__colors__:"folder-theme",__colour__:"folder-theme",__colours__:"folder-theme",__command__:"folder-command",__commandline__:"folder-command",__commands__:"folder-command",__common__:"folder-shared",__compiled__:"folder-dist",__components__:"folder-components",__composable__:"folder-functions",__composables__:"folder-functions",__concept__:"folder-mock",__concepts__:"folder-mock",__conf__:"folder-config",__config__:"folder-config",__configs__:"folder-config",__configuration__:"folder-config",__configurations__:"folder-config",__confs__:"folder-config",__connection__:"folder-connection",__connections__:"folder-connection",__console__:"folder-console",__const__:"folder-constant",__constant__:"folder-constant",__constants__:"folder-constant",__consts__:"folder-constant",__container__:"folder-container",__containers__:"folder-container",__content__:"folder-content",__contents__:"folder-content",__context__:"folder-context",__contexts__:"folder-context","__contract-test__":"folder-contract","__contract-testing__":"folder-contract","__contract-tests__":"folder-contract",__contract__:"folder-contract",__contracts__:"folder-contract",__controller__:"folder-controller",__controllers__:"folder-controller",__controls__:"folder-controller",__conversation__:"folder-messages",__conversations__:"folder-messages",__core__:"folder-core",__coverage__:"folder-coverage",__crash__:"folder-error",__crashes__:"folder-error",__crates__:"folder-lib",__css__:"folder-css",__cts__:"folder-typescript",__cubit__:"folder-bloc",__cubits__:"folder-bloc",__cue__:"folder-cue",__cues__:"folder-cue",__cursor__:"folder-cursor",__custom__:"folder-custom",__customs__:"folder-custom",__cypher__:"folder-secure",__cypress__:"folder-cypress",__dal__:"folder-dal",__dart__:"folder-dart",__dart_tool__:"folder-dart",__dart_tools__:"folder-dart","__data-access-layer__":"folder-dal","__data-access__":"folder-dal",__data__:"folder-database",__database__:"folder-database",__databases__:"folder-database",__db__:"folder-database",__deb__:"folder-linux",__debian__:"folder-linux",__debug__:"folder-debug",__debugger__:"folder-debug",__debugging__:"folder-debug",__decorator__:"folder-decorators",__decorators__:"folder-decorators",__deepin__:"folder-linux",__delta__:"folder-delta",__deltas__:"folder-delta",__demo__:"folder-examples",__demos__:"folder-examples",__dependencies__:"folder-packages",__design__:"folder-theme",__designs__:"folder-theme",__desktop__:"folder-desktop",__devcontainer__:"folder-container",__devpackages__:"folder-packages",__devtools__:"folder-tools",__dialog__:"folder-messages",__dialogs__:"folder-messages",__diary__:"folder-docs",__directive__:"folder-directive",__directives__:"folder-directive",__display__:"folder-desktop",__dist__:"folder-dist",__distribution__:"folder-dist",__doc__:"folder-docs",__docker__:"folder-docker",__dockerfiles__:"folder-docker",__dockerhub__:"folder-docker",__docs__:"folder-docs",__document__:"folder-docs",__documentation__:"folder-docs",__documents__:"folder-docs",__download__:"folder-download",__downloader__:"folder-download",__downloaders__:"folder-download",__downloads__:"folder-download",__draft__:"folder-mock",__drafts__:"folder-mock",__drizzle__:"folder-drizzle",__ds_store__:"folder-macos",__dump__:"folder-dump",__dumps__:"folder-dump",__e2e__:"folder-coverage",__easing__:"folder-animation",__easings__:"folder-animation",__element__:"folder-element",__elements__:"folder-element",__email__:"folder-mail",__emails__:"folder-mail",__enum__:"folder-enum",__enums__:"folder-enum",__env__:"folder-environment",__environment__:"folder-environment",__environments__:"folder-environment",__envs__:"folder-environment",__err__:"folder-error",__error__:"folder-error",__errors__:"folder-error",__errs__:"folder-error","__eslint-config__":"folder-eslint","__eslint-configs__":"folder-eslint","__eslint-plugin__":"folder-eslint","__eslint-plugins__":"folder-eslint",__eslint__:"folder-eslint",__etc__:"folder-other",__event__:"folder-event",__events__:"folder-event",__example__:"folder-examples",__examples__:"folder-examples","__expo-shared__":"folder-expo",__expo__:"folder-expo",__export__:"folder-export",__exported__:"folder-export",__exports__:"folder-export",__extension__:"folder-plugin",__extensions__:"folder-plugin",__external__:"folder-lib",__externals__:"folder-lib",__extra__:"folder-other",__extras__:"folder-other",__fastlane__:"folder-fastlane",__favicon__:"folder-favicon",__favicons__:"folder-favicon",__feat__:"folder-features",__feats__:"folder-features",__feature__:"folder-features",__features__:"folder-features",__fig__:"folder-images",__figs__:"folder-images",__figure__:"folder-images",__figures__:"folder-images",__filter__:"folder-filter",__filters__:"folder-filter","__firebase-cloud-functions__":"folder-cloud-functions","__firebase-cloudfunctions__":"folder-cloud-functions","__firebase-firestore__":"folder-firestore",__firebase__:"folder-firebase",__firestore__:"folder-firestore",__fixture__:"folder-mock",__fixtures__:"folder-mock","__flow-typed__":"folder-flow",__flutter__:"folder-flutter",__font__:"folder-font",__fonts__:"folder-font",__forgejo__:"folder-forgejo",__form__:"folder-form",__forms__:"folder-form",__forum__:"folder-messages",__fragments__:"folder-components",__frontend__:"folder-client",__frontends__:"folder-client",__func__:"folder-functions",__funcs__:"folder-functions",__function__:"folder-functions",__functions__:"folder-functions",__game__:"folder-console",__gamemaker2__:"folder-gamemaker",__gamemaker__:"folder-gamemaker",__games__:"folder-console",__gcp__:"folder-aws","__gemini-ai__":"folder-gemini-ai",__gemini__:"folder-gemini-ai",__geminiai__:"folder-gemini-ai",__gen__:"folder-generator",__generated__:"folder-generator",__generator__:"folder-generator",__generators__:"folder-generator",__gens__:"folder-generator",__git__:"folder-git",__gitea__:"folder-gitea",__githooks__:"folder-git","__github/issue_template__":"folder-template","__github/pull_request_template__":"folder-template","__github/workflows__":"folder-gh-workflows",__github__:"folder-github",__gitlab__:"folder-gitlab",__global__:"folder-global",__glsl__:"folder-shader",__go__:"folder-go","__godot-cpp__":"folder-godot",__godot__:"folder-godot",__golang__:"folder-go",__gql__:"folder-graphql",__gradle__:"folder-gradle",__graphql__:"folder-graphql",__guard__:"folder-guard",__guards__:"folder-guard",__gui__:"folder-ui","__gulp-tasks__":"folder-gulp",__gulp__:"folder-gulp","__gulpfile.babel.js__":"folder-gulp","__gulpfile.js__":"folder-gulp","__gulpfile.mjs__":"folder-gulp","__gulpfile.ts__":"folder-gulp",__gulpfiles__:"folder-gulp",__handler__:"folder-controller",__handlers__:"folder-controller",__helm__:"folder-helm",__helmchart__:"folder-helm",__helmcharts__:"folder-helm",__helper__:"folder-helper",__helpers__:"folder-helper",__hg__:"folder-mercurial",__hgext__:"folder-mercurial",__hghooks__:"folder-mercurial",__histories__:"folder-backup",__history__:"folder-backup",__hlsl__:"folder-shader",__home__:"folder-home",__hook__:"folder-hook",__hooks__:"folder-hook",__html__:"folder-views",__husky__:"folder-husky",__i18n__:"folder-i18n",__ico__:"folder-images",__icon__:"folder-images",__icons__:"folder-images",__icos__:"folder-images",__idea__:"folder-intellij",__image__:"folder-images",__images__:"folder-images",__img__:"folder-images",__imgs__:"folder-images",__import__:"folder-import",__imported__:"folder-import",__imports__:"folder-import",__in__:"folder-input",__inc64__:"folder-include",__inc__:"folder-include",__include__:"folder-include",__includes__:"folder-include",__infra__:"folder-server",__infrastructure__:"folder-server",__input__:"folder-input",__inputs__:"folder-input","__integration-test__":"folder-coverage","__integration-tests__":"folder-coverage",__integration__:"folder-connection",__integrations__:"folder-connection",__interceptor__:"folder-interceptor",__interceptors__:"folder-interceptor",__interface__:"folder-interface",__interfaces__:"folder-interface",__internationalization__:"folder-i18n",__inventories__:"folder-server",__inventory__:"folder-server",__io__:"folder-input",__ios__:"folder-ios",__ipad__:"folder-macos",__iphone__:"folder-macos",__ipod__:"folder-macos",__ipynb__:"folder-jupyter",__it__:"folder-coverage",__j2__:"folder-jinja",__java__:"folder-java",__javascript__:"folder-javascript",__javascripts__:"folder-javascript",__jinja2__:"folder-jinja",__jinja__:"folder-jinja",__job__:"folder-job",__jobs__:"folder-job",__js__:"folder-javascript",__json__:"folder-json",__jsonc__:"folder-json",__jsonl__:"folder-json",__jsons__:"folder-json",__jupyter__:"folder-jupyter",__jwt__:"folder-keys",__k8s__:"folder-kubernetes",__key__:"folder-keys",__keys__:"folder-keys",__kit__:"folder-tools",__kits__:"folder-tools",__knowledge__:"folder-docs",__kotlin__:"folder-kotlin",__kql__:"folder-kusto",__kubernetes__:"folder-kubernetes",__kusto__:"folder-kusto",__l10n__:"folder-i18n",__lambda__:"folder-functions",__lambdas__:"folder-functions",__landing__:"folder-home",__lang__:"folder-i18n",__langs__:"folder-i18n",__language__:"folder-i18n",__languages__:"folder-i18n",__layout__:"folder-layout",__layouts__:"folder-layout","__lefthook-local__":"folder-lefthook",__lefthook__:"folder-lefthook",__less__:"folder-less",__lib64__:"folder-lib",__lib__:"folder-lib",__libraries__:"folder-lib",__library__:"folder-lib",__libs__:"folder-lib",__license__:"folder-license",__licenses__:"folder-license",__link__:"folder-link",__links__:"folder-link",__linux__:"folder-linux",__linuxbsd__:"folder-linux",__liquibase__:"folder-liquibase",__locale__:"folder-i18n",__locales__:"folder-i18n",__localization__:"folder-i18n",__log__:"folder-log",__logging__:"folder-log",__logic__:"folder-functions",__logs__:"folder-log",__lottie__:"folder-lottie",__lottiefiles__:"folder-lottie",__lotties__:"folder-lottie",__lua__:"folder-lua",__luau__:"folder-luau",__mac__:"folder-macos","__macbook-air__":"folder-macos",__macbook__:"folder-macos",__macos__:"folder-macos",__macosx__:"folder-macos",__mail__:"folder-mail",__mailers__:"folder-mail",__mails__:"folder-mail",__main__:"folder-home",__manager__:"folder-admin",__managers__:"folder-admin",__mapping__:"folder-mappings",__mappings__:"folder-mappings",__markdown__:"folder-markdown",__math__:"folder-functions",__maths__:"folder-functions",__md__:"folder-markdown",__measure__:"folder-benchmark",__measurement__:"folder-benchmark",__measures__:"folder-benchmark",__media__:"folder-video",__messages__:"folder-messages",__messaging__:"folder-messages","__meta-inf__":"folder-config",__meta__:"folder-meta",__metadata__:"folder-meta",__metro__:"folder-metro",__middleware__:"folder-middleware",__middlewares__:"folder-middleware",__migration__:"folder-migrations",__migrations__:"folder-migrations",__mint__:"folder-linux",__misc__:"folder-other",__miscellaneous__:"folder-other",__mjml__:"folder-mjml",__mjs__:"folder-javascript",__mobile__:"folder-mobile",__mobiles__:"folder-mobile",__mock__:"folder-mock",__mocks__:"folder-mock",__mod__:"folder-plugin",__modding__:"folder-plugin",__model__:"folder-class",__models__:"folder-class",__moderator__:"folder-admin",__moderators__:"folder-admin",__mods__:"folder-plugin",__module__:"folder-plugin",__modules__:"folder-plugin",__mojo__:"folder-mojo",__molecule__:"folder-molecule",__molecules__:"folder-molecule",__moon__:"folder-moon",__motion__:"folder-animation",__motions__:"folder-animation",__movie__:"folder-video",__movies__:"folder-video",__mq__:"folder-queue",__mts__:"folder-typescript",__music__:"folder-audio",__navigation__:"folder-routes",__navigations__:"folder-routes",__netlify__:"folder-netlify",__news__:"folder-docs",__next__:"folder-next",__nginx__:"folder-nginx",__node__:"folder-node",__node_modules__:"folder-node",__nodejs__:"folder-node",__note__:"folder-docs",__notebook__:"folder-jupyter",__notebooks__:"folder-jupyter",__notes__:"folder-docs",__now__:"folder-vercel",__nuxt__:"folder-nuxt","__nyc-output__":"folder-coverage",__nyc_output__:"folder-coverage",__obsidian__:"folder-obsidian",__opencode__:"folder-opencode",__option__:"folder-config",__options__:"folder-config",__organism__:"folder-organism",__organisms__:"folder-organism",__osx__:"folder-macos",__other__:"folder-other",__others__:"folder-other",__out__:"folder-dist",__output__:"folder-dist",__outputs__:"folder-dist",__package__:"folder-packages",__packages__:"folder-packages",__pact__:"folder-contract",__pacts__:"folder-contract",__page__:"folder-views",__pages__:"folder-views",__palette__:"folder-theme",__palettes__:"folder-theme",__partial__:"folder-include",__partials__:"folder-include",__patches__:"folder-git",__pdf__:"folder-pdf",__pdfs__:"folder-pdf","__pdm-build__":"folder-pdm","__pdm-plugins__":"folder-pdm",__perf__:"folder-benchmark",__performance__:"folder-benchmark",__phone__:"folder-mobile",__phones__:"folder-mobile",__photo__:"folder-images",__photograph__:"folder-images",__photographs__:"folder-images",__photos__:"folder-images",__php__:"folder-php",__phpmailer__:"folder-phpmailer",__pic__:"folder-images",__pics__:"folder-images",__picture__:"folder-images",__pictures__:"folder-images",__pipe__:"folder-pipe",__pipeline__:"folder-pipe",__pipelines__:"folder-pipe",__pipes__:"folder-pipe",__pkg__:"folder-packages",__pkgs__:"folder-packages",__plastic__:"folder-plastic",__playground__:"folder-sandbox",__playgrounds__:"folder-sandbox",__playlist__:"folder-audio",__playlists__:"folder-audio",__plugin__:"folder-plugin",__plugins__:"folder-plugin",__policies__:"folder-policy",__policy__:"folder-policy",__popos__:"folder-linux",__portability__:"folder-mobile",__portable__:"folder-mobile",__post__:"folder-docs",__postman__:"folder-postman",__posts__:"folder-docs",__powershell__:"folder-powershell",__pref__:"folder-config",__preference__:"folder-config",__preferences__:"folder-config",__prefs__:"folder-config",__presentation__:"folder-ui",__preview__:"folder-review",__previews__:"folder-review","__prisma/schema__":"folder-prisma",__prisma__:"folder-prisma",__private__:"folder-private",__profiling__:"folder-benchmark",__proj__:"folder-project",__project__:"folder-project",__projects__:"folder-project",__projs__:"folder-project",__prompt__:"folder-prompts",__prompts__:"folder-prompts",__properties__:"folder-config",__props__:"folder-config",__protobuf__:"folder-proto",__protobufs__:"folder-proto",__protos__:"folder-proto",__provider__:"folder-controller",__providers__:"folder-controller",__proxy__:"folder-public",__ps1__:"folder-powershell",__ps4__:"folder-console",__ps5__:"folder-console",__ps__:"folder-powershell",__public__:"folder-public",__public_html__:"folder-views",__pwa__:"folder-client",__pycache__:"folder-python",__pytest_cache__:"folder-python",__python__:"folder-python",__pytorch__:"folder-pytorch",__quasar__:"folder-quasar",__queue__:"folder-queue",__queues__:"folder-queue",__r__:"folder-r",__recordings__:"folder-audio",__release__:"folder-dist",__remote__:"folder-connection",__remotes__:"folder-connection",__repo__:"folder-repository",__report__:"folder-resource",__reports__:"folder-resource",__repos__:"folder-repository",__repositories__:"folder-repository",__repository__:"folder-repository",__res__:"folder-resource",__resolver__:"folder-resolver",__resolvers__:"folder-resolver",__resource__:"folder-resource",__resources__:"folder-resource",__restapi__:"folder-api",__review__:"folder-review",__reviewed__:"folder-review",__reviews__:"folder-review",__revisal__:"folder-review",__revisals__:"folder-review",__robot__:"folder-robot",__robots__:"folder-robot",__router__:"folder-routes",__routers__:"folder-routes",__routes__:"folder-routes",__routing__:"folder-routes",__rule__:"folder-rules",__rules__:"folder-rules",__rust__:"folder-rust",__salt__:"folder-salt",__saltstack__:"folder-salt","__sample-data__":"folder-examples",__sample__:"folder-examples",__samples__:"folder-examples",__sandbox__:"folder-sandbox",__sandboxes__:"folder-sandbox",__sass__:"folder-sass",__scala__:"folder-scala",__schema__:"folder-class",__schemas__:"folder-class",__sconf_temp__:"folder-scons",__scons__:"folder-scons",__scons_cache__:"folder-scons",__screen__:"folder-views",__screengrab__:"folder-images",__screengrabs__:"folder-images",__screens__:"folder-views",__screenshot__:"folder-images",__screenshots__:"folder-images",__script__:"folder-scripts",__scripting__:"folder-scripts",__scripts__:"folder-scripts",__scss__:"folder-sass",__secret__:"folder-keys",__secrets__:"folder-keys",__secure__:"folder-secure",__security__:"folder-secure",__seed__:"folder-seeders",__seeders__:"folder-seeders",__seeding__:"folder-seeders",__seeds__:"folder-seeders",__server__:"folder-server",__serverless__:"folder-serverless",__serverpackages__:"folder-packages",__servers__:"folder-server",__service__:"folder-controller",__services__:"folder-controller",__setting__:"folder-config",__settings__:"folder-config",__shader__:"folder-shader",__shaders__:"folder-shader",__shared__:"folder-shared",__shop__:"folder-cart","__shopping-cart__":"folder-cart",__shopping__:"folder-cart",__sim__:"folder-simulations",__sims__:"folder-simulations",__simulation__:"folder-simulations",__simulations__:"folder-simulations",__site__:"folder-public",__sketch__:"folder-mock",__sketches__:"folder-mock",__skill__:"folder-skills",__skills__:"folder-skills",__smtp__:"folder-mail",__snap__:"folder-snapcraft",__snapcraft__:"folder-snapcraft",__snapshots__:"folder-test",__snippet__:"folder-snippet",__snippets__:"folder-snippet",__song__:"folder-audio",__songs__:"folder-audio",__sound__:"folder-audio",__sounds__:"folder-audio",__source__:"folder-src",__sources__:"folder-src",__spa__:"folder-client",__spec__:"folder-test",__specs__:"folder-test",__spellcheck__:"folder-syntax",__spellcheckers__:"folder-syntax",__sql__:"folder-database","__src-tauri__":"folder-src-tauri",__src__:"folder-src",__srcs__:"folder-src",__ssl__:"folder-secure",__stack__:"folder-stack",__stacks__:"folder-stack",__start__:"folder-home",__static__:"folder-resource",__stencil__:"folder-stencil",__store__:"folder-store",__stores__:"folder-store",__stories__:"folder-storybook",__storybook__:"folder-storybook",__style__:"folder-css",__styles__:"folder-css",__stylesheet__:"folder-css",__stylesheets__:"folder-css",__stylus__:"folder-stylus",__sublime__:"folder-sublime",__submodules__:"folder-git",__supabase__:"folder-supabase","__svelte-kit__":"folder-svelte",__svelte__:"folder-svelte",__svg__:"folder-svg",__svgs__:"folder-svg",__switch__:"folder-console",__syntax__:"folder-syntax",__syntaxes__:"folder-syntax","__table-of-contents__":"folder-toc",__target__:"folder-target",__taskfile__:"folder-taskfile",__taskfiles__:"folder-taskfile",__tasks__:"folder-tasks",__television__:"folder-television",__temp__:"folder-temp",__template__:"folder-template",__templates__:"folder-template",__terraform__:"folder-terraform",__test__:"folder-test",__testfiles__:"folder-test",__testing__:"folder-test",__tests__:"folder-test",__texture__:"folder-images",__textures__:"folder-images",__theme__:"folder-theme",__themes__:"folder-theme","__third-party__":"folder-lib",__thirdparty__:"folder-lib",__tickets__:"folder-tasks",__tls__:"folder-secure",__tmp__:"folder-temp",__toc__:"folder-toc",__token__:"folder-keys",__tokens__:"folder-keys",__toolbox__:"folder-tools",__toolboxes__:"folder-tools",__tooling__:"folder-tools",__toolkit__:"folder-tools",__toolkits__:"folder-tools",__tools__:"folder-tools",__torch__:"folder-pytorch",__transition__:"folder-animation",__transitions__:"folder-animation",__translate__:"folder-i18n",__translation__:"folder-i18n",__translations__:"folder-i18n",__trash__:"folder-trash",__trigger__:"folder-trigger",__triggers__:"folder-trigger",__ts__:"folder-typescript",__turbo__:"folder-turborepo",__tv__:"folder-television",__tx__:"folder-i18n",__typeface__:"folder-font",__typefaces__:"folder-font",__types__:"folder-typescript",__typescript__:"folder-typescript",__typings__:"folder-typescript",__ubuntu__:"folder-linux",__ui__:"folder-ui",__unity__:"folder-unity",__unix__:"folder-linux",__update__:"folder-update",__updates__:"folder-update",__upgrade__:"folder-update",__upgrades__:"folder-update",__upload__:"folder-upload",__uploads__:"folder-upload",__util__:"folder-utils",__utilities__:"folder-utils",__utility__:"folder-utils",__utils__:"folder-utils",__ux__:"folder-ui",__validation__:"folder-rules",__validations__:"folder-rules",__validator__:"folder-rules",__validators__:"folder-rules",__vector__:"folder-svg",__vectors__:"folder-svg",__vendor__:"folder-lib",__vendors__:"folder-lib",__venv__:"folder-environment",__vercel__:"folder-vercel",__verdaccio__:"folder-verdaccio",__vid__:"folder-video",__video__:"folder-video",__videos__:"folder-video",__vids__:"folder-video",__view__:"folder-views",__views__:"folder-views",__vm__:"folder-vm",__vms__:"folder-vm",__voice__:"folder-audio",__voices__:"folder-audio","__vscode-test__":"folder-vscode",__vscode__:"folder-vscode",__vue__:"folder-vue",__vuepress__:"folder-vuepress",__wakatime__:"folder-wakatime",__web__:"folder-public",__webpack__:"folder-webpack",__website__:"folder-public",__websites__:"folder-public",__widget__:"folder-components",__widgets__:"folder-components",__wiki__:"folder-docs",__win10__:"folder-windows",__win11__:"folder-windows",__win32__:"folder-windows",__win__:"folder-windows",__windows10__:"folder-windows",__windows11__:"folder-windows",__windows__:"folder-windows",__windowsnt__:"folder-windows",__windowsxp__:"folder-windows",__winnt__:"folder-windows",__winxp__:"folder-windows","__wordpress-org__":"folder-wordpress","__wp-content__":"folder-wordpress",__wsl__:"folder-linux",__www__:"folder-public",__wwwroot__:"folder-public",__xbox__:"folder-console",__xtask__:"folder-scripts",__yarn__:"folder-yarn",__zeabur__:"folder-zeabur",__zed__:"folder-zed",_addin:"folder-plugin",_addins:"folder-plugin",_addon:"folder-plugin",_addons:"folder-plugin",_admin:"folder-admin",_admins:"folder-admin",_agent:"folder-robot",_agents:"folder-robot",_android:"folder-android",_angular:"folder-angular",_anim:"folder-animation",_animated:"folder-animation",_animation:"folder-animation",_animations:"folder-animation",_anims:"folder-animation",_ansible:"folder-ansible",_api:"folder-api",_apis:"folder-api",_apollo:"folder-apollo","_apollo-cache":"folder-apollo","_apollo-client":"folder-apollo","_apollo-config":"folder-apollo",_app:"folder-app",_apple:"folder-macos",_application:"folder-app",_applications:"folder-app",_apps:"folder-app",_appwrite:"folder-appwrite",_arc:"folder-archive",_archival:"folder-archive",_archive:"folder-archive",_archives:"folder-archive",_arcs:"folder-archive",_article:"folder-docs",_articles:"folder-docs",_asm:"folder-assembly",_assembly:"folder-assembly",_asset:"folder-resource",_assets:"folder-resource",_astro:"folder-astro",_atom:"folder-atom",_atoms:"folder-atom",_attachment:"folder-attachment",_attachments:"folder-attachment",_aud:"folder-audio",_audio:"folder-audio",_audios:"folder-audio",_auds:"folder-audio",_aurelia_project:"folder-aurelia",_auth:"folder-secure",_authentication:"folder-secure",_auto:"folder-generator",_aws:"folder-aws",_azure:"folder-aws","_azure-pipelines":"folder-azure-pipelines","_azure-pipelines-ci":"folder-azure-pipelines","_back-up":"folder-backup","_back-ups":"folder-backup",_backend:"folder-server",_backends:"folder-server",_backup:"folder-backup",_backups:"folder-backup",_bak:"folder-backup",_baks:"folder-backup",_base:"folder-base",_bases:"folder-base",_batch:"folder-batch",_batches:"folder-batch",_batchs:"folder-batch",_bench:"folder-benchmark",_benches:"folder-benchmark",_benchmark:"folder-benchmark",_benchmarks:"folder-benchmark",_bibliographies:"folder-bibliography",_bibliography:"folder-bibliography",_bicep:"folder-bicep",_bin:"folder-dist",_bkp:"folder-backup",_bkps:"folder-backup",_blender:"folder-blender","_blender-assets":"folder-blender","_blender-files":"folder-blender","_blender-models":"folder-blender","_blender-project":"folder-blender",_bloc:"folder-bloc",_blocs:"folder-bloc",_blog:"folder-docs",_book:"folder-bibliography",_books:"folder-bibliography",_bot:"folder-robot",_bots:"folder-robot",_bower_components:"folder-bower",_browser:"folder-public",_browsers:"folder-public",_build:"folder-dist",_buildkite:"folder-buildkite",_builds:"folder-dist",_built:"folder-dist",_bull:"folder-queue",_cache:"folder-temp",_cached:"folder-temp",_calc:"folder-functions",_calcs:"folder-functions",_calculation:"folder-functions",_calculations:"folder-functions",_cargo:"folder-rust",_cart:"folder-cart",_centos:"folder-linux",_cert:"folder-secure",_certificate:"folder-secure",_certificates:"folder-secure",_certs:"folder-secure",_cfg:"folder-config",_cfgs:"folder-config","_cfn-gen":"folder-generator",_changes:"folder-delta",_changeset:"folder-changesets",_changesets:"folder-changesets",_chat:"folder-messages",_chats:"folder-messages",_ci:"folder-ci",_cipher:"folder-secure",_circleci:"folder-circleci",_cjs:"folder-javascript",_class:"folder-class",_classes:"folder-class",_claude:"folder-claude",_cli:"folder-command",_client:"folder-client",_clients:"folder-client",_cline_docs:"folder-cline",_clis:"folder-command","_cloud-firestore":"folder-firestore","_cloud-functions":"folder-cloud-functions",_cloudflare:"folder-cloudflare",_cloudfunctions:"folder-cloud-functions",_cluster:"folder-cluster",_clusters:"folder-cluster",_cmd:"folder-command",_cobol:"folder-cobol",_code:"folder-src",_color:"folder-theme",_colors:"folder-theme",_colour:"folder-theme",_colours:"folder-theme",_command:"folder-command",_commandline:"folder-command",_commands:"folder-command",_common:"folder-shared",_compiled:"folder-dist",_components:"folder-components",_composable:"folder-functions",_composables:"folder-functions",_concept:"folder-mock",_concepts:"folder-mock",_conf:"folder-config",_config:"folder-config",_configs:"folder-config",_configuration:"folder-config",_configurations:"folder-config",_confs:"folder-config",_connection:"folder-connection",_connections:"folder-connection",_console:"folder-console",_const:"folder-constant",_constant:"folder-constant",_constants:"folder-constant",_consts:"folder-constant",_container:"folder-container",_containers:"folder-container",_content:"folder-content",_contents:"folder-content",_context:"folder-context",_contexts:"folder-context",_contract:"folder-contract","_contract-test":"folder-contract","_contract-testing":"folder-contract","_contract-tests":"folder-contract",_contracts:"folder-contract",_controller:"folder-controller",_controllers:"folder-controller",_controls:"folder-controller",_conversation:"folder-messages",_conversations:"folder-messages",_core:"folder-core",_coverage:"folder-coverage",_crash:"folder-error",_crashes:"folder-error",_crates:"folder-lib",_css:"folder-css",_cts:"folder-typescript",_cubit:"folder-bloc",_cubits:"folder-bloc",_cue:"folder-cue",_cues:"folder-cue",_cursor:"folder-cursor",_custom:"folder-custom",_customs:"folder-custom",_cypher:"folder-secure",_cypress:"folder-cypress",_dal:"folder-dal",_dart:"folder-dart",_dart_tool:"folder-dart",_dart_tools:"folder-dart",_data:"folder-database","_data-access":"folder-dal","_data-access-layer":"folder-dal",_database:"folder-database",_databases:"folder-database",_db:"folder-database",_deb:"folder-linux",_debian:"folder-linux",_debug:"folder-debug",_debugger:"folder-debug",_debugging:"folder-debug",_decorator:"folder-decorators",_decorators:"folder-decorators",_deepin:"folder-linux",_delta:"folder-delta",_deltas:"folder-delta",_demo:"folder-examples",_demos:"folder-examples",_dependencies:"folder-packages",_design:"folder-theme",_designs:"folder-theme",_desktop:"folder-desktop",_devcontainer:"folder-container",_devpackages:"folder-packages",_devtools:"folder-tools",_dialog:"folder-messages",_dialogs:"folder-messages",_diary:"folder-docs",_directive:"folder-directive",_directives:"folder-directive",_display:"folder-desktop",_dist:"folder-dist",_distribution:"folder-dist",_doc:"folder-docs",_docker:"folder-docker",_dockerfiles:"folder-docker",_dockerhub:"folder-docker",_docs:"folder-docs",_document:"folder-docs",_documentation:"folder-docs",_documents:"folder-docs",_download:"folder-download",_downloader:"folder-download",_downloaders:"folder-download",_downloads:"folder-download",_draft:"folder-mock",_drafts:"folder-mock",_drizzle:"folder-drizzle",_ds_store:"folder-macos",_dump:"folder-dump",_dumps:"folder-dump",_e2e:"folder-coverage",_easing:"folder-animation",_easings:"folder-animation",_element:"folder-element",_elements:"folder-element",_email:"folder-mail",_emails:"folder-mail",_enum:"folder-enum",_enums:"folder-enum",_env:"folder-environment",_environment:"folder-environment",_environments:"folder-environment",_envs:"folder-environment",_err:"folder-error",_error:"folder-error",_errors:"folder-error",_errs:"folder-error",_eslint:"folder-eslint","_eslint-config":"folder-eslint","_eslint-configs":"folder-eslint","_eslint-plugin":"folder-eslint","_eslint-plugins":"folder-eslint",_etc:"folder-other",_event:"folder-event",_events:"folder-event",_example:"folder-examples",_examples:"folder-examples",_expo:"folder-expo","_expo-shared":"folder-expo",_export:"folder-export",_exported:"folder-export",_exports:"folder-export",_extension:"folder-plugin",_extensions:"folder-plugin",_external:"folder-lib",_externals:"folder-lib",_extra:"folder-other",_extras:"folder-other",_fastlane:"folder-fastlane",_favicon:"folder-favicon",_favicons:"folder-favicon",_feat:"folder-features",_feats:"folder-features",_feature:"folder-features",_features:"folder-features",_fig:"folder-images",_figs:"folder-images",_figure:"folder-images",_figures:"folder-images",_filter:"folder-filter",_filters:"folder-filter",_firebase:"folder-firebase","_firebase-cloud-functions":"folder-cloud-functions","_firebase-cloudfunctions":"folder-cloud-functions","_firebase-firestore":"folder-firestore",_firestore:"folder-firestore",_fixture:"folder-mock",_fixtures:"folder-mock","_flow-typed":"folder-flow",_flutter:"folder-flutter",_font:"folder-font",_fonts:"folder-font",_forgejo:"folder-forgejo",_form:"folder-form",_forms:"folder-form",_forum:"folder-messages",_fragments:"folder-components",_frontend:"folder-client",_frontends:"folder-client",_func:"folder-functions",_funcs:"folder-functions",_function:"folder-functions",_functions:"folder-functions",_game:"folder-console",_gamemaker:"folder-gamemaker",_gamemaker2:"folder-gamemaker",_games:"folder-console",_gcp:"folder-aws",_gemini:"folder-gemini-ai","_gemini-ai":"folder-gemini-ai",_geminiai:"folder-gemini-ai",_gen:"folder-generator",_generated:"folder-generator",_generator:"folder-generator",_generators:"folder-generator",_gens:"folder-generator",_git:"folder-git",_gitea:"folder-gitea",_githooks:"folder-git",_github:"folder-github","_github/issue_template":"folder-template","_github/pull_request_template":"folder-template","_github/workflows":"folder-gh-workflows",_gitlab:"folder-gitlab",_global:"folder-global",_glsl:"folder-shader",_go:"folder-go",_godot:"folder-godot","_godot-cpp":"folder-godot",_golang:"folder-go",_gql:"folder-graphql",_gradle:"folder-gradle",_graphql:"folder-graphql",_guard:"folder-guard",_guards:"folder-guard",_gui:"folder-ui",_gulp:"folder-gulp","_gulp-tasks":"folder-gulp","_gulpfile.babel.js":"folder-gulp","_gulpfile.js":"folder-gulp","_gulpfile.mjs":"folder-gulp","_gulpfile.ts":"folder-gulp",_gulpfiles:"folder-gulp",_handler:"folder-controller",_handlers:"folder-controller",_helm:"folder-helm",_helmchart:"folder-helm",_helmcharts:"folder-helm",_helper:"folder-helper",_helpers:"folder-helper",_hg:"folder-mercurial",_hgext:"folder-mercurial",_hghooks:"folder-mercurial",_histories:"folder-backup",_history:"folder-backup",_hlsl:"folder-shader",_home:"folder-home",_hook:"folder-hook",_hooks:"folder-hook",_html:"folder-views",_husky:"folder-husky",_i18n:"folder-i18n",_ico:"folder-images",_icon:"folder-images",_icons:"folder-images",_icos:"folder-images",_idea:"folder-intellij",_image:"folder-images",_images:"folder-images",_img:"folder-images",_imgs:"folder-images",_import:"folder-import",_imported:"folder-import",_imports:"folder-import",_in:"folder-input",_inc:"folder-include",_inc64:"folder-include",_include:"folder-include",_includes:"folder-include",_infra:"folder-server",_infrastructure:"folder-server",_input:"folder-input",_inputs:"folder-input",_integration:"folder-connection","_integration-test":"folder-coverage","_integration-tests":"folder-coverage",_integrations:"folder-connection",_interceptor:"folder-interceptor",_interceptors:"folder-interceptor",_interface:"folder-interface",_interfaces:"folder-interface",_internationalization:"folder-i18n",_inventories:"folder-server",_inventory:"folder-server",_io:"folder-input",_ios:"folder-ios",_ipad:"folder-macos",_iphone:"folder-macos",_ipod:"folder-macos",_ipynb:"folder-jupyter",_it:"folder-coverage",_j2:"folder-jinja",_java:"folder-java",_javascript:"folder-javascript",_javascripts:"folder-javascript",_jinja:"folder-jinja",_jinja2:"folder-jinja",_job:"folder-job",_jobs:"folder-job",_js:"folder-javascript",_json:"folder-json",_jsonc:"folder-json",_jsonl:"folder-json",_jsons:"folder-json",_jupyter:"folder-jupyter",_jwt:"folder-keys",_k8s:"folder-kubernetes",_key:"folder-keys",_keys:"folder-keys",_kit:"folder-tools",_kits:"folder-tools",_knowledge:"folder-docs",_kotlin:"folder-kotlin",_kql:"folder-kusto",_kubernetes:"folder-kubernetes",_kusto:"folder-kusto",_l10n:"folder-i18n",_lambda:"folder-functions",_lambdas:"folder-functions",_landing:"folder-home",_lang:"folder-i18n",_langs:"folder-i18n",_language:"folder-i18n",_languages:"folder-i18n",_layout:"folder-layout",_layouts:"folder-layout",_lefthook:"folder-lefthook","_lefthook-local":"folder-lefthook",_less:"folder-less",_lib:"folder-lib",_lib64:"folder-lib",_libraries:"folder-lib",_library:"folder-lib",_libs:"folder-lib",_license:"folder-license",_licenses:"folder-license",_link:"folder-link",_links:"folder-link",_linux:"folder-linux",_linuxbsd:"folder-linux",_liquibase:"folder-liquibase",_locale:"folder-i18n",_locales:"folder-i18n",_localization:"folder-i18n",_log:"folder-log",_logging:"folder-log",_logic:"folder-functions",_logs:"folder-log",_lottie:"folder-lottie",_lottiefiles:"folder-lottie",_lotties:"folder-lottie",_lua:"folder-lua",_luau:"folder-luau",_mac:"folder-macos",_macbook:"folder-macos","_macbook-air":"folder-macos",_macos:"folder-macos",_macosx:"folder-macos",_mail:"folder-mail",_mailers:"folder-mail",_mails:"folder-mail",_main:"folder-home",_manager:"folder-admin",_managers:"folder-admin",_mapping:"folder-mappings",_mappings:"folder-mappings",_markdown:"folder-markdown",_math:"folder-functions",_maths:"folder-functions",_md:"folder-markdown",_measure:"folder-benchmark",_measurement:"folder-benchmark",_measures:"folder-benchmark",_media:"folder-video",_messages:"folder-messages",_messaging:"folder-messages",_meta:"folder-meta","_meta-inf":"folder-config",_metadata:"folder-meta",_metro:"folder-metro",_middleware:"folder-middleware",_middlewares:"folder-middleware",_migration:"folder-migrations",_migrations:"folder-migrations",_mint:"folder-linux",_misc:"folder-other",_miscellaneous:"folder-other",_mjml:"folder-mjml",_mjs:"folder-javascript",_mobile:"folder-mobile",_mobiles:"folder-mobile",_mock:"folder-mock",_mocks:"folder-mock",_mod:"folder-plugin",_modding:"folder-plugin",_model:"folder-class",_models:"folder-class",_moderator:"folder-admin",_moderators:"folder-admin",_mods:"folder-plugin",_module:"folder-plugin",_modules:"folder-plugin",_mojo:"folder-mojo",_molecule:"folder-molecule",_molecules:"folder-molecule",_moon:"folder-moon",_motion:"folder-animation",_motions:"folder-animation",_movie:"folder-video",_movies:"folder-video",_mq:"folder-queue",_mts:"folder-typescript",_music:"folder-audio",_navigation:"folder-routes",_navigations:"folder-routes",_netlify:"folder-netlify",_news:"folder-docs",_next:"folder-next",_nginx:"folder-nginx",_node:"folder-node",_node_modules:"folder-node",_nodejs:"folder-node",_note:"folder-docs",_notebook:"folder-jupyter",_notebooks:"folder-jupyter",_notes:"folder-docs",_now:"folder-vercel",_nuxt:"folder-nuxt","_nyc-output":"folder-coverage",_nyc_output:"folder-coverage",_obsidian:"folder-obsidian",_opencode:"folder-opencode",_option:"folder-config",_options:"folder-config",_organism:"folder-organism",_organisms:"folder-organism",_osx:"folder-macos",_other:"folder-other",_others:"folder-other",_out:"folder-dist",_output:"folder-dist",_outputs:"folder-dist",_package:"folder-packages",_packages:"folder-packages",_pact:"folder-contract",_pacts:"folder-contract",_page:"folder-views",_pages:"folder-views",_palette:"folder-theme",_palettes:"folder-theme",_partial:"folder-include",_partials:"folder-include",_patches:"folder-git",_pdf:"folder-pdf",_pdfs:"folder-pdf","_pdm-build":"folder-pdm","_pdm-plugins":"folder-pdm",_perf:"folder-benchmark",_performance:"folder-benchmark",_phone:"folder-mobile",_phones:"folder-mobile",_photo:"folder-images",_photograph:"folder-images",_photographs:"folder-images",_photos:"folder-images",_php:"folder-php",_phpmailer:"folder-phpmailer",_pic:"folder-images",_pics:"folder-images",_picture:"folder-images",_pictures:"folder-images",_pipe:"folder-pipe",_pipeline:"folder-pipe",_pipelines:"folder-pipe",_pipes:"folder-pipe",_pkg:"folder-packages",_pkgs:"folder-packages",_plastic:"folder-plastic",_playground:"folder-sandbox",_playgrounds:"folder-sandbox",_playlist:"folder-audio",_playlists:"folder-audio",_plugin:"folder-plugin",_plugins:"folder-plugin",_policies:"folder-policy",_policy:"folder-policy",_popos:"folder-linux",_portability:"folder-mobile",_portable:"folder-mobile",_post:"folder-docs",_postman:"folder-postman",_posts:"folder-docs",_powershell:"folder-powershell",_pref:"folder-config",_preference:"folder-config",_preferences:"folder-config",_prefs:"folder-config",_presentation:"folder-ui",_preview:"folder-review",_previews:"folder-review",_prisma:"folder-prisma","_prisma/schema":"folder-prisma",_private:"folder-private",_profiling:"folder-benchmark",_proj:"folder-project",_project:"folder-project",_projects:"folder-project",_projs:"folder-project",_prompt:"folder-prompts",_prompts:"folder-prompts",_properties:"folder-config",_props:"folder-config",_proto:"folder-proto",_protobuf:"folder-proto",_protobufs:"folder-proto",_protos:"folder-proto",_provider:"folder-controller",_providers:"folder-controller",_proxy:"folder-public",_ps:"folder-powershell",_ps1:"folder-powershell",_ps4:"folder-console",_ps5:"folder-console",_public:"folder-public",_public_html:"folder-views",_pwa:"folder-client",_pycache:"folder-python",_pytest_cache:"folder-python",_python:"folder-python",_pytorch:"folder-pytorch",_quasar:"folder-quasar",_queue:"folder-queue",_queues:"folder-queue",_r:"folder-r",_recordings:"folder-audio",_release:"folder-dist",_remote:"folder-connection",_remotes:"folder-connection",_repo:"folder-repository",_report:"folder-resource",_reports:"folder-resource",_repos:"folder-repository",_repositories:"folder-repository",_repository:"folder-repository",_res:"folder-resource",_resolver:"folder-resolver",_resolvers:"folder-resolver",_resource:"folder-resource",_resources:"folder-resource",_restapi:"folder-api",_review:"folder-review",_reviewed:"folder-review",_reviews:"folder-review",_revisal:"folder-review",_revisals:"folder-review",_robot:"folder-robot",_robots:"folder-robot",_router:"folder-routes",_routers:"folder-routes",_routes:"folder-routes",_routing:"folder-routes",_rule:"folder-rules",_rules:"folder-rules",_rust:"folder-rust",_salt:"folder-salt",_saltstack:"folder-salt",_sample:"folder-examples","_sample-data":"folder-examples",_samples:"folder-examples",_sandbox:"folder-sandbox",_sandboxes:"folder-sandbox",_sass:"folder-sass",_scala:"folder-scala",_schema:"folder-class",_schemas:"folder-class",_sconf_temp:"folder-scons",_scons:"folder-scons",_scons_cache:"folder-scons",_screen:"folder-views",_screengrab:"folder-images",_screengrabs:"folder-images",_screens:"folder-views",_screenshot:"folder-images",_screenshots:"folder-images",_script:"folder-scripts",_scripting:"folder-scripts",_scripts:"folder-scripts",_scss:"folder-sass",_secret:"folder-keys",_secrets:"folder-keys",_secure:"folder-secure",_security:"folder-secure",_seed:"folder-seeders",_seeders:"folder-seeders",_seeding:"folder-seeders",_seeds:"folder-seeders",_server:"folder-server",_serverless:"folder-serverless",_serverpackages:"folder-packages",_servers:"folder-server",_service:"folder-controller",_services:"folder-controller",_setting:"folder-config",_settings:"folder-config",_shader:"folder-shader",_shaders:"folder-shader",_shared:"folder-shared",_shop:"folder-cart",_shopping:"folder-cart","_shopping-cart":"folder-cart",_sim:"folder-simulations",_sims:"folder-simulations",_simulation:"folder-simulations",_simulations:"folder-simulations",_site:"folder-public",_sketch:"folder-mock",_sketches:"folder-mock",_skill:"folder-skills",_skills:"folder-skills",_smtp:"folder-mail",_snap:"folder-snapcraft",_snapcraft:"folder-snapcraft",_snapshots:"folder-test",_snippet:"folder-snippet",_snippets:"folder-snippet",_song:"folder-audio",_songs:"folder-audio",_sound:"folder-audio",_sounds:"folder-audio",_source:"folder-src",_sources:"folder-src",_spa:"folder-client",_spec:"folder-test",_specs:"folder-test",_spellcheck:"folder-syntax",_spellcheckers:"folder-syntax",_sql:"folder-database",_src:"folder-src","_src-tauri":"folder-src-tauri",_srcs:"folder-src",_ssl:"folder-secure",_stack:"folder-stack",_stacks:"folder-stack",_start:"folder-home",_static:"folder-resource",_stencil:"folder-stencil",_store:"folder-store",_stores:"folder-store",_stories:"folder-storybook",_storybook:"folder-storybook",_style:"folder-css",_styles:"folder-css",_stylesheet:"folder-css",_stylesheets:"folder-css",_stylus:"folder-stylus",_sublime:"folder-sublime",_submodules:"folder-git",_supabase:"folder-supabase",_svelte:"folder-svelte","_svelte-kit":"folder-svelte",_svg:"folder-svg",_svgs:"folder-svg",_switch:"folder-console",_syntax:"folder-syntax",_syntaxes:"folder-syntax","_table-of-contents":"folder-toc",_target:"folder-target",_taskfile:"folder-taskfile",_taskfiles:"folder-taskfile",_tasks:"folder-tasks",_television:"folder-television",_temp:"folder-temp",_template:"folder-template",_templates:"folder-template",_terraform:"folder-terraform",_test:"folder-test",_testfiles:"folder-test",_testing:"folder-test",_tests:"folder-test",_texture:"folder-images",_textures:"folder-images",_theme:"folder-theme",_themes:"folder-theme","_third-party":"folder-lib",_thirdparty:"folder-lib",_tickets:"folder-tasks",_tls:"folder-secure",_tmp:"folder-temp",_toc:"folder-toc",_token:"folder-keys",_tokens:"folder-keys",_toolbox:"folder-tools",_toolboxes:"folder-tools",_tooling:"folder-tools",_toolkit:"folder-tools",_toolkits:"folder-tools",_tools:"folder-tools",_torch:"folder-pytorch",_transition:"folder-animation",_transitions:"folder-animation",_translate:"folder-i18n",_translation:"folder-i18n",_translations:"folder-i18n",_trash:"folder-trash",_trigger:"folder-trigger",_triggers:"folder-trigger",_ts:"folder-typescript",_turbo:"folder-turborepo",_tv:"folder-television",_tx:"folder-i18n",_typeface:"folder-font",_typefaces:"folder-font",_types:"folder-typescript",_typescript:"folder-typescript",_typings:"folder-typescript",_ubuntu:"folder-linux",_ui:"folder-ui",_unity:"folder-unity",_unix:"folder-linux",_update:"folder-update",_updates:"folder-update",_upgrade:"folder-update",_upgrades:"folder-update",_upload:"folder-upload",_uploads:"folder-upload",_util:"folder-utils",_utilities:"folder-utils",_utility:"folder-utils",_utils:"folder-utils",_ux:"folder-ui",_validation:"folder-rules",_validations:"folder-rules",_validator:"folder-rules",_validators:"folder-rules",_vector:"folder-svg",_vectors:"folder-svg",_vendor:"folder-lib",_vendors:"folder-lib",_venv:"folder-environment",_vercel:"folder-vercel",_verdaccio:"folder-verdaccio",_vid:"folder-video",_video:"folder-video",_videos:"folder-video",_vids:"folder-video",_view:"folder-views",_views:"folder-views",_vm:"folder-vm",_vms:"folder-vm",_voice:"folder-audio",_voices:"folder-audio",_vscode:"folder-vscode","_vscode-test":"folder-vscode",_vue:"folder-vue",_vuepress:"folder-vuepress",_wakatime:"folder-wakatime",_web:"folder-public",_webpack:"folder-webpack",_website:"folder-public",_websites:"folder-public",_widget:"folder-components",_widgets:"folder-components",_wiki:"folder-docs",_win:"folder-windows",_win10:"folder-windows",_win11:"folder-windows",_win32:"folder-windows",_windows:"folder-windows",_windows10:"folder-windows",_windows11:"folder-windows",_windowsnt:"folder-windows",_windowsxp:"folder-windows",_winnt:"folder-windows",_winxp:"folder-windows","_wordpress-org":"folder-wordpress","_wp-content":"folder-wordpress",_wsl:"folder-linux",_www:"folder-public",_wwwroot:"folder-public",_xbox:"folder-console",_xtask:"folder-scripts",_yarn:"folder-yarn",_zeabur:"folder-zeabur",_zed:"folder-zed",addin:"folder-plugin",addins:"folder-plugin",addon:"folder-plugin",addons:"folder-plugin",admin:"folder-admin",admins:"folder-admin",agent:"folder-robot",agents:"folder-robot",android:"folder-android",angular:"folder-angular",anim:"folder-animation",animated:"folder-animation",animation:"folder-animation",animations:"folder-animation",anims:"folder-animation",ansible:"folder-ansible",api:"folder-api",apis:"folder-api",apollo:"folder-apollo","apollo-cache":"folder-apollo","apollo-client":"folder-apollo","apollo-config":"folder-apollo",app:"folder-app",apple:"folder-macos",application:"folder-app",applications:"folder-app",apps:"folder-app",appwrite:"folder-appwrite",arc:"folder-archive",archival:"folder-archive",archive:"folder-archive",archives:"folder-archive",arcs:"folder-archive",article:"folder-docs",articles:"folder-docs",asm:"folder-assembly",assembly:"folder-assembly",asset:"folder-resource",assets:"folder-resource",astro:"folder-astro",atom:"folder-atom",atoms:"folder-atom",attachment:"folder-attachment",attachments:"folder-attachment",aud:"folder-audio",audio:"folder-audio",audios:"folder-audio",auds:"folder-audio",aurelia_project:"folder-aurelia",auth:"folder-secure",authentication:"folder-secure",auto:"folder-generator",aws:"folder-aws",azure:"folder-aws","azure-pipelines":"folder-azure-pipelines","azure-pipelines-ci":"folder-azure-pipelines","back-up":"folder-backup","back-ups":"folder-backup",backend:"folder-server",backends:"folder-server",backup:"folder-backup",backups:"folder-backup",bak:"folder-backup",baks:"folder-backup",base:"folder-base",bases:"folder-base",batch:"folder-batch",batches:"folder-batch",batchs:"folder-batch",bench:"folder-benchmark",benches:"folder-benchmark",benchmark:"folder-benchmark",benchmarks:"folder-benchmark",bibliographies:"folder-bibliography",bibliography:"folder-bibliography",bicep:"folder-bicep",bin:"folder-dist",bkp:"folder-backup",bkps:"folder-backup",blender:"folder-blender","blender-assets":"folder-blender","blender-files":"folder-blender","blender-models":"folder-blender","blender-project":"folder-blender",bloc:"folder-bloc",blocs:"folder-bloc",blog:"folder-docs",book:"folder-bibliography",books:"folder-bibliography",bot:"folder-robot",bots:"folder-robot",bower_components:"folder-bower",browser:"folder-public",browsers:"folder-public",build:"folder-dist",buildkite:"folder-buildkite",builds:"folder-dist",built:"folder-dist",bull:"folder-queue",cache:"folder-temp",cached:"folder-temp",calc:"folder-functions",calcs:"folder-functions",calculation:"folder-functions",calculations:"folder-functions",cargo:"folder-rust",cart:"folder-cart",centos:"folder-linux",cert:"folder-secure",certificate:"folder-secure",certificates:"folder-secure",certs:"folder-secure",cfg:"folder-config",cfgs:"folder-config","cfn-gen":"folder-generator",changes:"folder-delta",changeset:"folder-changesets",changesets:"folder-changesets",chat:"folder-messages",chats:"folder-messages",ci:"folder-ci",cipher:"folder-secure",circleci:"folder-circleci",cjs:"folder-javascript",class:"folder-class",classes:"folder-class",claude:"folder-claude",cli:"folder-command",client:"folder-client",clients:"folder-client",cline_docs:"folder-cline",clis:"folder-command","cloud-firestore":"folder-firestore","cloud-functions":"folder-cloud-functions",cloudflare:"folder-cloudflare",cloudfunctions:"folder-cloud-functions",cluster:"folder-cluster",clusters:"folder-cluster",cmd:"folder-command",cobol:"folder-cobol",code:"folder-src",color:"folder-theme",colors:"folder-theme",colour:"folder-theme",colours:"folder-theme",command:"folder-command",commandline:"folder-command",commands:"folder-command",common:"folder-shared",compiled:"folder-dist",components:"folder-components",composable:"folder-functions",composables:"folder-functions",concept:"folder-mock",concepts:"folder-mock",conf:"folder-config",config:"folder-config",configs:"folder-config",configuration:"folder-config",configurations:"folder-config",confs:"folder-config",connection:"folder-connection",connections:"folder-connection",console:"folder-console",const:"folder-constant",constant:"folder-constant",constants:"folder-constant",consts:"folder-constant",container:"folder-container",containers:"folder-container",content:"folder-content",contents:"folder-content",context:"folder-context",contexts:"folder-context",contract:"folder-contract","contract-test":"folder-contract","contract-testing":"folder-contract","contract-tests":"folder-contract",contracts:"folder-contract",controller:"folder-controller",controllers:"folder-controller",controls:"folder-controller",conversation:"folder-messages",conversations:"folder-messages",core:"folder-core",coverage:"folder-coverage",crash:"folder-error",crashes:"folder-error",crates:"folder-lib",css:"folder-css",cts:"folder-typescript",cubit:"folder-bloc",cubits:"folder-bloc",cue:"folder-cue",cues:"folder-cue",cursor:"folder-cursor",custom:"folder-custom",customs:"folder-custom",cypher:"folder-secure",cypress:"folder-cypress",dal:"folder-dal",dart:"folder-dart",dart_tool:"folder-dart",dart_tools:"folder-dart",data:"folder-database","data-access":"folder-dal","data-access-layer":"folder-dal",database:"folder-database",databases:"folder-database",db:"folder-database",deb:"folder-linux",debian:"folder-linux",debug:"folder-debug",debugger:"folder-debug",debugging:"folder-debug",decorator:"folder-decorators",decorators:"folder-decorators",deepin:"folder-linux",delta:"folder-delta",deltas:"folder-delta",demo:"folder-examples",demos:"folder-examples",dependencies:"folder-packages",design:"folder-theme",designs:"folder-theme",desktop:"folder-desktop",devcontainer:"folder-container",devpackages:"folder-packages",devtools:"folder-tools",dialog:"folder-messages",dialogs:"folder-messages",diary:"folder-docs",directive:"folder-directive",directives:"folder-directive",display:"folder-desktop",dist:"folder-dist",distribution:"folder-dist",doc:"folder-docs",docker:"folder-docker",dockerfiles:"folder-docker",dockerhub:"folder-docker",docs:"folder-docs",document:"folder-docs",documentation:"folder-docs",documents:"folder-docs",download:"folder-download",downloader:"folder-download",downloaders:"folder-download",downloads:"folder-download",draft:"folder-mock",drafts:"folder-mock",drizzle:"folder-drizzle",ds_store:"folder-macos",dump:"folder-dump",dumps:"folder-dump",e2e:"folder-coverage",easing:"folder-animation",easings:"folder-animation",element:"folder-element",elements:"folder-element",email:"folder-mail",emails:"folder-mail",enum:"folder-enum",enums:"folder-enum",env:"folder-environment",environment:"folder-environment",environments:"folder-environment",envs:"folder-environment",err:"folder-error",error:"folder-error",errors:"folder-error",errs:"folder-error",eslint:"folder-eslint","eslint-config":"folder-eslint","eslint-configs":"folder-eslint","eslint-plugin":"folder-eslint","eslint-plugins":"folder-eslint",etc:"folder-other",event:"folder-event",events:"folder-event",example:"folder-examples",examples:"folder-examples",expo:"folder-expo","expo-shared":"folder-expo",export:"folder-export",exported:"folder-export",exports:"folder-export",extension:"folder-plugin",extensions:"folder-plugin",external:"folder-lib",externals:"folder-lib",extra:"folder-other",extras:"folder-other",fastlane:"folder-fastlane",favicon:"folder-favicon",favicons:"folder-favicon",feat:"folder-features",feats:"folder-features",feature:"folder-features",features:"folder-features",fig:"folder-images",figs:"folder-images",figure:"folder-images",figures:"folder-images",filter:"folder-filter",filters:"folder-filter",firebase:"folder-firebase","firebase-cloud-functions":"folder-cloud-functions","firebase-cloudfunctions":"folder-cloud-functions","firebase-firestore":"folder-firestore",firestore:"folder-firestore",fixture:"folder-mock",fixtures:"folder-mock","flow-typed":"folder-flow",flutter:"folder-flutter",font:"folder-font",fonts:"folder-font",forgejo:"folder-forgejo",form:"folder-form",forms:"folder-form",forum:"folder-messages",fragments:"folder-components",frontend:"folder-client",frontends:"folder-client",func:"folder-functions",funcs:"folder-functions",function:"folder-functions",functions:"folder-functions",game:"folder-console",gamemaker:"folder-gamemaker",gamemaker2:"folder-gamemaker",games:"folder-console",gcp:"folder-aws",gemini:"folder-gemini-ai","gemini-ai":"folder-gemini-ai",geminiai:"folder-gemini-ai",gen:"folder-generator",generated:"folder-generator",generator:"folder-generator",generators:"folder-generator",gens:"folder-generator",git:"folder-git",gitea:"folder-gitea",githooks:"folder-git",github:"folder-github","github/issue_template":"folder-template","github/pull_request_template":"folder-template","github/workflows":"folder-gh-workflows",gitlab:"folder-gitlab",global:"folder-global",glsl:"folder-shader",go:"folder-go",godot:"folder-godot","godot-cpp":"folder-godot",golang:"folder-go",gql:"folder-graphql",gradle:"folder-gradle",graphql:"folder-graphql",guard:"folder-guard",guards:"folder-guard",gui:"folder-ui",gulp:"folder-gulp","gulp-tasks":"folder-gulp","gulpfile.babel.js":"folder-gulp","gulpfile.js":"folder-gulp","gulpfile.mjs":"folder-gulp","gulpfile.ts":"folder-gulp",gulpfiles:"folder-gulp",handler:"folder-controller",handlers:"folder-controller",helm:"folder-helm",helmchart:"folder-helm",helmcharts:"folder-helm",helper:"folder-helper",helpers:"folder-helper",hg:"folder-mercurial",hgext:"folder-mercurial",hghooks:"folder-mercurial",histories:"folder-backup",history:"folder-backup",hlsl:"folder-shader",home:"folder-home",hook:"folder-hook",hooks:"folder-hook",html:"folder-views",husky:"folder-husky",i18n:"folder-i18n",ico:"folder-images",icon:"folder-images",icons:"folder-images",icos:"folder-images",idea:"folder-intellij",image:"folder-images",images:"folder-images",img:"folder-images",imgs:"folder-images",import:"folder-import",imported:"folder-import",imports:"folder-import",in:"folder-input",inc:"folder-include",inc64:"folder-include",include:"folder-include",includes:"folder-include",infra:"folder-server",infrastructure:"folder-server",input:"folder-input",inputs:"folder-input",integration:"folder-connection","integration-test":"folder-coverage","integration-tests":"folder-coverage",integrations:"folder-connection",interceptor:"folder-interceptor",interceptors:"folder-interceptor",interface:"folder-interface",interfaces:"folder-interface",internationalization:"folder-i18n",inventories:"folder-server",inventory:"folder-server",io:"folder-input",ios:"folder-ios",ipad:"folder-macos",iphone:"folder-macos",ipod:"folder-macos",ipynb:"folder-jupyter",it:"folder-coverage",j2:"folder-jinja",java:"folder-java",javascript:"folder-javascript",javascripts:"folder-javascript",jinja:"folder-jinja",jinja2:"folder-jinja",job:"folder-job",jobs:"folder-job",js:"folder-javascript",json:"folder-json",jsonc:"folder-json",jsonl:"folder-json",jsons:"folder-json",jupyter:"folder-jupyter",jwt:"folder-keys",k8s:"folder-kubernetes",key:"folder-keys",keys:"folder-keys",kit:"folder-tools",kits:"folder-tools",knowledge:"folder-docs",kotlin:"folder-kotlin",kql:"folder-kusto",kubernetes:"folder-kubernetes",kusto:"folder-kusto",l10n:"folder-i18n",lambda:"folder-functions",lambdas:"folder-functions",landing:"folder-home",lang:"folder-i18n",langs:"folder-i18n",language:"folder-i18n",languages:"folder-i18n",layout:"folder-layout",layouts:"folder-layout",lefthook:"folder-lefthook","lefthook-local":"folder-lefthook",less:"folder-less",lib:"folder-lib",lib64:"folder-lib",libraries:"folder-lib",library:"folder-lib",libs:"folder-lib",license:"folder-license",licenses:"folder-license",link:"folder-link",links:"folder-link",linux:"folder-linux",linuxbsd:"folder-linux",liquibase:"folder-liquibase",locale:"folder-i18n",locales:"folder-i18n",localization:"folder-i18n",log:"folder-log",logging:"folder-log",logic:"folder-functions",logs:"folder-log",lottie:"folder-lottie",lottiefiles:"folder-lottie",lotties:"folder-lottie",lua:"folder-lua",luau:"folder-luau",mac:"folder-macos",macbook:"folder-macos","macbook-air":"folder-macos",macos:"folder-macos",macosx:"folder-macos",mail:"folder-mail",mailers:"folder-mail",mails:"folder-mail",main:"folder-home",manager:"folder-admin",managers:"folder-admin",mapping:"folder-mappings",mappings:"folder-mappings",markdown:"folder-markdown",math:"folder-functions",maths:"folder-functions",md:"folder-markdown",measure:"folder-benchmark",measurement:"folder-benchmark",measures:"folder-benchmark",media:"folder-video",messages:"folder-messages",messaging:"folder-messages",meta:"folder-meta","meta-inf":"folder-config",metadata:"folder-meta",metro:"folder-metro",middleware:"folder-middleware",middlewares:"folder-middleware",migration:"folder-migrations",migrations:"folder-migrations",mint:"folder-linux",misc:"folder-other",miscellaneous:"folder-other",mjml:"folder-mjml",mjs:"folder-javascript",mobile:"folder-mobile",mobiles:"folder-mobile",mock:"folder-mock",mocks:"folder-mock",mod:"folder-plugin",modding:"folder-plugin",model:"folder-class",models:"folder-class",moderator:"folder-admin",moderators:"folder-admin",mods:"folder-plugin",module:"folder-plugin",modules:"folder-plugin",mojo:"folder-mojo",molecule:"folder-molecule",molecules:"folder-molecule",moon:"folder-moon",motion:"folder-animation",motions:"folder-animation",movie:"folder-video",movies:"folder-video",mq:"folder-queue",mts:"folder-typescript",music:"folder-audio",navigation:"folder-routes",navigations:"folder-routes",netlify:"folder-netlify",news:"folder-docs",next:"folder-next",nginx:"folder-nginx",node:"folder-node",node_modules:"folder-node",nodejs:"folder-node",note:"folder-docs",notebook:"folder-jupyter",notebooks:"folder-jupyter",notes:"folder-docs",now:"folder-vercel",nuxt:"folder-nuxt","nyc-output":"folder-coverage",nyc_output:"folder-coverage",obsidian:"folder-obsidian",opencode:"folder-opencode",option:"folder-config",options:"folder-config",organism:"folder-organism",organisms:"folder-organism",osx:"folder-macos",other:"folder-other",others:"folder-other",out:"folder-dist",output:"folder-dist",outputs:"folder-dist",package:"folder-packages",packages:"folder-packages",pact:"folder-contract",pacts:"folder-contract",page:"folder-views",pages:"folder-views",palette:"folder-theme",palettes:"folder-theme",partial:"folder-include",partials:"folder-include",patches:"folder-git",pdf:"folder-pdf",pdfs:"folder-pdf","pdm-build":"folder-pdm","pdm-plugins":"folder-pdm",perf:"folder-benchmark",performance:"folder-benchmark",phone:"folder-mobile",phones:"folder-mobile",photo:"folder-images",photograph:"folder-images",photographs:"folder-images",photos:"folder-images",php:"folder-php",phpmailer:"folder-phpmailer",pic:"folder-images",pics:"folder-images",picture:"folder-images",pictures:"folder-images",pipe:"folder-pipe",pipeline:"folder-pipe",pipelines:"folder-pipe",pipes:"folder-pipe",pkg:"folder-packages",pkgs:"folder-packages",plastic:"folder-plastic",playground:"folder-sandbox",playgrounds:"folder-sandbox",playlist:"folder-audio",playlists:"folder-audio",plugin:"folder-plugin",plugins:"folder-plugin",policies:"folder-policy",policy:"folder-policy",popos:"folder-linux",portability:"folder-mobile",portable:"folder-mobile",post:"folder-docs",postman:"folder-postman",posts:"folder-docs",powershell:"folder-powershell",pref:"folder-config",preference:"folder-config",preferences:"folder-config",prefs:"folder-config",presentation:"folder-ui",preview:"folder-review",previews:"folder-review",prisma:"folder-prisma","prisma/schema":"folder-prisma",private:"folder-private",profiling:"folder-benchmark",proj:"folder-project",project:"folder-project",projects:"folder-project",projs:"folder-project",prompt:"folder-prompts",prompts:"folder-prompts",properties:"folder-config",props:"folder-config",proto:"folder-proto",protobuf:"folder-proto",protobufs:"folder-proto",protos:"folder-proto",provider:"folder-controller",providers:"folder-controller",proxy:"folder-public",ps:"folder-powershell",ps1:"folder-powershell",ps4:"folder-console",ps5:"folder-console",public:"folder-public",public_html:"folder-views",pwa:"folder-client",pycache:"folder-python",pytest_cache:"folder-python",python:"folder-python",pytorch:"folder-pytorch",quasar:"folder-quasar",queue:"folder-queue",queues:"folder-queue",r:"folder-r",recordings:"folder-audio",release:"folder-dist",remote:"folder-connection",remotes:"folder-connection",repo:"folder-repository",report:"folder-resource",reports:"folder-resource",repos:"folder-repository",repositories:"folder-repository",repository:"folder-repository",res:"folder-resource",resolver:"folder-resolver",resolvers:"folder-resolver",resource:"folder-resource",resources:"folder-resource",restapi:"folder-api",review:"folder-review",reviewed:"folder-review",reviews:"folder-review",revisal:"folder-review",revisals:"folder-review",robot:"folder-robot",robots:"folder-robot",router:"folder-routes",routers:"folder-routes",routes:"folder-routes",routing:"folder-routes",rule:"folder-rules",rules:"folder-rules",rust:"folder-rust",salt:"folder-salt",saltstack:"folder-salt",sample:"folder-examples","sample-data":"folder-examples",samples:"folder-examples",sandbox:"folder-sandbox",sandboxes:"folder-sandbox",sass:"folder-sass",scala:"folder-scala",schema:"folder-class",schemas:"folder-class",sconf_temp:"folder-scons",scons:"folder-scons",scons_cache:"folder-scons",screen:"folder-views",screengrab:"folder-images",screengrabs:"folder-images",screens:"folder-views",screenshot:"folder-images",screenshots:"folder-images",script:"folder-scripts",scripting:"folder-scripts",scripts:"folder-scripts",scss:"folder-sass",secret:"folder-keys",secrets:"folder-keys",secure:"folder-secure",security:"folder-secure",seed:"folder-seeders",seeders:"folder-seeders",seeding:"folder-seeders",seeds:"folder-seeders",server:"folder-server",serverless:"folder-serverless",serverpackages:"folder-packages",servers:"folder-server",service:"folder-controller",services:"folder-controller",setting:"folder-config",settings:"folder-config",shader:"folder-shader",shaders:"folder-shader",shared:"folder-shared",shop:"folder-cart",shopping:"folder-cart","shopping-cart":"folder-cart",sim:"folder-simulations",sims:"folder-simulations",simulation:"folder-simulations",simulations:"folder-simulations",site:"folder-public",sketch:"folder-mock",sketches:"folder-mock",skill:"folder-skills",skills:"folder-skills",smtp:"folder-mail",snap:"folder-snapcraft",snapcraft:"folder-snapcraft",snapshots:"folder-test",snippet:"folder-snippet",snippets:"folder-snippet",song:"folder-audio",songs:"folder-audio",sound:"folder-audio",sounds:"folder-audio",source:"folder-src",sources:"folder-src",spa:"folder-client",spec:"folder-test",specs:"folder-test",spellcheck:"folder-syntax",spellcheckers:"folder-syntax",sql:"folder-database",src:"folder-src","src-tauri":"folder-src-tauri",srcs:"folder-src",ssl:"folder-secure",stack:"folder-stack",stacks:"folder-stack",start:"folder-home",static:"folder-resource",stencil:"folder-stencil",store:"folder-store",stores:"folder-store",stories:"folder-storybook",storybook:"folder-storybook",style:"folder-css",styles:"folder-css",stylesheet:"folder-css",stylesheets:"folder-css",stylus:"folder-stylus",sublime:"folder-sublime",submodules:"folder-git",supabase:"folder-supabase",svelte:"folder-svelte","svelte-kit":"folder-svelte",svg:"folder-svg",svgs:"folder-svg",switch:"folder-console",syntax:"folder-syntax",syntaxes:"folder-syntax","table-of-contents":"folder-toc",target:"folder-target",taskfile:"folder-taskfile",taskfiles:"folder-taskfile",tasks:"folder-tasks",television:"folder-television",temp:"folder-temp",template:"folder-template",templates:"folder-template",terraform:"folder-terraform",test:"folder-test",testfiles:"folder-test",testing:"folder-test",tests:"folder-test",texture:"folder-images",textures:"folder-images",theme:"folder-theme",themes:"folder-theme","third-party":"folder-lib",thirdparty:"folder-lib",tickets:"folder-tasks",tls:"folder-secure",tmp:"folder-temp",toc:"folder-toc",token:"folder-keys",tokens:"folder-keys",toolbox:"folder-tools",toolboxes:"folder-tools",tooling:"folder-tools",toolkit:"folder-tools",toolkits:"folder-tools",tools:"folder-tools",torch:"folder-pytorch",transition:"folder-animation",transitions:"folder-animation",translate:"folder-i18n",translation:"folder-i18n",translations:"folder-i18n",trash:"folder-trash",trigger:"folder-trigger",triggers:"folder-trigger",ts:"folder-typescript",turbo:"folder-turborepo",tv:"folder-television",tx:"folder-i18n",typeface:"folder-font",typefaces:"folder-font",types:"folder-typescript",typescript:"folder-typescript",typings:"folder-typescript",ubuntu:"folder-linux",ui:"folder-ui",unity:"folder-unity",unix:"folder-linux",update:"folder-update",updates:"folder-update",upgrade:"folder-update",upgrades:"folder-update",upload:"folder-upload",uploads:"folder-upload",util:"folder-utils",utilities:"folder-utils",utility:"folder-utils",utils:"folder-utils",ux:"folder-ui",validation:"folder-rules",validations:"folder-rules",validator:"folder-rules",validators:"folder-rules",vector:"folder-svg",vectors:"folder-svg",vendor:"folder-lib",vendors:"folder-lib",venv:"folder-environment",vercel:"folder-vercel",verdaccio:"folder-verdaccio",vid:"folder-video",video:"folder-video",videos:"folder-video",vids:"folder-video",view:"folder-views",views:"folder-views",vm:"folder-vm",vms:"folder-vm",voice:"folder-audio",voices:"folder-audio",vscode:"folder-vscode","vscode-test":"folder-vscode",vue:"folder-vue",vuepress:"folder-vuepress",wakatime:"folder-wakatime",web:"folder-public",webpack:"folder-webpack",website:"folder-public",websites:"folder-public",widget:"folder-components",widgets:"folder-components",wiki:"folder-docs",win:"folder-windows",win10:"folder-windows",win11:"folder-windows",win32:"folder-windows",windows:"folder-windows",windows10:"folder-windows",windows11:"folder-windows",windowsnt:"folder-windows",windowsxp:"folder-windows",winnt:"folder-windows",winxp:"folder-windows","wordpress-org":"folder-wordpress","wp-content":"folder-wordpress",wsl:"folder-linux",www:"folder-public",wwwroot:"folder-public",xbox:"folder-console",xtask:"folder-scripts",yarn:"folder-yarn",zeabur:"folder-zeabur",zed:"folder-zed"},wk={".autorc":"auto_light",".browserslistrc":"browserlist_light",".bun-version":"bun_light",".codeclimate.yml":"code-climate_light",".config/releaserc":"semantic-release_light",".config/releaserc.cjs":"semantic-release_light",".config/releaserc.cts":"semantic-release_light",".config/releaserc.js":"semantic-release_light",".config/releaserc.json":"semantic-release_light",".config/releaserc.json5":"semantic-release_light",".config/releaserc.jsonc":"semantic-release_light",".config/releaserc.mjs":"semantic-release_light",".config/releaserc.mts":"semantic-release_light",".config/releaserc.toml":"semantic-release_light",".config/releaserc.ts":"semantic-release_light",".config/releaserc.yaml":"semantic-release_light",".config/releaserc.yml":"semantic-release_light",".config/stylelintrc":"stylelint_light",".config/stylelintrc.cjs":"stylelint_light",".config/stylelintrc.cts":"stylelint_light",".config/stylelintrc.js":"stylelint_light",".config/stylelintrc.json":"stylelint_light",".config/stylelintrc.json5":"stylelint_light",".config/stylelintrc.jsonc":"stylelint_light",".config/stylelintrc.mjs":"stylelint_light",".config/stylelintrc.mts":"stylelint_light",".config/stylelintrc.toml":"stylelint_light",".config/stylelintrc.ts":"stylelint_light",".config/stylelintrc.yaml":"stylelint_light",".config/stylelintrc.yml":"stylelint_light",".copilotignore":"copilot_light",".cursor":"cursor_light",".cursor.json":"cursor_light",".cursorignore":"cursor_light",".cursorindexingignore":"cursor_light",".cursorrc":"cursor_light",".cursorrules":"cursor_light",".drone.yml":"drone_light",".easignore":"expo_light",".nano-staged.cjs":"nano-staged_light",".nano-staged.js":"nano-staged_light",".nano-staged.json":"nano-staged_light",".nano-staged.mjs":"nano-staged_light",".nanostagedrc":"nano-staged_light",".nowignore":"vercel_light",".pnpmfile.cjs":"pnpm_light",".releaserc":"semantic-release_light",".releaserc.cjs":"semantic-release_light",".releaserc.cts":"semantic-release_light",".releaserc.js":"semantic-release_light",".releaserc.json":"semantic-release_light",".releaserc.json5":"semantic-release_light",".releaserc.jsonc":"semantic-release_light",".releaserc.mjs":"semantic-release_light",".releaserc.mts":"semantic-release_light",".releaserc.toml":"semantic-release_light",".releaserc.ts":"semantic-release_light",".releaserc.yaml":"semantic-release_light",".releaserc.yml":"semantic-release_light",".rubocop-todo.yml":"rubocop_light",".rubocop.yml":"rubocop_light",".rubocop_todo.yml":"rubocop_light",".shellcheckrc":"shellcheck_light",".stylelintcache":"stylelint_light",".stylelintignore":"stylelint_light",".stylelintrc":"stylelint_light",".stylelintrc.cjs":"stylelint_light",".stylelintrc.cts":"stylelint_light",".stylelintrc.js":"stylelint_light",".stylelintrc.json":"stylelint_light",".stylelintrc.json5":"stylelint_light",".stylelintrc.jsonc":"stylelint_light",".stylelintrc.mjs":"stylelint_light",".stylelintrc.mts":"stylelint_light",".stylelintrc.toml":"stylelint_light",".stylelintrc.ts":"stylelint_light",".stylelintrc.yaml":"stylelint_light",".stylelintrc.yml":"stylelint_light",".vercelignore":"vercel_light",".wakatime-project":"wakatime_light","auto-config.js":"auto_light","auto-config.json":"auto_light","auto-config.ts":"auto_light","auto-config.yaml":"auto_light","auto-config.yml":"auto_light","auto.config.js":"auto_light","auto.config.ts":"auto_light",browserslist:"browserlist_light","bun.lock":"bun_light","bun.lockb":"bun_light","bunfig.toml":"bun_light","circle.yml":"circleci_light","copilot-instructions.md":"copilot_light","deno.json":"deno_light","deno.jsonc":"deno_light","deno.lock":"deno_light","eas.json":"expo_light",hosts:"hosts_light","jsr.json":"jsr_light","jsr.jsonc":"jsr_light","nano-staged.cjs":"nano-staged_light","nano-staged.js":"nano-staged_light","nano-staged.json":"nano-staged_light","nano-staged.mjs":"nano-staged_light","netlify.json":"netlify_light","netlify.toml":"netlify_light","netlify.yaml":"netlify_light","netlify.yml":"netlify_light","next.config.js":"next_light","next.config.mjs":"next_light","next.config.mts":"next_light","next.config.ts":"next_light","now.json":"vercel_light","openapi.json":"openapi_light","openapi.yaml":"openapi_light","openapi.yml":"openapi_light","opencode.json":"opencode_light","opencode.jsonc":"opencode_light","payload.config.js":"payload_light","payload.config.mjs":"payload_light","payload.config.mts":"payload_light","payload.config.ts":"payload_light","pnpm-lock.yaml":"pnpm_light","pnpm-workspace.yaml":"pnpm_light","release.config.cjs":"semantic-release_light","release.config.cts":"semantic-release_light","release.config.js":"semantic-release_light","release.config.json":"semantic-release_light","release.config.json5":"semantic-release_light","release.config.jsonc":"semantic-release_light","release.config.mjs":"semantic-release_light","release.config.mts":"semantic-release_light","release.config.toml":"semantic-release_light","release.config.ts":"semantic-release_light","release.config.yaml":"semantic-release_light","release.config.yml":"semantic-release_light","remix.config.js":"remix_light","remix.config.ts":"remix_light",sconscript:"scons_light",sconstruct:"scons_light",scsub:"scons_light",shellcheckrc:"shellcheck_light","snowpack.config.cjs":"snowpack_light","snowpack.config.cts":"snowpack_light","snowpack.config.js":"snowpack_light","snowpack.config.json":"snowpack_light","snowpack.config.mjs":"snowpack_light","snowpack.config.mts":"snowpack_light","snowpack.config.ts":"snowpack_light","snowpack.deps.json":"snowpack_light","stitches.config.js":"stitches_light","stitches.config.ts":"stitches_light","stylelint.config.cjs":"stylelint_light","stylelint.config.cts":"stylelint_light","stylelint.config.js":"stylelint_light","stylelint.config.json":"stylelint_light","stylelint.config.json5":"stylelint_light","stylelint.config.jsonc":"stylelint_light","stylelint.config.mjs":"stylelint_light","stylelint.config.mts":"stylelint_light","stylelint.config.toml":"stylelint_light","stylelint.config.ts":"stylelint_light","stylelint.config.yaml":"stylelint_light","stylelint.config.yml":"stylelint_light","turbo.json":"turborepo_light","turbo.jsonc":"turborepo_light","vercel.json":"vercel_light","vercel.ts":"vercel_light","warp.md":"warp_light","zeabur.json":"zeabur_light","zeabur.json5":"zeabur_light","zeabur.jsonc":"zeabur_light","zeabur.toml":"zeabur_light","zeabur.yaml":"zeabur_light","zeabur.yml":"zeabur_light"},QP={".wakatime-project":"wakatime_light",ai:"adobe-illustrator_light",ait:"adobe-illustrator_light",blink:"blink_light",cr:"crystal_light","drone.yml":"drone_light",ecr:"crystal_light",fen:"chess_light",hcl:"hcl_light",huff:"huff_light",iuml:"uml_light",j2:"jinja_light",jinja:"jinja_light","jinja-html":"jinja_light",jinja2:"jinja_light","openapi.json":"openapi_light","openapi.yaml":"openapi_light","openapi.yml":"openapi_light",pgn:"chess_light",plantuml:"uml_light",psb:"adobe-photoshop_light",psd:"adobe-photoshop_light",psdt:"adobe-photoshop_light",pu:"uml_light",puml:"uml_light",tldr:"tldraw_light",tofu:"opentofu_light",toml:"toml_light",verse:"verse_light",wsd:"uml_light",zeabur:"zeabur_light"},yk={"-cursor":"folder-cursor_light","-idea":"folder-intellij_light","-j2":"folder-jinja_light","-jinja":"folder-jinja_light","-jinja2":"folder-jinja_light",".cursor":"folder-cursor_light",".idea":"folder-intellij_light",".j2":"folder-jinja_light",".jinja":"folder-jinja_light",".jinja2":"folder-jinja_light",__cursor__:"folder-cursor_light",__idea__:"folder-intellij_light",__j2__:"folder-jinja_light",__jinja2__:"folder-jinja_light",__jinja__:"folder-jinja_light",_cursor:"folder-cursor_light",_idea:"folder-intellij_light",_j2:"folder-jinja_light",_jinja:"folder-jinja_light",_jinja2:"folder-jinja_light",cursor:"folder-cursor_light",idea:"folder-intellij_light",j2:"folder-jinja_light",jinja:"folder-jinja_light",jinja2:"folder-jinja_light"},kk={pug:'',just:'',json:'',playwright:'',xml:'',javascript:'',rocket:'',routing:'',settings:'',typedoc:'',"markdoc-config":'',"astro-config":'',visualstudio:'',"go-mod":'',"python-misc":'',ruff:'',uv:'',scons:'',console:'',excalidraw:'',gradle:'',license:'',unlicense:'',key:'',keystatic:'',ruby:'',gemfile:'',rubocop:'',rspec:'',swift:'',docker:'',latexmk:'',email:'',graphql:'',xaml:'',happo:'',chromatic:'',git:'',lua:'',r:'',dart:'',cmake:'',semgrep:'',"vue-config":'',nuxt:'',harmonix:'',lock:'',angular:'',mjml:'',vercel:'',liara:'',verdaccio:'',payload:'',next:'',remark:'',remix:'',laravel:'',vfl:'',kl:'',postcss:'',posthtml:'',todo:'',cabal:'',http:'',graphcool:'',webpack:'',rstack:'',lynx:'',ionic:'',gulp:'',nodejs:'',npm:'',yarn:'',android:'',tune:'',turborepo:'',babel:'',blitz:'',contributing:'',readme:'',changelog:'',architecture:'',credits:'',authors:'',flow:'',favicon:'',karma:'',bithound:'',svgo:'',appveyor:'',travis:'',codecov:'',sonarcloud:'',protractor:'',fusebox:'',heroku:'',editorconfig:'',bower:'',eslint:'',conduct:'',watchman:'',aurelia:'',auto:'',mocha:'',jenkins:'',firebase:'',rollup:'',hack:'',hardhat:'',stylelint:'',"code-climate":'',prettier:'',renovate:'',apollo:'',nodemon:'',webhint:'',browserlist:'',snyk:'',drone:'',opencode:'',sequelize:'',gatsby:'',wakatime:'',circleci:'',cloudfoundry:'',grunt:'',jest:'',fastlane:'',helm:'',wallaby:'',stencil:'',makefile:'',"semantic-release":'',bitbucket:'',bazel:'',"godot-assets":'',"azure-pipelines":'',vagrant:'',prisma:'',istanbul:'',tailwindcss:'',buildkite:'',netlify:'',svelte:'',nest:'',moon:'',percy:'',gitpod:'',stackblitz:'',codeowners:'',gcp:'',amplify:'',husky:'',tilt:'',capacitor:'',adonis:'',meson:'',commitizen:'',commitlint:'',buck:'',nx:'',dune:'',roadmap:'',nuget:'',stryker:'',modernizr:'',slug:'',stitches:'',nginx:'',minecraft:'',replit:'',duc:'',snowpack:'',quasar:'',dependabot:'',vite:'',vitest:'',velite:'',rolldown:'',lerna:'',windicss:'',textlint:'',vlang:'',sentry:'',contentlayer:'',phpunit:'',"php-cs-fixer":'',robots:'',tsconfig:'',tauri:'',jsconfig:'',maven:'',serverless:'',supabase:'',ember:'',horusec:'',poetry:'',pdm:'',parcel:'',astyle:'',lighthouse:'',svgr:'',rome:'',cypress:'',plop:'',tobimake:'',gleam:'',pnpm:'',gridsome:'',steadybit:'',caddy:'',openapi:'',swagger:'',bun:'',"nano-staged":'',knip:'',taskfile:'',craco:'',mercurial:'',deno:'',plastic:'',typst:'',unocss:'',"ifanr-cloud":'',concourse:'',syncpack:'',werf:'',luau:'',wally:'',panda:'',biome:'',esbuild:'',drizzle:'',puppeteer:'',garden:'',pkl:'',kubernetes:'',phpstan:'',screwdriver:'',snapcraft:'',kcl:'',clangd:'',markdownlint:'',trigger:'',deepsource:'',jsr:'',"coderabbit-ai":'',"gemini-ai":'',taze:'',wxt:'',lefthook:'',label:'',zeabur:'',copilot:'',"pre-commit":'',lintstaged:'',histoire:'',installation:'',"github-sponsors":'',"minecraft-fabric":'',umi:'',"pm2-ecosystem":'',hosts:'',citation:'',xmake:'',wrangler:'',cline:'',packship:'',snakemake:'',hadolint:'',tsdoc:'',oxc:'',claude:'',cursor:'',metro:'',bashly:'',google:'',shellcheck:'',warp:'',skill:'',tsdown:'',appwrite:'',expo:'',slint:'',html:'',markdown:'',blink:'',css:'',sass:'',less:'',json_schema:'',hjson:'',jinja:'',proto:'',prompt:'',sublime:'',simulink:'',quarto:'',twine:'',yaml:'',toml:'',toon:'',image:'',palette:'',react:'',react_ts:'',typescript:'',"typescript-def":'',markdoc:'',markojs:'',astro:'',pdf:'',table:'',vscode:'',varnish:'',database:'',kusto:'',csharp:'',qsharp:'',zip:'',vala:'',zig:'',exe:'',hex:'',java:'',jar:'',javaclass:'',c3:'',c:'',h:'',hip:'',cpp:'',hpp:'',"objective-c":'',"objective-cpp":'',rc:'',go:'',python:'',url:'',powershell:'',word:'',certificate:'',font:'',lib:'',bibliography:'',"bibtex-style":'',dll:'',fsharp:'',arduino:'',tex:'',context:'',"doctex-installer":'',bbx:'',cbx:'',lbx:'',powerpoint:'',video:'',virtual:'',vedic:'',audio:'',coffee:'',document:'',lyric:'',rust:'',raml:'',haskell:'',kotlin:'',otne:'',diff:'',clojure:'',groovy:'',dart_generated:'',actionscript:'',mxml:'',autohotkey:'',flash:'',"adobe-swc":'',swc:'',assembly:'',vue:'',ocaml:'',odin:'',onnx:'',"javascript-map":'',"css-map":'',handlebars:'',perl:'',haxe:'',"test-ts":'',"test-jsx":'',"test-js":'',puppet:'',elixir:'',livescript:'',erlang:'',twig:'',julia:'',elm:'',purescript:'',smarty:'',stylus:'',reason:'',bucklescript:'',merlin:'',verilog:'',mathematica:'',wolframlanguage:'',nunjucks:'',robot:'',solidity:'',autoit:'',haml:'',yang:'',terraform:'',opentofu:'',applescript:'',cake:'',cucumber:'',nim:'',apiblueprint:'',riot:'',coldfusion:'',nix:'',slim:'',restql:'',kivy:'',sbt:'',gitlab:'',figma:'',huff:'',crystal:'',cuda:'',log:'',dotjs:'',ejs:'',processing:'',storybook:'',wepy:'',hcl:'',san:'',quokka:'',django:'',red:'',foxpro:'',i18n:'',webassembly:'',jupyter:'',d:'',mdx:'',mdsvex:'',ballerina:'',racket:'',mint:'',velocity:'',godot:'',azure:'',razor:'',abc:'',asciidoc:'',edge:'',scheme:'',lisp:'',"3d":'',svg:'',"adobe-illustrator":'',"adobe-photoshop":'',vim:'',moonscript:'',advpl:'',disc:'',fortran:'',tcl:'',liquid:'',prolog:'',coconut:'',sketch:'',pawn:'',forth:'',uml:'',dhall:'',sml:'',opam:'',imba:'',drawio:'',pascal:'',unity:'',sas:'',command:'',denizenscript:'',search:'',rescript:'',"rescript-interface":'',brainfuck:'',bicep:'',cobol:'',grain:'',lolcode:'',idris:'',pipeline:'',opa:'',scala:'',lilypond:'',chess:'',gemini:'',php:'',ada:'',coala:'',dinophp:'',teal:'',template:'',shader:'',siyuan:'',ndst:'',tobi:'',capnp:'',tree:'',cadence:'',antlr:'',stylable:'',pinejs:'',gamemaker:'',tldraw:'',mermaid:'',mojo:'',roblox:'',rbxmk:'',spwn:'',templ:'',chrome:'',stan:'',abap:'',lottie:'',"apps-script":'',verified:'',bruno:'',cairo:'',"grafana-alloy":'',freemarker:'',tsil:'',hurl:'',cds:'',verse:'',sway:'',"bench-ts":'',"bench-jsx":'',"bench-js":'',controller:'',"dependencies-update":'',subtitles:'',beancount:'',epub:'',regedit:'',gnuplot:'',coloredpetrinets:'',pytorch:'',blender:'',"vanilla-extract":'',toc:'',cue:'',lean:'',salt:'',macaulay2:'',uiua:'',mrpack:'',"folder-rust":'',"folder-robot":'',"folder-src":'',"folder-dist":'',"folder-css":'',"folder-sass":'',"folder-television":'',"folder-desktop":'',"folder-console":'',"folder-images":'',"folder-scripts":'',"folder-node":'',"folder-javascript":'',"folder-json":'',"folder-font":'',"folder-bower":'',"folder-test":'',"folder-directive":'',"folder-jinja":'',"folder-markdown":'',"folder-pdm":'',"folder-php":'',"folder-phpmailer":'',"folder-sublime":'',"folder-docs":'',"folder-gh-workflows":'',"folder-git":'',"folder-github":'',"folder-gitea":'',"folder-gitlab":'',"folder-forgejo":'',"folder-vscode":'',"folder-views":'',"folder-vue":'',"folder-vuepress":'',"folder-expo":'',"folder-config":'',"folder-i18n":'',"folder-components":'',"folder-verdaccio":'',"folder-aurelia":'',"folder-resource":'',"folder-lib":'',"folder-theme":'',"folder-webpack":'',"folder-global":'',"folder-public":'',"folder-include":'',"folder-docker":'',"folder-nginx":'',"folder-astro":'',"folder-database":'',"folder-migrations":'',"folder-log":'',"folder-target":'',"folder-temp":'',"folder-aws":'',"folder-audio":'',"folder-video":'',"folder-kubernetes":'',"folder-import":'',"folder-export":'',"folder-wakatime":'',"folder-circleci":'',"folder-wordpress":'',"folder-gradle":'',"folder-coverage":'',"folder-class":'',"folder-other":'',"folder-lua":'',"folder-turborepo":'',"folder-typescript":'',"folder-graphql":'',"folder-routes":'',"folder-ci":'',"folder-eslint":'',"folder-benchmark":'',"folder-messages":'',"folder-less":'',"folder-gulp":'',"folder-python":'',"folder-r":'',"folder-sandbox":'',"folder-scons":'',"folder-mojo":'',"folder-moon":'',"folder-debug":'',"folder-fastlane":'',"folder-plugin":'',"folder-middleware":'',"folder-controller":'',"folder-ansible":'',"folder-server":'',"folder-client":'',"folder-tasks":'',"folder-android":'',"folder-ios":'',"folder-ui":'',"folder-upload":'',"folder-download":'',"folder-tools":'',"folder-helper":'',"folder-serverless":'',"folder-api":'',"folder-app":'',"folder-apollo":'',"folder-archive":'',"folder-backup":'',"folder-batch":'',"folder-buildkite":'',"folder-cluster":'',"folder-command":'',"folder-constant":'',"folder-container":'',"folder-content":'',"folder-context":'',"folder-core":'',"folder-delta":'',"folder-dump":'',"folder-examples":'',"folder-environment":'',"folder-functions":'',"folder-generator":'',"folder-hook":'',"folder-trigger":'',"folder-job":'',"folder-keys":'',"folder-layout":'',"folder-mail":'',"folder-mappings":'',"folder-meta":'',"folder-changesets":'',"folder-packages":'',"folder-shared":'',"folder-shader":'',"folder-stack":'',"folder-template":'',"folder-utils":'',"folder-supabase":'',"folder-private":'',"folder-linux":'',"folder-windows":'',"folder-macos":'',"folder-error":'',"folder-event":'',"folder-secure":'',"folder-custom":'',"folder-mock":'',"folder-syntax":'',"folder-vm":'',"folder-stylus":'',"folder-flow":'',"folder-rules":'',"folder-review":'',"folder-animation":'',"folder-guard":'',"folder-prisma":'',"folder-pipe":'',"folder-interceptor":'',"folder-svg":'',"folder-nuxt":'',"folder-terraform":'',"folder-mobile":'',"folder-stencil":'',"folder-firebase":'',"folder-firestore":'',"folder-cloud-functions":'',"folder-svelte":'',"folder-update":'',"folder-intellij":'',"folder-azure-pipelines":'',"folder-mjml":'',"folder-admin":'',"folder-jupyter":'',"folder-scala":'',"folder-connection":'',"folder-quasar":'',"folder-next":'',"folder-dal":'',"folder-cobol":'',"folder-yarn":'',"folder-husky":'',"folder-storybook":'',"folder-base":'',"folder-cart":'',"folder-home":'',"folder-project":'',"folder-prompts":'',"folder-interface":'',"folder-netlify":'',"folder-enum":'',"folder-contract":'',"folder-helm":'',"folder-queue":'',"folder-vercel":'',"folder-cypress":'',"folder-decorators":'',"folder-java":'',"folder-resolver":'',"folder-angular":'',"folder-unity":'',"folder-pdf":'',"folder-proto":'',"folder-plastic":'',"folder-gamemaker":'',"folder-mercurial":'',"folder-godot":'',"folder-lottie":'',"folder-taskfile":'',"folder-drizzle":'',"folder-cloudflare":'',"folder-seeders":'',"folder-store":'',"folder-bicep":'',"folder-snapcraft":'',"folder-flutter":'',"folder-snippet":'',"folder-element":'',"folder-src-tauri":'',"folder-favicon":'',"folder-features":'',"folder-lefthook":'',"folder-bloc":'',"folder-powershell":'',"folder-repository":'',"folder-luau":'',"folder-obsidian":'',"folder-trash":'',"folder-cline":'',"folder-liquibase":'',"folder-dart":'',"folder-zeabur":'',"folder-kusto":'',"folder-policy":'',"folder-attachment":'',"folder-bibliography":'',"folder-link":'',"folder-pytorch":'',"folder-blender":'',"folder-atom":'',"folder-molecule":'',"folder-organism":'',"folder-claude":'',"folder-cursor":'',"folder-gemini-ai":'',"folder-opencode":'',"folder-input":'',"folder-salt":'',"folder-simulations":'',"folder-metro":'',"folder-filter":'',"folder-toc":'',"folder-cue":'',"folder-license":'',"folder-form":'',"folder-postman":'',"folder-skills":'',"folder-zed":'',"folder-appwrite":'',"folder-assembly":'',"folder-go":'',"folder-kotlin":'',file:'',folder:'',scons_light:'',rubocop_light:'',vercel_light:'',payload_light:'',next_light:'',remix_light:'',turborepo_light:'',auto_light:'',stylelint_light:'',"code-climate_light":'',browserlist_light:'',drone_light:'',opencode_light:'',wakatime_light:'',circleci_light:'',"semantic-release_light":'',netlify_light:'',stitches_light:'',snowpack_light:'',pnpm_light:'',openapi_light:'',bun_light:'',"nano-staged_light":'',deno_light:'',jsr_light:'',zeabur_light:'',copilot_light:'',hosts_light:'',cursor_light:'',shellcheck_light:'',warp_light:'',expo_light:'',blink_light:'',jinja_light:'',toml_light:'',opentofu_light:'',huff_light:'',crystal_light:'',hcl_light:'',"adobe-illustrator_light":'',"adobe-photoshop_light":'',uml_light:'',chess_light:'',tldraw_light:'',verse_light:'',"folder-jinja_light":'',"folder-intellij_light":'',"folder-cursor_light":''};function eu(e,t){return Object.hasOwn(e,t)}function kd(e,t,n,o){const s=e[n];return!o||!eu(t,n)?s:t[n]}function eH(){return typeof window<"u"&&typeof window.matchMedia!="function"?!1:!vp().value}function tH(e,t){const n=e.toLowerCase();if(eu(r3,e))return kd(r3,wk,e,t);if(eu(r3,n))return kd(r3,wk,n,t)}function nH(e,t){const o=e.toLowerCase().split(".");for(let s=1;sn.length>0).at(-1)??e}function sH(e){return e.replaceAll(/\s(?:width|height)="[^"]*"/g,"").replace(/^
-`;const r=e.attrIndex("class"),i=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return r<0?i.push(["class",l]):(i[r]=i[r].slice(),i[r][1]+=` ${l}`),`
${t}
+`;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`
${t}
`}return`
${t}
-`}function Ad(e){return!e.attrs||e.attrs.length===0?`${po(e.content)}`:`${po(e.content)}`}function R8(e){const t=po(e.content);return e.attrs?`${t}
+`}function Ed(e){return!e.attrs||e.attrs.length===0?`${po(e.content)}`:`${po(e.content)}`}function F8(e){const t=po(e.content);return e.attrs?`${t} `:`
${t}
-`}function Fre(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function $b(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function jre(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function Nb(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function a5(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?``:`<${s}>`;let r=(o===-1?"`}const Ore={langPrefix:"language-",xhtmlOut:!1,breaks:!1},g3=Object.prototype.hasOwnProperty,Hn={code_inline(e,t){return Ad(e[t])},code_block(e,t){return R8(e[t])},fence(e,t,n,o,s){const r=e[t],i=r.info?UE(r.info).trim():"",{langName:l,langAttrs:a}=tI(i),c=n.highlight,u=po(r.content);if(!c)return q2(r,u,i,l,n);const d=c(r.content,l,a);return Sp(d)?d.then(f=>q2(r,f||u,i,l,n)):q2(r,d||u,i,l,n)},image(e,t,n,o,s){const r=e[t],i=s.renderInlineAsText(r.children||[],n,o),l=r.attrIndex("alt");return l>=0&&r.attrs?r.attrs[l][1]=i:r.attrs?r.attrs.push(["alt",i]):r.attrs=[["alt",i]],a5(r,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
+`}function Die(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function Nb(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Vie(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function zb(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function c5(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?``:`<${s}>`;let i=(o===-1?"`}const Wie={langPrefix:"language-",xhtmlOut:!1,breaks:!1},v3=Object.prototype.hasOwnProperty,Hn={code_inline(e,t){return Ed(e[t])},code_block(e,t){return F8(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?GT(i.info).trim():"",{langName:l,langAttrs:a}=sI(r),c=n.highlight,u=po(i.content);if(!c)return U2(i,u,r,l,n);const d=c(i.content,l,a);return Cp(d)?d.then(f=>U2(i,f||u,r,l,n)):U2(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],c5(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
`:`
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
`:`
`:` -`},text(e,t){return po(e[t].content)},text_special(e,t){return po(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function zb(e,t,n){const o=e.info?UE(e.info).trim():"",{langName:s,langAttrs:r}=tI(o),i=t.highlight,l=po(e.content);if(!i)return q2(e,l,o,s,t);const a=i(e.content,s,r);if(Sp(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return q2(e,a||l,o,s,t)}function Th(e,t,n,o){switch(e.type){case"text":return t.text===Hn.text?e.content.length===0?"":po(e.content):null;case"text_special":return t.text_special===Hn.text_special?e.content.length===0?"":po(e.content):null;case"softbreak":return t.softbreak===Hn.softbreak?o:null;case"hardbreak":return t.hardbreak===Hn.hardbreak?n:null;case"html_inline":return t.html_inline===Hn.html_inline?e.content:null;case"code_inline":return t.code_inline===Hn.code_inline?Ad(e):null;default:return null}}function Pre(e,t,n,o,s){const r=e[0];switch(r.type){case"text":if(s.text===Hn.text)return r.content.length===0?"":po(r.content);break;case"text_special":if(s.text_special===Hn.text_special)return r.content.length===0?"":po(r.content);break;case"softbreak":if(s.softbreak===Hn.softbreak)return t.breaks?t.xhtmlOut?`
+`},text(e,t){return po(e[t].content)},text_special(e,t){return po(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Bb(e,t,n){const o=e.info?GT(e.info).trim():"",{langName:s,langAttrs:i}=sI(o),r=t.highlight,l=po(e.content);if(!r)return U2(e,l,o,s,t);const a=r(e.content,s,i);if(Cp(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return U2(e,a||l,o,s,t)}function Th(e,t,n,o){switch(e.type){case"text":return t.text===Hn.text?e.content.length===0?"":po(e.content):null;case"text_special":return t.text_special===Hn.text_special?e.content.length===0?"":po(e.content):null;case"softbreak":return t.softbreak===Hn.softbreak?o:null;case"hardbreak":return t.hardbreak===Hn.hardbreak?n:null;case"html_inline":return t.html_inline===Hn.html_inline?e.content:null;case"code_inline":return t.code_inline===Hn.code_inline?Ed(e):null;default:return null}}function qie(e,t,n,o,s){const i=e[0];switch(i.type){case"text":if(s.text===Hn.text)return i.content.length===0?"":po(i.content);break;case"text_special":if(s.text_special===Hn.text_special)return i.content.length===0?"":po(i.content);break;case"softbreak":if(s.softbreak===Hn.softbreak)return t.breaks?t.xhtmlOut?`
`:`
`:` `;break;case"hardbreak":if(s.hardbreak===Hn.hardbreak)return t.xhtmlOut?`
`:`
-`;break;case"html_inline":if(s.html_inline===Hn.html_inline)return r.content;break;case"code_inline":if(s.code_inline===Hn.code_inline)return Ad(r);break}const i=s[r.type];if(!i)return a5(r,t.xhtmlOut===!0);const l=i(e,0,t,n,o);return typeof l=="string"?l:o4(l,r.type)}var Hre=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Hn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},r=this.rules,i=o.xhtmlOut===!0;let l,a,c,u,d,f,p="",h="",m=!1,k="";for(let x=0;x0&&e[x-1].hidden?` -`:"";if(v==="list_item_open"&&(!w.attrs||w.attrs.length===0)&&x+3${this.renderInlineTokens($.children||[],o,s)}`,x+=3;continue}}if(x+2 -`,x+=2;continue}}}if(v==="inline"){const z=w.children||[];if(z.length===1){m||(l=r.text,a=r.text_special,c=r.softbreak,u=r.hardbreak,d=r.html_inline,f=r.code_inline,p=o.xhtmlOut?`
+`;break;case"html_inline":if(s.html_inline===Hn.html_inline)return i.content;break;case"code_inline":if(s.code_inline===Hn.code_inline)return Ed(i);break}const r=s[i.type];if(!r)return c5(i,t.xhtmlOut===!0);const l=r(e,0,t,n,o);return typeof l=="string"?l:s4(l,i.type)}var Uie=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Hn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,p="",h="",m=!1,k="";for(let x=0;x0&&e[x-1].hidden?` +`:"";if(w==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&x+3${this.renderInlineTokens($.children||[],o,s)}`,x+=3;continue}}if(x+2 +`,x+=2;continue}}}if(w==="inline"){const z=v.children||[];if(z.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,p=o.xhtmlOut?`
`:`
`,h=o.breaks?p:` -`,m=!0);const $=z[0];switch($.type){case"text":if(l===Hn.text){k+=po($.content);continue}break;case"text_special":if(a===Hn.text_special){k+=po($.content);continue}break;case"softbreak":if(c===Hn.softbreak){k+=h;continue}break;case"hardbreak":if(u===Hn.hardbreak){k+=p;continue}break;case"html_inline":if(d===Hn.html_inline){k+=$.content;continue}break;case"code_inline":if(f===Hn.code_inline){k+=Ad($);continue}break}}k+=this.renderInlineTokens(z,o,s);continue}const M=r[v];if(!M){const z=w.attrs;if(!w.hidden){if(!z||z.length===0)switch(v){case"hr":k+=i?`


+`,m=!0);const $=z[0];switch($.type){case"text":if(l===Hn.text){k+=po($.content);continue}break;case"text_special":if(a===Hn.text_special){k+=po($.content);continue}break;case"softbreak":if(c===Hn.softbreak){k+=h;continue}break;case"hardbreak":if(u===Hn.hardbreak){k+=p;continue}break;case"html_inline":if(d===Hn.html_inline){k+=$.content;continue}break;case"code_inline":if(f===Hn.code_inline){k+=Ed($);continue}break}}k+=this.renderInlineTokens(z,o,s);continue}const M=i[w];if(!M){const z=v.attrs;if(!v.hidden){if(!z||z.length===0)switch(w){case"hr":k+=r?`
`:`
-`;continue;case"heading_open":k+=`<${w.tag}>`;continue;case"heading_close":k+=` +`;continue;case"heading_open":k+=`<${v.tag}>`;continue;case"heading_close":k+=` `;continue;case"paragraph_open":k+=`${b}

`;continue;case"paragraph_close":k+=`

`;continue;case"list_item_open":{const $=e[x+1];k+=b+($&&($.type==="inline"||$.hidden||$.nesting===-1&&$.tag==="li")?"
  • ":`
  • `);continue}case"list_item_close":k+=`
  • @@ -704,162 +704,162 @@ ${i} `;continue;case"tr_close":k+=` `;continue;case"td_open":k+=`${b}`;continue;case"td_close":k+=` `;continue;case"th_open":k+=`${b}`;continue;case"th_close":k+=` -`;continue}else if(z.length===1){const $=z[0];if(v==="ordered_list_open"&&$[0]==="start"){k+=`${b}
      -`;continue}if(v==="td_open"&&$[0]==="style"){k+=`${b}`;continue}if(v==="th_open"&&$[0]==="style"){k+=`${b}`;continue}}}k+=this.renderToken(e,x,o);continue}if(v==="code_block"&&M===Hn.code_block){k+=R8(w);continue}if(v==="fence"&&M===Hn.fence){k+=zb(w,o);continue}if(v==="html_block"&&M===Hn.html_block){k+=w.content;continue}const R=M(e,x,o,s,this);typeof R=="string"?k+=R:k+=o4(R,w.type)}return k}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},r=this.rules;let i="";for(let l=0;l0&&e[t-1].hidden?` +`;continue}else if(z.length===1){const $=z[0];if(w==="ordered_list_open"&&$[0]==="start"){k+=`${b}
        +`;continue}if(w==="td_open"&&$[0]==="style"){k+=`${b}`;continue}if(w==="th_open"&&$[0]==="style"){k+=`${b}`;continue}}}k+=this.renderToken(e,x,o);continue}if(w==="code_block"&&M===Hn.code_block){k+=F8(v);continue}if(w==="fence"&&M===Hn.fence){k+=Bb(v,o);continue}if(w==="html_block"&&M===Hn.html_block){k+=v.content;continue}const R=M(e,x,o,s,this);typeof R=="string"?k+=R:k+=s4(R,v.type)}return k}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` `:"",u=a?`> -`:">";if(!l||l.length===0)return r===0?n.xhtmlOut?`${c}<${i} /${u}`:`${c}<${i}${u}`:r===-1?`${c}(n||(n={...t}),n);if(g3.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),g3.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(g3.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(g3.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...Ore,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,r=t.type;if(r==="code_block"&&s.code_block===Hn.code_block)return R8(t);if(r==="html_block"&&s.html_block===Hn.html_block)return t.content;const i=this.mergeOptions(n),l=o??{};if(r==="inline")return this.renderInlineTokens(t.children||[],i,l);const a=s[r];if(!a)return t.block?this.renderToken(e,0,i):a5(t,i.xhtmlOut===!0);if(r==="fence"&&a===Hn.fence)return zb(t,i);const c=a(e,0,i,l,this);return typeof c=="string"?c:o4(c,r)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules;if(e.length===1)return Pre(e,t,n,this,o);const s=t.xhtmlOut===!0,r=s?`
        +`:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}(n||(n={...t}),n);if(v3.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),v3.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(v3.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(v3.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...Wie,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Hn.code_block)return F8(t);if(i==="html_block"&&s.html_block===Hn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):c5(t,r.xhtmlOut===!0);if(i==="fence"&&a===Hn.fence)return Bb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:s4(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules;if(e.length===1)return qie(e,t,n,this,o);const s=t.xhtmlOut===!0,i=s?`
        `:`
        -`,i=t.breaks?r:` -`,l=o.text,a=o.text_special,c=o.softbreak,u=o.hardbreak,d=o.html_inline,f=o.code_inline,p=o.link_open,h=o.link_close,m=o.em_open,k=o.em_close,x=o.strong_open,w=o.strong_close;let v="";for(let b=0;b`;if(c===Hn.softbreak&&b+3`,b+=1;continue}if(M.type==="em_open"&&!m&&!k&&b+2${T}`,b+=2;continue}}}if(M.type==="strong_open"&&!x&&!w&&b+2${T}`,b+=2;continue}}}switch(M.type){case"text":if(l===Hn.text){const $=M.content.length===0?"":po(M.content);if(d===Hn.html_inline&&b+1=4)return!0;continue}if(l===9){if(i+=4-i%4,r++,i>=4)return!0;continue}break}if(r0&&c<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=r+1;for(;a57)break;a++}if(a=xe,!Y&&Ke!==void 0&&(et=qo(e),Y=et>=Ke)),Y){const D=this.parseFullDocument(e,O,n,et,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!zl(O)?.unbounded}),D.tokens}else if(j){const D=(ye,Ce,me)=>yeme?me:ye;et===void 0&&(et=qo(e));const X=oe&&!se?Ib(e.length,et,n.options):null,ve=X?.maxChunkChars??(q?D(Math.ceil(e.length/P),8e3,64e3):W??1e4),fe=X?.maxChunkLines??(q?D(Math.ceil(et/P),150,700):G??200),pe=X?.maxChunks??(q?D(Math.ceil(e.length/64e3),P,32):ee),te=e.length>0&&e.charCodeAt(e.length-1)===10,de=F&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&X?.strategy!=="plain";if((A||de)&&(e.length>=ve*2||et>=fe*2)&&te){const ye=l5(n,e,O,{maxChunkChars:ve,maxChunkLines:fe,fenceAware:X?.fenceAware??Q,maxChunks:pe});return this.cache={src:e,tokens:ye,env:O,lineCount:et,lastSegment:void 0,globalStateReason:Mr(e)},this.updateCacheLineCount(this.cache,et),this.recordChunkedParseResult(O,A?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ne=this.parseFullDocument(e,O,n,et);return et=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:O,lineCount:et,lastSegment:void 0,globalStateReason:Mr(e)},this.updateCacheLineCount(this.cache,et),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!zl(O)?.unbounded}),ne.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",cs(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const r=e.startsWith(s.src)?e.slice(s.src.length):null;let i=s.globalStateReason;i===void 0&&(i=Mr(s.src),s.globalStateReason=i);const l=i?null:r!==null?this.detectGlobalStateForAppend(s,r):Mr(e),a=i||l;if(a){const O=o??s.env;oa(O);const H=Mr(e),V=this.parseFullDocument(e,O,n),A=V.tokens,F=V.lineCount;return this.cache={src:e,tokens:A,env:O,lineCount:F,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!zl(O)?.unbounded}),A}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length5e3?H=8:u.length>1e3?H=6:u.length>200&&(H=4),H=Math.min(H,O);let V=null;const A=n.options?.streamContextParseStrategy??"chars",F=n.options?.streamContextParseMinChars??200,j=n.options?.streamContextParseMinLines??2;let q;const P=()=>(q===void 0&&(q=qo(u)),q),W=this.canDirectlyParseAppend(s),G=W&&this.shouldUseUnboundedAppend(e,s,u);let ee=!1;if(!W)switch(A){case"lines":ee=P()>=j;break;case"constructs":if(u.length>=F){ee=!0;break}if(Wre(u)){ee=!0;break}ee=P()>=j;break;case"chars":default:ee=u.length>=F}if(H>0&&ee){const Q=this.getTailLines(s.src,H)+u;try{const ge=this.core.parse(Q,s.env,n).tokens,xe=ge.findIndex(Ke=>Ke.map&&typeof Ke.map[1]=="number"&&Ke.map[1]>H);if(xe!==-1){const Ke=ge.slice(xe),et=O-H;et!==0&&this.shiftTokenLines(Ke,et),V={tokens:Ke}}}catch{V=null}}else V=null;if(!V){const Q=O;if(G)V={tokens:V2(n,u,s.env,{mode:"stream"})},Q>0&&this.shiftTokenLines(V.tokens,Q);else{const ge=this.core.parse(u,s.env,n);Q>0&&this.shiftTokenLines(ge.tokens,Q),V=ge}}let se=0;if(s.tokens.length>0&&V.tokens.length>0){const Q=s.tokens[s.tokens.length-1],ge=V.tokens[0];try{Q.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(Q.children||(Q.children=[]),this.appendTokens(Q.children,ge.children)),Q.content=(Q.content||"")+(ge.content||""),se=1)}catch{se=0}}const oe=s.tokens.length;if(V.tokens.length>se){const Q=s.tokens,ge=V.tokens,xe=Math.min(Q.length,ge.length-se);let Ke=0;for(let et=xe;et>0;et--){let Y=!0;for(let ne=0;ne0&&(se+=Ke),ge.length>se&&this.appendTokens(s.tokens,ge,se)}if(s.src=e,s.globalStateReason=null,s.lineCount=O+(q??P()),s.tokens.length>oe){const Q=this.getLastSegment(s.tokens,e,oe,s.tokens.length,e.length-u.length,O);Q?s.lastSegment=Q:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,G&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",cs(s.env,{area:"stream",path:G?"stream-unbounded-append":"stream-append",reason:G?"large-delta":"safe-append",unbounded:G}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",cs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const p=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,k=!p&&!u&&h,x=m||k,w=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,R=n.options?.streamChunkMaxChunks,z=!!n.__explicitStreamChunkConfig,$=n.options?.autoTuneChunks!==!1,T=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+qo(u):void 0;if(x){E===void 0&&(E=qo(e));const O=(P,W,G)=>PG?G:P,H=$&&!z?Ib(e.length,E,n.options):null,V=H?.maxChunkChars??(w?O(Math.ceil(e.length/v),8e3,64e3):b??1e4),A=H?.maxChunkLines??(w?O(Math.ceil(E/v),150,700):M??200),F=H?.maxChunks??(w?O(Math.ceil(e.length/64e3),v,32):R),j=e.length>0&&e.charCodeAt(e.length-1)===10,q=k&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((m||q)&&(e.length>=V*2||E>=A*2)&&j){const P=l5(n,e,d,{maxChunkChars:V,maxChunkLines:A,fenceAware:H?.fenceAware??T,maxChunks:F});return this.cache={src:e,tokens:P,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Mr(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),P}}const N=this.parseFullDocument(e,d,n,E),C=N.tokens;return E=N.lineCount,this.cache={src:e,tokens:C,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Mr(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!zl(d)?.unbounded}),C}recordChunkedParseResult(e,t){const n=zl(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",cs(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!zl(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",cs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const r=Mr(e);Gd(t)&&oa(t);const i=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?JE(n,e.length,o):"no";if(i==="yes"){const a=V2(n,e,t);return cs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?qo(e):0)}}let l=o;if(i==="need-lines"&&(l=qo(e),XE(n,e.length,l))){const a=V2(n,e,t);return cs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?qo(e):0),{tokens:jc(t,r,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:qo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let r=0,i=-1;for(let a=0;a=2));a++);if(r<2)return null;const l=(i===-1?o:o.slice(0,i)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(` -`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const r=t.src.slice(0,s.srcOffset);if(!e.startsWith(r))return null;const i=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===i)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(i)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+qo(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let r=null,i=0;for(;i<=s;){let l=o.indexOf(` -`,i);l===-1&&(l=s);let a=i;for(;a=3&&(r?r.marker===c&&d>=r.length&&(r=null):r={marker:c,length:d})}}if(l===s)break;i=l+1}return r!==null}peek(){return this.cache?.tokens??Vre}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;sEh?n.slice(n.length-Eh):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,r){if(o<=n)return null;let i=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(i)?i:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,r)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(i)?i:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,r)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,r=-1;for(;s>0;){if(r=e.indexOf(` -`,r+1),r===-1)return e.length;s--}return r+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,r){if(!r||this.mayContainReferenceDefinition(r))return null;const i=t.tokens[s.tokenStart];switch(i?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,r,i);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,r,i);default:return null}}tryListTailAppendMerge(e,t,n,o,s,r,i){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l0&&this.shiftTokenLines(d,f);const p=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,i.level),h=this.getListParagraphMode(u,0,u.length,0);(p==="loose"||h==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,i.level,!1),this.setListParagraphVisibility(d,0,d.length,i.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+qo(r);t.lineCount=m;const k=this.getDocLineCount(e,m);return i.map&&(i.map[1]=k),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:k,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,r,i){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(r))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const k=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,x=t.lineCount??qo(t.src);t.tokens.splice(k,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const w=x+qo(r);t.lineCount=w;const v=this.getDocLineCount(e,w);if(i.map&&(i.map[1]=v),p.tbodyOpenIndex>=0){const b=t.tokens[p.tbodyOpenIndex];b?.map&&(b.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`,r=t.breaks?i:` +`,l=o.text,a=o.text_special,c=o.softbreak,u=o.hardbreak,d=o.html_inline,f=o.code_inline,p=o.link_open,h=o.link_close,m=o.em_open,k=o.em_close,x=o.strong_open,v=o.strong_close;let w="";for(let b=0;b`;if(c===Hn.softbreak&&b+3`,b+=1;continue}if(M.type==="em_open"&&!m&&!k&&b+2${E}`,b+=2;continue}}}if(M.type==="strong_open"&&!x&&!v&&b+2${E}`,b+=2;continue}}}switch(M.type){case"text":if(l===Hn.text){const $=M.content.length===0?"":po(M.content);if(d===Hn.html_inline&&b+1=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i0&&c<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a57)break;a++}if(a=xe,!Y&&Ke!==void 0&&(et=qo(e),Y=et>=Ke)),Y){const D=this.parseFullDocument(e,O,n,et,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!zl(O)?.unbounded}),D.tokens}else if(j){const D=(ye,Ce,me)=>yeme?me:ye;et===void 0&&(et=qo(e));const X=oe&&!se?Lb(e.length,et,n.options):null,ve=X?.maxChunkChars??(q?D(Math.ceil(e.length/P),8e3,64e3):W??1e4),fe=X?.maxChunkLines??(q?D(Math.ceil(et/P),150,700):G??200),pe=X?.maxChunks??(q?D(Math.ceil(e.length/64e3),P,32):ee),te=e.length>0&&e.charCodeAt(e.length-1)===10,de=F&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&X?.strategy!=="plain";if((A||de)&&(e.length>=ve*2||et>=fe*2)&&te){const ye=a5(n,e,O,{maxChunkChars:ve,maxChunkLines:fe,fenceAware:X?.fenceAware??Q,maxChunks:pe});return this.cache={src:e,tokens:ye,env:O,lineCount:et,lastSegment:void 0,globalStateReason:Mi(e)},this.updateCacheLineCount(this.cache,et),this.recordChunkedParseResult(O,A?"explicit-initial-large-doc":"default-initial-large-doc"),ye}}const ne=this.parseFullDocument(e,O,n,et);return et=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:O,lineCount:et,lastSegment:void 0,globalStateReason:Mi(e)},this.updateCacheLineCount(this.cache,et),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!zl(O)?.unbounded}),ne.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",cs(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Mi(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Mi(e),a=r||l;if(a){const O=o??s.env;oa(O);const H=Mi(e),V=this.parseFullDocument(e,O,n),A=V.tokens,F=V.lineCount;return this.cache={src:e,tokens:A,env:O,lineCount:F,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,F),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(O,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!zl(O)?.unbounded}),A}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length5e3?H=8:u.length>1e3?H=6:u.length>200&&(H=4),H=Math.min(H,O);let V=null;const A=n.options?.streamContextParseStrategy??"chars",F=n.options?.streamContextParseMinChars??200,j=n.options?.streamContextParseMinLines??2;let q;const P=()=>(q===void 0&&(q=qo(u)),q),W=this.canDirectlyParseAppend(s),G=W&&this.shouldUseUnboundedAppend(e,s,u);let ee=!1;if(!W)switch(A){case"lines":ee=P()>=j;break;case"constructs":if(u.length>=F){ee=!0;break}if(Gie(u)){ee=!0;break}ee=P()>=j;break;case"chars":default:ee=u.length>=F}if(H>0&&ee){const Q=this.getTailLines(s.src,H)+u;try{const ge=this.core.parse(Q,s.env,n).tokens,xe=ge.findIndex(Ke=>Ke.map&&typeof Ke.map[1]=="number"&&Ke.map[1]>H);if(xe!==-1){const Ke=ge.slice(xe),et=O-H;et!==0&&this.shiftTokenLines(Ke,et),V={tokens:Ke}}}catch{V=null}}else V=null;if(!V){const Q=O;if(G)V={tokens:W2(n,u,s.env,{mode:"stream"})},Q>0&&this.shiftTokenLines(V.tokens,Q);else{const ge=this.core.parse(u,s.env,n);Q>0&&this.shiftTokenLines(ge.tokens,Q),V=ge}}let se=0;if(s.tokens.length>0&&V.tokens.length>0){const Q=s.tokens[s.tokens.length-1],ge=V.tokens[0];try{Q.type==="inline"&&ge.type==="inline"&&(ge.children&&ge.children.length>0&&(Q.children||(Q.children=[]),this.appendTokens(Q.children,ge.children)),Q.content=(Q.content||"")+(ge.content||""),se=1)}catch{se=0}}const oe=s.tokens.length;if(V.tokens.length>se){const Q=s.tokens,ge=V.tokens,xe=Math.min(Q.length,ge.length-se);let Ke=0;for(let et=xe;et>0;et--){let Y=!0;for(let ne=0;ne0&&(se+=Ke),ge.length>se&&this.appendTokens(s.tokens,ge,se)}if(s.src=e,s.globalStateReason=null,s.lineCount=O+(q??P()),s.tokens.length>oe){const Q=this.getLastSegment(s.tokens,e,oe,s.tokens.length,e.length-u.length,O);Q?s.lastSegment=Q:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,G&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",cs(s.env,{area:"stream",path:G?"stream-unbounded-append":"stream-append",reason:G?"large-delta":"safe-append",unbounded:G}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",cs(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const p=!!n.__explicitStreamChunkFallbackSetting,h=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,k=!p&&!u&&h,x=m||k,v=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,R=n.options?.streamChunkMaxChunks,z=!!n.__explicitStreamChunkConfig,$=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let T=u&&s.lineCount!==void 0?s.lineCount+qo(u):void 0;if(x){T===void 0&&(T=qo(e));const O=(P,W,G)=>PG?G:P,H=$&&!z?Lb(e.length,T,n.options):null,V=H?.maxChunkChars??(v?O(Math.ceil(e.length/w),8e3,64e3):b??1e4),A=H?.maxChunkLines??(v?O(Math.ceil(T/w),150,700):M??200),F=H?.maxChunks??(v?O(Math.ceil(e.length/64e3),w,32):R),j=e.length>0&&e.charCodeAt(e.length-1)===10,q=k&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((m||q)&&(e.length>=V*2||T>=A*2)&&j){const P=a5(n,e,d,{maxChunkChars:V,maxChunkLines:A,fenceAware:H?.fenceAware??E,maxChunks:F});return this.cache={src:e,tokens:P,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Mi(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),P}}const N=this.parseFullDocument(e,d,n,T),C=N.tokens;return T=N.lineCount,this.cache={src:e,tokens:C,env:d,lineCount:T,lastSegment:void 0,globalStateReason:Mi(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",cs(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!zl(d)?.unbounded}),C}recordChunkedParseResult(e,t){const n=zl(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",cs(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!zl(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",cs(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Mi(e);Yd(t)&&oa(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?tI(n,e.length,o):"no";if(r==="yes"){const a=W2(n,e,t);return cs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?qo(e):0)}}let l=o;if(r==="need-lines"&&(l=qo(e),eI(n,e.length,l))){const a=W2(n,e,t);return cs(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?qo(e):0),{tokens:Oc(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:qo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(` +`);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+qo(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(` +`,r);l===-1&&(l=s);let a=r;for(;a=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??Kie}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;sIh?n.slice(n.length-Ih):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(` +`,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l0&&this.shiftTokenLines(d,f);const p=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),h=this.getListParagraphMode(u,0,u.length,0);(p==="loose"||h==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+qo(i);t.lineCount=m;const k=this.getDocLineCount(e,m);return r.map&&(r.map[1]=k),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:k,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(h.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(h,m);const k=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,x=t.lineCount??qo(t.src);t.tokens.splice(k,0,...h),t.src=e,t.env=n,t.globalStateReason=null;const v=x+qo(i);t.lineCount=v;const w=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=w),p.tbodyOpenIndex>=0){const b=t.tokens[p.tbodyOpenIndex];b?.map&&(b.map[1]=w)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:w,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` `);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let r=-1,i=-1;for(let l=t+1;l=0){for(let l=s-1;l>r;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){i=l;break}}if(i<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:r,tbodyCloseIndex:i}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],r=e[e.length-1];if(s.type!==t||r.type!==n||s.level!==0||r.level!==0||o!==void 0&&s.markup!==o)return!1;let i=0;for(let l=0;l0&&l0||a.nesting<0)&&(i+=a.nesting)}return i===0}getListParagraphMode(e,t,n,o){let s=!1,r=!1;const i=o+2;for(let l=t;l=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=qo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o=0;r--)n.push(s.children[r]);for(;n.length>0;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}}}};const Rb={default:Bre,zero:Rre,commonmark:zre};function Kre(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function Gre(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function Fb(e){return e.experimental?{...e,...e.experimental}:e}function di(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function jb(e,t,n){for(let o=0;o=4?n.quotes=[$[0],$[1],$[2],$[3]]:n.quotes=["“","”","‘","’"]}let i=jb(r?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=jb(r?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ob(r?.options,s,"fullChunkedFallback"),c=Ob(r?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const p=new Ose;let h=null;const m=()=>(h||(h=new Dre(n)),h);let k=null;const x=()=>(k||(k=new Zre(p)),k);let w=null;const v=()=>(w||(w=new aE),w),b=$=>!u&&!!d&&!Gre($,d),M=($,T)=>o==="default"&&!u&&h===null&&f!==null&&$.parse===f&&b($)&&!$.stream.enabled&&T<($.options.autoUnboundedThresholdChars??4e6)&&$.options.html===!1&&$.options.xhtmlOut===!1&&$.options.breaks===!1&&$.options.langPrefix==="language-"&&$.options.linkify===!1&&$.options.typographer===!1&&$.options.highlight===null,R=($,T)=>o==="default"&&!u&&b($)&&!$.stream.enabled&&!$.options.fullChunkedFallback&&T<($.options.autoUnboundedThresholdChars??4e6)&&$.options.html===!1&&$.options.linkify===!1&&$.options.typographer===!1,z={core:p,block:p.block,inline:p.inline,get linkify(){const $=v();return Object.defineProperty(this,"linkify",{value:$,writable:!0,configurable:!0}),$},get renderer(){const $=m();return Object.defineProperty(this,"renderer",{value:$,writable:!0,configurable:!0}),$},options:n,__explicitFullChunkConfig:i,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set($){const T=Fb($);return this.options={...this.options,...T},(di($,"fullChunkSizeChars")||di($,"fullChunkSizeLines")||di($,"fullChunkMaxChunks"))&&(i=!0,this.__explicitFullChunkConfig=!0),(di($,"streamChunkSizeChars")||di($,"streamChunkSizeLines")||di($,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),di($,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),di($,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(T),typeof T.stream=="boolean"&&(this.stream.enabled=T.stream,k&&(k.reset(),k.resetStats())),this},configure($){const T=typeof $=="string"?Rb[$]:$;if(!T)throw new Error("Wrong `markdown-it` preset, can't be empty");if(T.options&&this.set(T.options),T.components){const E=T.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable($,T){const E=Array.isArray($)?$:[$],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],C=new Set;for(const O of N){if(!O)continue;const H=O.enable(E,!0);for(let V=0;V!C.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},disable($,T){const E=Array.isArray($)?$:[$],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],C=new Set;for(const O of N){if(!O)continue;const H=O.disable(E,!0);for(let V=0;V!C.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},use($,...T){const E=typeof $=="function"?$:$&&typeof $.default=="function"?$.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const N=[this,...T],C=$;return u=!0,E.apply(C,N),this},render($,T){let E;if(M(this,$.length)){T!==void 0&&(cr(T),E=wh("render"));const O=E?ec():0,H=E?Ab($,E):Mb($);if(E&&(E.attemptMs=ec()-O,H===null&&(E.fallbackReason="unsupported-stock-subset"),o2(T,E)),H!==null)return T!==void 0&&cs(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const N=T??{},C=this.parse($,N);return E&&o2(N,E),m().render(C,this.options,N)},async renderAsync($,T){let E;if(M(this,$.length)){T!==void 0&&(cr(T),E=wh("render"));const O=E?ec():0,H=E?Ab($,E):Mb($);if(E&&(E.attemptMs=ec()-O,H===null&&(E.fallbackReason="unsupported-stock-subset"),o2(T,E)),H!==null)return T!==void 0&&cs(T,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const N=T??{},C=this.parse($,N);return E&&o2(N,E),m().renderAsync(C,this.options,N)},renderIterable($,T={}){const E=this.parseIterable($,T);return m().render(E,this.options,T)},async renderAsyncIterable($,T={}){const E=await this.parseAsyncIterable($,T);return m().renderAsync(E,this.options,T)},renderInline($,T={}){const E=this.parseInline($,T);return m().render(E,this.options,T)},validateLink:jE,normalizeLink:OE,normalizeLinkText:PE,utils:mne,helpers:{...ooe},parse($,T){if(typeof $!="string")throw new TypeError("Input data should be a String");if(T!==void 0&&cr(T),R(this,$.length)){const O=T===void 0?void 0:wh("parse"),H=O?ec():0,V=Xse($,O);if(O&&(O.attemptMs=ec()-H,V===null&&(O.fallbackReason="unsupported-stock-subset"),o2(T,O)),V!==null)return T!==void 0&&cs(T,{area:"parse",path:"stock-fast",reason:"stock-subset"}),V}const E=T??{};let N;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const O=JE(this,$.length);if(O==="yes"){const H=V2(this,$,E);return cs(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}O==="need-lines"&&(N=qo($))}if(!this.stream.enabled){const O=$.length,H=this.options.autoTuneChunks!==!1,V=i,A=!a&&b(this),F=!!this.options.fullChunkedFallback,j=A&&O>=2e5;let q;(F||j||N!==void 0)&&(q=N??qo($));const P=(F||j)&&H&&!V?Nre(O,q,this.options):null;if(F||j){const W=q??0;if(F?O>=(this.options.fullChunkThresholdChars??2e4)||W>=(this.options.fullChunkThresholdLines??400):j){if(P&&P.strategy!=="plain"){const G=l5(this,$,E,{maxChunkChars:P.maxChunkChars,maxChunkLines:P.maxChunkLines,fenceAware:P.fenceAware,maxChunks:P.maxChunks});return T&&Pb(T,F?"explicit-full-chunk":"default-large-string"),G}if(F){const G=(Y,ne,D)=>YD?D:Y,ee=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,oe=G(Math.ceil(O/se),8e3,64e3),Q=G(Math.ceil(W/se),150,700),ge=ee?oe:this.options.fullChunkSizeChars??1e4,xe=ee?Q:this.options.fullChunkSizeLines??200,Ke=ee?G(Math.ceil(O/64e3),se,32):this.options.fullChunkMaxChunks,et=l5(this,$,E,{maxChunkChars:ge,maxChunkLines:xe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ke});return T&&Pb(T,"explicit-full-chunk"),et}}}if(N!==void 0&&b(this)&&XE(this,O,q??N)){const W=V2(this,$,E);return cs(T,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),W}}const C=Mr($);return cs(T,{area:"parse",path:"plain",reason:"default-plain"}),jc(E,C,()=>p.parse($,E,this).tokens)},parseIterable($,T={}){return cr(T),Ere(this,$,T)},parseAsyncIterable($,T={}){return cr(T),Ire(this,$,T)},parseIterableToSink($,T,E={}){return cr(E),Lre(this,$,T,E)},parseAsyncIterableToSink($,T,E={}){return cr(E),$re(this,$,T,E)},parseInline($,T={}){if(typeof $!="string")throw new TypeError("Input data should be a String");cr(T),Gd(T)&&oa(T);const E=p.createState($,T,this);return E.inlineMode=!0,p.process(E),E.tokens}};if(z.stream={enabled:!!n.stream,parse($,T){return z.stream.enabled?x().parse($,T,z):z.parse($,T??{})},reset(){x().reset()},peek(){return k?k.peek():[]},stats(){return k?k.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){k&&k.resetStats()}},r?.components){const $=r.components;$.core?.rules&&z.core.ruler.enableOnly($.core.rules),$.block?.rules&&z.block.ruler.enableOnly($.block.rules),$.inline?.rules&&z.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&z.inline.ruler2.enableOnly($.inline2.rules)}return d=Kre(z),f=z.parse,z}var Xre=Yre;const oI=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Jre=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],sI=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],Qre=["svg","g","path"],eie=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],tie=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],nie=["action","data","href","src","srcset","poster","xlink:href","formaction"],oie=["script"],sie=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],r1=new Set(oI),rI=new Set(sI),Td=new Set([...oI,...Jre,...sI,...Qre]),iI=new Set([...Td,...eie]),rie=new Set(tie),iie=new Set(nie),Jd=new Set(oie),lI=new Set(sie);function aI(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const lie={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function cI(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const r=n??o;if(r){const i=Number.parseInt(r,n?10:16);try{return Number.isFinite(i)?String.fromCodePoint(i):""}catch{return""}}return lie[String(s??"").toLowerCase()]??t})}const v3=new Set(["http","https","mailto","tel"]),aie=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),R1=new Set(["http","https"]);function uI(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const cie=/^https?:\/\//i;function uie(e){if(!cie.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function die(e,t,n){if(!U2(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function U2(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function fie(e,t){return t==="href"||t==="xlink:href"?U2(e,t)?v3:R1:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?R1:(U2(e,t),v3)}function d0(e,t={}){if(uie(e))return!1;const n=aI(cI(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const i=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!i:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const r=uI(n);return r?r==="file"?!die(n,o,s):U2(o,s)?aie.has(r):!fie(o,s).has(r):!1}function pie(e){const t=cI(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=uI(aI(t).toLowerCase());return n==="http"||n==="https"}function hie(e,t={}){const n=String(e??"").trim();return n?d0(n,t)?"":n:""}function Hb(e){return hie(e,{tagName:"img",attrName:"src"})}function mie(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,p,h,m,k){return f[p].nesting===1&&f[p].attrJoin("class",t),k.renderToken(f,p,h,m,k)}n=n||{};const r=3,i=n.marker||":",l=i.charCodeAt(0),a=i.length,c=n.validate||o,u=n.render||s;function d(f,p,h,m){let k,x=!1,w=f.bMarks[p]+f.tShift[p],v=f.eMarks[p];if(l!==f.src.charCodeAt(w))return!1;for(k=w+1;k<=v&&i[(k-w)%a]===f.src[k];k++);const b=Math.floor((k-w)/a);if(b=h||(w=f.bMarks[z]+f.tShift[z],v=f.eMarks[z],w=4)){for(k=w+1;k<=v&&i[(k-w)%a]===f.src[k];k++);if(!(Math.floor((k-w)/a)=2){const i=Number(r[0]),l=Number(r[1]);Number.isFinite(i)&&Number.isFinite(l)&&(s.map=[i+t,Math.min(l+t,n)])}Array.isArray(s.children)&&dI(s.children,t,n)}}function vie(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(mie,t,{render(n,o){return n[o].nesting===1?`
        `:`
        -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const r=t,i=r.bMarks[n]+r.tShift[n],l=r.eMarks[n],a=r.src.slice(i,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,p;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let R=0,z=-1;for(let $=0;$0&&(p=m.slice(0,z))}p||(f=d||void 0)}if(s)return!0;const k=!!r.env.__markstreamFinal;let x=n+1,w=!1;for(;x<=o;){const R=r.bMarks[x]+r.tShift[x],z=r.eMarks[x];if(r.src.slice(R,z).trim()===":::"){w=!0;break}x++}w||(x=o);const v=r.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.map=[n,w?x:o],v.meta={...v.meta??{},unclosed:!w&&!k},f&&v.attrSet("data-args",f),p)try{const R=JSON.parse(p);for(const[z,$]of Object.entries(R)){const T=$!=null&&typeof $=="object";v.attrSet(`data-${z}`,T?JSON.stringify($):String($))}}catch{const R=gie(p);if(R)for(const[z,$]of Object.entries(R)){const T=$!=null&&typeof $=="object";v.attrSet(`data-${z}`,T?JSON.stringify($):String($))}else v.attrSet("data-attrs",p)}const b=[];for(let R=n+1;RR.trim().length>0)){let R=b.join(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=qo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const Fb={default:Pie,zero:Hie,commonmark:Oie};function Qie(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function ere(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function jb(e){return e.experimental?{...e,...e.experimental}:e}function dr(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function Ob(e,t,n){for(let o=0;o=4?n.quotes=[$[0],$[1],$[2],$[3]]:n.quotes=["“","”","‘","’"]}let r=Ob(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Ob(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Pb(i?.options,s,"fullChunkedFallback"),c=Pb(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const p=new Wse;let h=null;const m=()=>(h||(h=new Zie(n)),h);let k=null;const x=()=>(k||(k=new Jie(p)),k);let v=null;const w=()=>(v||(v=new dT),v),b=$=>!u&&!!d&&!ere($,d),M=($,E)=>o==="default"&&!u&&h===null&&f!==null&&$.parse===f&&b($)&&!$.stream.enabled&&E<($.options.autoUnboundedThresholdChars??4e6)&&$.options.html===!1&&$.options.xhtmlOut===!1&&$.options.breaks===!1&&$.options.langPrefix==="language-"&&$.options.linkify===!1&&$.options.typographer===!1&&$.options.highlight===null,R=($,E)=>o==="default"&&!u&&b($)&&!$.stream.enabled&&!$.options.fullChunkedFallback&&E<($.options.autoUnboundedThresholdChars??4e6)&&$.options.html===!1&&$.options.linkify===!1&&$.options.typographer===!1,z={core:p,block:p.block,inline:p.inline,get linkify(){const $=w();return Object.defineProperty(this,"linkify",{value:$,writable:!0,configurable:!0}),$},get renderer(){const $=m();return Object.defineProperty(this,"renderer",{value:$,writable:!0,configurable:!0}),$},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set($){const E=jb($);return this.options={...this.options,...E},(dr($,"fullChunkSizeChars")||dr($,"fullChunkSizeLines")||dr($,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(dr($,"streamChunkSizeChars")||dr($,"streamChunkSizeLines")||dr($,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),dr($,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),dr($,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),h&&h.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,k&&(k.reset(),k.resetStats())),this},configure($){const E=typeof $=="string"?Fb[$]:$;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const T=E.components;T.core?.rules&&this.core.ruler.enableOnly(T.core.rules),T.block?.rules&&this.block.ruler.enableOnly(T.block.rules),T.inline?.rules&&this.inline.ruler.enableOnly(T.inline.rules),T.inline2?.rules&&this.inline.ruler2.enableOnly(T.inline2.rules)}return this},enable($,E){const T=Array.isArray($)?$:[$],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],C=new Set;for(const O of N){if(!O)continue;const H=O.enable(T,!0);for(let V=0;V!C.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},disable($,E){const T=Array.isArray($)?$:[$],N=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],C=new Set;for(const O of N){if(!O)continue;const H=O.disable(T,!0);for(let V=0;V!C.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},use($,...E){const T=typeof $=="function"?$:$&&typeof $.default=="function"?$.default:void 0;if(!T)throw new TypeError("MarkdownIt.use: plugin must be a function");const N=[this,...E],C=$;return u=!0,T.apply(C,N),this},render($,E){let T;if(M(this,$.length)){E!==void 0&&(ci(E),T=yh("render"));const O=T?ec():0,H=T?Eb($,T):Ab($);if(T&&(T.attemptMs=ec()-O,H===null&&(T.fallbackReason="unsupported-stock-subset"),s2(E,T)),H!==null)return E!==void 0&&cs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const N=E??{},C=this.parse($,N);return T&&s2(N,T),m().render(C,this.options,N)},async renderAsync($,E){let T;if(M(this,$.length)){E!==void 0&&(ci(E),T=yh("render"));const O=T?ec():0,H=T?Eb($,T):Ab($);if(T&&(T.attemptMs=ec()-O,H===null&&(T.fallbackReason="unsupported-stock-subset"),s2(E,T)),H!==null)return E!==void 0&&cs(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const N=E??{},C=this.parse($,N);return T&&s2(N,T),m().renderAsync(C,this.options,N)},renderIterable($,E={}){const T=this.parseIterable($,E);return m().render(T,this.options,E)},async renderAsyncIterable($,E={}){const T=await this.parseAsyncIterable($,E);return m().renderAsync(T,this.options,E)},renderInline($,E={}){const T=this.parseInline($,E);return m().render(T,this.options,E)},validateLink:HT,normalizeLink:DT,normalizeLinkText:VT,utils:kne,helpers:{...aoe},parse($,E){if(typeof $!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&ci(E),R(this,$.length)){const O=E===void 0?void 0:yh("parse"),H=O?ec():0,V=nie($,O);if(O&&(O.attemptMs=ec()-H,V===null&&(O.fallbackReason="unsupported-stock-subset"),s2(E,O)),V!==null)return E!==void 0&&cs(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),V}const T=E??{};let N;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const O=tI(this,$.length);if(O==="yes"){const H=W2(this,$,T);return cs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}O==="need-lines"&&(N=qo($))}if(!this.stream.enabled){const O=$.length,H=this.options.autoTuneChunks!==!1,V=r,A=!a&&b(this),F=!!this.options.fullChunkedFallback,j=A&&O>=2e5;let q;(F||j||N!==void 0)&&(q=N??qo($));const P=(F||j)&&H&&!V?jie(O,q,this.options):null;if(F||j){const W=q??0;if(F?O>=(this.options.fullChunkThresholdChars??2e4)||W>=(this.options.fullChunkThresholdLines??400):j){if(P&&P.strategy!=="plain"){const G=a5(this,$,T,{maxChunkChars:P.maxChunkChars,maxChunkLines:P.maxChunkLines,fenceAware:P.fenceAware,maxChunks:P.maxChunks});return E&&Hb(E,F?"explicit-full-chunk":"default-large-string"),G}if(F){const G=(Y,ne,D)=>YD?D:Y,ee=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,oe=G(Math.ceil(O/se),8e3,64e3),Q=G(Math.ceil(W/se),150,700),ge=ee?oe:this.options.fullChunkSizeChars??1e4,xe=ee?Q:this.options.fullChunkSizeLines??200,Ke=ee?G(Math.ceil(O/64e3),se,32):this.options.fullChunkMaxChunks,et=a5(this,$,T,{maxChunkChars:ge,maxChunkLines:xe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ke});return E&&Hb(E,"explicit-full-chunk"),et}}}if(N!==void 0&&b(this)&&eI(this,O,q??N)){const W=W2(this,$,T);return cs(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),W}}const C=Mi($);return cs(E,{area:"parse",path:"plain",reason:"default-plain"}),Oc(T,C,()=>p.parse($,T,this).tokens)},parseIterable($,E={}){return ci(E),zie(this,$,E)},parseAsyncIterable($,E={}){return ci(E),Bie(this,$,E)},parseIterableToSink($,E,T={}){return ci(T),Rie(this,$,E,T)},parseAsyncIterableToSink($,E,T={}){return ci(T),Fie(this,$,E,T)},parseInline($,E={}){if(typeof $!="string")throw new TypeError("Input data should be a String");ci(E),Yd(E)&&oa(E);const T=p.createState($,E,this);return T.inlineMode=!0,p.process(T),T.tokens}};if(z.stream={enabled:!!n.stream,parse($,E){return z.stream.enabled?x().parse($,E,z):z.parse($,E??{})},reset(){x().reset()},peek(){return k?k.peek():[]},stats(){return k?k.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){k&&k.resetStats()}},i?.components){const $=i.components;$.core?.rules&&z.core.ruler.enableOnly($.core.rules),$.block?.rules&&z.block.ruler.enableOnly($.block.rules),$.inline?.rules&&z.inline.ruler.enableOnly($.inline.rules),$.inline2?.rules&&z.inline.ruler2.enableOnly($.inline2.rules)}return d=Qie(z),f=z.parse,z}var nre=tre;const rI=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ore=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],lI=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],sre=["svg","g","path"],ire=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],rre=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],lre=["action","data","href","src","srcset","poster","xlink:href","formaction"],are=["script"],cre=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],i1=new Set(rI),aI=new Set(lI),Td=new Set([...rI,...ore,...lI,...sre]),cI=new Set([...Td,...ire]),ure=new Set(rre),dre=new Set(lre),Qd=new Set(are),uI=new Set(cre);function dI(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const fre={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function fI(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return fre[String(s??"").toLowerCase()]??t})}const w3=new Set(["http","https","mailto","tel"]),pre=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),R1=new Set(["http","https"]);function pI(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const hre=/^https?:\/\//i;function mre(e){if(!hre.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function gre(e,t,n){if(!Z2(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Z2(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function vre(e,t){return t==="href"||t==="xlink:href"?Z2(e,t)?w3:R1:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?R1:(Z2(e,t),w3)}function d0(e,t={}){if(mre(e))return!1;const n=dI(fI(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=pI(n);return i?i==="file"?!gre(n,o,s):Z2(o,s)?pre.has(i):!vre(o,s).has(i):!1}function wre(e){const t=fI(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=pI(dI(t).toLowerCase());return n==="http"||n==="https"}function yre(e,t={}){const n=String(e??"").trim();return n?d0(n,t)?"":n:""}function Db(e){return yre(e,{tagName:"img",attrName:"src"})}function kre(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,p,h,m,k){return f[p].nesting===1&&f[p].attrJoin("class",t),k.renderToken(f,p,h,m,k)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,p,h,m){let k,x=!1,v=f.bMarks[p]+f.tShift[p],w=f.eMarks[p];if(l!==f.src.charCodeAt(v))return!1;for(k=v+1;k<=w&&r[(k-v)%a]===f.src[k];k++);const b=Math.floor((k-v)/a);if(b=h||(v=f.bMarks[z]+f.tShift[z],w=f.eMarks[z],v=4)){for(k=v+1;k<=w&&r[(k-v)%a]===f.src[k];k++);if(!(Math.floor((k-v)/a)=2){const r=Number(i[0]),l=Number(i[1]);Number.isFinite(r)&&Number.isFinite(l)&&(s.map=[r+t,Math.min(l+t,n)])}Array.isArray(s.children)&&hI(s.children,t,n)}}function _re(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(kre,t,{render(n,o){return n[o].nesting===1?`
        `:`
        +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,p;const h=d.indexOf("{"),m=h>=0?d.slice(h).trimStart():void 0;if(h===-1)f=d||void 0;else{if(f=d.slice(0,h).trim()||void 0,m?.startsWith("{")){let R=0,z=-1;for(let $=0;$0&&(p=m.slice(0,z))}p||(f=d||void 0)}if(s)return!0;const k=!!i.env.__markstreamFinal;let x=n+1,v=!1;for(;x<=o;){const R=i.bMarks[x]+i.tShift[x],z=i.eMarks[x];if(i.src.slice(R,z).trim()===":::"){v=!0;break}x++}v||(x=o);const w=i.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${u}`),w.map=[n,v?x:o],w.meta={...w.meta??{},unclosed:!v&&!k},f&&w.attrSet("data-args",f),p)try{const R=JSON.parse(p);for(const[z,$]of Object.entries(R)){const E=$!=null&&typeof $=="object";w.attrSet(`data-${z}`,E?JSON.stringify($):String($))}}catch{const R=bre(p);if(R)for(const[z,$]of Object.entries(R)){const E=$!=null&&typeof $=="object";w.attrSet(`data-${z}`,E?JSON.stringify($):String($))}else w.attrSet("data-attrs",p)}const b=[];for(let R=n+1;RR.trim().length>0)){let R=b.join(` `);R.endsWith(` `)||(R+=` `),R.endsWith(` `)||(R+=` -`);const z=r.tokens[r.tokens.length-1];z&&(z.raw=R);const $=[];r.md.block.parse(R,r.md,r.env,$),dI($,n+1,n+1+b.length),r.tokens.push(...$)}const M=r.push("vmr_container_close","div",-1);return w||(M.hidden=!0,M.map=[o,o]),r.line=w?x+1:x,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ki(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zo(e){let t=!1,n=!1;for(let o=0;o")return o}return-1}function Cp(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const r=o[2]||o[3]||o[4]||"";t.push([s,r])}return t}const wie=/^[a-z][a-z0-9_-]*$/;function Db(e){return wie.test(String(e??"").trim().toLowerCase())}function xi(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Db(t)?t.toLowerCase():"";let n=1;for(;n]/.test(r)?"":Db(s)?s:""}function E0(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=xi(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function yie(...e){const t=new Set,n=[];for(const o of e)for(const s of E0(o))t.has(s)||(t.add(s),n.push(s));return n}function kie(e){const t=E0(e);return{key:t.join(","),tags:t}}function fI(e){return xi(e)}function bie(e,t){const n=String(e??""),o=xi(t);if(!o)return!1;const s=Ki(o),r=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return r?r[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function pI(e,t){const n=xi(t);return!!n&&!Td.has(n)&&!bie(e,n)}function _ie(e,t){const n=String(e??""),o=xi(t);if(!o)return n;const s=Ki(o),r=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),i=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(r,"").replace(i,"")}const hI=r1,xie=Td,mI=new Set(rI);mI.delete("details");const Sie=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Cie=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,F8=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,Mie=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function c5(e){return(e.match(F8)?.[1]??"").toLowerCase()}function Zg(e){return/^\s*<\s*\//.test(e)}function Kg(e,t){return hI.has(t)||/\/\s*>\s*$/.test(e)}function Aie(e,t){let n=0;for(let o=0;o0&&n--;continue}Kg(s,r)||n++}}return n}function Vb(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,r;for(;(r=o.exec(e))!==null;){const i=r[0]??"",l=!!r[1],a=!l&&/\/\s*>$/.test(i);if(l){if(s===0)return{start:r.index,end:r.index+i.length};s--;continue}a||s++}return null}function Eie(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const r=s[0]??"",i=!!s[1],l=!i&&/\/\s*>$/.test(r);if(i){o>0&&o--;continue}l||o++}return o}function u5(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Iie(e){const t=e;return t.meta||(t.meta={}),t.meta}function Ih(e,t,n){const o=Iie(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function Lie(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${Ki(p)}(?=[\s>/])`,"i")),o=[];let s=!1;const r=p=>p?n.some(h=>h.test(p)):!1,i=p=>{if(!(!p||!o.length))for(const h of o)h.raw+=p,h.inner+=p},l=()=>{!o.length||!s||(i(` -`),s=!1)},a=p=>{i(p)},c=p=>{for(let m=0;m{const h=o[o.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ki(h)}\s*>`,"i");return p.match(m)?.[0]??null},d=p=>!!u(p),f=(p,h,m)=>{const k=m??(p.type==="html_inline"?c5(h):"");if(!(k&&t.has(k))){i(h);return}const x=Zg(h),w=!x&&Kg(h,k);if(x){if(!o.length||o[o.length-1].tag!==k){i(h);return}c(h);return}if(i(h),w){Ih(p,h,"");return}o.push({tag:k,token:p,raw:h,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const h=String(p.content??"");if(d(h)?s=!1:l(),!o.length&&!r(h)){s=!1;continue}let m=0,k=!0;for(const x of p.children){const w=u5(x),v=x.type==="html_inline"?c5(w):"",b=v&&t.has(v);let M=w;if(k&&h&&w&&(o.length||b)){const R=h.indexOf(w,m);if(R!==-1)a(h.slice(m,R)),M=h.slice(R,R+w.length),m=R+w.length;else{if(o.length&&!b)continue;k=!1}}f(x,M,v)}k&&h&&m0;continue}if(o.length&&typeof p.content=="string"){const h=u5(p),m=p.type==="html_block"?u(h):null;if(m){c(`${s?` -`:""}${m}`),s=o.length>0;continue}if(!p.content)continue;l(),i(p.content),s=!0}}for(const p of o)Ih(p.token,p.raw,p.inner)}function $ie(e){return/^\s*<\s*[!?]/.test(e)}function Nie(e){const t=new Set(xie);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function Wb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function zie(e,t){let n=null;for(const r of e.matchAll(Sie)){const i=r.index??-1;if(i<0)continue;const l=(r[1]??"").toLowerCase();Wb(l,t)&&Zo(e.slice(i))===-1&&(!n||i")&&(!n||r")&&(!n||r{const p=f,h=new Set(n),m=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const v of m){const b=xi(String(v??""));b&&h.add(b)}const k=Nie(Array.from(h)),x=new Set(Fie);for(const v of h)x.add(v);return{autoCloseInlineTagSet:x,commonHtmlTags:k,customTagSet:h,shouldMergeHtmlBlockTag:v=>h.has(v)||!k.has(v)||mI.has(v)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const p=f.children[0];return p?.type!=="html_block"?"":String(f.content??p.content??"")},r=(f,p)=>{f.type="html_block",f.content=p,f.raw=p,f.children=[]},i=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,p)=>{const h=i(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const k={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},k,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:m,raw:m}]:[k]},u=(f,p,h)=>f[p-1]?.type==="paragraph_open"&&f[p+1]?.type==="paragraph_close"?"inline":h,d=(f,p)=>{const h=i(p);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const p=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=o(f);for(const k of p){const x=k;if(x.type!=="inline"||!Array.isArray(x.children))continue;const w=String(x.content??""),v=x.children.length?x.children:w.includes("<")?[{type:"text",content:w,raw:w}]:null;if(v)try{const b=Rie(v,h);if(x.children=b.children,b.pendingBuffer){const M=w.lastIndexOf(b.pendingBuffer);if(M!==-1){const R=w.slice(0,M);x.content=R,typeof x.raw=="string"&&(x.raw=R)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}Lie(p,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:k}=o(f),x=[];for(let w=0;w0){const[M,R]=x[x.length-1];if(w!==R){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(w,1),w--;continue}const z=String(v.content??v.raw??"");if(z){const $=p[R],T=`${String($.content||"")} -${z}`,E=Zo(T),N=E===-1?null:Vb(T,M,E+1);if(N){const C=T.slice(0,N.end),O=T.slice(N.end);$.content=C,$.loading=!1,p.splice(w,1),x.pop();const H=d($,O)?[]:c(O,u(p,w,"paragraph"));H.length&&p.splice(w,0,...H),w--;continue}$.content=T,$.loading!==!1&&($.loading=!0)}p.splice(w,1),w--;continue}}const b=s(v);if(b){if($ie(b))continue;const M=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),R=/^\s*<\s*\//.test(b);if(!M||!k(M))continue;if(r(v,b),!R)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(b)&&Eie(b,M)>0&&x.push([M,w]);else if(x.length>0&&M&&x[x.length-1][0]===M){const[,z]=x[x.length-1],$=p[z];$.content=`${String($.content||"")} -${b}`,$.loading=!1,x.pop(),p.splice(w,1),w--}continue}else if(x.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){p.splice(w,1),w--;continue}const M=v.content||"",R=new RegExp(`<\\s*\\/\\s*${x[x.length-1][0]}\\s*>`,"i").test(M);if(M){const[,z]=x[x.length-1],$=p[z];$.content=`${$.content||""} -${M}`,$.loading!==!1&&($.loading=!R)}R&&x.pop(),p.splice(w,1),w--}else continue}if(m.size>0){const w=new Map,v=new Map,b=z=>{let $=w.get(z);return $||($=new RegExp(`<\\s*${z}\\b`,"i"),w.set(z,$)),$},M=z=>{let $=v.get(z);return $||($=new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i"),v.set(z,$)),$},R=[];for(let z=0;z0){const N=R[R.length-1],C=p[N.index],O=$.type==="html_block"?M(N.tag).exec(T):null;if(O){const A=O.index+O[0].length,F=T.slice(0,A),j=T.slice(A);C.content=`${String(C.content??"")} -${F}`,Array.isArray(C.children)&&C.children.push({type:"html_inline",content:``,raw:``}),R.pop();const q=d(C,j)?[]:c(j,u(p,z,"paragraph"));q.length?p.splice(z,1,...q):(p.splice(z,1),z--);continue}if($.type!=="inline")continue;const H=Array.isArray($.children)?$.children:[],V=Aie(H,N.tag);if(V!==-1){const A=H.slice(0,V+1),F=H.slice(V+1),j=A.map(q=>String(q?.content??q?.raw??"")).join("");if(C.content=`${String(C.content??"")} +`);const z=i.tokens[i.tokens.length-1];z&&(z.raw=R);const $=[];i.md.block.parse(R,i.md,i.env,$),hI($,n+1,n+1+b.length),i.tokens.push(...$)}const M=i.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[o,o]),i.line=v?x+1:x,!0},{alt:["paragraph","reference","blockquote","list"]})}function Kr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zo(e){let t=!1,n=!1;for(let o=0;o")return o}return-1}function Mp(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const xre=/^[a-z][a-z0-9_-]*$/;function Vb(e){return xre.test(String(e??"").trim().toLowerCase())}function xr(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return Vb(t)?t.toLowerCase():"";let n=1;for(;n]/.test(i)?"":Vb(s)?s:""}function T0(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=xr(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function Sre(...e){const t=new Set,n=[];for(const o of e)for(const s of T0(o))t.has(s)||(t.add(s),n.push(s));return n}function Cre(e){const t=T0(e);return{key:t.join(","),tags:t}}function mI(e){return xr(e)}function Mre(e,t){const n=String(e??""),o=xr(t);if(!o)return!1;const s=Kr(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function gI(e,t){const n=xr(t);return!!n&&!Td.has(n)&&!Mre(e,n)}function Are(e,t){const n=String(e??""),o=xr(t);if(!o)return n;const s=Kr(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const vI=i1,Ere=Td,wI=new Set(aI);wI.delete("details");const Tre=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,Ire=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,j8=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,Lre=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function u5(e){return(e.match(j8)?.[1]??"").toLowerCase()}function Kg(e){return/^\s*<\s*\//.test(e)}function Gg(e,t){return vI.has(t)||/\/\s*>\s*$/.test(e)}function $re(e,t){let n=0;for(let o=0;o0&&n--;continue}Gg(s,i)||n++}}return n}function Wb(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Kr(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function zre(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Kr(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function d5(e){const t=e;return String(t.raw??t.content??t.markup??"")}function Bre(e){const t=e;return t.meta||(t.meta={}),t.meta}function Lh(e,t,n){const o=Bre(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function Rre(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${Kr(p)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=p=>p?n.some(h=>h.test(p)):!1,r=p=>{if(!(!p||!o.length))for(const h of o)h.raw+=p,h.inner+=p},l=()=>{!o.length||!s||(r(` +`),s=!1)},a=p=>{r(p)},c=p=>{for(let m=0;m{const h=o[o.length-1]?.tag;if(!h)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Kr(h)}\s*>`,"i");return p.match(m)?.[0]??null},d=p=>!!u(p),f=(p,h,m)=>{const k=m??(p.type==="html_inline"?u5(h):"");if(!(k&&t.has(k))){r(h);return}const x=Kg(h),v=!x&&Gg(h,k);if(x){if(!o.length||o[o.length-1].tag!==k){r(h);return}c(h);return}if(r(h),v){Lh(p,h,"");return}o.push({tag:k,token:p,raw:h,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const h=String(p.content??"");if(d(h)?s=!1:l(),!o.length&&!i(h)){s=!1;continue}let m=0,k=!0;for(const x of p.children){const v=d5(x),w=x.type==="html_inline"?u5(v):"",b=w&&t.has(w);let M=v;if(k&&h&&v&&(o.length||b)){const R=h.indexOf(v,m);if(R!==-1)a(h.slice(m,R)),M=h.slice(R,R+v.length),m=R+v.length;else{if(o.length&&!b)continue;k=!1}}f(x,M,w)}k&&h&&m0;continue}if(o.length&&typeof p.content=="string"){const h=d5(p),m=p.type==="html_block"?u(h):null;if(m){c(`${s?` +`:""}${m}`),s=o.length>0;continue}if(!p.content)continue;l(),r(p.content),s=!0}}for(const p of o)Lh(p.token,p.raw,p.inner)}function Fre(e){return/^\s*<\s*[!?]/.test(e)}function jre(e){const t=new Set(Ere);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function qb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Ore(e,t){let n=null;for(const i of e.matchAll(Tre)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();qb(l,t)&&Zo(e.slice(r))===-1&&(!n||r")&&(!n||i")&&(!n||i{const p=f,h=new Set(n),m=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const w of m){const b=xr(String(w??""));b&&h.add(b)}const k=jre(Array.from(h)),x=new Set(Dre);for(const w of h)x.add(w);return{autoCloseInlineTagSet:x,commonHtmlTags:k,customTagSet:h,shouldMergeHtmlBlockTag:w=>h.has(w)||!k.has(w)||wI.has(w)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const p=f.children[0];return p?.type!=="html_block"?"":String(f.content??p.content??"")},i=(f,p)=>{f.type="html_block",f.content=p,f.raw=p,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,p)=>{const h=r(f);if(!/\S/.test(h))return[];if(l(h))return[{type:"code_block",content:a(h),raw:h}];const m=h.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const k={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},k,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:m,raw:m}]:[k]},u=(f,p,h)=>f[p-1]?.type==="paragraph_open"&&f[p+1]?.type==="paragraph_close"?"inline":h,d=(f,p)=>{const h=r(p);return!/\S/.test(h)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${h}`,f.children.push({type:"text",content:h,raw:h}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const p=f.tokens??[],{commonHtmlTags:h,customTagSet:m}=o(f);for(const k of p){const x=k;if(x.type!=="inline"||!Array.isArray(x.children))continue;const v=String(x.content??""),w=x.children.length?x.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(w)try{const b=Hre(w,h);if(x.children=b.children,b.pendingBuffer){const M=v.lastIndexOf(b.pendingBuffer);if(M!==-1){const R=v.slice(0,M);x.content=R,typeof x.raw=="string"&&(x.raw=R)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}Rre(p,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const p=f.tokens??[],{autoCloseInlineTagSet:h,customTagSet:m,shouldMergeHtmlBlockTag:k}=o(f),x=[];for(let v=0;v0){const[M,R]=x[x.length-1];if(v!==R){if(w.type==="paragraph_open"||w.type==="paragraph_close"){p.splice(v,1),v--;continue}const z=String(w.content??w.raw??"");if(z){const $=p[R],E=`${String($.content||"")} +${z}`,T=Zo(E),N=T===-1?null:Wb(E,M,T+1);if(N){const C=E.slice(0,N.end),O=E.slice(N.end);$.content=C,$.loading=!1,p.splice(v,1),x.pop();const H=d($,O)?[]:c(O,u(p,v,"paragraph"));H.length&&p.splice(v,0,...H),v--;continue}$.content=E,$.loading!==!1&&($.loading=!0)}p.splice(v,1),v--;continue}}const b=s(w);if(b){if(Fre(b))continue;const M=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),R=/^\s*<\s*\//.test(b);if(!M||!k(M))continue;if(i(w,b),!R)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(b)&&zre(b,M)>0&&x.push([M,v]);else if(x.length>0&&M&&x[x.length-1][0]===M){const[,z]=x[x.length-1],$=p[z];$.content=`${String($.content||"")} +${b}`,$.loading=!1,x.pop(),p.splice(v,1),v--}continue}else if(x.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){p.splice(v,1),v--;continue}const M=w.content||"",R=new RegExp(`<\\s*\\/\\s*${x[x.length-1][0]}\\s*>`,"i").test(M);if(M){const[,z]=x[x.length-1],$=p[z];$.content=`${$.content||""} +${M}`,$.loading!==!1&&($.loading=!R)}R&&x.pop(),p.splice(v,1),v--}else continue}if(m.size>0){const v=new Map,w=new Map,b=z=>{let $=v.get(z);return $||($=new RegExp(`<\\s*${z}\\b`,"i"),v.set(z,$)),$},M=z=>{let $=w.get(z);return $||($=new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i"),w.set(z,$)),$},R=[];for(let z=0;z0){const N=R[R.length-1],C=p[N.index],O=$.type==="html_block"?M(N.tag).exec(E):null;if(O){const A=O.index+O[0].length,F=E.slice(0,A),j=E.slice(A);C.content=`${String(C.content??"")} +${F}`,Array.isArray(C.children)&&C.children.push({type:"html_inline",content:``,raw:``}),R.pop();const q=d(C,j)?[]:c(j,u(p,z,"paragraph"));q.length?p.splice(z,1,...q):(p.splice(z,1),z--);continue}if($.type!=="inline")continue;const H=Array.isArray($.children)?$.children:[],V=$re(H,N.tag);if(V!==-1){const A=H.slice(0,V+1),F=H.slice(V+1),j=A.map(q=>String(q?.content??q?.raw??"")).join("");if(C.content=`${String(C.content??"")} ${j}`,Array.isArray(C.children)&&C.children.push(...A),F.length){const q=F.map(P=>String(P.content??P.raw??"")).join("");if(q.trim()){const P=q.replace(/^\s+/,"");if(d(C,q))p.splice(z,1),z--;else if(P.startsWith("<"))p.splice(z,1,{type:"html_block",content:P});else{const W=c(q,u(p,z,"paragraph"));p.splice(z,1,...W)}}else p.splice(z,1),z--}else p.splice(z,1),z--;R.pop();continue}C.content=`${String(C.content??"")} -${T}`,Array.isArray(C.children)&&C.children.push(...H),p.splice(z,1),z--;continue}if($.type!=="inline")continue;const E=Array.isArray($.children)?$.children:[];for(const N of m)if((E.length?Tie(E,N):b(N).test(T)&&!M(N).test(T)?1:0)>0){R.push({tag:N,index:z});break}}}{let w=0;for(let v=0;v0?w--:(p.splice(v,1),v--))}}for(let w=0;w/]+)/)?.[1]??"").toLowerCase();if($.startsWith("!")||$.startsWith("?")){v.loading=!1;continue}if(m.has($)){const V=String(v.content??""),A=Zo(V),F=A===-1?null:Vb(V,$,A+1);v.loading=F?!1:v.loading!==void 0?v.loading:!0;const j=F?.start??-1,q=F?F.end-F.start:0;if(j!==-1){const P=V.slice(0,j+q);let W="";A!==-1&&A]+)))?/g;let E;for(;(E=T.exec(v.content||""))!==null;)E[1],E[2]||E[3]||E[4];const N=String(v.content??""),C=new RegExp(`<\\/\\s*${$}\\s*>`,"i").exec(N),O=C?C.index:-1,H=C?C[0].length:0;if(O!==-1){const V=N.slice(0,O+H),A=(N.slice(O+H)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:V,tag:$,loading:!1}],v.content=V,v.raw=V,A&&p.splice(w+1,0,A.startsWith("<")?{type:"html_block",content:A}:{type:"text",content:A,raw:A})}else v.children=[{type:"html_block",content:v.content,tag:$,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const $=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),T=v.children[1],E=String(T?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(T?.type==="html_inline"&&E===$)continue;h.has($)?(v.children[0].loading=!0,v.children[0].tag=$,v.children.push({type:"html_inline",tag:$,loading:!0,content:``})):v.children=[{type:"html_block",loading:!0,tag:$,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const $=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has($))continue;v.children=[{type:"html_block",loading:!1,tag:$,content:v.children.map(T=>T.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const b=String(v.content),M=v,R=M.children[0];if(R?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(M.children.length=0);continue}const z=String(R.content??b).match(Mie)?.[1]?.toLowerCase()??"";if(z){if(/\/\s*>\s*$/.test(b)||hI.has(z)){M.children=[{type:"html_inline",content:b}];continue}M.children.length=0}}})}function Oie(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Pie(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;sa.trim().length>0);if(l.length===1&&!Oie(l[0]??"")){const a=l[0]??"",c=r.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const gI=/\.([a-z0-9]{1,15})$/i,Hie=/[_()[\]{}<>]/u,Die=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Vie=/[?#@]/u,Wie=/[\\/]/u,qie=/^[\p{L}\p{N}./\\-]+$/u,Uie=/^[A-Za-z0-9-]{1,63}$/u,Zie=/^xn--[a-z0-9-]{2,59}$/i,Kie=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Gie=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Yie=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Xie=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Jie=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Qie=2e3,ele=512,tle={},nle=new Set(["ai","md","py","rs","sh","zip"]),vI=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ole=new Set([...vI,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),sle=new Set(["com","dev","io","page","site"]),rle=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),ile=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),o0=new Map;function qb(e,t){if(!e||e.length>ele)return t;for(o0.set(e,t);o0.size>Qie;){const n=o0.keys().next().value;if(!n)break;o0.delete(n)}return t}function Ed(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Lh(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Ed(n)?n:void 0}function Ub(e,t){if(!Ed(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function Zb(e){const t=Qd(e);return Ed(t)?t:void 0}function lle(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Kb(e,t){if(!Ed(t))return;const n=String(e??"").trim().split(/\s+/u).map(lle).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>d5(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>d5(s,{marketTicker:!0}))&&(o.marketTicker=!0),Ed(o)?o:void 0}function h1(e,t=!1){let n;return{options(o){return t||o==null?Ub(e,n):Ub(e,Lh(Zb(o),Kb(o,n)))},remember(o){const s=Zb(o);n=t?Lh(n,s):Lh(s,Kb(o,n))},reset(){n=void 0}}}function Gb(e){return Uie.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function ale(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Gb(n)||Zie.test(n)?t.every(Gb):!1}function wI(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function cle(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function ule(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function yI(e,t,n){const o=cle(t);return wI(e)&&ule(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function dle(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Qd(e){const t=String(e??""),n=o0.get(t);return n?(o0.delete(t),o0.set(t,n),n):dle(t)?qb(t,{explicitFilename:Yie.test(t),filename:Xie.test(t),marketTicker:Jie.test(t)}):qb(t,tle)}function fle(e){return ale(e.split(/[\\/]/)[0]??"")}function ple(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function hle(e){if(Hie.test(e)||!qie.test(e))return!0;if(Wie.test(e))return!fle(e);const t=e.replace(gI,"");return wI(t)?!0:t.split(".").filter(Boolean).some(ple)}function mle(e,t,n){if(!(n?ole:vI).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?Gie:Kie).test(o)}function d5(e,t={}){if(!e||Die.test(e)||Vie.test(e))return!1;const n=e.match(gI);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return mle(e,o,t.marketTicker===!0)?!0:ile.has(o)?!nle.has(o)||t.filename?!0:hle(e):!!(t.explicitFilename&&sle.has(o)||t.filename&&rle.has(o))}const Yb=["!"];function Sr(e){return{type:"text",content:e,raw:e}}function F1(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function j1(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Ca(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function gle(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Sr(t))}}function Xb(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||sn?.[0]==="href")?.[1];return typeof t=="string"?t:""}function wle(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function Jb(e,t,n){let o="";for(let s=t+1;s{const n=t.tokens??[];for(let o=0;oi.type==="code_inline"),o=new Map;let s=0;for(let i=0;i0&&c?Qb(c):-1;if(u!==-1&&c)for(const d of c.slice(u))d==="("?s++:d===")"&&s>0&&s--}a!==-1&&(i=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?s++:a===")"&&s>0&&s--}const r=Qd(t);for(let i=0;i<=e.length-1;i++){i<0&&(i=0);const l=e[i];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let c=i+1;c0){const h=Qb(c);h!==-1&&(d===-1||h=m.content.length){p-=m.content.length;continue}if(p<0)break;const k=m.content[p],x=m.content.slice(0,p);let w=m.content.slice(p);for(let M=h+1;M0&&(e.splice(h+1,v),a=h+1);let b=u;if(k==="!"&&f!==-1)b=u.slice(0,f);else if(w){const M=encodeURI(w);if(M&&u.endsWith(M))b=u.slice(0,u.length-M.length);else{const R=k?encodeURI(k):"",z=R?u.indexOf(R):-1;z!==-1&&(b=u.slice(0,z))}}b!==u&&wle(l,b),w&&e.splice(a+1,0,Sr(w));break}}}if(!n){if(l?.type==="em_open"&&e[i-1]?.type==="text"&&e[i-1].content?.endsWith("*")){const a=e[i-1].content?.replace(/(\*+)$/,"")||"";e[i-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let c=i+1;cd[0]==="href")?.[1]||"";if(e[i+3]?.type==="text"){const d=(e[i+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(u+=e[i+3]?.content?.slice(0,d)||"",e[i+3].content=""),a.push(Ca(c,u,f));const p=e[i+3].content?.replace(/^\)\**/,"");p&&a.push(Sr(p)),e.splice(i-4,8,...a)}else a.push({type:"link",loading:!0,href:u,title:"",text:c,children:[{type:"text",content:u,raw:u}],raw:`[${c}](${u})`}),e.splice(i-4,7,...a);continue}else if(e[i-1].content==="]("&&e[i-3]?.type==="text"&&e[i-3].content?.endsWith(")"))if(e[i-2]?.type==="strong_open"){const[a,c]=e[i-3].content?.split("[**")||[];e[i+1].content=c||"",e[i-3].content=a||"",e[i-1].content=""}else if(e[i-2]?.type==="em_open"){const[a,c]=e[i-3].content?.split("[*")||[];e[i+1].content=c||"",e[i-3].content=a||"",e[i-1].content=""}else{const[a,c]=e[i-3].content?.split("[")||[];e[i+1].content=c||"",e[i-3].content=a||"",e[i-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[i-2]?.type==="link_open"&&e[i+1]?.type==="text"&&e[i-1]?.type==="text"){const a=e[i-1].content||"",c=e[i-2].attrs||[],u=c.find(x=>x[0]==="href")?.[1]||"",d=c.find(x=>x[0]==="title")?.[1]||"";let f=3,p=2;const h=(e[i-3]?.content||"").match(/^(\*+)$/),m=[];if(h){p+=1;const x=h[1].length;F1(m,x)}if(l.markup!=="linkify"&&e[i+1].type==="text"&&e[i+1]?.content?.startsWith("](")){f+=1;for(let x=i+1;xk[0]==="href")?.[1];e[i+5]?.type==="text"&&e[i+5].content==="."?(f=(m||f)+e[i+5].content,e[i+5].content=""):f=m||f,p+=3}let h=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[i+2]?.type==="text"){const m=(e[i+2]?.content??"").indexOf(")");h=m===-1,m===-1&&(f+=e[i+2]?.content?.slice(0,m)||"",e[i+2].content="")}a.push(Ca(d,f,h)),j1(a,2),e.splice(i-2,p,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[i+1]?.type==="strong_open"&&e[i+2]?.type==="text"&&e[i+2].content==="]("&&e[i+3]?.type==="link_open"&&e[i+5]?.type==="link_close"&&e[i+6]?.type==="text"&&e[i+6].content===")"&&e[i+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const c=(a[2]||"")+a[1];let u=e[i+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!u&&e[i+4]?.type==="text"&&(u=e[i+4].content||"");const d=[];F1(d,2),d.push(Ca(c,u,!1)),j1(d,2),e.splice(i,9,...d),i-=d.length-1;continue}}}}if(n)return e;for(let i=0;i{const n=t.tokens??[];for(let o=0;o{const n=t.tokens??[];for(let o=0;o=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let k=u+1;for(;k=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let k=u+1;for(;k{const n=t;try{const o=Nle(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function e_(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function t_(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function n_(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function kI(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function $h(e){return kI(e)!==null}function bI(e){return/^:?-+:?$/.test(e.trim())}function Tle(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(bI)}function Ele(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ile(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(bI)&&Ele(n)}function Lle(e){return e==="|"||e==="|:"}function $le(e){const t=kI(e);return t!==null&&t.every(n=>!n.includes(":"))}function Nle(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,r=e[s];if(r.type==="inline"){const i=String(r.content??""),l=i.split(` -`)[0]??"",[a="",c="",...u]=i.split(` -`),d=!t&&!i.includes(` -`)&&/\r?\n$/.test(n)&&$h(i);if(!t&&(i.includes(` -`)&&u.length===0&&$h(a)&&Ile(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>n_(h)),p=[...e_(),...f,...t_()];o.splice(s-1,3,...p)}else if(i.includes(` -`)&&u.length===0&&$h(a)&&Tle(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>n_(h)),p=[...e_(),...f,...t_()];o.splice(s-1,3,...p)}else i.includes(` -`)&&u.length===0&&$le(a)&&Lle(c)&&(r.content=i.slice(0,-2),r.children.splice(2,1))}return o}function zle(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const r=n[n.length-1],i=o;let l=0,a=t;for(;a=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=i.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===r?l++:c===i[i.length-1]&&l>0&&l--,a++}return-1}var Ble=zle;const Rle=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],f5=Rle.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Fle=/\\[a-z]+/i,_I="(?:\\\\|\\u0008)",jle=new RegExp(String.raw`${_I}(?:${f5})\s*\{[^}]+\}`,"i"),Ole=new RegExp(String.raw`(?:${_I})?(?:${f5})\s*\{`,"i"),Ple=/\\(?:text|frac|left|right|times)/,Hle=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,Dle=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,Vle=/[A-Z]+\s*\([^)]+\)/i,Wle=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,qle=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Ule=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Zle={"\b":"\\b","\v":"\\v","\f":"\\f"};function Kle(e){let t="";for(const n of e)t+=Zle[n]??n;return t}function Oa(e){if(!e)return!1;const t=Kle(e),n=t.trim();if(Ule.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=Fle.test(t),s=jle.test(t),r=Ole.test(t),i=Ple.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=Hle.test(t)&&!Dle.test(t),c=Vle.test(t),u=Wle.test(n),d=qle.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||r||i||l||a||c||u||d||f||p}const xI="__markstreamMathPluginApplied",j8=80,SI=2e4,o_=SI+4096;function Gg(e){return!!e[xI]}function Gle(e){e[xI]=!0}const CI=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],Yle=["cdot","mathbf{","partial","mu_{"],MI=CI.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),AI="[ \r\b\f\v]",Xle=new RegExp(`([^\\\\])(${Yle.map(e=>e).join("|")})+`,"g"),Jle=/span\{([^}]+)\}/,Qle=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,eae=/(^|[^\\])\\\r?\n/g,tae=/(^|[^\\])\\$/g,nae=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,oae=new RegExp(`(${AI})|(${MI})\\b`,"g"),s_=new Map,r_=new Map;function sae(e){if(!e)return oae;const t=[...e];t.sort((i,l)=>l.length-i.length);const n=t.join(""),o=s_.get(n);if(o)return o;const s=`(?:${t.map(i=>i.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,r=new RegExp(`(${AI})|(${s})\\b`,"g");return s_.set(n,r),r}function rae(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=r_.get(o);if(s)return s;const r=e?[f5,MI].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),f5].filter(Boolean).join("|"),i=new RegExp(`(^|[^\\\\\\w])(${r})\\s*\\{`,"g");return r_.set(o,i),i}const i_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function l_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function iae(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&nae.test(n))return t;const o=n?t.slice(n.length):t;return`${n}${"\\!".repeat(o.length)}`})}function a_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function Ma(e,t){const n=t?.commands??CI,o=t?.escapeExclamation??!0,s=t?.commands==null,r=sae(s?void 0:n);let i=e.replace(r,(c,u,d,f,p)=>{if(u!==void 0&&i_[u]!==void 0)return`\\${i_[u]}`;if(d&&n.includes(d)){const h=p&&typeof f=="number"?p[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});o&&(i=iae(i));let l=i;const a=rae(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(Jle,"span\\{$1\\}").replace(Qle,"\\operatorname{span}\\{$1\\}"),l=l.replace(eae,`$1\\\\ -`),l=l.replace(tae,"$1\\\\"),l=l.replace(Xle,"$1\\$2"),l}function c_(e){const t=e.trim();return!(!Oa(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function TI(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[r]==="\\"&&r+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)o++,n--;return o%2===1}function O8(e,t){let n=t;for(;n0&&e[o-1]==="$"||o+1=l)break;const c=p5(s,a);if(c){i=Math.max(a+Math.max(1,t.length),c[1]);continue}ef(e,a)||r++,i=a+Math.max(1,t.length)}return r}function Yg(e,t,n){const o=Ld(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Ld(o.slice(0,s)).trim()||ef(o,s))return-1;const r=TI(o);if(p5(r,s))return-1;const i=u_(o,t,0,s,r);if(t==="$$"){if(i%2===1)return-1}else if(i>u_(o,n,0,s,r))return-1;return s}function Id(e){return e===" "||e===" "}function Ld(e){let t=e.length;for(;t>0&&Id(e[t-1]);)t--;return e.slice(0,t)}function d_(e){let t=0;for(let n=0;n=48&&t<=57}function aae(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o=3}function cae(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function uae(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(cae)}function dae(e){let t=0;if(!f_(e[t]))return!1;for(;f_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Id(e[t+1])}function EI(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Id(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Id(t[1])||dae(t)||aae(t)||uae(t))}function p_(e,t){return e?t?`${e} -${t}`:e:t}function P8(e){const t=String(e??"").trim();return t?Oa(t):!1}function h_(e){let t=0;for(let n=0;nj8){p=!0;break}const m=s[h],k=mc(m,u);if(k!==-1){const x=p_(f,m.slice(0,k));if(!P8(x)){p=!0;break}const w=m.slice(k+u.length),v=w.trim()?`suffix:${h_(w)}`:"nosuffix";return["closed",c,o+l,d,o+h,k,h_(x),v].join(":")}if(EI(m)){p=!0;break}if(f=p_(f,m),f.length>SI){p=!0;break}}if(!p&&P8(f))return["pending",c,o+l,d].join(":")}}return null}function zh(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function pae(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function Bh(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function hae(e,t){Gle(e);const n=(i,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=i.push("paragraph_open","p",1);u.map=[a,a+1];const d=i.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],i.push("paragraph_close","p",-1)},o=(i,l)=>{const a=i,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(w,v)=>{let b=v;for(;b=3&&(!b||/\s/.test(b))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,w),a.pos=w,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let m=h,k=h;const x=h;for(const[w,v]of f){const b=a.src,M=TI(b),R=lae(b,u);let z=!1;w==="$$"&&m!==x&&(m=x);let $=-1,T=-1,E=0;const N=C=>{if((C==="undefined"||C==null)&&(C=""),C==="\\"){a.pos=a.pos+C.length,m=a.pos;return}if(C==="\\)"||C==="\\("){const V=a.push("text_special","",0);V.content=C==="\\)"?")":"(",V.markup=C,a.pos=a.pos+C.length,m=a.pos;return}if(!C)return;if(w==="$$"&&C.includes("$")){let V=0;for(;V0&&C[A-1]==="$"||A+10){const F=C.slice(0,O),j=a.push("text","",0);j.content=F,a.pos=a.pos+F.length,m=a.pos}const V=C.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(V){const[,F,j]=V,q=j.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),P=q?q[1]:j,W=q&&q[2]?q[2]:null,G=a.push("image","img",0);G.attrs=[["src",P],["alt",F]],W&&G.attrs.push(["title",W]),G.content=F,G.children=[{type:"text",content:F,tag:""}],a.pos=a.pos+V[0].length,m=a.pos;const ee=C.slice(O+V[0].length);ee&&N(ee);return}const A=a.push("text","",0);A.content=C,a.pos=a.pos+C.length,m=a.pos;return}const H=a.push("text","",0);H.content=C,a.pos=a.pos+C.length,m=a.pos};for(;!(m>=b.length);){const C=b.indexOf(w,m);if(C===-1)break;if(ef(b,C)){m=C+Math.max(1,w.length);continue}const O=p5(M,C);if(O){m=O[1];continue}const H=p5(R,C);if(H){m=H[1];continue}if(C===$&&m===T){if(E++,E>2){m=C+Math.max(1,w.length);continue}}else E=0,$=C,T=m;if(w==="("&&C>0){let ee=C-1;for(;ee>=0&&b[ee]===" ";)ee--;if(ee>=0&&b[ee]==="]"){m=C+w.length;continue}}if(w==="$"&&C>0&&b[C-1]==="$"){m=C+1;continue}if(w==="$"&&C=b.length);){const O=O8(b,C);if(O===-1)break;if(O+10&&b[O-1]==="$"){C=O+1;continue}const H=Nh(b,O+1);if(H===-1)break;const V=b.slice(O+1,H),A=V.includes("`"),F=!V||!V.trim(),j=b[H+1],q=zh(V,j),P=Bh(V);if(!A&&!F&&!q&&!P){const W=b.slice(m,O);W&&N(W);const G=a.push("math_inline","math",0);G.content=Ma(V,t),G.markup="$",G.raw=`$${V}$`,G.loading=!1,m=H+1,C=H+1}else N("$"),C=O+1}C{const u=i,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,p=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),k=!1,x="",w="",v=!1,b="",M=!1;for(const[W,G]of p)if(m.startsWith(W))if(W.includes("[")){const ee=W==="\\["?m.slice(W.length):"";if(W==="\\["&&mc(ee,G)===-1&&!/^\s*!\[/.test(ee)&&!ee.includes("`")&&Oa(ee)){k=!0,x=W,w=G;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1=0?"\\]":w,E=$>=0?$:mc(m,w,z);if(!v&&E>x.length){const W=m.slice(R+x.length,E),G=u.push("math_block","math",0);G.content=Ma(W),G.markup=x==="$$"?"$$":x==="["?"[]":"\\[\\]",G.map=[l,l+1],G.raw=`${x}${W}${T}`,G.block=!0,G.loading=!1,u.line=l+1;const ee=m.slice(E+T.length);return ee.trim()&&n(u,ee,l),!0}let N=l,C="",O=!1,H="",V=l;const A=v?m:m===x?"":m.slice(x.length),F=!f&&x==="\\["?"]":"",j=mc(A,w);if(j!==-1){const W=j;C=A.slice(0,W),H=A.slice(W+w.length),V=v?l+1:l,O=!0,N=V}else for(A&&!v&&(C=A),N=l+1;N0){R.push({tag:N,index:z});break}}}{let v=0;for(let w=0;w0?v--:(p.splice(w,1),w--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if($.startsWith("!")||$.startsWith("?")){w.loading=!1;continue}if(m.has($)){const V=String(w.content??""),A=Zo(V),F=A===-1?null:Wb(V,$,A+1);w.loading=F?!1:w.loading!==void 0?w.loading:!0;const j=F?.start??-1,q=F?F.end-F.start:0;if(j!==-1){const P=V.slice(0,j+q);let W="";A!==-1&&A]+)))?/g;let T;for(;(T=E.exec(w.content||""))!==null;)T[1],T[2]||T[3]||T[4];const N=String(w.content??""),C=new RegExp(`<\\/\\s*${$}\\s*>`,"i").exec(N),O=C?C.index:-1,H=C?C[0].length:0;if(O!==-1){const V=N.slice(0,O+H),A=(N.slice(O+H)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:V,tag:$,loading:!1}],w.content=V,w.raw=V,A&&p.splice(v+1,0,A.startsWith("<")?{type:"html_block",content:A}:{type:"text",content:A,raw:A})}else w.children=[{type:"html_block",content:w.content,tag:$,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const $=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=w.children[1],T=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&T===$)continue;h.has($)?(w.children[0].loading=!0,w.children[0].tag=$,w.children.push({type:"html_inline",tag:$,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:$,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const $=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(h.has($))continue;w.children=[{type:"html_block",loading:!1,tag:$,content:w.children.map(E=>E.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const b=String(w.content),M=w,R=M.children[0];if(R?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(M.children.length=0);continue}const z=String(R.content??b).match(Lre)?.[1]?.toLowerCase()??"";if(z){if(/\/\s*>\s*$/.test(b)||vI.has(z)){M.children=[{type:"html_inline",content:b}];continue}M.children.length=0}}})}function Wre(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function qre(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;sa.trim().length>0);if(l.length===1&&!Wre(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const yI=/\.([a-z0-9]{1,15})$/i,Ure=/[_()[\]{}<>]/u,Zre=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Kre=/[?#@]/u,Gre=/[\\/]/u,Yre=/^[\p{L}\p{N}./\\-]+$/u,Xre=/^[A-Za-z0-9-]{1,63}$/u,Jre=/^xn--[a-z0-9-]{2,59}$/i,Qre=/^(?:[A-Z]{1,6}|\d{1,8})$/u,ele=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,tle=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,nle=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,ole=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,sle=2e3,ile=512,rle={},lle=new Set(["ai","md","py","rs","sh","zip"]),kI=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),ale=new Set([...kI,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),cle=new Set(["com","dev","io","page","site"]),ule=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),dle=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),o0=new Map;function Ub(e,t){if(!e||e.length>ile)return t;for(o0.set(e,t);o0.size>sle;){const n=o0.keys().next().value;if(!n)break;o0.delete(n)}return t}function Id(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function $h(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Id(n)?n:void 0}function Zb(e,t){if(!Id(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function Kb(e){const t=ef(e);return Id(t)?t:void 0}function fle(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Gb(e,t){if(!Id(t))return;const n=String(e??"").trim().split(/\s+/u).map(fle).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>f5(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>f5(s,{marketTicker:!0}))&&(o.marketTicker=!0),Id(o)?o:void 0}function h1(e,t=!1){let n;return{options(o){return t||o==null?Zb(e,n):Zb(e,$h(Kb(o),Gb(o,n)))},remember(o){const s=Kb(o);n=t?$h(n,s):$h(s,Gb(o,n))},reset(){n=void 0}}}function Yb(e){return Xre.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function ple(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Yb(n)||Jre.test(n)?t.every(Yb):!1}function bI(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function hle(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function mle(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function _I(e,t,n){const o=hle(t);return bI(e)&&mle(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function gle(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function ef(e){const t=String(e??""),n=o0.get(t);return n?(o0.delete(t),o0.set(t,n),n):gle(t)?Ub(t,{explicitFilename:tle.test(t),filename:nle.test(t),marketTicker:ole.test(t)}):Ub(t,rle)}function vle(e){return ple(e.split(/[\\/]/)[0]??"")}function wle(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function yle(e){if(Ure.test(e)||!Yre.test(e))return!0;if(Gre.test(e))return!vle(e);const t=e.replace(yI,"");return bI(t)?!0:t.split(".").filter(Boolean).some(wle)}function kle(e,t,n){if(!(n?ale:kI).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?ele:Qre).test(o)}function f5(e,t={}){if(!e||Zre.test(e)||Kre.test(e))return!1;const n=e.match(yI);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return kle(e,o,t.marketTicker===!0)?!0:dle.has(o)?!lle.has(o)||t.filename?!0:yle(e):!!(t.explicitFilename&&cle.has(o)||t.filename&&ule.has(o))}const Xb=["!"];function Si(e){return{type:"text",content:e,raw:e}}function F1(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function j1(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Ca(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function ble(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Si(t))}}function Jb(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||sn?.[0]==="href")?.[1];return typeof t=="string"?t:""}function xle(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function Qb(e,t,n){let o="";for(let s=t+1;s{const n=t.tokens??[];for(let o=0;or.type==="code_inline"),o=new Map;let s=0;for(let r=0;r0&&c?e_(c):-1;if(u!==-1&&c)for(const d of c.slice(u))d==="("?s++:d===")"&&s>0&&s--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?s++:a===")"&&s>0&&s--}const i=ef(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let c=r+1;c0){const h=e_(c);h!==-1&&(d===-1||h=m.content.length){p-=m.content.length;continue}if(p<0)break;const k=m.content[p],x=m.content.slice(0,p);let v=m.content.slice(p);for(let M=h+1;M0&&(e.splice(h+1,w),a=h+1);let b=u;if(k==="!"&&f!==-1)b=u.slice(0,f);else if(v){const M=encodeURI(v);if(M&&u.endsWith(M))b=u.slice(0,u.length-M.length);else{const R=k?encodeURI(k):"",z=R?u.indexOf(R):-1;z!==-1&&(b=u.slice(0,z))}}b!==u&&xle(l,b),v&&e.splice(a+1,0,Si(v));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let c=r+1;cd[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(u+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Ca(c,u,f));const p=e[r+3].content?.replace(/^\)\**/,"");p&&a.push(Si(p)),e.splice(r-4,8,...a)}else a.push({type:"link",loading:!0,href:u,title:"",text:c,children:[{type:"text",content:u,raw:u}],raw:`[${c}](${u})`}),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,c]=e[r-3].content?.split("[**")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,c]=e[r-3].content?.split("[*")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,c]=e[r-3].content?.split("[")||[];e[r+1].content=c||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",c=e[r-2].attrs||[],u=c.find(x=>x[0]==="href")?.[1]||"",d=c.find(x=>x[0]==="title")?.[1]||"";let f=3,p=2;const h=(e[r-3]?.content||"").match(/^(\*+)$/),m=[];if(h){p+=1;const x=h[1].length;F1(m,x)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let x=r+1;xk[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(m||f)+e[r+5].content,e[r+5].content=""):f=m||f,p+=3}let h=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const m=(e[r+2]?.content??"").indexOf(")");h=m===-1,m===-1&&(f+=e[r+2]?.content?.slice(0,m)||"",e[r+2].content="")}a.push(Ca(d,f,h)),j1(a,2),e.splice(r-2,p,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const c=(a[2]||"")+a[1];let u=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!u&&e[r+4]?.type==="text"&&(u=e[r+4].content||"");const d=[];F1(d,2),d.push(Ca(c,u,!1)),j1(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let o=0;o{const n=t.tokens??[];for(let o=0;o=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let k=u+1;for(;k=0&&e[h].type==="text"&&e[h].content==="";)h--;const m=e[h];let k=u+1;for(;k{const n=t;try{const o=jle(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function t_(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function n_(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function o_(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function xI(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Nh(e){return xI(e)!==null}function SI(e){return/^:?-+:?$/.test(e.trim())}function Nle(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(SI)}function zle(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ble(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(SI)&&zle(n)}function Rle(e){return e==="|"||e==="|:"}function Fle(e){const t=xI(e);return t!==null&&t.every(n=>!n.includes(":"))}function jle(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(` +`)[0]??"",[a="",c="",...u]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&Nh(r);if(!t&&(r.includes(` +`)&&u.length===0&&Nh(a)&&Ble(c)||d)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>o_(h)),p=[...t_(),...f,...n_()];o.splice(s-1,3,...p)}else if(r.includes(` +`)&&u.length===0&&Nh(a)&&Nle(c)){const f=l.slice(1,-1).split("|").map(h=>h.trim()).flatMap(h=>o_(h)),p=[...t_(),...f,...n_()];o.splice(s-1,3,...p)}else r.includes(` +`)&&u.length===0&&Fle(a)&&Rle(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function Ole(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var Ple=Ole;const Hle=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],p5=Hle.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Dle=/\\[a-z]+/i,CI="(?:\\\\|\\u0008)",Vle=new RegExp(String.raw`${CI}(?:${p5})\s*\{[^}]+\}`,"i"),Wle=new RegExp(String.raw`(?:${CI})?(?:${p5})\s*\{`,"i"),qle=/\\(?:text|frac|left|right|times)/,Ule=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,Zle=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,Kle=/[A-Z]+\s*\([^)]+\)/i,Gle=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Yle=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Xle=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Jle={"\b":"\\b","\v":"\\v","\f":"\\f"};function Qle(e){let t="";for(const n of e)t+=Jle[n]??n;return t}function Oa(e){if(!e)return!1;const t=Qle(e),n=t.trim();if(Xle.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=Dle.test(t),s=Vle.test(t),i=Wle.test(t),r=qle.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=Ule.test(t)&&!Zle.test(t),c=Kle.test(t),u=Gle.test(n),d=Yle.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||p}const MI="__markstreamMathPluginApplied",O8=80,AI=2e4,s_=AI+4096;function Yg(e){return!!e[MI]}function eae(e){e[MI]=!0}const EI=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],tae=["cdot","mathbf{","partial","mu_{"],TI=EI.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),II="[ \r\b\f\v]",nae=new RegExp(`([^\\\\])(${tae.map(e=>e).join("|")})+`,"g"),oae=/span\{([^}]+)\}/,sae=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,iae=/(^|[^\\])\\\r?\n/g,rae=/(^|[^\\])\\$/g,lae=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,aae=new RegExp(`(${II})|(${TI})\\b`,"g"),i_=new Map,r_=new Map;function cae(e){if(!e)return aae;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=i_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${II})|(${s})\\b`,"g");return i_.set(n,i),i}function uae(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=r_.get(o);if(s)return s;const i=e?[p5,TI].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),p5].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return r_.set(o,r),r}const l_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function a_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function dae(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&lae.test(n))return t;const o=n?t.slice(n.length):t;return`${n}${"\\!".repeat(o.length)}`})}function c_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function Ma(e,t){const n=t?.commands??EI,o=t?.escapeExclamation??!0,s=t?.commands==null,i=cae(s?void 0:n);let r=e.replace(i,(c,u,d,f,p)=>{if(u!==void 0&&l_[u]!==void 0)return`\\${l_[u]}`;if(d&&n.includes(d)){const h=p&&typeof f=="number"?p[f-1]:void 0;return h==="\\"||h&&/\w/.test(h)?c:`\\${d}`}return c});o&&(r=dae(r));let l=r;const a=uae(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(oae,"span\\{$1\\}").replace(sae,"\\operatorname{span}\\{$1\\}"),l=l.replace(iae,`$1\\\\ +`),l=l.replace(rae,"$1\\\\"),l=l.replace(nae,"$1\\$2"),l}function u_(e){const t=e.trim();return!(!Oa(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function LI(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[i]==="\\"&&i+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)o++,n--;return o%2===1}function P8(e,t){let n=t;for(;n0&&e[o-1]==="$"||o+1=l)break;const c=h5(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}tf(e,a)||i++,r=a+Math.max(1,t.length)}return i}function Xg(e,t,n){const o=$d(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!$d(o.slice(0,s)).trim()||tf(o,s))return-1;const i=LI(o);if(h5(i,s))return-1;const r=d_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>d_(o,n,0,s,i))return-1;return s}function Ld(e){return e===" "||e===" "}function $d(e){let t=e.length;for(;t>0&&Ld(e[t-1]);)t--;return e.slice(0,t)}function f_(e){let t=0;for(let n=0;n=48&&t<=57}function pae(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o=3}function hae(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function mae(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(hae)}function gae(e){let t=0;if(!p_(e[t]))return!1;for(;p_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Ld(e[t+1])}function $I(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Ld(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Ld(t[1])||gae(t)||pae(t)||mae(t))}function h_(e,t){return e?t?`${e} +${t}`:e:t}function H8(e){const t=String(e??"").trim();return t?Oa(t):!1}function m_(e){let t=0;for(let n=0;nO8){p=!0;break}const m=s[h],k=gc(m,u);if(k!==-1){const x=h_(f,m.slice(0,k));if(!H8(x)){p=!0;break}const v=m.slice(k+u.length),w=v.trim()?`suffix:${m_(v)}`:"nosuffix";return["closed",c,o+l,d,o+h,k,m_(x),w].join(":")}if($I(m)){p=!0;break}if(f=h_(f,m),f.length>AI){p=!0;break}}if(!p&&H8(f))return["pending",c,o+l,d].join(":")}}return null}function Bh(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function wae(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function Rh(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function yae(e,t){eae(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(v,w)=>{let b=w;for(;b=3&&(!b||/\s/.test(b))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,v),a.pos=v,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),h=Math.max(0,a.pos-p.length);let m=h,k=h;const x=h;for(const[v,w]of f){const b=a.src,M=LI(b),R=fae(b,u);let z=!1;v==="$$"&&m!==x&&(m=x);let $=-1,E=-1,T=0;const N=C=>{if((C==="undefined"||C==null)&&(C=""),C==="\\"){a.pos=a.pos+C.length,m=a.pos;return}if(C==="\\)"||C==="\\("){const V=a.push("text_special","",0);V.content=C==="\\)"?")":"(",V.markup=C,a.pos=a.pos+C.length,m=a.pos;return}if(!C)return;if(v==="$$"&&C.includes("$")){let V=0;for(;V0&&C[A-1]==="$"||A+10){const F=C.slice(0,O),j=a.push("text","",0);j.content=F,a.pos=a.pos+F.length,m=a.pos}const V=C.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(V){const[,F,j]=V,q=j.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),P=q?q[1]:j,W=q&&q[2]?q[2]:null,G=a.push("image","img",0);G.attrs=[["src",P],["alt",F]],W&&G.attrs.push(["title",W]),G.content=F,G.children=[{type:"text",content:F,tag:""}],a.pos=a.pos+V[0].length,m=a.pos;const ee=C.slice(O+V[0].length);ee&&N(ee);return}const A=a.push("text","",0);A.content=C,a.pos=a.pos+C.length,m=a.pos;return}const H=a.push("text","",0);H.content=C,a.pos=a.pos+C.length,m=a.pos};for(;!(m>=b.length);){const C=b.indexOf(v,m);if(C===-1)break;if(tf(b,C)){m=C+Math.max(1,v.length);continue}const O=h5(M,C);if(O){m=O[1];continue}const H=h5(R,C);if(H){m=H[1];continue}if(C===$&&m===E){if(T++,T>2){m=C+Math.max(1,v.length);continue}}else T=0,$=C,E=m;if(v==="("&&C>0){let ee=C-1;for(;ee>=0&&b[ee]===" ";)ee--;if(ee>=0&&b[ee]==="]"){m=C+v.length;continue}}if(v==="$"&&C>0&&b[C-1]==="$"){m=C+1;continue}if(v==="$"&&C=b.length);){const O=P8(b,C);if(O===-1)break;if(O+10&&b[O-1]==="$"){C=O+1;continue}const H=zh(b,O+1);if(H===-1)break;const V=b.slice(O+1,H),A=V.includes("`"),F=!V||!V.trim(),j=b[H+1],q=Bh(V,j),P=Rh(V);if(!A&&!F&&!q&&!P){const W=b.slice(m,O);W&&N(W);const G=a.push("math_inline","math",0);G.content=Ma(V,t),G.markup="$",G.raw=`$${V}$`,G.loading=!1,m=H+1,C=H+1}else N("$"),C=O+1}C{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,p=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],h=u.bMarks[l]+u.tShift[l];let m=u.src.slice(h,u.eMarks[l]).trim(),k=!1,x="",v="",w=!1,b="",M=!1;for(const[W,G]of p)if(m.startsWith(W))if(W.includes("[")){const ee=W==="\\["?m.slice(W.length):"";if(W==="\\["&&gc(ee,G)===-1&&!/^\s*!\[/.test(ee)&&!ee.includes("`")&&Oa(ee)){k=!0,x=W,v=G;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1=0?"\\]":v,T=$>=0?$:gc(m,v,z);if(!w&&T>x.length){const W=m.slice(R+x.length,T),G=u.push("math_block","math",0);G.content=Ma(W),G.markup=x==="$$"?"$$":x==="["?"[]":"\\[\\]",G.map=[l,l+1],G.raw=`${x}${W}${E}`,G.block=!0,G.loading=!1,u.line=l+1;const ee=m.slice(T+E.length);return ee.trim()&&n(u,ee,l),!0}let N=l,C="",O=!1,H="",V=l;const A=w?m:m===x?"":m.slice(x.length),F=!f&&x==="\\["?"]":"",j=gc(A,v);if(j!==-1){const W=j;C=A.slice(0,W),H=A.slice(W+v.length),V=w?l+1:l,O=!0,N=V}else for(A&&!w&&(C=A),N=l+1;N{const u=i,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(i,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",r,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function mae(e){const t=e.renderer.rules.image||function(n,o,s,r,i){const l=n,a=i;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,r,i)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,r,i)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],r=String(s.info??"").trim();return`
        ${e.utils.escapeHtml(String(s.content??""))}
        `})}const gae=/^\s]/i,vae=/^<\/a\s*>/i;function wae(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let o=0;for(let s=n.length-1;s>=0;s--){const r=n[s];if(r?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==r.level&&n[s]?.type!=="link_open";)s--;continue}if(r?.type==="html_inline"){const i=String(r.content??"");gae.test(i)&&o>0&&o--,vae.test(i)&&o++}if(!(o>0)&&r?.type==="text"&&t.pretest(String(r.content??"")))return!0}return!1}function yae(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(o=>o.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",o=>{if(!o.md?.options?.linkify)return;const s=Array.isArray(o.tokens)?o.tokens:[],r=o.md.linkify;if(!r)return;const i=s.filter(l=>wae(l,r));if(i.length)return n(Object.assign(Object.create(Object.getPrototypeOf(o)),o,{tokens:i}))})}function kae(e){const t=e.inline.ruler,n=t.getNamedRules?.(),o=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof o!="function"||typeof s!="function")return;const r=e.validateLink,i=e;i.__markstreamOriginalValidateLink=r,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===r?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return o(...l);const u=a.validateLink;a.validateLink=c;try{return o(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const c=a.validateLink;a.validateLink=r;try{return s(...l)}finally{a.validateLink=c}})}function bae(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),r=new Xre({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||r.set({validateLink:i=>!d0(i,{tagName:"a",attrName:"href"})}),kae(r),yae(r),(e.enableMath??!0)&&hae(r,{...e.mathOptions??{}}),(e.enableContainers??!0)&&vie(r),e.enableFixIndentedCodeBlock!==!1&&Pie(r),yle(r),xle(r),ble(r),Ale(r),mae(r),jie(r,{customHtmlTags:e.customHtmlTags}),r}function f0(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>f0(n))),t}function _ae(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function xae(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function Sae(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function w3(e,t,n){const o=[];let s="",r=t+1;const i=[];for(;rn.startsWith(t)||t.startsWith(n)):!1}function g_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function v_(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function Aae(e,t){const n=[],o=[],s=[],r=[],i=e.split(Cae),l=/\r?\n$/.test(e),a=i.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!$I.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);s.push(v_(m,a))}else if(h.startsWith("+")){const m=h.slice(1);r.push(v_(m,a))}else{g_(n,o,s,r);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),o.push(m)}},u=l?Math.max(0,i.length-1):i.length;for(let p=0;p0||r.length>0)&&g_(n,o,s,r);const d=n.join(` +`:""}${v}`,P.map=[l,N+1],P.block=!0,P.loading=!O,u.line=N+1,H.trim()&&n(u,H,V),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function kae(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`
        ${e.utils.escapeHtml(String(s.content??""))}
        `})}const bae=/^\s]/i,_ae=/^<\/a\s*>/i;function xae(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let o=0;for(let s=n.length-1;s>=0;s--){const i=n[s];if(i?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==i.level&&n[s]?.type!=="link_open";)s--;continue}if(i?.type==="html_inline"){const r=String(i.content??"");bae.test(r)&&o>0&&o--,_ae.test(r)&&o++}if(!(o>0)&&i?.type==="text"&&t.pretest(String(i.content??"")))return!0}return!1}function Sae(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(o=>o.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",o=>{if(!o.md?.options?.linkify)return;const s=Array.isArray(o.tokens)?o.tokens:[],i=o.md.linkify;if(!i)return;const r=s.filter(l=>xae(l,i));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(o)),o,{tokens:r}))})}function Cae(e){const t=e.inline.ruler,n=t.getNamedRules?.(),o=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof o!="function"||typeof s!="function")return;const i=e.validateLink,r=e;r.__markstreamOriginalValidateLink=i,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===i?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return o(...l);const u=a.validateLink;a.validateLink=c;try{return o(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const c=a.validateLink;a.validateLink=i;try{return s(...l)}finally{a.validateLink=c}})}function Mae(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new nre({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!d0(r,{tagName:"a",attrName:"href"})}),Cae(i),Sae(i),(e.enableMath??!0)&&yae(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&_re(i),e.enableFixIndentedCodeBlock!==!1&&qre(i),Sle(i),Ele(i),Mle(i),$le(i),kae(i),Vre(i,{customHtmlTags:e.customHtmlTags}),i}function f0(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>f0(n))),t}function Aae(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function Eae(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function Tae(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function y3(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;in.startsWith(t)||t.startsWith(n)):!1}function v_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function w_(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function $ae(e,t){const n=[],o=[],s=[],i=[],r=e.split(Iae),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),c=p=>{const h=p;if(!BI.some(m=>h.startsWith(m)))if(h.startsWith("-")){const m=h.slice(1);s.push(w_(m,a))}else if(h.startsWith("+")){const m=h.slice(1);i.push(w_(m,a))}else{v_(n,o,s,i);const m=a&&h.startsWith(" ")?h.slice(1):h;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let p=0;p0||i.length>0)&&v_(n,o,s,i);const d=n.join(` `),f=o.join(` `);return{original:t&&l&&d?`${d} `:d,updated:t&&l&&f?`${f} -`:f}}function Xg(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,r=String(e.info??""),i=r.startsWith("diff"),l=i?(()=>{const c=r,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():r;let a=String(e.content??"");if(m_.test(a)&&(a=a.replace(m_,"")),i){const{original:c,updated:u}=Aae(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:i,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:i,loading:o===!0?!1:o===!1?!0:!t}}function Tae(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Eae(){return{type:"hardbreak",raw:`\\ -`}}function Iae(e,t,n){const o=[];let s="",r=t+1;const i=[];for(;r\s*$/.test(t)||r1.has(e)}function Lae(e){if(!e||e.length===0)return w_();const t=Fh.get(e);if(t)return t;const n=e.map(xi).filter(Boolean);if(!n.length){const s=w_();return Fh.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Ep({customHtmlTags:e})};return Fh.set(e,o),o}function RI(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function $ae(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function h5(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,r]=e[o];if(String(s).toLowerCase()===n)return r}}function Nae(e,t,n){const o=e.slice();return h5(o,"href")||o.push(["href",t]),n!=null&&!h5(o,"title")&&o.push(["title",n]),o}function H8(e){return e.map(RI).join("")}function s4(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const r=t[t.length-1];if(r?.type==="text"){r.content=`${r.content}${s}`,r.raw=`${r.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:s4(o.children)});continue}t.push(o)}return t}function zae(e,t,n){let o=0;for(let s=t;s`;m.toLowerCase().includes(M.toLowerCase())||(m+=M),x=!0,k=!0}const w=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=v.exec(l))!==null;){const M=b[1],R=b[2]||b[3]||b[4]||"";w.push([M,R])}if(c?.has(a)){const M=$ae(e);return[{type:a,tag:a,attrs:w,content:M?M.inner:p.innerTokens.length?H8(p.innerTokens):"",children:p.innerTokens.length?o(p.innerTokens,s,r,i):[],raw:M?.raw??m,loading:e.loading||k,autoClosed:x},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:w,content:m,children:h,raw:m,loading:k,autoClosed:x},p.nextIndex]}function FI(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>FI(t)).join(""):String(e.content??"")}function Rae(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>FI(t)).join("")}function y_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),r=n.find(d=>d[0]==="alt")?.[1],i=Rae(o??e);let l="";i?l=i:r!=null&&String(r).length>0?l=String(r):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function Fae(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function jae(e,t,n){const o=[];let s="",r=t+1;const i=[];for(;r=0;o--){const[s,r]=e[o];if(String(s).toLowerCase()===n)return r}}function Pae(e,t,n){const o=e.slice();return m5(o,"href")||o.push(["href",t]),n!=null&&!m5(o,"title")&&o.push(["title",n]),o}function y3(e,t,n){const o=e[t],s=Oae(o.attrs),r=String(m5(s,"href")??""),i=m5(s,"title"),l=i==null?null:String(i),a=Pae(s,r,l);let c=t+1;const u=[];let d=!0;for(;ck.type==="strong_open")){const k=String(p.content??""),x=String(p.raw??k),w=f0(p);w.content=k.slice(0,-2),w.raw=x.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=w}const h=Oo(f,void 0,void 0,n),m=h.map(k=>{const x=k;return"content"in k?String(x.content??""):String(x.raw??"")}).join("");return{node:{type:"link",href:r,title:l,text:m,children:h,raw:`[${m}](${r}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:r0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:r?@[\\\]^_`{|}~]/,Qae=/\p{P}/u,e1e=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,t1e=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,n1e=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,o1e=/:\/\//,D8=1,jI=2,s1e=4,r1e=8,OI=16,Na=32,r4=64,S2=128,PI=256,i1e=512,C2=1024,l1e=1982;function k3(e){let t=0;for(let n=0;n=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function i1(e){return!!e&&Xae.test(e)}function l1(e){return!!e&&(Jae.test(e)||Qae.test(e))}function DI(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&e1e.test(e)}function VI(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&t1e.test(e)}function c1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||i1(o)?!1:!(l1(o)&&!DI(o,n)&&n&&!i1(n)&&!l1(n))}function u1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||i1(n)?!1:!(l1(n)&&!VI(n,o)&&o&&!i1(o)&&!l1(o))}function d1e(e,t,n=0){let o=n,s=!1;for(;o0?e[t-1]:void 0,o=e[t+2];return!o||i1(o)?!1:!(l1(o)&&!DI(o,n)&&n&&!i1(n)&&!l1(n))}function p1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||i1(n)?!1:!(l1(n)&&!VI(n,o)&&o&&!i1(o)&&!l1(o))}function h1e(e,t=0){let n=t,o=!1;for(;n=0&&e[r]==="\\";r--)s++;return s%2===1}const w1e=/[\p{L}\p{N}]/u,y1e=/^[\p{L}\p{N}]+$/u;function V8(e){return e?w1e.test(e):!1}function WI(e){return e?y1e.test(e):!1}function Z2(e,t){let n=t;for(;n0?e[t-1]:void 0,s=n=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n=3)return o;n=o+s.len}return-1}function x1e(e){return e?n1e.test(e)||o1e.test(e):!1}function S1e(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Oo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,r=Qd(t),i={filename:s?.filename||r.filename,explicitFilename:s?.explicitFilename||r.explicitFilename,marketTicker:s?.marketTicker||r.marketTicker};(i.filename||i.explicitFilename||i.marketTicker)&&(o={...o,__linkifyDemotionContext:i});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function p(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(Y,ne){const D=e.length===1?t:String(ne.content??""),X=[],ve=k1e(Y);if(ve!==-1){M(Y.slice(0,ve),Y.slice(0,ve));const pe=Y.slice(ve);return pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}if(Zae.test(Y)){const pe=Y.indexOf("~~");pe!==-1&&X.push({type:"strikethrough",index:pe})}if(Kae.test(Y)){const pe=Y.indexOf("**");pe!==-1&&X.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(Y)){const pe=D?HI(D,0):Y.indexOf("*");if(D&&pe===-1)return!1;pe!==-1&&X.push({type:"emphasis",index:pe})}X.sort((pe,te)=>pe.index!==te.index?pe.index-te.index:pe.type===te.type?0:pe.type==="strong"?-1:te.type==="strong"?1:0);const fe=X[0];if(!fe)return!1;if(fe.type==="strikethrough"){const pe=fe.index,te=pe>-1?Y.slice(0,pe):"";if(te&&M(te,te),pe===-1)return u++,!0;const de=Y.indexOf("~~",pe+2),ye=de===-1?Y.slice(pe+2):Y.slice(pe+2,de),Ce=de===-1?"":Y.slice(de+2),{node:me}=b_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return h(),b(me),Ce&&(N({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(fe.type==="strong"){const pe=fe.index,te=pe>-1?Y.slice(0,pe):"";if(te&&M(te,te),pe===-1)return u++,!0;if(t&&pe===0){let re=!1,ke=0;for(;ke=2)return M(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>a1e(t))return M(Y.slice(te.length),Y.slice(te.length)),u++,!0;const de=Z2(Y,pe);if(de.len>=3){const re=_1e(Y,pe+de.len);if(re!==-1){const ke=Y.slice(pe+de.len,re);if(b1e(ke)){const{node:Fe}=s2([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);h(),b(Fe);const at=Y.slice(re+3);return at&&(N({type:"text",content:at,raw:at}),u--),u++,!0}}}if(!f1e(Y,pe)){const re=Y.slice(pe,pe+de.len);M(re,re);const ke=Y.slice(pe+de.len);return ke&&(N({type:"text",content:ke,raw:ke}),u--),u++,!0}const ye=h1e(Y,pe+2);let Ce="",me="";if(ye.index!==-1){Ce=Y.slice(pe+2,ye.index),me=Y.slice(ye.index+2);const re=ye.index,ke=Z2(Y,re);if(de.intraword&&ke.intraword&&!WI(Ce)||!Ce&&de.len>=4&&de.intraword)return M(Y.slice(te.length),Y.slice(te.length)),u++,!0}else{if(d||ye.sawInvalidClose||de.intraword)return M(Y.slice(te.length),Y.slice(te.length)),u++,!0;Ce=Y.slice(pe+2),me=""}if(!Ce&&/^\*+$/.test(me))return M(Y,Y),u++,!0;const{node:be}=s2([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ce,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return h(),b(be),me&&(N({type:"text",content:me,raw:me}),u--),u++,!0}if(fe.type==="emphasis"){let pe=fe.index;pe===-1&&(pe=0);const te=Y.slice(0,pe);if(te&&M(te,te),!c1e(Y,pe)){M(Y[pe],Y[pe]);const re=Y.slice(pe+1);return re&&(N({type:"text",content:re,raw:re}),u--),u++,!0}const de=Z2(Y,pe),ye=d1e(D,Y,pe+1),Ce=ye.index,me=e[u+1];if(o?.final&&me?.type==="em_open"&&Ce!==-1&&Y.slice(pe+1,Ce).trim()!==Y.slice(pe+1,Ce)||Ce===-1&&(ye.sawInvalidClose||o?.final||de.intraword||!V8(Y[pe+1])))return M(Y.slice(pe),Y.slice(pe)),u++,!0;const{node:be}=w3([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ce>-1?Y.slice(pe+1,Ce):Y.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(h(),b(be),Ce!==-1&&Ce{for(let be=0;be=0&&me[ke]==="\\";ke--)re++;if(re%2===0)return be}return-1})(Y);if(X===-1)return!1;let ve=1;for(let me=X+1;mefe?.type==="math_inline")||!Gae.test(Y))return null;const D=ne.parseInline(Y,{__markstreamFinal:!!o?.final});if(!Array.isArray(D)||D.length===0)return null;const X=(D.find(fe=>fe?.type==="inline")?.children??[]).filter(fe=>!(fe?.type==="text"&&String(fe.content??"")===""));if(!X.length||!X.some(fe=>fe?.type!=="text")||X.length===1&&X[0]?.type==="text"&&String(X[0].content??"")===Y)return null;const ve=Oo(X,Y,n,o);return ve.length?ve:null}function w(Y){h(),a.push(Y)}function v(Y){h();const ne=f0(Y);a.push(ne)}function b(Y){w(Y)}function M(Y,ne){c?(c.content+=Y,c.raw+=ne??Y):(c={type:"text",content:String(Y??""),raw:String(ne??Y??"")},a.push(c))}function R(Y,ne){if(!Y)return;const D=Oo([{...ne,type:"text",content:Y,raw:Y}],Y,n,o);if(D.length===1&&D[0]?.type==="text"){const X=D[0];M(String(X.content??""),String(X.raw??X.content??""));return}for(const X of D)b(X)}function z(Y,ne){return String(Y.markup??"").startsWith(ne)}function $(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const ne=e[u-1];!ne||ne.type!=="text"||!z(ne,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function T(Y){return Y.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function E(Y,ne,D=k3(Y)){let X=Y;const ve=String(ne.content??"");return(D&D8)!==0&&X.endsWith("\\")&&!z(ne,"\\\\")&&!ve.endsWith("\\\\")&&(X=X.slice(0,-1)),(D&C2)!==0&&X.endsWith("(")&&!z(ne,"\\(")&&!ve.endsWith("\\(")&&(X=X.slice(0,-1)),(D&jI)!==0&&/\*+$/.test(X)&&!z(ne,"\\*")&&!ve.endsWith("\\*")&&(X=X.replace(/\*+$/,"")),X}for(;u{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(g_.test(a)&&(a=a.replace(g_,"")),r){const{original:c,updated:u}=$ae(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function Nae(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function zae(){return{type:"hardbreak",raw:`\\ +`}}function Bae(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i\s*$/.test(t)||i1.has(e)}function Rae(e){if(!e||e.length===0)return y_();const t=jh.get(e);if(t)return t;const n=e.map(xr).filter(Boolean);if(!n.length){const s=y_();return jh.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:Ip({customHtmlTags:e})};return jh.set(e,o),o}function OI(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Fae(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function m5(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function jae(e,t,n){const o=e.slice();return m5(o,"href")||o.push(["href",t]),n!=null&&!m5(o,"title")&&o.push(["title",n]),o}function D8(e){return e.map(OI).join("")}function i4(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:i4(o.children)});continue}t.push(o)}return t}function Oae(e,t,n){let o=0;for(let s=t;s`;m.toLowerCase().includes(M.toLowerCase())||(m+=M),x=!0,k=!0}const v=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=w.exec(l))!==null;){const M=b[1],R=b[2]||b[3]||b[4]||"";v.push([M,R])}if(c?.has(a)){const M=Fae(e);return[{type:a,tag:a,attrs:v,content:M?M.inner:p.innerTokens.length?D8(p.innerTokens):"",children:p.innerTokens.length?o(p.innerTokens,s,i,r):[],raw:M?.raw??m,loading:e.loading||k,autoClosed:x},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:v,content:m,children:h,raw:m,loading:k,autoClosed:x},p.nextIndex]}function PI(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>PI(t)).join(""):String(e.content??"")}function Hae(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>PI(t)).join("")}function k_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=Hae(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function Dae(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function Vae(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function qae(e,t,n){const o=e.slice();return g5(o,"href")||o.push(["href",t]),n!=null&&!g5(o,"title")&&o.push(["title",n]),o}function k3(e,t,n){const o=e[t],s=Wae(o.attrs),i=String(g5(s,"href")??""),r=g5(s,"title"),l=r==null?null:String(r),a=qae(s,i,l);let c=t+1;const u=[];let d=!0;for(;ck.type==="strong_open")){const k=String(p.content??""),x=String(p.raw??k),v=f0(p);v.content=k.slice(0,-2),v.raw=x.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=v}const h=Oo(f,void 0,void 0,n),m=h.map(k=>{const x=k;return"content"in k?String(x.content??""):String(x.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:h,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i?@[\\\]^_`{|}~]/,s1e=/\p{P}/u,i1e=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,r1e=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,l1e=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,a1e=/:\/\//,V8=1,HI=2,c1e=4,u1e=8,DI=16,Na=32,r4=64,C2=128,VI=256,d1e=512,M2=1024,f1e=1982;function b3(e){let t=0;for(let n=0;n=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function r1(e){return!!e&&n1e.test(e)}function l1(e){return!!e&&(o1e.test(e)||s1e.test(e))}function qI(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&i1e.test(e)}function UI(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&r1e.test(e)}function h1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||r1(o)?!1:!(l1(o)&&!qI(o,n)&&n&&!r1(n)&&!l1(n))}function m1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||r1(n)?!1:!(l1(n)&&!UI(n,o)&&o&&!r1(o)&&!l1(o))}function g1e(e,t,n=0){let o=n,s=!1;for(;o0?e[t-1]:void 0,o=e[t+2];return!o||r1(o)?!1:!(l1(o)&&!qI(o,n)&&n&&!r1(n)&&!l1(n))}function w1e(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||r1(n)?!1:!(l1(n)&&!UI(n,o)&&o&&!r1(o)&&!l1(o))}function y1e(e,t=0){let n=t,o=!1;for(;n=0&&e[i]==="\\";i--)s++;return s%2===1}const x1e=/[\p{L}\p{N}]/u,S1e=/^[\p{L}\p{N}]+$/u;function W8(e){return e?x1e.test(e):!1}function ZI(e){return e?S1e.test(e):!1}function K2(e,t){let n=t;for(;n0?e[t-1]:void 0,s=n=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n=3)return o;n=o+s.len}return-1}function E1e(e){return e?l1e.test(e)||a1e.test(e):!1}function T1e(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Oo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=ef(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function p(){return e===f&&(e=e.slice()),e}function h(){c=null}function m(Y,ne){const D=e.length===1?t:String(ne.content??""),X=[],ve=C1e(Y);if(ve!==-1){M(Y.slice(0,ve),Y.slice(0,ve));const pe=Y.slice(ve);return pe&&(N({type:"text",content:pe,raw:pe}),u--),u++,!0}if(Jae.test(Y)){const pe=Y.indexOf("~~");pe!==-1&&X.push({type:"strikethrough",index:pe})}if(Qae.test(Y)){const pe=Y.indexOf("**");pe!==-1&&X.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(Y)){const pe=D?WI(D,0):Y.indexOf("*");if(D&&pe===-1)return!1;pe!==-1&&X.push({type:"emphasis",index:pe})}X.sort((pe,te)=>pe.index!==te.index?pe.index-te.index:pe.type===te.type?0:pe.type==="strong"?-1:te.type==="strong"?1:0);const fe=X[0];if(!fe)return!1;if(fe.type==="strikethrough"){const pe=fe.index,te=pe>-1?Y.slice(0,pe):"";if(te&&M(te,te),pe===-1)return u++,!0;const de=Y.indexOf("~~",pe+2),ye=de===-1?Y.slice(pe+2):Y.slice(pe+2,de),Ce=de===-1?"":Y.slice(de+2),{node:me}=__([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return h(),b(me),Ce&&(N({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(fe.type==="strong"){const pe=fe.index,te=pe>-1?Y.slice(0,pe):"";if(te&&M(te,te),pe===-1)return u++,!0;if(t&&pe===0){let ie=!1,ke=0;for(;ke=2)return M(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>p1e(t))return M(Y.slice(te.length),Y.slice(te.length)),u++,!0;const de=K2(Y,pe);if(de.len>=3){const ie=A1e(Y,pe+de.len);if(ie!==-1){const ke=Y.slice(pe+de.len,ie);if(M1e(ke)){const{node:Fe}=i2([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);h(),b(Fe);const at=Y.slice(ie+3);return at&&(N({type:"text",content:at,raw:at}),u--),u++,!0}}}if(!v1e(Y,pe)){const ie=Y.slice(pe,pe+de.len);M(ie,ie);const ke=Y.slice(pe+de.len);return ke&&(N({type:"text",content:ke,raw:ke}),u--),u++,!0}const ye=y1e(Y,pe+2);let Ce="",me="";if(ye.index!==-1){Ce=Y.slice(pe+2,ye.index),me=Y.slice(ye.index+2);const ie=ye.index,ke=K2(Y,ie);if(de.intraword&&ke.intraword&&!ZI(Ce)||!Ce&&de.len>=4&&de.intraword)return M(Y.slice(te.length),Y.slice(te.length)),u++,!0}else{if(d||ye.sawInvalidClose||de.intraword)return M(Y.slice(te.length),Y.slice(te.length)),u++,!0;Ce=Y.slice(pe+2),me=""}if(!Ce&&/^\*+$/.test(me))return M(Y,Y),u++,!0;const{node:be}=i2([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Ce,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return h(),b(be),me&&(N({type:"text",content:me,raw:me}),u--),u++,!0}if(fe.type==="emphasis"){let pe=fe.index;pe===-1&&(pe=0);const te=Y.slice(0,pe);if(te&&M(te,te),!h1e(Y,pe)){M(Y[pe],Y[pe]);const ie=Y.slice(pe+1);return ie&&(N({type:"text",content:ie,raw:ie}),u--),u++,!0}const de=K2(Y,pe),ye=g1e(D,Y,pe+1),Ce=ye.index,me=e[u+1];if(o?.final&&me?.type==="em_open"&&Ce!==-1&&Y.slice(pe+1,Ce).trim()!==Y.slice(pe+1,Ce)||Ce===-1&&(ye.sawInvalidClose||o?.final||de.intraword||!W8(Y[pe+1])))return M(Y.slice(pe),Y.slice(pe)),u++,!0;const{node:be}=y3([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ce>-1?Y.slice(pe+1,Ce):Y.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(h(),b(be),Ce!==-1&&Ce{for(let be=0;be=0&&me[ke]==="\\";ke--)ie++;if(ie%2===0)return be}return-1})(Y);if(X===-1)return!1;let ve=1;for(let me=X+1;mefe?.type==="math_inline")||!e1e.test(Y))return null;const D=ne.parseInline(Y,{__markstreamFinal:!!o?.final});if(!Array.isArray(D)||D.length===0)return null;const X=(D.find(fe=>fe?.type==="inline")?.children??[]).filter(fe=>!(fe?.type==="text"&&String(fe.content??"")===""));if(!X.length||!X.some(fe=>fe?.type!=="text")||X.length===1&&X[0]?.type==="text"&&String(X[0].content??"")===Y)return null;const ve=Oo(X,Y,n,o);return ve.length?ve:null}function v(Y){h(),a.push(Y)}function w(Y){h();const ne=f0(Y);a.push(ne)}function b(Y){v(Y)}function M(Y,ne){c?(c.content+=Y,c.raw+=ne??Y):(c={type:"text",content:String(Y??""),raw:String(ne??Y??"")},a.push(c))}function R(Y,ne){if(!Y)return;const D=Oo([{...ne,type:"text",content:Y,raw:Y}],Y,n,o);if(D.length===1&&D[0]?.type==="text"){const X=D[0];M(String(X.content??""),String(X.raw??X.content??""));return}for(const X of D)b(X)}function z(Y,ne){return String(Y.markup??"").startsWith(ne)}function $(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const ne=e[u-1];!ne||ne.type!=="text"||!z(ne,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function E(Y){return Y.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function T(Y,ne,D=b3(Y)){let X=Y;const ve=String(ne.content??"");return(D&V8)!==0&&X.endsWith("\\")&&!z(ne,"\\\\")&&!ve.endsWith("\\\\")&&(X=X.slice(0,-1)),(D&M2)!==0&&X.endsWith("(")&&!z(ne,"\\(")&&!ve.endsWith("\\(")&&(X=X.slice(0,-1)),(D&HI)!==0&&/\*+$/.test(X)&&!z(ne,"\\*")&&!ve.endsWith("\\*")&&(X=X.replace(/\*+$/,"")),X}for(;u=0;re--){const ke=a[re];if(ke.type!=="text")break;de=re,ye=String(ke.content??"")+ye}dete==="href")?.[1],pe=String(fe??"");if(t&&pe){const te=t.indexOf("](");if(te!==-1){const de=t.indexOf(")",te+2);de===-1?ne.loading=!0:ne.loading&&t.slice(te+2,de).includes(pe)&&(ne.loading=!1)}}F(ne)||w(ne)}function V(Y){if(Y.markup!=="linkify")return!1;const{node:ne,nextIndex:D}=y3(e,u,o);return q(ne,D)?(u=D,!0):!1}function A(Y){h(),b(Hae(Y)),u++}function F(Y){if(Y.type!=="link")return!1;const ne=a[a.length-1];if(!ne||ne.type!=="text")return!1;const D=String(ne.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!D)return!1;const X=Y,ve=String(X.href??""),fe=String(X.text??""),pe=String(D[2]??""),te=ve.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ve||!(fe===ve||fe===te||x1e(fe)))return!1;const de=String(D[1]??"");return de?(ne.content=de,ne.raw=de):a.pop(),w({...Y,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${ve}${X.title?` "${X.title}"`:""})`}),!0}function j(Y){if(Y.type!=="link")return!1;const ne=Y,D=String(ne.href??"");return D?q({href:D,title:ne.title==null||ne.title===""?null:String(ne.title),loading:!!ne.loading},u+1):!1}function q(Y,ne){const D=a[a.length-1];if(D?.type!=="image"||D.src||!D.loading||!String(D.raw??"").endsWith("]("))return!1;const X=e[ne],ve=String(X?.content??"");if(X?.type!=="text"||!ve.startsWith(")"))return!1;a.pop(),c=null;const fe=String(D.alt??"");w({type:"image",src:Y.href,alt:fe,title:Y.title,raw:`![${fe}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const pe=ve.slice(1),te=f0(X);return te.content=pe,te.raw=pe,p()[ne]=te,!0}function P(Y){if(Y.type!=="link")return!1;const ne=a[a.length-1],D=e[u-1];if(!ne||ne.type!=="text"||D?.type!=="text")return!1;const X=String(ne.content??""),ve=String(D.content??"");if(!X.endsWith("!")||!ve.endsWith("!")||z(D,"\\!"))return!1;const fe=X.slice(0,-1);fe?(ne.content=fe,ne.raw=fe,c=ne):(a.pop(),c=null);const pe=Y,te=String(pe.text??pe.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),de=String(pe.href??""),ye=pe.title==null||pe.title===""?null:String(pe.title);return w({type:"image",src:de,alt:te,title:ye,raw:`![${te}](${de}${ye?` "${ye}"`:""})`,loading:!!pe.loading}),!0}function W(Y,ne="",D=null){const X=String(Y.alt??Y.raw??"");return{type:"link",href:ne,title:D,text:X,children:[Y],raw:`[${X}](${ne}${D?` "${D}"`:""})`,loading:!0}}function G(Y){const ne=Y.startsWith("![")?Y:`![${Y}`,D=ne.slice(2),X=D.indexOf("](");return{type:"image",src:"",alt:X===-1?D.replace(/\]$/,""):D.slice(0,X),title:null,raw:ne,loading:!0}}function ee(Y){const ne=Y.indexOf("[![");if(ne===-1||typeof t=="string"&&e.length===1&&v1e(t,ne,"["))return!1;const D=Y.slice(0,ne);return D&&M(D,D),w(W(G(Y.slice(ne+1)))),u++,!0}function se(Y){if(o?.final)return!1;const ne=e[u-1];if(ne?.type!=="text"||!String(ne.content??"").endsWith("[")||z(ne,"\\["))return!1;const D=a[a.length-1];if(D?.type==="text"&&D.content.endsWith("[")){const X=D.content.slice(0,-1);X?(D.content=X,D.raw=X,c=D):(a.pop(),c=null)}return w(W(y_(Y))),u++,!0}function oe(Y){if(Y.type!=="link")return!1;const ne=Y,D=String(ne.raw??""),X=String(ne.text??"");if(!D.startsWith("[![")&&!X.startsWith("!["))return!1;const ve=ne.title==null||ne.title===""?null:String(ne.title);return w(W({type:"image",src:String(ne.href??""),alt:X.replace(/^!\[/,"").replace(/\]$/,""),title:ve,raw:D.startsWith("[![")?D.slice(1):D,loading:!0})),!0}function Q(Y){if(!Y.startsWith("]("))return!1;const ne=e[u-2];if(ne?.type==="text"&&String(ne.content??"").endsWith("[")&&z(ne,"\\["))return!1;const D=a[a.length-1];if(D?.type!=="image"&&D?.type!=="link")return!1;const X=D,ve=D?.type==="link"&&Array.isArray(X.children)&&X.children.length===1&&X.children[0]?.type==="image"?a.pop():null,fe=ve?ve.children[0]:a.pop();if(!fe||fe.type!=="image")return!1;const pe=e[u+1];let te=String(ve?.href??""),de=ve?.title==null?null:String(ve.title),ye=!0;if(pe?.type==="link_open"){const{node:me,nextIndex:be}=y3(e,u+1,o);te=me.href,de=me.title,ye=!0,u=be}else{if(te=Y.slice(2),te.includes('"')){const me=te.split('"');te=String(me[0]??"").trim(),de=me[1]==null?null:String(me[1]).trim()}u++}const Ce=W(fe,te,de);return Ce.loading=ye,w(Ce),!0}function ge(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&z(Y,"\\[")}function xe(Y,ne){const D=Y.indexOf("[");if(D===-1)return!1;let X=Y.slice(0,D);const ve=Y.indexOf("](",D);if(ve!==-1){const fe=e[u+2];let pe=Y.slice(D+1,ve);if(pe.includes("[")){const re=pe.indexOf("[");X+=Y.slice(0,D+re+1);const ke=D+re+1;pe=Y.slice(ke+1,ve)}const te=e[u+1];if(Y.endsWith("](")&&te?.type==="link_open"&&fe){const re=e[u+4];let ke=4,Fe=!0;if(re?.type==="text"){const dt=String(re.content??"");if(dt.startsWith(")")){Fe=!1;const $t=dt.slice(1);if($t){const Tt=f0(re);Tt.content=$t,Tt.raw=$t,p()[u+4]=Tt}else ke++}else dt==="."&&ke++}R(X,ne);const at=String(fe.content??"");return o?.validateLink&&!o.validateLink(at)?M(pe,pe):w({type:"link",href:at,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Fe}),u+=ke,!0}const de=Y.indexOf(")",ve),ye=de!==-1?Y.slice(ve+2,de):"",Ce=de===-1;let me=X.match(/\*+$/);if(me&&(X=X.replace(/\*+$/,"")),R(X,ne),me||(me=pe.match(/^\*+/)),!d&&me){const re=me[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const ke=[];if(re===1?ke.push({type:"em_open",tag:"em",nesting:1}):re===2?ke.push({type:"strong_open",tag:"strong",nesting:1}):re===3&&(ke.push({type:"strong_open",tag:"strong",nesting:1}),ke.push({type:"em_open",tag:"em",nesting:1})),ke.push({type:"link",href:ye,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Ce}),re===1){ke.push({type:"em_close",tag:"em",nesting:-1});const{node:Fe}=w3(ke,0,o);b(Fe)}else if(re===2){ke.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Fe}=s2(ke,0,void 0,o);b(Fe)}else if(re===3){ke.push({type:"em_close",tag:"em",nesting:-1}),ke.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Fe}=s2(ke,0,void 0,o);b(Fe)}else{const{node:Fe}=w3(ke,0,o);b(Fe)}}else o?.validateLink&&!o.validateLink(ye)?M(pe,pe):w({type:"link",href:ye,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Ce});const be=de!==-1?Y.slice(de+1):"";return be&&(N({type:"text",content:be,raw:be}),u--),u++,!0}return!1}function Ke(Y){const ne=Y.indexOf("![");if(ne===-1)return!1;const D=Y.slice(0,ne);return D&&!c?c={type:"text",content:D,raw:D}:D&&c&&(c.content+=D),c&&(a.push(c),c=null),w(G(Y.slice(ne))),u++,!0}function et(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ne=Y.slice(1).match(/[^\s\]]/);if(ne===null)return u++,!0;if(ne&&/x/i.test(ne[0])){const D=ne[0]==="x"||ne[0]==="X";return w({type:"checkbox_input",checked:D,raw:D?"[x]":"[ ]"}),u++,!0}return!1}return a}function Qg(e,t,n){const o=n?.__sourceLineMapper;if(!o)return{startLine:e,endLine:t};const s=o(e),r=t>e?o(t-1).endLine:o(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,r)}}function __(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let o=0;for(let s=0;so&&e[s-1]!==` -`&&i++,{startLine:r,endLine:i}}function $d(e,t,n,o){const s=C1e(e,t,n);return Qg(s.startLine,s.endLine,o)}function M1e(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const o=Number(n[0]),s=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(s)?null:Qg(o,s,t)}function Wn(e,t,n){if(!n?.includeSourceMap)return e;const o=M1e(t,n);if(!o)return e;if(e.sourceMap=o,e.type==="code_block"){const s=e;s.startLine=o.startLine,s.endLine=o.endLine}return e}function A1e(e,t,n,o){if(!o?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const r=Number(s[0]),i=Number(s[1]),l=Number(n);return!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(l)||(e.sourceMap=Qg(r,Math.max(i,l),o)),e}function T1e(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const r=String(s.content??""),i=r.replace(/[ \t\r\n]+$/g,"");if(i===r)break;if(i){s.content=i;break}o.pop();continue}break}}function E1e(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const r=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(r)){o.pop();continue}const i=r.replace(/[ \t\r\n\d.)]+$/g,"");i!==r&&(i?s.content=i:o.pop())}break}}function I1e(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function gu(e,t,n){const o=e[t],s=[],r=h1(n,!0);let i=t+1;for(;id.raw).join("")};n?.includeSourceMap&&Wn(u,e[i],n),s.push(u),i=c+1}else i+=1;const l={type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const a=o.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:s,raw:s.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&Wn(l,o,n),[l,i+1]}function L1e(e,t,n,o){const s=String(n[1]??"note"),r=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),i=[],l=h1(o,!0);let a=t+1;for(;ac.raw).join(` +`},a.push(c)),u++;break;case"code_inline":b(Dae(Y)),u++;break;case"html_inline":{const[ne,D]=Pae(Y,e,u,Oo,t,n,o);b(ne),u=D;break}case"link_open":H(Y);break;case"image":se(Y)||(h(),b(k_(Y)),u++);break;case"strong_open":{h();const{node:ne,nextIndex:D}=i2(e,u,Y.content,o);b(ne),u=D;break}case"em_open":{h();const{node:ne,nextIndex:D}=y3(e,u,o);b(ne),u=D;break}case"s_open":{h();const{node:ne,nextIndex:D}=__(e,u,o);b(ne),u=D;break}case"mark_open":{h();const{node:ne,nextIndex:D}=Bae(e,u,o);b(ne),u=D;break}case"ins_open":{h();const{node:ne,nextIndex:D}=Vae(e,u,o);b(ne),u=D;break}case"sub_open":{h();const{node:ne,nextIndex:D}=Gae(e,u,o);b(ne),u=D;break}case"sup_open":{h();const{node:ne,nextIndex:D}=Yae(e,u,o);b(ne),u=D;break}case"sub":h(),b({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":h(),b({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{h();const ne=e[u-1];ne?.type==="text"&&/\|:-+/.test(String(ne.content??""))?M("",""):b(Tae(Y)),u++;break}case"checkbox":h(),b(Aae(Y)),u++;break;case"checkbox_input":h(),b(Eae(Y)),u++;break;case"footnote_ref":h(),b(Nae(Y)),u++;break;case"footnote_anchor":{h();const ne=Y.meta??{};v({type:"footnote_anchor",id:String(ne.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":h(),b(zae()),u++;break;case"fence":h(),b(Jg(e[u])),u++;break;case"math_inline":$(Y),h(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(b(b_({...Y,content:e[u+1].content})),u+=2):b(b_(Y)),u++;break;case"reference":A(Y);break;case"text_special":M(String(Y.content??""),String(Y.content??"")),u++;break;default:{const ne=Y;if(Y.type==="link"&&ne.href!=null&&o?.validateLink&&!o.validateLink(String(ne.href))){h();const D=String(ne.text??"");M(D,D),u++}else oe(Y)||j(Y)||P(Y)||F(Y)||w(Y),u++;break}}}function C(Y,ne,D,X,ve=b3(Y)){const fe=Xae({...ne,content:Y});if(c){c.content+=T(fe.content,ne,ve),c.raw+=fe.raw;return}const pe=D?.tag==="br"&&e[u-2]?.content==="[";X||(fe.content=T(fe.content,ne,ve)),c=fe,c.center=pe,a.push(c)}function O(Y){const ne=String(Y.content??""),D=b3(ne),X=(D&V8)!==0,ve=e.length===1&&X&&typeof t=="string"?String(t):"";let fe=ve?k1e(ve):X?ne.replace(t1e,"$1"):ne;const pe=fe===ne?D:b3(fe);if(Y.content==="<"||fe==="1"&&e[u-1]?.tag==="br"){u++;return}const te=(pe&VI)!==0?fe.indexOf("$"):-1;te!==-1&&te===fe.lastIndexOf("$")&&fe.endsWith("$")&&(fe=fe.slice(0,-1)),fe.endsWith("undefined")&&!t?.endsWith("undefined")&&(fe=fe.slice(0,-9));let de=a.length,ye="";for(let ie=a.length-1;ie>=0;ie--){const ke=a[ie];if(ke.type!=="text")break;de=ie,ye=String(ke.content??"")+ye}dete==="href")?.[1],pe=String(fe??"");if(t&&pe){const te=t.indexOf("](");if(te!==-1){const de=t.indexOf(")",te+2);de===-1?ne.loading=!0:ne.loading&&t.slice(te+2,de).includes(pe)&&(ne.loading=!1)}}F(ne)||v(ne)}function V(Y){if(Y.markup!=="linkify")return!1;const{node:ne,nextIndex:D}=k3(e,u,o);return q(ne,D)?(u=D,!0):!1}function A(Y){h(),b(Uae(Y)),u++}function F(Y){if(Y.type!=="link")return!1;const ne=a[a.length-1];if(!ne||ne.type!=="text")return!1;const D=String(ne.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!D)return!1;const X=Y,ve=String(X.href??""),fe=String(X.text??""),pe=String(D[2]??""),te=ve.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ve||!(fe===ve||fe===te||E1e(fe)))return!1;const de=String(D[1]??"");return de?(ne.content=de,ne.raw=de):a.pop(),v({...Y,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${ve}${X.title?` "${X.title}"`:""})`}),!0}function j(Y){if(Y.type!=="link")return!1;const ne=Y,D=String(ne.href??"");return D?q({href:D,title:ne.title==null||ne.title===""?null:String(ne.title),loading:!!ne.loading},u+1):!1}function q(Y,ne){const D=a[a.length-1];if(D?.type!=="image"||D.src||!D.loading||!String(D.raw??"").endsWith("]("))return!1;const X=e[ne],ve=String(X?.content??"");if(X?.type!=="text"||!ve.startsWith(")"))return!1;a.pop(),c=null;const fe=String(D.alt??"");v({type:"image",src:Y.href,alt:fe,title:Y.title,raw:`![${fe}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const pe=ve.slice(1),te=f0(X);return te.content=pe,te.raw=pe,p()[ne]=te,!0}function P(Y){if(Y.type!=="link")return!1;const ne=a[a.length-1],D=e[u-1];if(!ne||ne.type!=="text"||D?.type!=="text")return!1;const X=String(ne.content??""),ve=String(D.content??"");if(!X.endsWith("!")||!ve.endsWith("!")||z(D,"\\!"))return!1;const fe=X.slice(0,-1);fe?(ne.content=fe,ne.raw=fe,c=ne):(a.pop(),c=null);const pe=Y,te=String(pe.text??pe.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),de=String(pe.href??""),ye=pe.title==null||pe.title===""?null:String(pe.title);return v({type:"image",src:de,alt:te,title:ye,raw:`![${te}](${de}${ye?` "${ye}"`:""})`,loading:!!pe.loading}),!0}function W(Y,ne="",D=null){const X=String(Y.alt??Y.raw??"");return{type:"link",href:ne,title:D,text:X,children:[Y],raw:`[${X}](${ne}${D?` "${D}"`:""})`,loading:!0}}function G(Y){const ne=Y.startsWith("![")?Y:`![${Y}`,D=ne.slice(2),X=D.indexOf("](");return{type:"image",src:"",alt:X===-1?D.replace(/\]$/,""):D.slice(0,X),title:null,raw:ne,loading:!0}}function ee(Y){const ne=Y.indexOf("[![");if(ne===-1||typeof t=="string"&&e.length===1&&_1e(t,ne,"["))return!1;const D=Y.slice(0,ne);return D&&M(D,D),v(W(G(Y.slice(ne+1)))),u++,!0}function se(Y){if(o?.final)return!1;const ne=e[u-1];if(ne?.type!=="text"||!String(ne.content??"").endsWith("[")||z(ne,"\\["))return!1;const D=a[a.length-1];if(D?.type==="text"&&D.content.endsWith("[")){const X=D.content.slice(0,-1);X?(D.content=X,D.raw=X,c=D):(a.pop(),c=null)}return v(W(k_(Y))),u++,!0}function oe(Y){if(Y.type!=="link")return!1;const ne=Y,D=String(ne.raw??""),X=String(ne.text??"");if(!D.startsWith("[![")&&!X.startsWith("!["))return!1;const ve=ne.title==null||ne.title===""?null:String(ne.title);return v(W({type:"image",src:String(ne.href??""),alt:X.replace(/^!\[/,"").replace(/\]$/,""),title:ve,raw:D.startsWith("[![")?D.slice(1):D,loading:!0})),!0}function Q(Y){if(!Y.startsWith("]("))return!1;const ne=e[u-2];if(ne?.type==="text"&&String(ne.content??"").endsWith("[")&&z(ne,"\\["))return!1;const D=a[a.length-1];if(D?.type!=="image"&&D?.type!=="link")return!1;const X=D,ve=D?.type==="link"&&Array.isArray(X.children)&&X.children.length===1&&X.children[0]?.type==="image"?a.pop():null,fe=ve?ve.children[0]:a.pop();if(!fe||fe.type!=="image")return!1;const pe=e[u+1];let te=String(ve?.href??""),de=ve?.title==null?null:String(ve.title),ye=!0;if(pe?.type==="link_open"){const{node:me,nextIndex:be}=k3(e,u+1,o);te=me.href,de=me.title,ye=!0,u=be}else{if(te=Y.slice(2),te.includes('"')){const me=te.split('"');te=String(me[0]??"").trim(),de=me[1]==null?null:String(me[1]).trim()}u++}const Ce=W(fe,te,de);return Ce.loading=ye,v(Ce),!0}function ge(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&z(Y,"\\[")}function xe(Y,ne){const D=Y.indexOf("[");if(D===-1)return!1;let X=Y.slice(0,D);const ve=Y.indexOf("](",D);if(ve!==-1){const fe=e[u+2];let pe=Y.slice(D+1,ve);if(pe.includes("[")){const ie=pe.indexOf("[");X+=Y.slice(0,D+ie+1);const ke=D+ie+1;pe=Y.slice(ke+1,ve)}const te=e[u+1];if(Y.endsWith("](")&&te?.type==="link_open"&&fe){const ie=e[u+4];let ke=4,Fe=!0;if(ie?.type==="text"){const dt=String(ie.content??"");if(dt.startsWith(")")){Fe=!1;const $t=dt.slice(1);if($t){const Et=f0(ie);Et.content=$t,Et.raw=$t,p()[u+4]=Et}else ke++}else dt==="."&&ke++}R(X,ne);const at=String(fe.content??"");return o?.validateLink&&!o.validateLink(at)?M(pe,pe):v({type:"link",href:at,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Fe}),u+=ke,!0}const de=Y.indexOf(")",ve),ye=de!==-1?Y.slice(ve+2,de):"",Ce=de===-1;let me=X.match(/\*+$/);if(me&&(X=X.replace(/\*+$/,"")),R(X,ne),me||(me=pe.match(/^\*+/)),!d&&me){const ie=me[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const ke=[];if(ie===1?ke.push({type:"em_open",tag:"em",nesting:1}):ie===2?ke.push({type:"strong_open",tag:"strong",nesting:1}):ie===3&&(ke.push({type:"strong_open",tag:"strong",nesting:1}),ke.push({type:"em_open",tag:"em",nesting:1})),ke.push({type:"link",href:ye,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Ce}),ie===1){ke.push({type:"em_close",tag:"em",nesting:-1});const{node:Fe}=y3(ke,0,o);b(Fe)}else if(ie===2){ke.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Fe}=i2(ke,0,void 0,o);b(Fe)}else if(ie===3){ke.push({type:"em_close",tag:"em",nesting:-1}),ke.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Fe}=i2(ke,0,void 0,o);b(Fe)}else{const{node:Fe}=y3(ke,0,o);b(Fe)}}else o?.validateLink&&!o.validateLink(ye)?M(pe,pe):v({type:"link",href:ye,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:Ce});const be=de!==-1?Y.slice(de+1):"";return be&&(N({type:"text",content:be,raw:be}),u--),u++,!0}return!1}function Ke(Y){const ne=Y.indexOf("![");if(ne===-1)return!1;const D=Y.slice(0,ne);return D&&!c?c={type:"text",content:D,raw:D}:D&&c&&(c.content+=D),c&&(a.push(c),c=null),v(G(Y.slice(ne))),u++,!0}function et(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ne=Y.slice(1).match(/[^\s\]]/);if(ne===null)return u++,!0;if(ne&&/x/i.test(ne[0])){const D=ne[0]==="x"||ne[0]==="X";return v({type:"checkbox_input",checked:D,raw:D?"[x]":"[ ]"}),u++,!0}return!1}return a}function ev(e,t,n){const o=n?.__sourceLineMapper;if(!o)return{startLine:e,endLine:t};const s=o(e),i=t>e?o(t-1).endLine:o(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,i)}}function x_(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let o=0;for(let s=0;so&&e[s-1]!==` +`&&r++,{startLine:i,endLine:r}}function Nd(e,t,n,o){const s=I1e(e,t,n);return ev(s.startLine,s.endLine,o)}function L1e(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const o=Number(n[0]),s=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(s)?null:ev(o,s,t)}function Wn(e,t,n){if(!n?.includeSourceMap)return e;const o=L1e(t,n);if(!o)return e;if(e.sourceMap=o,e.type==="code_block"){const s=e;s.startLine=o.startLine,s.endLine=o.endLine}return e}function $1e(e,t,n,o){if(!o?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const i=Number(s[0]),r=Number(s[1]),l=Number(n);return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=ev(i,Math.max(r,l),o)),e}function N1e(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function z1e(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function B1e(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function vu(e,t,n){const o=e[t],s=[],i=h1(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Wn(u,e[r],n),s.push(u),r=c+1}else r+=1;const l={type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const a=o.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:s,raw:s.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&Wn(l,o,n),[l,r+1]}function R1e(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=h1(o,!0);let a=t+1;for(;ac.raw).join(` `)} -:::`},a+1]}const $1e=new Set(["warning","info","note","tip","danger","caution"]);function N1e(e){let t=0;for(;t=0;m--){const k=f[m];if(k.type==="text"&&/:+/.test(k.content)){p=m;break}}const h={type:"paragraph",children:Oo((p!==-1?f.slice(0,p):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Wn(h,e[c],n),l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=gu(e,c,a.options());n?.includeSourceMap&&Wn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=vu(e,c,a.options());n?.includeSourceMap&&Wn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=Mp(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:r,children:l,raw:`:::${s} ${r} +:::`},a+1]}const F1e=new Set(["warning","info","note","tip","danger","caution"]);function j1e(e){let t=0;for(;t=0;m--){const k=f[m];if(k.type==="text"&&/:+/.test(k.content)){p=m;break}}const h={type:"paragraph",children:Oo((p!==-1?f.slice(0,p):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Wn(h,e[c],n),l.push(h),a.remember(h.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=vu(e,c,a.options());n?.includeSourceMap&&Wn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=wu(e,c,a.options());n?.includeSourceMap&&Wn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=Ap(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i} ${l.map(d=>d.raw).join(` `)} -:::`},c+1]}const B1e=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function R1e(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=B1e.exec(String(o.info??""));return s?L1e(e,t,s,n):null}const ev={parseContainer:(e,t,n)=>z1e(e,t,n),matchAdmonition:R1e};function vu(e,t,n){const o=[],s=h1(n,!0);let r=t+1;for(;rl.raw).join(` -`)};return n?.includeSourceMap&&Wn(i,e[t],n),[i,r+1]}function F1e(e){if(e.info?.startsWith("diff"))return Xg(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function j1e(e,t,n){const o=[];let s=t+1,r=[],i=[];const l=h1(n,!0);for(;sc.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(i=[];a0&&(o.push({type:"definition_item",term:r,definition:i,raw:`${r.map(c=>c.raw).join("")}: ${i.map(c=>c.raw).join(` -`)}`}),r=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(` -`)},s+1]}function O1e(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),r=[],i=h1(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function P1e(e,t,n){const o=e[t],s=o.attrs,r=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,i=String(o.tag?.substring(1)??"1"),l=Number.parseInt(i,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...r?{attrs:r}:{},children:Oo(a.children||[],c,void 0,n),raw:c}}function H1e(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),r=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let i=0,l=Math.max(0,n);for(;l$/.test(d)||i++,l=a+u+1;continue}l=a+1}return-1}function qI(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!k.includes(">");else if(c)c=!k.includes("?>");else if(k.startsWith("");else if(k.startsWith("");else if(k.startsWith("");else{const x=s(k);if(x)if(x.closing){for(let w=i.length-1;w>=0;w--)if(i[w]===x.tag){i.length=w;break}}else x.selfClosing||r(x.after,x.tag)||i.push(x.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||i.length>0}function S0e(e,t,n){if(!n?.length)return!1;const o=new Set(E0(n));if(!o.size)return!1;const s=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},r=u=>u===" "||u===" ",i=u=>{if(u[0]!=="<")return null;let d=1;for(;d"&&m!=="/")return null;const k=u.indexOf(">",d);if(k===-1)return null;let x=k-1;for(;x>=0&&r(u[x]);)x--;return{closing:f,tag:h,selfClosing:!f&&u[x]==="/",after:u.slice(k+1)}},l=(u,d)=>{const f=u.toLowerCase();let p=0;for(;p")return!0}}return!1},a=[];let c=0;for(;c=t?t:u,f=e.slice(c,d),p=f.endsWith("\r")?f.slice(0,-1):f,h=wu(p);if(h){const m=i(p.slice(h.index));if(m)if(m.closing){for(let k=a.length-1;k>=0;k--)if(a[k]===m.tag){a.length=k;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function C0e(e,t){const n=o0e.exec(e);if(!n)return null;const o=n[1]??"",s=n.index+o.length,r=e.indexOf(` -`,s),i=e.slice(s,r===-1?e.length:r);return!wu(i.endsWith("\r")?i.slice(0,-1):i)||_0e(e,s)||x0e(e,s)||S0e(e,s,t)?null:`${e.slice(0,n.index)}${o}`}function nL(e,t,n){let o=t;for(;oo&&(i=!0),t.inMath=!1,t.mathOpenOffset=null,r+=2;continue}r++;continue}if(t.inDollarMath){if(e.startsWith("$$",r)&&!r2(e,l)){o!=null&&s&&n+r+2>o&&(i=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,r+=2;continue}r++;continue}if(e[r]==="`"&&!r2(e,l)){const a=nL(e,r,"`"),c=M0e(e,r+a,a);if(c===-1)break;r=c+a;continue}if(e.startsWith("\\[",r)&&!r2(e,l)){t.inMath=!0,t.mathOpenOffset=n+r,r+=2;continue}if(e.startsWith("$$",r)&&!r2(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+r,r+=2;continue}r++}return i}function A0e(e,t){if(!Gg(t))return e;const n=t,o=A_.get(n),s=o?.source===e?o.state:o&&e.startsWith(o.source)?oL(o.state,e.slice(o.source.length),o.source.length-o.state.lineBuffer.length).state:Tp(e).state;A_.set(n,{source:e,state:s});const{context:r}=s,i=r.inMath?r.mathOpenOffset:r.inDollarMath?r.dollarMathOpenOffset:null;if(i==null)return e;const l=e.slice(i+2),a=e.lastIndexOf(` -`,i-1)+1;if(e.slice(a,i).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return Oa(l)&&!u?e:e.slice(0,i)}function T0e(e,t,n,o,s){const r=ov(e),i=sv(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&rv(e)==null&&Vh(t),t.inFence&&t.fenceInList&&e.trim()&&r.column=t.fenceLen&&/^\s*$/.test(l.rest)&&Vh(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&r.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return L_(e,t,n,o,s)}else return L_(e,t,n,o,s);return!1}function Tp(e,t=v0e(),n=null,o=!1,s=0){const r=K2(t);let i=K2(t),l="",a=!1,c=0;for(;cc&&e[u-1]==="\r"?u-1:d?u:e.length,p=e.slice(c,f);T0e(p,r,s+c,n,o)&&(a=!0),d?(i=K2(r),l=""):l=p,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:i,context:r,lineBuffer:l}}}function oL(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:K2(e.committedContext),context:K2(e.context),lineBuffer:e.lineBuffer+t}}:Tp(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function E0e(e,t){if(!Gg(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Ap.get(o);if(s?.source===t)return;const r=s?t.startsWith(s.source):!1,i=r&&s?t.slice(s.source.length):"",l=r&&s?oL(s.explicitBracketMath,i,s.source.length-s.explicitBracketMath.lineBuffer.length):Tp(t),a=l.state,c=r&&s?l.closedOpenMath:!1;if(s&&r&&s.key===null&&s.pendingCandidate===!1&&!c&&!b0e(s.source,i)&&!y0e(t)){s.source=t,s.explicitBracketMath=a;return}const u=fae(t);(s&&(s&&!r||s.key!==u||c)||!s&&u)&&n.reset(),w0e(e,t,u,a)}function I0e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function L0e(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,r)=>s===o[r])}function Wh(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&L0e(e,t)}function $_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function $0e(e){for(let t=0;t+5":""}function z_(e){return{type:"paragraph",children:e,raw:e.map(B0e).join("")}}function B_(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function R_(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=f0e(t);if(!s?.size)return null;let r=-1;for(let u=0;up?.type==="hardbreak")){r=u;break}}if(r===-1)return null;const i=o.slice(0,r),l=o[r];if(!l)return null;const a=[];i.length&&a.push(z_(i)),a.push(l);const c=o.slice(r+1);return c.length&&a.push(z_(c)),a}function R0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function G2(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function F0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ki(t)}\s*>\s*$`,"i").test(n)}const qh=new Set(["iframe","script","style","textarea","title"]);function tf(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=f=>{if(e.startsWith("",f+4);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}const p=Zo(e.slice(f));if(p===-1)return null;const h=f+p+1,m=e.slice(f,h);if(/^<\s*[!?]/.test(m))return{closing:!1,end:h,selfClosing:!1,tag:""};let k=m.slice(1).trimStart();const x=k.startsWith("/");x&&(k=k.slice(1).trimStart());const w=k.match(/^([A-Z][\w:-]*)/i);return w?.[1]?{closing:x,end:h,selfClosing:/\/\s*>$/.test(m),tag:w[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},r=(f,p)=>{const h=new RegExp(String.raw`<\s*\/\s*${Ki(f)}(?=\s|>)`,"gi");h.lastIndex=p;const m=h.exec(e);if(!m||m.index==null)return null;const k=s(m.index);return k?{start:m.index,end:k.end}:null};let i=-1,l=-1,a=Math.max(0,n);for(;a$/.test(c))return{raw:c,start:i,end:l+1,closed:!0};if(qh.has(o)){const f=r(o,l+1);return f?{raw:e.slice(i,f.end),start:i,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(i),start:i,end:e.length,closed:!1}}let u=1,d=l+1;for(;d]*$/,"")} -`}function F_(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function P0e(e,t,n){return n?e.includes(n,t)?!0:F_(e.slice(Math.max(0,t))).includes(F_(n)):!1}function H0e(e,t){let n=Math.max(0,t);for(;n0?r:void 0,children:l,raw:f},u?c+1:c]}function Dh(e,t,n,o){if(n?.type.endsWith("_close")){let s=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(s)||(s=Array.isArray(t.map)?Number(t.map[1])+1:NaN),$1e(e,t,s,o)}return Wn(e,t,o)}function e0e(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function t0e(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function n0e(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Kr(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Kr(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function o0e(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Zo(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const h=c+1;return{raw:e.slice(r,h),start:r,end:h}}let u=1,d=c+1;const f=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},p=h=>{const m=e.slice(h);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d",h);if(m===-1)return null;if(u--,u===0){const k=m+1;return{raw:e.slice(r,k),start:r,end:k}}d=m+1;continue}if(f(h)){const m=Zo(e.slice(h));if(m===-1)return null;u++,d=h+m+1;continue}d=h+1}return{raw:e.slice(r),start:r,end:e.length}}function q8(e){return Number.isFinite(e)&&e>0?e:0}function s0e(e,t){const n=q8(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s\s*$/.test(h),k=p===-1?null:n0e(f,l,p+1),x=k?.start??-1;let v="";p!==-1&&(x!==-1&&p]+)))?/g;let M;for(;(M=b.exec(h))!==null;){const $=M[1];if(!$||$.toLowerCase()===l)continue;const E=M[2]||M[3]||M[4]||"";w.push([$,E])}const R=!n?.final&&!m&&k==null,z={type:l,tag:l,content:e0e(v),raw:String(d?.raw??i.raw??f),loading:R,attrs:w.length?w:void 0};return s&&(d?z.sourceMap=Nd(a,d.start,d.end,n):Wn(z,o,n)),[z,t+1]}return s&&Wn(i,o,n),[i,t+1]}case"table_open":{const[i,r]=Y1e(e,t,n);return s&&Wn(i,o,n),[i,r]}case"dl_open":{const[i,r]=V1e(e,t,n);return s&&Wn(i,o,n),[i,r]}case"footnote_open":{const[i,r]=W1e(e,t,n);return s&&Wn(i,o,n),[i,r]}case"hr":{const i=X1e();return s&&Wn(i,o,n),[i,t+1]}}return null}function nv(e,t,n,o){const s=Ap(e,t,n);if(s)return s;const i=e[t],r=n?.includeSourceMap===!0;switch(i.type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer){const l=o.parseContainer(e,t,n);return r&&Dh(l[0],i,e[l[1]-1],n),l}break;case"container_open":if(o?.matchAdmonition){const l=o.matchAdmonition(e,t,n);if(l)return r&&Dh(l[0],i,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=Q1e(e,t,n);return r&&Dh(l[0],i,e[l[1]-1],n),l}}return null}function i0e(){return{type:"hardbreak",raw:`\\ +`}}function r0e(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:Oo(o.children||[],s,void 0,n),raw:s}}const C_=new WeakMap,XI=new WeakMap,M_=new WeakMap,A_=new WeakMap;function sl(e,t,n){const o=t?.map,s=n?.__sourceMarkdown;if(!Array.isArray(o)||o.length<2||typeof s!="string"||!n)return;const i=Number(o[0]),r=Number(o[1]);if(!Number.isFinite(i)||!Number.isFinite(r))return;let l=M_.get(n);if(!l){l=[0];for(let a=0;a{if(!c0e.has(t.type))return!1;const n=t.children;return!Array.isArray(n)||tL(n)})}function f0e(e){const t=[];let n=!1,o=0;for(;o{const u=r[c+1]??n.length;return{firstToken:n[a],lastToken:n[u-1],tokenCount:u-a}});v5.set(e,{groupBoundaries:l,source:t,nodes:s,stableGroupCount:o.mixed?Math.max(0,r.length-1):p0e(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:i.requireClosingStrong})}function m0e(e,t,n,o){for(let s=0;s0&&a.requireClosingStrong===o.requireClosingStrong&&t.startsWith(a.source)&&l.length>=u&&(c==="append"||c==="tail")&&m0e(a,n,l,u)){const f=l[u]??n.length,p=l4(n.slice(f),o,s),h=l.length-u;if(p.length===h){const m=a.nodes.slice(0,u).concat(p);return zd(s,"processTokensReusedTopLevelNodes",u),I_(e,t,n,r,m,o),m}}const d=l4(n,o,s);return I_(e,t,n,r,d,o),d}function v0e(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=T0(t);return n.length?new Set(n):null}function w0e(e,t){const n=e;let o=C_.get(n);o||(o=new Map,C_.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function y0e(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _3(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=Y1(s.value,n))}}function Y1(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Y1(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Y1(l,t),Y1(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Y1(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),_3(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),_3(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),_3(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!y0e(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),_3(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=Y1(i[r],t);return s}function nL(e,t=!0){if(!t)return f0(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>nL(a,t)):t&&r&&typeof r=="object"&&(l=Y1(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function L_(e,t=!0){return e.map(n=>nL(n,t))}function ov(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function k0e(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function b0e(e){Ep.delete(e)}function _0e(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function G2(e){return{...e}}function x0e(e,t,n,o=Tp(t).state){Ep.set(e,{explicitBracketMath:o,source:t,key:n,pendingCandidate:n===null&&zI(t)})}function S0e(e){return e.endsWith("$")||e.endsWith("\\")}function C0e(e){const t=Math.max(e.lastIndexOf(` +`)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return l0e.some(o=>n.endsWith(o))}function M0e(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||C0e(e)&&/[\r\n]/.test(t)):!1}function r2(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function U8(e){return e===" "||e===" "}function oL(e,t){return t===" "?e+1:e+4-e%4}function sv(e){let t=0,n=0;for(;t3?null:t}function Vh(e){const t=yu(e);if(!t)return null;const n=t.index,o=e[n];if(o!=="`"&&o!=="~")return null;let s=n;for(;s")return n?t:null;n=!0,s++,(t[s]===" "||t[s]===" ")&&s++,t=t.slice(s)}}function sL(e){const t=Vh(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=rv(e),o=n==null?null:Vh(n);if(o)return{...o,inBlockquote:!0,inList:!1,listIndent:0};const s=iv(e);if(!s)return null;const i=Vh(s.content);return i==null?null:{...i,inBlockquote:!1,inList:!0,listIndent:s.contentIndent}}function A0e(e,t){let n=!1,o="",s=0,i=!1,r=!1,l=0,a=null,c=0;for(;c=t?t:u,f=e.slice(c,d),p=f.endsWith("\r")?f.slice(0,-1):f,h=sv(p),m=iv(p);n&&i&&p.trim()&&rv(p)==null&&(n=!1,o="",s=0,i=!1,r=!1,l=0),n&&r&&p.trim()&&h.column=s&&/^\s*$/.test(k.rest)&&(n=!1,o="",s=0,i=!1,r=!1,l=0):(n=!0,o=k.markerChar,s=k.markerLen,i=k.inBlockquote,r=k.inList||a!=null&&!k.inBlockquote&&h.column>=a,l=k.listIndent||a||0)),u===-1||u>=t)break;c=u+1}return n}function E0e(e,t){const n=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},s=d=>{if(d[0]!=="<")return null;let f=1;for(;f"&&k!=="/")return null;const x=Zo(d);if(x===-1)return null;let v=x-1;for(;v>=0&&n(d[v]);)v--;return{closing:p,tag:m,selfClosing:!p&&d[v]==="/",after:d.slice(x+1)}},i=(d,f)=>{const p=d.toLowerCase();let h=0;for(;h")return!0}}return!1},r=[];let l=!1,a=!1,c=!1,u=0;for(;u=t?t:d,p=e.slice(u,f),h=p.endsWith("\r")?p.slice(0,-1):p,m=yu(h);if(m){const k=h.slice(m.index);if(l)l=!k.includes("-->");else if(a)a=!k.includes(">");else if(c)c=!k.includes("?>");else if(k.startsWith("");else if(k.startsWith("");else if(k.startsWith("");else{const x=s(k);if(x)if(x.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===x.tag){r.length=v;break}}else x.selfClosing||i(x.after,x.tag)||r.push(x.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||r.length>0}function T0e(e,t,n){if(!n?.length)return!1;const o=new Set(T0(n));if(!o.size)return!1;const s=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},i=u=>u===" "||u===" ",r=u=>{if(u[0]!=="<")return null;let d=1;for(;d"&&m!=="/")return null;const k=u.indexOf(">",d);if(k===-1)return null;let x=k-1;for(;x>=0&&i(u[x]);)x--;return{closing:f,tag:h,selfClosing:!f&&u[x]==="/",after:u.slice(k+1)}},l=(u,d)=>{const f=u.toLowerCase();let p=0;for(;p")return!0}}return!1},a=[];let c=0;for(;c=t?t:u,f=e.slice(c,d),p=f.endsWith("\r")?f.slice(0,-1):f,h=yu(p);if(h){const m=r(p.slice(h.index));if(m)if(m.closing){for(let k=a.length-1;k>=0;k--)if(a[k]===m.tag){a.length=k;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function I0e(e,t){const n=a0e.exec(e);if(!n)return null;const o=n[1]??"",s=n.index+o.length,i=e.indexOf(` +`,s),r=e.slice(s,i===-1?e.length:i);return!yu(r.endsWith("\r")?r.slice(0,-1):r)||A0e(e,s)||E0e(e,s)||T0e(e,s,t)?null:`${e.slice(0,n.index)}${o}`}function iL(e,t,n){let o=t;for(;oo&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,i+=2;continue}i++;continue}if(t.inDollarMath){if(e.startsWith("$$",i)&&!r2(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,i+=2;continue}i++;continue}if(e[i]==="`"&&!r2(e,l)){const a=iL(e,i,"`"),c=L0e(e,i+a,a);if(c===-1)break;i=c+a;continue}if(e.startsWith("\\[",i)&&!r2(e,l)){t.inMath=!0,t.mathOpenOffset=n+i,i+=2;continue}if(e.startsWith("$$",i)&&!r2(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+i,i+=2;continue}i++}return r}function $0e(e,t){if(!Yg(t))return e;const n=t,o=E_.get(n),s=o?.source===e?o.state:o&&e.startsWith(o.source)?rL(o.state,e.slice(o.source.length),o.source.length-o.state.lineBuffer.length).state:Tp(e).state;E_.set(n,{source:e,state:s});const{context:i}=s,r=i.inMath?i.mathOpenOffset:i.inDollarMath?i.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return Oa(l)&&!u?e:e.slice(0,r)}function N0e(e,t,n,o,s){const i=sv(e),r=iv(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&rv(e)==null&&Wh(t),t.inFence&&t.fenceInList&&e.trim()&&i.column=t.fenceLen&&/^\s*$/.test(l.rest)&&Wh(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&i.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return $_(e,t,n,o,s)}else return $_(e,t,n,o,s);return!1}function Tp(e,t=_0e(),n=null,o=!1,s=0){const i=G2(t);let r=G2(t),l="",a=!1,c=0;for(;cc&&e[u-1]==="\r"?u-1:d?u:e.length,p=e.slice(c,f);N0e(p,i,s+c,n,o)&&(a=!0),d?(r=G2(i),l=""):l=p,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:i,lineBuffer:l}}}function rL(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:G2(e.committedContext),context:G2(e.context),lineBuffer:e.lineBuffer+t}}:Tp(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function z0e(e,t){if(!Yg(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Ep.get(o);if(s?.source===t)return;const i=s?t.startsWith(s.source):!1,r=i&&s?t.slice(s.source.length):"",l=i&&s?rL(s.explicitBracketMath,r,s.source.length-s.explicitBracketMath.lineBuffer.length):Tp(t),a=l.state,c=i&&s?l.closedOpenMath:!1;if(s&&i&&s.key===null&&s.pendingCandidate===!1&&!c&&!M0e(s.source,r)&&!S0e(t)){s.source=t,s.explicitBracketMath=a;return}const u=vae(t);(s&&(s&&!i||s.key!==u||c)||!s&&u)&&n.reset(),x0e(e,t,u,a)}function B0e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function R0e(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function qh(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&R0e(e,t)}function N_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function F0e(e){for(let t=0;t+5":""}function B_(e){return{type:"paragraph",children:e,raw:e.map(P0e).join("")}}function R_(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function F_(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=v0e(t);if(!s?.size)return null;let i=-1;for(let u=0;up?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(B_(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(B_(c)),a}function H0e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Y2(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function D0e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Kr(t)}\s*>\s*$`,"i").test(n)}const Uh=new Set(["iframe","script","style","textarea","title"]);function nf(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const p=Zo(e.slice(f));if(p===-1)return null;const h=f+p+1,m=e.slice(f,h);if(/^<\s*[!?]/.test(m))return{closing:!1,end:h,selfClosing:!1,tag:""};let k=m.slice(1).trimStart();const x=k.startsWith("/");x&&(k=k.slice(1).trimStart());const v=k.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:x,end:h,selfClosing:/\/\s*>$/.test(m),tag:v[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},i=(f,p)=>{const h=new RegExp(String.raw`<\s*\/\s*${Kr(f)}(?=\s|>)`,"gi");h.lastIndex=p;const m=h.exec(e);if(!m||m.index==null)return null;const k=s(m.index);return k?{start:m.index,end:k.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(c))return{raw:c,start:r,end:l+1,closed:!0};if(Uh.has(o)){const f=i(o,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let u=1,d=l+1;for(;d]*$/,"")} +`}function j_(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function q0e(e,t,n){return n?e.includes(n,t)?!0:j_(e.slice(Math.max(0,t))).includes(j_(n)):!1}function U0e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function rL(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const V0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),W0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function q0e(e){return/\n\s*\n/.test(e)||W0e.test(e)}function U0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>V0e.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!q0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function Z0e(e){const t=[];let n=0;for(;n=e.length)break;const o=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!o?.[1])return null;const s=tf(e,o[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function K0e(e,t,n,o){const s=n.customHtmlTags?.join("\0")??"",r=t,i=M_.get(r),l=i&&i.final===o&&i.customHtmlTags===s&&i.requireClosingStrong===n.requireClosingStrong&&i.validateLink===n.validateLink,a=e.map((c,u)=>l&&i.blocks[u]===c?i.children[u]:Hc(c,t,n));return M_.set(r,{blocks:e,children:a,customHtmlTags:s,final:o,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function G0e(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const r=s,i=String(r.tag??"").toLowerCase();if(!i||i==="details"||lI.has(i)||Array.isArray(r.children))return s;const l=String(s.raw??r.content??"");if(!l)return s;const a=Zo(l);if(a===-1)return s;const c=tf(l,i,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return s;const p=rL(n,o),h=d?null:Z0e(f),m=h?K0e(h,t,p,o):Hc(f,t,p);return U0e(f,m)?{...s,children:m}:s})}function Y0e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function Hc(e,t,n){return e.trim()?lL(e,t,{...n,__disableStreamParse:!0}):[]}function X0e(e,t,n){const o=Hc(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function J0e(e,t,n){const o=qI({content:e}),s=Zo(e),r=sL(e,"summary");if(s!==-1&&r!==-1&&r>=s+1){const i=X0e(e.slice(s+1,r),t,n);i.length>0&&(o.children=i)}return o.raw=e,o}function Q0e(e,t,n){const o=Zo(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const r=tf(s,"summary",0);if(!r)return Hc(s,t,n);const i=s.slice(0,r.start),l=s.slice(r.end);return[...Hc(i,t,n),J0e(r.raw,t,n),...Hc(l,t,n)]}function iL(e,t,n,o,s,r=0){const i=[];let l=r;for(let a=0;a{const P=sL(f,"details");return P!==-1?f.slice(0,P):f})():f,[v]=iL(x?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,p+f.length),b=Q0e(w,n,rL(o,s)),M=m===-1?"":String(e[m].raw??G2(e[m])??""),R=x||m!==-1&&k?.closed===!0,z=M.replace(/[\t\r\n ]+$/,""),$=R?(()=>{const P=(k?.raw??"").lastIndexOf(z);return P===-1?t.length:p+P})():t.length,T=Zo(f),E=x&&T!==-1?p+T+1:p+f.length,N=t.slice(E,$===-1?t.length:$),C=n.parse(N,{__markstreamFinal:s}),O=n.renderer.render(C,n.options,{__markstreamFinal:s}),H=$+z.length,V=R?Math.max($+M.length,H0e(t,H)):t.length,A=R?t.slice($,V):M,F=R?t.slice(p,V):t.slice(p),j=x&&T!==-1?f.slice(0,T+1):f,q={...c,tag:"details",attrs:Cp(f.slice(0,T+1)),raw:F,content:`${j}${O}${A}`,children:[...b,...v],loading:!s&&!R};if(o.includeSourceMap&&(q.sourceMap=$d(t,p,R?V:t.length,o)),i.push(q),l=R?V:t.length,m===-1&&!x)break;m!==-1&&(a=m)}return[i,l]}function ece(e,t,n,o){if(!n)return e;const s=e.slice();let r=0;for(let i=0;i=d.start&&T.end<=d.end){s.splice(R,1);continue}break}M=$+z.length,s.splice(R,1)}}return s}function tce(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const k=m.charCodeAt(0);return k>=65&&k<=90||k>=97&&k<=122},u=m=>{const k=m.charCodeAt(0);return k>=48&&k<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",p=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=p;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!p(l[a]))return!1;for(a++;a=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||k==='"'||k==="'"||k==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=w=>w===" "||w===" ",p=w=>{let v=0;for(;v{let v=0;for(;v";)for(b=!0,v++;v{const v=p(w);if(v)return v;const b=h(w);return b==null?null:p(b)};let k=0;const x=l.split(/\r?\n/);for(const w of x){const v=k,b=k+w.length;if(a=d&&/^\s*$/.test(M.rest)&&(c=!1,u="",d=0):(c=!0,u=R,d=z)}if(a<=b)break;k=b+1}return c},s=String(e??""),r=s.lastIndexOf("<");if(r===-1||o(s,r))return s;if(r>0){const l=s[r-1],a=l===" "||l===" "||l===` -`||l==="\r",c=s[r-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const i=s.slice(r);return i.includes(">")||i.length>1&&(i[1]===" "||i[1]===" "||i[1]===` -`||i[1]==="\r")||!n(i)?s:s.slice(0,r)}function O_(e,t){if(e===t)return;const n=e.split(/\r?\n/),o=t.split(/\r?\n/),s=[];let r=0;for(let i=0;i{const l=Number.isFinite(i)?Math.max(0,Math.trunc(i)):0;if(lString(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},r=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let k=0;k=4)return!0;continue}if(x===" ")return!0;break}return!1},i=h=>{let m=!1,k=!1;for(let x=0;x")return x}return-1},l=h=>{let m=0;for(;m{if(r(h))return-1;const k=h.replace(/^[ \t]+/,"");if(!k||k.startsWith(">")||k.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(k))return-1;let x=!1,w=0;for(;w=M.length){x=!0,w++;continue}const z=M[R];if(z==="!"||z==="?"){x=!0,w+=b+1;continue}if(z==="/"){x=!0,w+=b+1;continue}const $=R;for(;R"&&E!=="/"){x=!0,w++;continue}const N=new RegExp(String.raw`<\s*\/\s*${T}\s*>`,"i"),C=/\/\s*>$/.test(M),O=N.test(h.slice(w+b+1)),H=N.test(e.slice(m+w+b+1)),V=/[\r\n]/.test(e.slice(m+w+b+1));if(x&&n.has(T)&&!C&&!O&&(H||V))return w;x=!0,w+=b+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;pp&&e[h-1]==="\r",x=m?k?h-1:h:e.length,w=e.slice(p,x),v=m?k?`\r +`?n+1:t}function O_(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function aL(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const K0e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),G0e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function Y0e(e){return/\n\s*\n/.test(e)||G0e.test(e)}function X0e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>K0e.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!Y0e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function J0e(e){const t=[];let n=0;for(;n=e.length)break;const o=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!o?.[1])return null;const s=nf(e,o[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function Q0e(e,t,n,o){const s=n.customHtmlTags?.join("\0")??"",i=t,r=A_.get(i),l=r&&r.final===o&&r.customHtmlTags===s&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((c,u)=>l&&r.blocks[u]===c?r.children[u]:Dc(c,t,n));return A_.set(i,{blocks:e,children:a,customHtmlTags:s,final:o,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function ece(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||uI.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Zo(l);if(a===-1)return s;const c=nf(l,r,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return s;const p=aL(n,o),h=d?null:J0e(f),m=h?Q0e(h,t,p,o):Dc(f,t,p);return X0e(f,m)?{...s,children:m}:s})}function tce(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function Dc(e,t,n){return e.trim()?uL(e,t,{...n,__disableStreamParse:!0}):[]}function nce(e,t,n){const o=Dc(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function oce(e,t,n){const o=KI({content:e}),s=Zo(e),i=lL(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=nce(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function sce(e,t,n){const o=Zo(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=nf(s,"summary",0);if(!i)return Dc(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...Dc(r,t,n),oce(i.raw,t,n),...Dc(l,t,n)]}function cL(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a{const P=lL(f,"details");return P!==-1?f.slice(0,P):f})():f,[w]=cL(x?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,p+f.length),b=sce(v,n,aL(o,s)),M=m===-1?"":String(e[m].raw??Y2(e[m])??""),R=x||m!==-1&&k?.closed===!0,z=M.replace(/[\t\r\n ]+$/,""),$=R?(()=>{const P=(k?.raw??"").lastIndexOf(z);return P===-1?t.length:p+P})():t.length,E=Zo(f),T=x&&E!==-1?p+E+1:p+f.length,N=t.slice(T,$===-1?t.length:$),C=n.parse(N,{__markstreamFinal:s}),O=n.renderer.render(C,n.options,{__markstreamFinal:s}),H=$+z.length,V=R?Math.max($+M.length,U0e(t,H)):t.length,A=R?t.slice($,V):M,F=R?t.slice(p,V):t.slice(p),j=x&&E!==-1?f.slice(0,E+1):f,q={...c,tag:"details",attrs:Mp(f.slice(0,E+1)),raw:F,content:`${j}${O}${A}`,children:[...b,...w],loading:!s&&!R};if(o.includeSourceMap&&(q.sourceMap=Nd(t,p,R?V:t.length,o)),r.push(q),l=R?V:t.length,m===-1&&!x)break;m!==-1&&(a=m)}return[r,l]}function ice(e,t,n,o){if(!n)return e;const s=e.slice();let i=0;for(let r=0;r=d.start&&E.end<=d.end){s.splice(R,1);continue}break}M=$+z.length,s.splice(R,1)}}return s}function rce(e){const t=l=>l===" "||l===" "||l===` +`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const k=m.charCodeAt(0);return k>=65&&k<=90||k>=97&&k<=122},u=m=>{const k=m.charCodeAt(0);return k>=48&&k<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",p=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",h=p;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!p(l[a]))return!1;for(a++;a=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||k==='"'||k==="'"||k==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=v=>v===" "||v===" ",p=v=>{let w=0;for(;w{let w=0;for(;w";)for(b=!0,w++;w{const w=p(v);if(w)return w;const b=h(v);return b==null?null:p(b)};let k=0;const x=l.split(/\r?\n/);for(const v of x){const w=k,b=k+v.length;if(a=d&&/^\s*$/.test(M.rest)&&(c=!1,u="",d=0):(c=!0,u=R,d=z)}if(a<=b)break;k=b+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===` +`||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function P_(e,t){if(e===t)return;const n=e.split(/\r?\n/),o=t.split(/\r?\n/),s=[];let i=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(h??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=h=>h===" "||h===" ",s=h=>{const m=h.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||h==="_"||h==="-"||h===":"},i=h=>{if(!h)return!1;if(h[0]===" ")return!0;let m=0;for(let k=0;k=4)return!0;continue}if(x===" ")return!0;break}return!1},r=h=>{let m=!1,k=!1;for(let x=0;x")return x}return-1},l=h=>{let m=0;for(;m{if(i(h))return-1;const k=h.replace(/^[ \t]+/,"");if(!k||k.startsWith(">")||k.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(k))return-1;let x=!1,v=0;for(;v=M.length){x=!0,v++;continue}const z=M[R];if(z==="!"||z==="?"){x=!0,v+=b+1;continue}if(z==="/"){x=!0,v+=b+1;continue}const $=R;for(;R"&&T!=="/"){x=!0,v++;continue}const N=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),C=/\/\s*>$/.test(M),O=N.test(h.slice(v+b+1)),H=N.test(e.slice(m+v+b+1)),V=/[\r\n]/.test(e.slice(m+v+b+1));if(x&&n.has(E)&&!C&&!O&&(H||V))return v;x=!0,v+=b+1}return-1};let c=!1,u="",d=0,f="",p=0;for(;pp&&e[h-1]==="\r",x=m?k?h-1:h:e.length,v=e.slice(p,x),w=m?k?`\r `:` -`:"",b=l(w);let M=w;if(!c&&!b){const R=a(w,p);if(R!==-1){const z=v||` -`;M=`${w.slice(0,R).replace(/[ \t]+$/,"")}${z}${z}${w.slice(R).replace(/^[ \t]+/,"")}`}}f+=M,f+=v,b&&(c?b.markerChar===u&&b.markerLen>=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),p=m?h+1:e.length}return f}function oce(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},r=d=>{let f=0;for(;f{let f=!1,p=!1;for(let h=0;h")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let k=m+1;for(;k=d.length||d[k]!=="/"){m=d.indexOf("<",m+1);continue}for(k++;kd.length){m=d.indexOf("<",m+1);continue}let x=!0;for(let v=0;v="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==h[v]){x=!1;break}}if(!x){m=d.indexOf("<",m+1);continue}let w=k+h.length;if(w")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const p=f;for(;f=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),p=m?h+1:e.length}return f}function ace(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f{let f=!1,p=!1;for(let h=0;h")return h}return-1},l=(d,f,p)=>{const h=p.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let k=m+1;for(;k=d.length||d[k]!=="/"){m=d.indexOf("<",m+1);continue}for(k++;kd.length){m=d.indexOf("<",m+1);continue}let x=!0;for(let w=0;w="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==h[w]){x=!1;break}}if(!x){m=d.indexOf("<",m+1);continue}let v=k+h.length;if(v")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const p=f;for(;fu&&e[d-1]==="\r",p=f?d-1:d,h=e.slice(u,p);c+=a(h),c+=f?`\r `:` -`,u=d+1}return c}function sce(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let p=0,h=!1,m=0;for(;p=f.length||f[p]!==">")break;for(h=!0,p++;p{let p=0;for(;pnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;dString(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let p=0,h=!1,m=0;for(;p=f.length||f[p]!==">")break;for(h=!0,p++;p{let p=0;for(;pnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;dd&&e[f-1]==="\r",m=p?h?f-1:f:e.length,k=e.slice(d,m),x=p?h?`\r `:` -`:"",w=s(k),v=w?.prefix??"",b=w?.content??k,M=r(b);M&&(l?M.markerChar===a&&M.markerLen>=c&&/^\s*$/.test(M.rest)&&(l=!1,a="",c=0):(l=!0,a=M.markerChar,c=M.markerLen));let R=b;if(!l&&R.includes("{if(N.replace(/^[\t ]+/,"").startsWith("|"))return $;const C=N.slice(0,E).replace(/^[\t ]+/,"");if(C.length>0){const O=T.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=C.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!H||O!==H)return $}return`${T} +`:"",v=s(k),w=v?.prefix??"",b=v?.content??k,M=i(b);M&&(l?M.markerChar===a&&M.markerLen>=c&&/^\s*$/.test(M.rest)&&(l=!1,a="",c=0):(l=!0,a=M.markerChar,c=M.markerLen));let R=b;if(!l&&R.includes("{if(N.replace(/^[\t ]+/,"").startsWith("|"))return $;const C=N.slice(0,T).replace(/^[\t ]+/,"");if(C.length>0){const O=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=C.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!H||O!==H)return $}return`${E} -`});if(v){const z=v+R.split(` +`});if(w){const z=w+R.split(` `).join(` -${v}`);u+=z}else u+=R;u+=x,d=p?f+1:e.length}return u}function rce(e,t){if(!e||!t.length)return e;const n=new Set(t.map(C=>String(C??"").toLowerCase()));if(!n.size)return e;const o=C=>C===" "||C===" ",s=C=>{if(!C)return!1;if(C[0]===" ")return!0;let O=0;for(let H=0;H=4)return!0;continue}if(V===" ")return!0;break}return!1},r=C=>{const O=C.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||C==="_"||C==="-"||C===":"},i=C=>{let O=0;for(;O{let O=0,H=!1,V=0;for(;O=C.length||C[O]!==">")break;for(H=!0,O++;Oi(C).startsWith("<"),c=C=>{for(let O=0;O{if(s(C))return"";const O=i(C);if(!O.startsWith("<"))return"";let H=1;for(;H=O.length||O[H]==="/"||O[H]==="!"||O[H]==="?")return"";const V=H;for(;H"&&F!=="/"?"":A},d=C=>{if(s(C))return null;const O=i(C);if(!O.startsWith("<"))return null;let H=1;for(;H=O.length)return null;const V=O[H]==="/";if(V)for(H++;H"&&q!=="/")return null;if(V)return{type:"close",name:j};if(/\/\s*>\s*$/.test(O))return{type:"open",name:j,complete:!0};const P=O.indexOf(">",H);if(P!==-1){const W=O.slice(P+1);if(new RegExp(`<\\s*\\/\\s*${j}\\s*>`,"i").test(W))return{type:"open",name:j,complete:!0}}return{type:"open",name:j,complete:!1}},f=C=>{if(s(C))return null;const O=i(C).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const H=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const V=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!V?.[1]||!V[2])return null;const A=V[1].toLowerCase();return A===V[2].toLowerCase()?A:null};let p=!1,h="",m=0;const k=C=>{let O=0;for(;Ok(C),w=C=>{const O=i(C);return O?s(C)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},v=(C,O,H)=>{let V=C,A=0;for(;VV&&e[F-1]==="\r",P=j?q?F-1:F:e.length,W=e.slice(V,P),G=l(W),ee=G?.key??"";if(A>0&&O&&ee!==O)break;const se=G?.content??W,oe=d(se);if(oe?.name===H){if(oe.type==="open")oe.complete||A++;else if(A>0&&(A--,A===0))return!1}else if(A>0&&(c(se)||w(se)))return!0;if(j)V=F+1;else break}return!1};let b="",M=0,R=!0,z=!1,$=!1,T=` -`;const E=[];let N="";for(;MString(C??"").toLowerCase()));if(!n.size)return e;const o=C=>C===" "||C===" ",s=C=>{if(!C)return!1;if(C[0]===" ")return!0;let O=0;for(let H=0;H=4)return!0;continue}if(V===" ")return!0;break}return!1},i=C=>{const O=C.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||C==="_"||C==="-"||C===":"},r=C=>{let O=0;for(;O{let O=0,H=!1,V=0;for(;O=C.length||C[O]!==">")break;for(H=!0,O++;Or(C).startsWith("<"),c=C=>{for(let O=0;O{if(s(C))return"";const O=r(C);if(!O.startsWith("<"))return"";let H=1;for(;H=O.length||O[H]==="/"||O[H]==="!"||O[H]==="?")return"";const V=H;for(;H"&&F!=="/"?"":A},d=C=>{if(s(C))return null;const O=r(C);if(!O.startsWith("<"))return null;let H=1;for(;H=O.length)return null;const V=O[H]==="/";if(V)for(H++;H"&&q!=="/")return null;if(V)return{type:"close",name:j};if(/\/\s*>\s*$/.test(O))return{type:"open",name:j,complete:!0};const P=O.indexOf(">",H);if(P!==-1){const W=O.slice(P+1);if(new RegExp(`<\\s*\\/\\s*${j}\\s*>`,"i").test(W))return{type:"open",name:j,complete:!0}}return{type:"open",name:j,complete:!1}},f=C=>{if(s(C))return null;const O=r(C).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const H=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const V=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!V?.[1]||!V[2])return null;const A=V[1].toLowerCase();return A===V[2].toLowerCase()?A:null};let p=!1,h="",m=0;const k=C=>{let O=0;for(;Ok(C),v=C=>{const O=r(C);return O?s(C)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},w=(C,O,H)=>{let V=C,A=0;for(;VV&&e[F-1]==="\r",P=j?q?F-1:F:e.length,W=e.slice(V,P),G=l(W),ee=G?.key??"";if(A>0&&O&&ee!==O)break;const se=G?.content??W,oe=d(se);if(oe?.name===H){if(oe.type==="open")oe.complete||A++;else if(A>0&&(A--,A===0))return!1}else if(A>0&&(c(se)||v(se)))return!0;if(j)V=F+1;else break}return!1};let b="",M=0,R=!0,z=!1,$=!1,E=` +`;const T=[];let N="";for(;MM&&e[C-1]==="\r",V=O?H?C-1:C:e.length,A=e.slice(M,V),F=O?H?`\r `:` -`:"",j=l(A),q=j?.key??"",P=j?.content??A,W=x(P);W&&(p?W.markerChar===h&&W.markerLen>=m&&/^\s*$/.test(W.rest)&&(p=!1,h="",m=0):(p=!0,h=W.markerChar,m=W.markerLen));const G=E.length>0;if(!p&&!G){const se=u(P),oe=!!se&&!R&&z&&$&&v(M,q,se);se&&!R&&(!z||oe)&&(q&&N&&q===N?b+=`${q}${T}`:q||(b+=T))}if(b+=A,b+=F,F&&(T=F),!p){const se=d(P);if(se){if(se.type==="open")se.complete||E.push(se.name);else for(let oe=E.length-1;oe>=0;oe--)if(E[oe]===se.name){E.length=oe;break}}}const ee=c(P);R=ee,z=!ee&&a(P),$=!ee&&!!f(P),N=q,M=O?C+1:e.length}return b}function lL(e,t,n={}){const o=GI(n),s=o?tu():0,r=!!n.final,i=(e??"").toString();let l=i.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(m0e(t,n)&&(t.stream.reset(),g0e(t)),r||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(` +`:"",j=l(A),q=j?.key??"",P=j?.content??A,W=x(P);W&&(p?W.markerChar===h&&W.markerLen>=m&&/^\s*$/.test(W.rest)&&(p=!1,h="",m=0):(p=!0,h=W.markerChar,m=W.markerLen));const G=T.length>0;if(!p&&!G){const se=u(P),oe=!!se&&!R&&z&&$&&w(M,q,se);se&&!R&&(!z||oe)&&(q&&N&&q===N?b+=`${q}${E}`:q||(b+=E))}if(b+=A,b+=F,F&&(E=F),!p){const se=d(P);if(se){if(se.type==="open")se.complete||T.push(se.name);else for(let oe=T.length-1;oe>=0;oe--)if(T[oe]===se.name){T.length=oe;break}}}const ee=c(P);R=ee,z=!ee&&a(P),$=!ee&&!!f(P),N=q,M=O?C+1:e.length}return b}function uL(e,t,n={}){const o=JI(n),s=o?nu():0,i=!!n.final,r=(e??"").toString();let l=r.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(k0e(t,n)&&(t.stream.reset(),b0e(t)),i||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,v=>v.startsWith(` `)?` -`:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(` +`:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,v=>v.startsWith(` `)?` -`:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(` +`:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,v=>v.startsWith(` `)?` `:""):/\n\s*[*+]\s*$/.test(l)?l=l.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(` +`):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,v=>v.startsWith(` `)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,v,b)=>`${v}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(v,w,b)=>`${w}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,v=>v.startsWith(` `)?` `:""):/\n[[(]\n*$/.test(l)&&(l=l.replace(/(\n\[|\n\()+\n*$/g,` -`)),l=A0e(l,t),l=C0e(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const w=E0(n.customHtmlTags);if(w.length&&(l=nce(l,w),l=oce(l,w),l=rce(l,w),l=sce(l,w),l.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}r||(l=tce(l));const a=R0e(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:O_(i,l)};a[0].sourceMap=$d(l,0,l.length,b)}const w=n.preTransformTokens,v=n.postTransformTokens;if(nv(t,n)||typeof w=="function"||typeof v=="function"){const b=N_(t,l,{__markstreamFinal:r},n),M=typeof w=="function"&&w(b)||b;typeof v=="function"&&v(M)}return T_(a,n,o,s)}const c=N_(t,l,{__markstreamFinal:r},n);if(!c||!Array.isArray(c))return T_([],n,o,s);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const p=t,h=typeof p.validateLink=="function"&&p.__markstreamOriginalValidateLink&&p.validateLink!==p.__markstreamOriginalValidateLink?p.validateLink:void 0,m=n.validateLink??h??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),k={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?O_(i,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let x=d0e(t,l,f,k,o);if(d&&typeof d=="function"){const w=d(f);if(Array.isArray(w)){const v=w[0],b=v?.type;v&&typeof b=="string"?x=i4(w,{...k,__customHtmlBlockCursor:0},o):x=w}}if(Y0e(x)&&(x=ece(x,r,l,k),x=iL(x,l,t,k,r)[0],x=G0e(x,t,k,r)),r){const w=new WeakSet,v=b=>{if(!b||typeof b!="object"||w.has(b))return;if(w.add(b),Array.isArray(b)){for(const R of b)v(R);return}const M=b;M.type==="html_block"&&M.loading===!0&&(M.loading=!1);for(const R of Object.values(M))v(R)};v(x)}return x=XI(x,n),n.debug&&console.log("Parsed Markdown Tree Structure:",x),YI(x,o,s)}function P_(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=h1(t),s=t?.includeSourceMap===!0;let r=0;for(;ru.type==="html_block")){if(s)for(const u of c)Wn(u,l,t);for(const u of c)sl(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};s&&Wn(u,l,t);const d=R_(u,t);if(d){s&&B_(d,u);for(const f of d)sl(f,l,t);n.push(...d)}else sl(u,l,t),n.push(u)}o.remember(a)}r+=1;break;default:r+=1;break}}return n}const ice=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,lce=new Set([...Jd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),ace=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function H_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cce(e){return typeof e=="string"?e:e==null?"":String(e)}function aL(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Pa(e){return cce(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function cL(e){return Pa(e).replace(/`/g,"`")}function Ip(e){return String(e??"").trim().toLowerCase()}function iv(e,t="safe"){const n=Ip(e);return n?t==="escape"?!0:t==="trusted"?Jd.has(n):!ace.has(n):!1}function uL(e,t="safe"){const n=Ip(e);return n?t==="escape"?!0:t==="trusted"?Jd.has(n):lce.has(n):!1}function D_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${cL(o)}"`).join("")}function dL(e){const t=e.startsWith("/"),n=t?e.slice(1):e,o=n.match(ice);return o?{attrsStr:t?"":n.slice(o[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:o[1]}:null}function uce(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||d0(s,{tagName:t,attrName:"srcset"})})}function fL(e,t,n,o){return rie.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?uce(t,o):!!(iie.has(e)&&t&&d0(t,{tagName:o,attrName:e}))}function X1(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function pL(e,t,n,o=!1){if(t!=="safe"||Ip(n)!=="a")return e;const s=X1(e,"href");if(o&&(!s||!e[s])){const a=X1(e,"target"),c=X1(e,"rel");return a&&delete e[a],c&&delete e[c],e}const r=X1(e,"target");if((r?String(e[r]).trim():"").toLowerCase()!=="_blank")return e;const i=X1(e,"rel"),l=new Set(String(i?e[i]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),i&&i!=="rel"&&delete e[i],e.rel=Array.from(l).join(" "),e}function V_(e,t="safe",n){const o={};for(const[s,r]of Object.entries(e)){const i=s.trim(),l=i.toLowerCase();!i||!aL(i)||fL(l,r,t,n)||(o[i]=r)}return pL(o,t,n,!!X1(e,"href"))}function hL(e,t){const n=e.toLowerCase();return iI.has(n)?!1:H_(t,n)||H_(t,e)}function lv(e,t="safe",n){const o={};for(const[s,r]of Object.entries(e)){const i=s.trim(),l=i.toLowerCase();!i||!aL(i)||fL(l,r,t,n)||(o[i]=r)}return pL(o,t,n,!!X1(e,"href"))}function Y2(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function l4(e,t="safe",n){const o=lv(Y2(e),t,n),s=Object.entries(o).map(([r,i])=>[r,i]);return s.length>0?s:void 0}function dce(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function fce(e){const t={};for(const[n,o]of Object.entries(e))t[n]=dce(o,n);return t}function Uh(e){return e.trim().length>0}function mL(e){const t=[];let n=0;for(;n",n);if(i!==-1){n=i+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(nn){const i=e.slice(n,o);Uh(i)&&t.push({type:"text",content:i})}if(e.startsWith("![CDATA[",o+1)){const i=e.indexOf("]]>",o);if(i!==-1){t.push({type:"text",content:e.slice(o,i+3)}),n=i+3;continue}break}if(e.startsWith("!",o+1)){const i=e.indexOf(">",o);if(i!==-1){n=i+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const r=dL(e.slice(o+1,s));if(!r){const i=e.slice(o,s+1);Uh(i)&&t.push({type:"text",content:i}),n=s+1;continue}if(r.isClosing)t.push({type:"tag_close",tagName:r.tagName});else{const i={};if(r.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(r.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(i[c]=u)}}t.push({type:r.isSelfClosing||r1.has(r.tagName.toLowerCase())?"self_closing":"tag_open",tagName:r.tagName,attrs:i})}n=s+1}return t}function pce(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const o=e.indexOf("<",n);if(o===-1){nn&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const l=e.indexOf("]]>",o);if(l!==-1){t.push({type:"text",content:e.slice(o,l+3)}),n=l+3;continue}break}if(e.startsWith("!",o+1)){const l=e.indexOf(">",o);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const r=dL(e.slice(o+1,s));if(!r){t.push({type:"text",content:e.slice(o,s+1)}),n=s+1;continue}if(r.isClosing){t.push({type:"tag_close",tagName:r.tagName}),n=s+1;continue}const i={};if(r.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(r.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(i[c]=u)}}t.push({type:r.isSelfClosing||r1.has(r.tagName.toLowerCase())?"self_closing":"tag_open",tagName:r.tagName,attrs:i}),n=s+1}return t}function hce(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Pa(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Pa(o)}`:` ${Pa(o)}="${cL(s)}"`).join("");return e.type==="self_closing"?`<${Pa(t)}${n} />`:`<${Pa(t)}${n}>`}function mce(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of mL(e))if((n.type==="tag_open"||n.type==="self_closing")&&hL(n.tagName??"",t))return!0;return!1}function Dc(e,t="safe"){if(!e)return"";if(t==="escape")return Pa(e);const n=pce(e),o=[],s=[],r=[];for(const i of n){if(i.type==="text"){r.length===0&&s.push(Pa(i.content??""));continue}const l=Ip(i.tagName);if(!l)continue;if(uL(l,t)){i.type==="tag_open"?r.push(l):i.type==="tag_close"&&r[r.length-1]===l&&r.pop();continue}if(r.length>0)continue;if(t==="safe"&&iv(l,t)){s.push(hce(i));continue}if(i.type==="self_closing"){s.push(`<${l}${D_(V_(i.attrs??{},t,l))}>`);continue}if(i.type==="tag_open"){s.push(`<${l}${D_(V_(i.attrs??{},t,l))}>`),r1.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(``)}const c=o.pop();c&&s.push(``)}for(;o.length>0;){const i=o.pop();i&&s.push(``)}return s.join("")}const gce=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],W_="http://www.w3.org/2000/svg",vce=new Set(["script","style","iframe","object","embed","link","meta"]),wce=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),yce=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),kce=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),bce=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function _ce(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function xce(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Sce(e){const t=e.nodeName.toLowerCase();return t==="use"?_ce(e):t==="image"?xce(e):t==="text"||t==="tspan"?!!e.textContent?.trim():bce.has(t)}function Cce(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Mce(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),r=String(n??"").trim();return r?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?r.startsWith("#")?r:"":o==="a"&&(s==="href"||s==="xlink:href")?d0(r,{tagName:"a",attrName:"href"})?"":r:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?d0(r,{tagName:"img",attrName:"src"})?"":r:s==="href"||s==="xlink:href"?r.startsWith("#")?r:"":d0(r,{tagName:o,attrName:s})?"":r:""}function Ace(e,t){let n=t+4;for(;n{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function vL(e){const t=gL(e),n=t.toLowerCase();let o=0;for(;on.test(t))||vL(t)}function Tce(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function _3(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function wL(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!vce.has(o)){if(o==="br"){t.push(` -`);return}for(const s of Array.from(n.childNodes))wL(s,t)}}function Ece(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];wL(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=_3(t.getAttribute("width")),r=_3(t.getAttribute("height")),i=_3(t.getAttribute("x")),l=_3(t.getAttribute("y")),a=e.ownerDocument.createElementNS(W_,"text");a.setAttribute("x",String(i+s/2)),a.setAttribute("y",String(l+r/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const p=e.ownerDocument.createElementNS(W_,"tspan");p.setAttribute("x",String(i+s/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function Ice(e){Ece(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!wce.has(o)){n.remove();continue}if(o==="style"&&q_(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const r of s){const i=r.name.toLowerCase();if(/^on/i.test(i)){n.removeAttribute(r.name);continue}if(i==="style"&&r.value&&q_(r.value)){n.removeAttribute(r.name);continue}if(i==="srcdoc"){n.removeAttribute(r.name);continue}if(yce.has(i)&&r.value){const l=Mce(o,i,r.value);if(!l){n.removeAttribute(r.name);continue}l!==r.value&&n.setAttribute(r.name,l);continue}if(kce.has(i)&&r.value&&vL(r.value)){n.removeAttribute(r.name);continue}if(r.value){const l=Cce(r.value);l!==r.value&&n.setAttribute(r.name,l)}}Tce(n)}}function UWe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Ice(n),Lce(n)?null:n}catch{return null}}function Lce(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const r=Number.parseFloat(s[2]||""),i=Number.parseFloat(s[3]||"");if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){Sce(s)&&(o=!0);for(const r of Array.from(s.attributes))if(/\bNaN\b/i.test(r.value)||r.name==="style"&&/max-width:\s*0(?:px)?/i.test(r.value))return!0}return!o}const x3=[];function Zh(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function $ce(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Nce(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function U_(e=`editor-${Date.now()}`,t={}){const n=bae(t),o=n;o.__markstreamRegisteredPluginCount=x3.length,o.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||x3.length);const s={"common.copy":"Copy"};let r;if(typeof t.i18n=="function")r=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;r=m=>h[m]??s[m]??m}else r=h=>s[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[k,...x]=m;typeof k=="function"&&n.use(k,...x)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(x3.length)for(const h of x3)if(Array.isArray(h)){const[m,...k]=h;typeof m=="function"&&n.use(m,...k)}else typeof h=="function"&&n.use(h);n.use(Fte),n.use(Pte),n.use(zte);const i=ene,l=i.default??i;n.use(l),n.use(Nte),n.use($te),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,k=m.src,x=!!m.env?.__markstreamFinal,w=k.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const b=v.map[0],M=v.map[1],R=v.markup,z=R[0],$=R.length,T=w[Math.max(0,M-1)]??"";let E=0;for(;Eb+1&&N>=$&&C===T.length,H=v;H.meta=H.meta??{},H.meta.unclosed=!O,H.meta.closed=!!O}});const a=(h,m)=>{const k=h,x=k.pos;if(k.src[x]!=="~")return!1;const w=k.src[x-1],v=k.src[x+1];if(/\d/.test(w)&&/\d/.test(v)){if(!m){const b=k.push("text","",0);b.content="~"}return k.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(h,m)=>{const k=h[m],x=String(k.info??"").trim(),w=String(k.content??""),v=btoa(unescape(encodeURIComponent(w))),b=$ce(x),M=Zh(b),R=Nce(`editor-${e}-${m}-${b}`),z=Zh(r("common.copy"));return`
        +`)),l=$0e(l,t),l=I0e(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const v=T0(n.customHtmlTags);if(v.length&&(l=lce(l,v),l=ace(l,v),l=uce(l,v),l=cce(l,v),l.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}i||(l=rce(l));const a=H0e(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:P_(r,l)};a[0].sourceMap=Nd(l,0,l.length,b)}const v=n.preTransformTokens,w=n.postTransformTokens;if(ov(t,n)||typeof v=="function"||typeof w=="function"){const b=z_(t,l,{__markstreamFinal:i},n),M=typeof v=="function"&&v(b)||b;typeof w=="function"&&w(M)}return T_(a,n,o,s)}const c=z_(t,l,{__markstreamFinal:i},n);if(!c||!Array.isArray(c))return T_([],n,o,s);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const p=t,h=typeof p.validateLink=="function"&&p.__markstreamOriginalValidateLink&&p.validateLink!==p.__markstreamOriginalValidateLink?p.validateLink:void 0,m=n.validateLink??h??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),k={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?P_(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let x=g0e(t,l,f,k,o);if(d&&typeof d=="function"){const v=d(f);if(Array.isArray(v)){const w=v[0],b=w?.type;w&&typeof b=="string"?x=l4(v,{...k,__customHtmlBlockCursor:0},o):x=v}}if(tce(x)&&(x=ice(x,i,l,k),x=cL(x,l,t,k,i)[0],x=ece(x,t,k,i)),i){const v=new WeakSet,w=b=>{if(!b||typeof b!="object"||v.has(b))return;if(v.add(b),Array.isArray(b)){for(const R of b)w(R);return}const M=b;M.type==="html_block"&&M.loading===!0&&(M.loading=!1);for(const R of Object.values(M))w(R)};w(x)}return x=eL(x,n),n.debug&&console.log("Parsed Markdown Tree Structure:",x),QI(x,o,s)}function H_(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=h1(t),s=t?.includeSourceMap===!0;let i=0;for(;iu.type==="html_block")){if(s)for(const u of c)Wn(u,l,t);for(const u of c)sl(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};s&&Wn(u,l,t);const d=F_(u,t);if(d){s&&R_(d,u);for(const f of d)sl(f,l,t);n.push(...d)}else sl(u,l,t),n.push(u)}o.remember(a)}i+=1;break;default:i+=1;break}}return n}const dce=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,fce=new Set([...Qd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),pce=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function D_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hce(e){return typeof e=="string"?e:e==null?"":String(e)}function dL(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Pa(e){return hce(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function fL(e){return Pa(e).replace(/`/g,"`")}function Lp(e){return String(e??"").trim().toLowerCase()}function lv(e,t="safe"){const n=Lp(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):!pce.has(n):!1}function pL(e,t="safe"){const n=Lp(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):fce.has(n):!1}function V_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${fL(o)}"`).join("")}function hL(e){const t=e.startsWith("/"),n=t?e.slice(1):e,o=n.match(dce);return o?{attrsStr:t?"":n.slice(o[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:o[1]}:null}function mce(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||d0(s,{tagName:t,attrName:"srcset"})})}function mL(e,t,n,o){return ure.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?mce(t,o):!!(dre.has(e)&&t&&d0(t,{tagName:o,attrName:e}))}function X1(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function gL(e,t,n,o=!1){if(t!=="safe"||Lp(n)!=="a")return e;const s=X1(e,"href");if(o&&(!s||!e[s])){const a=X1(e,"target"),c=X1(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=X1(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=X1(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function W_(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!dL(r)||mL(l,i,t,n)||(o[r]=i)}return gL(o,t,n,!!X1(e,"href"))}function vL(e,t){const n=e.toLowerCase();return cI.has(n)?!1:D_(t,n)||D_(t,e)}function av(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!dL(r)||mL(l,i,t,n)||(o[r]=i)}return gL(o,t,n,!!X1(e,"href"))}function X2(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function a4(e,t="safe",n){const o=av(X2(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function gce(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function vce(e){const t={};for(const[n,o]of Object.entries(e))t[n]=gce(o,n);return t}function Zh(e){return e.trim().length>0}function wL(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(nn){const r=e.slice(n,o);Zh(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",o+1)){const r=e.indexOf("]]>",o);if(r!==-1){t.push({type:"text",content:e.slice(o,r+3)}),n=r+3;continue}break}if(e.startsWith("!",o+1)){const r=e.indexOf(">",o);if(r!==-1){n=r+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=hL(e.slice(o+1,s));if(!i){const r=e.slice(o,s+1);Zh(r)&&t.push({type:"text",content:r}),n=s+1;continue}if(i.isClosing)t.push({type:"tag_close",tagName:i.tagName});else{const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||i1.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r})}n=s+1}return t}function wce(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const o=e.indexOf("<",n);if(o===-1){nn&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const l=e.indexOf("]]>",o);if(l!==-1){t.push({type:"text",content:e.slice(o,l+3)}),n=l+3;continue}break}if(e.startsWith("!",o+1)){const l=e.indexOf(">",o);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=hL(e.slice(o+1,s));if(!i){t.push({type:"text",content:e.slice(o,s+1)}),n=s+1;continue}if(i.isClosing){t.push({type:"tag_close",tagName:i.tagName}),n=s+1;continue}const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||i1.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r}),n=s+1}return t}function yce(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Pa(t)}>`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Pa(o)}`:` ${Pa(o)}="${fL(s)}"`).join("");return e.type==="self_closing"?`<${Pa(t)}${n} />`:`<${Pa(t)}${n}>`}function kce(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of wL(e))if((n.type==="tag_open"||n.type==="self_closing")&&vL(n.tagName??"",t))return!0;return!1}function Vc(e,t="safe"){if(!e)return"";if(t==="escape")return Pa(e);const n=wce(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Pa(r.content??""));continue}const l=Lp(r.tagName);if(!l)continue;if(pL(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&lv(l,t)){s.push(yce(r));continue}if(r.type==="self_closing"){s.push(`<${l}${V_(W_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${V_(W_(r.attrs??{},t,l))}>`),i1.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(``)}const c=o.pop();c&&s.push(``)}for(;o.length>0;){const r=o.pop();r&&s.push(``)}return s.join("")}const bce=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],q_="http://www.w3.org/2000/svg",_ce=new Set(["script","style","iframe","object","embed","link","meta"]),xce=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),Sce=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Cce=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Mce=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Ace(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Ece(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Tce(e){const t=e.nodeName.toLowerCase();return t==="use"?Ace(e):t==="image"?Ece(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Mce.has(t)}function Ice(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Lce(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?d0(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?d0(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":d0(i,{tagName:o,attrName:s})?"":i:""}function $ce(e,t){let n=t+4;for(;n{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function kL(e){const t=yL(e),n=t.toLowerCase();let o=0;for(;on.test(t))||kL(t)}function Nce(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function x3(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function bL(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!_ce.has(o)){if(o==="br"){t.push(` +`);return}for(const s of Array.from(n.childNodes))bL(s,t)}}function zce(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];bL(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=x3(t.getAttribute("width")),i=x3(t.getAttribute("height")),r=x3(t.getAttribute("x")),l=x3(t.getAttribute("y")),a=e.ownerDocument.createElementNS(q_,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const p=e.ownerDocument.createElementNS(q_,"tspan");p.setAttribute("x",String(r+s/2)),p.setAttribute("dy",d===0?`${u}em`:"1.2em"),p.textContent=f,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function Bce(e){zce(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!xce.has(o)){n.remove();continue}if(o==="style"&&U_(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&U_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(Sce.has(r)&&i.value){const l=Lce(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(Cce.has(r)&&i.value&&kL(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=Ice(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Nce(n)}}function rqe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Bce(n),Rce(n)?null:n}catch{return null}}function Rce(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){Tce(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const S3=[];function Kh(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Fce(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function jce(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function Z_(e=`editor-${Date.now()}`,t={}){const n=Mae(t),o=n;o.__markstreamRegisteredPluginCount=S3.length,o.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||S3.length);const s={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;i=m=>h[m]??s[m]??m}else i=h=>s[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[k,...x]=m;typeof k=="function"&&n.use(k,...x)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(S3.length)for(const h of S3)if(Array.isArray(h)){const[m,...k]=h;typeof m=="function"&&n.use(m,...k)}else typeof h=="function"&&n.use(h);n.use(Dte),n.use(qte),n.use(Ote);const r=ine,l=r.default??r;n.use(l),n.use(jte),n.use(Fte),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,k=m.src,x=!!m.env?.__markstreamFinal,v=k.split(/\r?\n/);for(const w of m.tokens){if(w.type!=="fence"||!w.map||!w.markup)continue;const b=w.map[0],M=w.map[1],R=w.markup,z=R[0],$=R.length,E=v[Math.max(0,M-1)]??"";let T=0;for(;Tb+1&&N>=$&&C===E.length,H=w;H.meta=H.meta??{},H.meta.unclosed=!O,H.meta.closed=!!O}});const a=(h,m)=>{const k=h,x=k.pos;if(k.src[x]!=="~")return!1;const v=k.src[x-1],w=k.src[x+1];if(/\d/.test(v)&&/\d/.test(w)){if(!m){const b=k.push("text","",0);b.content="~"}return k.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(h,m)=>{const k=h[m],x=String(k.info??"").trim(),v=String(k.content??""),w=btoa(unescape(encodeURIComponent(v))),b=Fce(x),M=Kh(b),R=jce(`editor-${e}-${m}-${b}`),z=Kh(i("common.copy"));return`
        - ${Zh(b.toUpperCase())} - + ${Kh(b.toUpperCase())} +
        -
        `};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const k=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(k)},f=(h,m)=>{const k=h;if(k.src[k.pos]!=="[")return!1;const x=c.exec(k.src.slice(k.pos));if(!x)return!1;const w=k.src.slice(Math.max(0,k.pos-120),k.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const v=k.src.slice(k.pos+x[0].length);if(v.startsWith("](")||v.startsWith("(")||d(v))return!1;if(!m){const b=x[1],M=k.push("reference","span",0);M.content=b,M.markup=x[0],M.raw=x[0]}return k.pos+=x[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(h,m)=>{const x=String(h[m].content??"");return`${x}`};const p=n.use.bind(n);return n.use=((...h)=>(o.__markstreamHasCustomParserExtensions=!0,p(...h))),n}function zce({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function yL({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const r=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&r===e?s?{settledContent:r,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:zce({nextContent:e,previousContent:t??r,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Bce={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Rce(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function kL(e){const t=Rce(e);return Bce[t]??t}function Fce(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>kL(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function jce(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Oce(e){return jce(e)?.join("\0")??""}function Pce(e,t){return`${Oce(e)}\0\0${Fce(t)?.join("\0")??""}`}function tc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function Z_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Hce=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,p=this.pendingChars<=0;if(this.source+=d,p){const h=K_();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=K_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,k=qce(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(k-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const x=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),w=Wce(this.source.slice(this.visible.length),x,this.segmenter);w.text&&(this.visible+=w.text,this.charBudget=Math.max(0,this.charBudget-w.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:r=350,catchUpThreshold:i=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=tc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,tc(o,1e3,1)),this.normalizedTargetLatencyMs=tc(s,900,1),this.normalizedCatchUpLatencyMs=tc(r,350,1),this.normalizedCatchUpThreshold=Z_(i,600),this.normalizedStartDelayMs=Z_(a,80),this.maxCommitFps=Math.trunc(tc(l,30,1)),this.maxCharsPerCommit=Math.trunc(tc(c,80,1)),this.flushOnFinish=u,this.segmenter=Vce(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Dce(e={},t){const n=new Hce(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Vce(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Wce(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const r=Array.from(e).slice(0,t);return{text:r.join(""),graphemeCount:r.length}}let o="",s=0;for(const r of n.segment(e)){if(s>=t)break;o+=r.segment,s++}return{text:o,graphemeCount:s}}function K_(){return typeof performance<"u"?performance.now():Date.now()}function qce(e,t,n){return Math.min(n,Math.max(t,e))}var Uce=(e,t,n)=>new Promise((o,s)=>{var r=a=>{try{l(n.next(a))}catch(c){s(c)}},i=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(r,i);l((n=n.apply(e,t)).next())});const U8=Symbol.for("markstream-vue:node-lifecycle");function ZWe(){}const av=new Map;let bL="material";const xc=new Map,G_=new Map;let Z8=null;function Zce(e){av.set(e.id,e)}function Kce(e){const t=av.get(bL);if(!t)return;const n=t.core[e];if(n)return n;const o=xc.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!xc.has(t.id)&&Yce(t)}function Gce(){var e,t;return(t=(e=av.get(bL))==null?void 0:e.fallback)!=null?t:""}function Yce(e){return Uce(this,null,function*(){var t,n,o;if(xc.has(e.id))return(t=xc.get(e.id))!=null?t:null;let s=G_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(r=>(xc.set(e.id,r),Z8?.(),r)).catch(()=>(xc.set(e.id,null),null)),G_.set(e.id,s)),s})}const Y_='',X_='',Xce={id:"material",core:{"":X_,plain:'',text:X_,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:Y_,csharp:Y_,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>ps(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Jce=jo(0);Z8=()=>{Jce.value++},Zce(Xce);const Qce={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Lp(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[r]=s.split(/\s+/),[i]=r.split(":");return i.toLowerCase()})(e);return(t=Qce[n])!=null?t:n}function KWe(e){const t=Lp(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function GWe(e){return Kce(Lp(e))||Gce()}const J_={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var $p=(e,t,n)=>new Promise((o,s)=>{var r=a=>{try{l(n.next(a))}catch(c){s(c)}},i=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(r,i);l((n=n.apply(e,t)).next())});let fr=null,s0=!1,r0=null,Np=uv;function nf(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function cv(){try{const e=globalThis;return nf(e?.katex)}catch{return null}}function uv(){return $p(null,null,function*(){const e=cv();if(e)return e;const t=yield ps(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ps(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return nf(t)})}function _L(e){const t=Promise.resolve(e).then(n=>{var o;return r0===t&&n?(fr=(o=nf(n))!=null?o:n,fr):null}).catch(()=>null).finally(()=>{r0===t&&(r0=null)});return r0=t,s0=!0,t}function eue(e){Np=e,fr=null,s0=!1,r0=null}function tue(e){eue(uv)}function xL(){return typeof Np=="function"}function YWe(){var e;const t=Np;if(!t||t===uv)return null;if(fr)return fr;const n=cv();if(n)return fr=n,fr;if(s0)return null;try{const o=t();return o?typeof o?.then=="function"?(_L(o),null):(fr=(e=nf(o))!=null?e:o,fr):null}catch{return null}}function SL(){return $p(this,null,function*(){var e;const t=cv();if(t)return fr=t,fr;if(fr)return fr;if(r0)return r0;if(s0)return null;const n=Np;if(!n)return s0=!0,null;try{const o=n();if(typeof o?.then=="function")return _L(o);if(o)return fr=(e=nf(o))!=null?e:o,s0=!0,fr}catch{}return s0=!0,null})}function CL(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Va=null,Ra=null;const qs=new Map,Kl=new Map;let zd=5;const p0=new Set;function X2(){if(qs.size{const{id:n,html:o,error:s}=t.data,r=qs.get(n);if(r)if(qs.delete(n),clearTimeout(r.timeoutId),r.cleanup(),X2(),s)r.aborted||r.reject(new Error(s));else{const{content:i,displayMode:l}=t.data;if(i){const a=`${l?"d":"i"}:${i}`;if(Kl.set(a,o),Kl.size>200){const c=Kl.keys().next().value;Kl.delete(c)}}r.aborted||r.resolve(o)}},Va.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of qs.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));qs.clear(),ML()}}function oue(){var e;for(const t of qs.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));qs.clear(),ML(),Va&&((e=Va.terminate)==null||e.call(Va)),Va=null,Ra=null}function sue(e,t=!0,n=2e3,o){return $p(this,null,function*(){performance.now();const s=CL(e);if(!xL()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ra)return Promise.reject(Ra);const r=`${t?"d":"i"}:${s}`,i=Kl.get(r);if(i)return X2(),Promise.resolve(i);const l=Va||(Ra=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ra.name="WorkerInitError",Ra.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ra);if(qs.size>=zd){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=qs.size,a.max=zd,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=qs.get(u);if(!m)return;qs.delete(u),m.cleanup();const k=new Error("Worker render timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT",m.aborted||m.reject(k),X2()},n);d=()=>{const m=qs.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const k=new Error("Aborted");k.name="AbortError",c(k)},o&&o.addEventListener("abort",d,{once:!0});const p=a,h=c;qs.set(u,{resolve:m=>{p(m)},reject:m=>{h(m)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:s,displayMode:t})}catch(m){const k=qs.get(u);qs.delete(u),clearTimeout(f),k?.cleanup(),k?.reject(m),X2()}})})}function XWe(e,t=!0,n){const o=`${t?"d":"i"}:${CL(e)}`;if(Kl.set(o,n),Kl.size>200){const s=Kl.keys().next().value;Kl.delete(s)}}const rue="WORKER_BUSY";function iue(e=2e3,t){return qs.size{let s,r=!1,i=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),p0.delete(l),t&&i&&t.removeEventListener("abort",i),i=null};l=()=>{r||(r=!0,a(),n())},p0.add(l),s=globalThis.setTimeout(()=>{if(r)return;r=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",o(c)},e),queueMicrotask(()=>X2()),t&&(i=()=>{if(r)return;r=!0,a();const c=new Error("Aborted");c.name="AbortError",o(c)},t.aborted?i():t.addEventListener("abort",i,{once:!0}))})}const i2={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function JWe(e){return $p(this,arguments,function*(t,n=!0,o={}){var s,r,i,l;if(!xL()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:i2.timeout,c=(r=o.waitTimeout)!=null?r:i2.waitTimeout,u=(i=o.backoffMs)!=null?i:i2.backoffMs,d=(l=o.maxRetries)!=null?l:i2.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):i2.maxRetries,p=o.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield sue(t,n,a,p)}catch(m){if(m?.code!==rue||h>=f)throw m;if(h++,yield iue(c,p).catch(()=>{}),p?.aborted){const k=new Error("Aborted");throw k.name="AbortError",k}u>0&&(yield new Promise(k=>globalThis.setTimeout(k,u*h)))}}})}function Sc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function lue(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function v5(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=lue(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function w5(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function AL(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function y5(e,t=360,n=500){return AL(e,t,n)}function k5(e,t=360,n=500){return AL(e,t,n)}var aue=Object.defineProperty,cue=Object.defineProperties,uue=Object.getOwnPropertyDescriptors,Q_=Object.getOwnPropertySymbols,due=Object.prototype.hasOwnProperty,fue=Object.prototype.propertyIsEnumerable,ex=(e,t,n)=>t in e?aue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TL=(e,t)=>{for(var n in t||(t={}))due.call(t,n)&&ex(e,n,t[n]);if(Q_)for(var n of Q_(t))fue.call(t,n)&&ex(e,n,t[n]);return e},tx=(e,t,n)=>new Promise((o,s)=>{var r=a=>{try{l(n.next(a))}catch(c){s(c)}},i=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(r,i);l((n=n.apply(e,t)).next())});const b5=()=>ps(()=>import("./mermaid.core-Pmnag6hS.js").then(e=>e.cb),__vite__mapDeps([4,5]));let Ll=null,Cc=b5,A2=null,K8=!1,G8=!1,T2=0;function pue(e){Cc=e,T2++,Ll=null,A2=null,K8=!1,G8=!1}function hue(e){pue(b5)}function nx(){return typeof Cc=="function"}function ox(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=TL({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:r=>typeof t.initialize=="function"?t.initialize(r):s.initialize?s.initialize(r):void 0},cue(n,uue(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function sx(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=TL({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function QWe(){return tx(this,null,function*(){if(Ll)return Ll;const e=(function(){try{const o=globalThis;return ox(o?.mermaid)}catch{return null}})();if(e)return Ll=e,sx(Ll),Ll;const t=Cc,n=T2;return t?t===b5&&K8?null:A2||(A2=tx(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===b5)return n===T2&&t===Cc&&(K8=!0,(function(r){G8||(G8=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',r))})(s)),null;throw s}finally{n===T2&&t===Cc&&(A2=null)}return n!==T2||t!==Cc?null:o?(Ll=ox(o),sx(Ll),Ll):null}),A2):null})}let Ar=null,Fa=null;const Oi=new Map,q1=new Map;function a4(e){for(const t of Oi.values())t.reject(e);Oi.clear(),q1.clear()}let rx=5,ix=!1;const mue="WORKER_BUSY",lx="MERMAID_DISABLED";function gue(e){if(Ar&&Ar!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",a4(n)}Ar=e,Fa=null;const t=e;Ar.onmessage=n=>{if(Ar!==t)return;const{id:o,ok:s,result:r,error:i}=n.data,l=Oi.get(o);l&&(s===!1||i?l.reject(new Error(i||"Unknown error")):l.resolve(r))},Ar.onerror=n=>{var o,s;if(Ar===t)if(Oi.size!==0){try{ix?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}a4(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Ar.onmessageerror=n=>{var o,s;if(Ar===t)if(Oi.size!==0){try{ix?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}a4(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function vue(){var e;if(Ar)try{a4(new Error("Worker cleared")),(e=Ar.terminate)==null||e.call(Ar)}catch{}Ar=null,Fa=null}function EL(e,t,n,o){if(!nx()){const i=new Error("Mermaid rendering disabled");return i.name="MermaidDisabled",i.code=lx,Promise.reject(i)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let r=q1.get(s);return r||(r=(function(i,l,a=1400){if(!nx()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=lx,Promise.reject(u)}if(Fa)return Promise.reject(Fa);const c=Ar||(Fa=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Fa.name="WorkerInitError",Fa.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(Fa);if(Oi.size>=rx){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=mue,u.inFlight=Oi.size,u.max=rx,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let p,h=!1;const m=()=>{h||(h=!0,p!=null&&globalThis.clearTimeout(p),Oi.delete(f))},k={resolve:x=>{m(),u(x)},reject:x=>{m(),d(x)}};Oi.set(f,k);try{c.postMessage({id:f,action:i,payload:l})}catch(x){return Oi.delete(f),void d(x)}p=globalThis.setTimeout(()=>{const x=new Error("Worker call timed out");x.name="WorkerTimeout",x.code="WORKER_TIMEOUT";const w=Oi.get(f);w&&w.reject(x)},a)})})(e,t,n),q1.set(s,r),r.then(()=>{q1.get(s)===r&&q1.delete(s)},()=>{q1.get(s)===r&&q1.delete(s)})),(function(i,l){if(!l)return i;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),i.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(r,o)}function eqe(e,t,n=1400,o){return EL("canParse",{code:e,theme:t},n,o)}function tqe(e,t,n=1400,o){return EL("findPrefix",{code:e,theme:t},n,o)}var wue=Object.defineProperty,yue=Object.defineProperties,kue=Object.getOwnPropertyDescriptors,ax=Object.getOwnPropertySymbols,bue=Object.prototype.hasOwnProperty,_ue=Object.prototype.propertyIsEnumerable,cx=(e,t,n)=>t in e?wue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t)=>{for(var n in t||(t={}))bue.call(t,n)&&cx(e,n,t[n]);if(ax)for(var n of ax(t))_ue.call(t,n)&&cx(e,n,t[n]);return e},gn=(e,t)=>yue(e,kue(t)),To=(e,t,n)=>new Promise((o,s)=>{var r=a=>{try{l(n.next(a))}catch(c){s(c)}},i=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(r,i);l((n=n.apply(e,t)).next())});const xue="__global__",Kh="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Y8=(()=>{const e=globalThis;if(e[Kh])return e[Kh];const t={scopedCustomComponents:{},revision:jo(0)};return e[Kh]=t,t})(),ux=Y8.revision,Sue=Symbol("markstreamCustomComponents"),Cue=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function of(e){return Cue.has(String(e).trim().toLowerCase())}function Mue(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Gh(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([xi(n),xi(Mue(n))]))!s||of(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function ws(e){const t=pn(Sue,null);return B(()=>{var n;return ux.value,(function(o,s={}){return ux.value,_t(_t(_t({},Gh(Y8.scopedCustomComponents[xue]||{})),Gh(s)),Gh((function(r){return r&&Y8.scopedCustomComponents[r]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const Aue=["aria-label"],Tue={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},Eue={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},to=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Kr=to(Ge({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(g(),S("svg",Eue,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(g(),S("svg",Tue,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,Aue))}),[["__scopeId","data-v-be21ab83"]]);Kr.install=e=>{e.component(Kr.__name,Kr)};const Iue={class:"emoji-node"},Nr=to(Ge({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("span",Iue,I(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Nr.install=e=>{e.component(Nr.__name,Nr)};const Lue=["id"],$ue=["title"],Gr=to(Ge({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(g(),S("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+I(e.node.id)+"]",9,$ue)],8,Lue))}}),[["__scopeId","data-v-c1463a29"]]);Gr.install=e=>{e.component(Gr.__name,Gr)};const IL=(()=>{try{return!1}catch{}return!1})();function Yh(e){IL&&console.warn(e)}function dx(e,t="safe",n){return lv(e,t,n)}function LL(e){return fce(e)}function Xh(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function dv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=l4((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([i,l])=>[String(i),Xh(l)]):s.filter(i=>i&&typeof i=="object"&&!Array.isArray(i)&&"name"in i).map(i=>[String(i.name),Xh(i.value)]):Object.entries(s).map(([i,l])=>[i,Xh(l)]):null,t,n);var s;if(!o)return;const r=LL(Y2(o));return Object.keys(r).length>0?r:void 0}function fx(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([r,i])=>i===""?` ${r}`:` ${r}="${i}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function l2(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Jh(e,t,n,o,s,r,i=!1){const l=(function(d,f){return hL(d,f)})(e,o);if(Jd.has(e.toLowerCase())||!l&&uL(e,r))return null;if(!l&&iv(e,r))return i?[fx(e,t,!0)]:[fx(e,t),...n,``];const a=lv(t,r,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=LL(a);return hn(d,gn(_t({},f),{key:u}),n.length>0?n:void 0)}return hn(e,gn(_t({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function $L(e,t){return mce(e,t)}function _5(e,t,n="safe"){if(!e)return[];try{return(function(r,i,l="safe"){let a=0;const c=[],u=[];for(const d of r)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=Jh(d.tagName,d.attrs||{},[],i,"ms-html-"+a++,l,!0);l2(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=Jh(h.tagName,h.attrs||{},h.children,i,h.autoKey,l);c.length>0?l2(c[c.length-1].children,m):l2(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&Yh(`Auto-closing unclosed tag: <${h.tagName}>`)}else Yh(`Ignoring closing tag with no matching opening tag: `)}for(;c.length>0;){const d=c.pop(),f=Jh(d.tagName,d.attrs||{},d.children,i,d.autoKey,l);c.length>0?l2(c[c.length-1].children,f):l2(u,f),Yh(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(mL(e),t,n)}catch(s){return o=s,IL&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const Nue=["innerHTML"],Yr=to(Ge({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=pn("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=ws(()=>t.customId),r=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),i=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Dc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=_5(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!$L(l,s.value))return{mode:"html",content:Dc(l,o.value)};const a=_5(l,s.value,o.value);return a===null?{mode:"html",content:Dc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>i.value.mode==="dynamic"?(g(),S("span",{key:0,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[Z(y(r),{nodes:i.value.nodes},null,8,["nodes"])],2)):i.value.mode==="text"?(g(),S("span",{key:1,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},I(i.value.content),3)):(g(),S("span",{key:2,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:i.value.content},null,10,Nue))}}),[["__scopeId","data-v-d17f12b0"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const zue={class:"inline-code"},Bue={key:0},rr=to(Ge({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Zd(),o=pn("markstreamFade",void 0),s=pn("markstreamTextStreamState",void 0),r=pn("markstreamStreamVersion",void 0),i=B(()=>{const w=n.fade;return w===""||w===!0||w==="true"||w!==!1&&w!=="false"&&void 0}),l=B(()=>typeof i.value=="boolean"?i.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var w;return String((w=t.node.code)!=null?w:"")}),c=B(()=>!l.value),u=B(()=>{var w;const v=(w=n["index-key"])!=null?w:n.indexKey;return v==null||v===""?"":String(v)}),d=U(t.node.code),f=U(""),p=U(0);let h;function m(){h?.(),h=void 0}function k(){m(),f.value&&(d.value=d.value+f.value,f.value="")}Ue([()=>t.node.code,u,l],([w])=>{const v=String(w??""),b=u.value,M=yL({nextContent:v,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(p.value+=1,(function(){if(!f.value||h||!r)return;const R=r.value;h=Ue(()=>r.value,z=>{z!==R&&k()},{flush:"sync"})})()):f.value||m(),b&&s?.set(b,v)},{immediate:!0}),du(m);const x=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(w,v)=>(g(),S("code",zue,[c.value?(g(),S(Me,{key:0},[He(I(a.value),1)],64)):(g(),S(Me,{key:1},[d.value?(g(),S("span",Bue,I(d.value),1)):J("",!0),f.value?(g(),S("span",{key:1,class:Be(["inline-code-stream-delta",[x.value]]),onAnimationend:k},I(f.value),35)):J("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);rr.install=e=>{e.component(rr.__name,rr)};const X8=U(!1),px=U(""),hx=U("top"),J2=U(null),Q2=U(null),J8=U(null),Q8=U(null),mx=U(null);let c4=null,u4=null,e7=0;function NL(){c4&&(clearTimeout(c4),c4=null),u4&&(clearTimeout(u4),u4=null)}let S3=!1,C3=null,gx=!1;function Rue(e,t,n="top",o=!1,s,r){if(!e)return;const i=++e7;NL();const l=()=>To(null,null,function*(){var a,c;if(yield(function(){return To(this,null,function*(){if(!S3&&!gx&&typeof document<"u"){C3!=null||(C3=To(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ps(()=>import("./vue.runtime.esm-bundler-B8toYgN9.js"),[]),ps(()=>import("./Tooltip-Dwp18XKI.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:X8.value,"anchor-el":J2.value,content:px.value,placement:hx.value,id:Q2.value,originX:J8.value,originY:Q8.value,isDark:(h=mx.value)!=null?h:void 0})}}).mount(p),S3=!0}));try{yield C3}catch(u){S3=!1,C3=null,gx=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),S3&&i===e7){Q2.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,J2.value=e,px.value=t,hx.value=n,J8.value=(a=s?.x)!=null?a:null,Q8.value=(c=s?.y)!=null?c:null,mx.value=typeof r=="boolean"?r:null,X8.value=!0;try{e.setAttribute("aria-describedby",Q2.value)}catch{}}});o?l():c4=setTimeout(l,80)}function Fue(e=!1){e7+=1,NL();const t=()=>{if(J2.value&&Q2.value)try{J2.value.removeAttribute("aria-describedby")}catch{}X8.value=!1,J2.value=null,Q2.value=null,J8.value=null,Q8.value=null};e?t():u4=setTimeout(t,120)}const jue={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Oue=Symbol("markstreamI18nFallback");function zL(e,t){var n;return(n=t?.[e])!=null?n:jue[e]}const t7=(e,t)=>{var n;return(n=zL(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function vx(e,t){return{t(n){const o=zL(n,t);if(e.te&&o!=null&&!e.te(n))return t7(n,t);const s=e.t(n);return s===n&&o!=null?t7(n,t):s}}}function Pue(){const e=(function(){var n,o,s;try{const r=gs(),i=Oue,l=r?.provides,a=(n=r?.appContext)==null?void 0:n.provides;return(s=(o=l?.[i])!=null?o:a?.[i])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=gs(),r=s?.proxy,i=r?.$t;if(typeof i=="function"){const c=r?.$te;return{t:i.bind(r),te:typeof c=="function"?c.bind(r):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return vx(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return vx({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>t7(n,e)}}const BL=Symbol("ViewportPriority"),RL=Symbol("ViewportPriorityOptions"),FL=Symbol("OffscreenHeavyNodeDeferral"),Hue=B(()=>!1),y0="400px";function fv(){return pn(RL,void 0)}function pv(){return pn(FL,Hue)}function Due(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",r=typeof t=="boolean"?U(t):t,i=s?(n=window.requestIdleCallback)!=null?n:z=>window.setTimeout(()=>z({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:z=>window.clearTimeout(z):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let p=null,h=null;function m(z){if(!z)return"viewport";let $=a.get(z);return $||($=c++,a.set(z,$)),String($)}function k(){if(p!=null){try{l?.(p)}catch{}p=null}}function x(z){if(z){const $=u.get(z);if($&&!$.targets.size){try{$.io.disconnect()}catch{}u.delete(z)}}d.size||f.size||k()}function w(z){const $=d.get(z);if(!$)return;const T=u.get($.bucketKey);if(!$.visible.value){$.visible.value=!0;try{$.resolve()}catch{}}try{T?.io.unobserve(z)}catch{}T?.targets.delete(z),d.delete(z),f.delete(z),x($.bucketKey)}function v(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&i&&p==null&&f.size&&(p=i(()=>{p=null;const z=f.values().next().value;z&&(f.delete(z),w(z),f.size&&v())},{timeout:1200}))}function b(z,$){if(!s||typeof IntersectionObserver>"u")return null;const T=(function(V,A){var F,j,q;return{root:(F=e?.(V??null))!=null?F:null,rootMargin:(j=A?.rootMargin)!=null?j:y0,threshold:(q=A?.threshold)!=null?q:0}})(z,$),E=[m((N=T).root),N.rootMargin,N.threshold].join("\0");var N;const C=u.get(E);if(C)return{key:E,bucket:C};let O;try{O=new IntersectionObserver(V=>{for(const A of V)(A.isIntersecting||A.intersectionRatio>0)&&w(A.target)},{root:T.root,rootMargin:T.rootMargin,threshold:T.threshold})}catch{return null}const H={io:O,targets:new Map};return u.set(E,H),{key:E,bucket:H}}function M(){if(s&&r.value)for(const[z,$]of Array.from(d.entries())){const T=b(z,$.opts);if(!T){w(z);continue}if(T.key===$.bucketKey)continue;const E=$.bucketKey,N=u.get(E);try{N?.io.unobserve(z)}catch{}N?.targets.delete(z),$.bucketKey=T.key,T.bucket.targets.set(z,$),T.bucket.io.observe(z),x(E)}}Ue(r,z=>{if(!z){for(const $ of Array.from(d.keys()))w($);k()}},{flush:"sync"});const R=(z,$)=>{const T=U(!1);let E,N=!1;const C=new Promise(A=>{E=()=>{N||(N=!0,A())}}),O=()=>{const A=d.get(z);if(!A)return f.delete(z),void x();const F=u.get(A.bucketKey);try{F?.io.unobserve(z)}catch{}F?.targets.delete(z),d.delete(z),f.delete(z),x(A.bucketKey)};if(!s||!r.value)return T.value=!0,E(),{isVisible:T,whenVisible:C,destroy:O};const H=b(z,$);if(!H)return T.value=!0,E(),{isVisible:T,whenVisible:C,destroy:O};const V={resolve:E,visible:T,bucketKey:H.key,opts:$};return d.set(z,V),H.bucket.targets.set(z,V),H.bucket.io.observe(z),s&&h==null&&(h=window.requestAnimationFrame(()=>{h=null,M()})),$?.allowIdle!==!1&&(f.add(z),v()),{isVisible:T,whenVisible:C,destroy:O}};return R.refresh=M,jn(BL,R),R}function hv(){var e,t;const n=pn(BL,void 0);if(n)return n;const o=new WeakMap,s=new Map,r=new Set;let i=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(i!=null){try{a?.(i)}catch{}i=null}},u=p=>{if(!p)return;const h=s.get(p);if(h&&!h.targets.size){try{h.io.disconnect()}catch{}s.delete(p)}},d=p=>{const h=o.get(p);if(!h)return;const m=s.get(h.bucketKey);if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{m?.io.unobserve(p)}catch{}o.delete(p),m?.targets.delete(p),r.delete(p),u(h.bucketKey),r.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&i==null&&r.size&&(i=l(()=>{i=null;const p=r.values().next().value;p&&(r.delete(p),d(p),r.size&&f())},{timeout:1200}))};return(p,h)=>{const m=U(!1);let k,x=!1;const w=new Promise(M=>{k=()=>{x||(x=!0,M())}}),v=()=>{const M=o.get(p);if(!M)return r.delete(p),void(r.size||c());const R=s.get(M.bucketKey);try{R?.io.unobserve(p)}catch{}o.delete(p),R?.targets.delete(p),r.delete(p),u(M.bucketKey),r.size||c()},b=(M=>{var R,z;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const $=(O=>{var H,V;return[(H=O?.rootMargin)!=null?H:y0,(V=O?.threshold)!=null?V:0].join("\0")})(M),T=s.get($);if(T)return{key:$,bucket:T};const E=(R=M?.rootMargin)!=null?R:y0;let N;try{N=new IntersectionObserver(O=>{for(const H of O)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:E,threshold:(z=M?.threshold)!=null?z:0})}catch{return null}const C={io:N,targets:new Set};return s.set($,C),{key:$,bucket:C}})(h);return b?(o.set(p,{resolve:k,visible:m,bucketKey:b.key}),b.bucket.targets.add(p),b.bucket.io.observe(p),h?.allowIdle!==!1&&(r.add(p),f()),{isVisible:m,whenVisible:w,destroy:v}):(m.value=!0,k(),{isVisible:m,whenVisible:w,destroy:v})}}function Vue(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Wue=["data-markstream-viewport-pending"],que=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Uue={key:1,class:"image-placeholder"},Zue={key:1,class:"image-node__raw-text"},Kue={key:2,class:"image-shimmer-overlay"},Gue={key:1,class:"image-node__raw-text"},Yue={key:3,class:"image-error"},Xa=to(Ge({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const r=e,i=t,l=U(!1),a=U(!1),c=U(""),u=U("primary"),d=U(null),f=Zd(),p=pn(U8,null),h=hv(),m=fv(),k=pv(),x=B(()=>Hb(r.node.src)),w=B(()=>Hb(r.fallbackSrc)),v=(s=(o=(n=gs())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),b=typeof window<"u"&&v?.getAttribute("src")===(x.value||w.value),M=U(typeof window>"u"||b||!k.value),R=jo(null);let z="",$=null;const T=B(()=>c.value),E=B(()=>!r.lazy),N=B(()=>typeof window<"u"&&k.value&&!b),C=B(()=>!N.value||M.value),O=B(()=>C.value?T.value:""),H=B(()=>{var xe,Ke;return(Ke=(xe=m?.value.heavyBlockMargin)!=null?xe:m?.value.rootMargin)!=null?Ke:y0}),V=B(()=>!r.node.loading&&u.value!=="failed"&&c.value.length>0),A=B(()=>u.value==="failed"),F=B(()=>(!E.value||N.value&&!M.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),j=B(()=>Vue(r,f));function q(xe=j.value){xe&&d.value&&p?.reportHeight(xe,d.value.offsetHeight)}function P(xe=j.value){xe&&vt(()=>{q(xe)})}function W(){$&&(clearTimeout($),$=null)}function G(){const xe=j.value;xe&&z!==xe&&(z&&p?.markSettled(z),W(),z=xe,p?.markPending(xe),typeof window<"u"&&($=window.setTimeout(()=>{z===xe&&(P(xe),ee())},8e3)))}function ee(){return To(this,null,function*(){const xe=z;xe&&(W(),z="",yield vt(),q(xe),p?.markSettled(xe))})}function se(){if(u.value==="primary"&&w.value&&w.value!==c.value)return u.value="fallback",c.value=w.value,l.value=!1,a.value=!1,void P();u.value="failed",a.value=!0,i("error",c.value),P()}function oe(){l.value=!0,a.value=!1,i("load",T.value),P()}function Q(xe){xe.preventDefault(),l.value&&!a.value&&i("click",[xe,T.value])}const{t:ge}=Pue();return Ue([x,w,()=>r.node.loading],()=>(l.value=!1,a.value=!1,r.node.loading||x.value?(c.value=x.value,void(u.value="primary")):w.value?(c.value=w.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Ue([d,N],([xe,Ke],et,Y)=>{var ne;if((ne=R.value)==null||ne.destroy(),R.value=null,!Ke||M.value)return void(M.value=!0);if(!xe)return void(M.value=!1);let D=!0;const X=h(xe,{rootMargin:H.value,allowIdle:!1});R.value=X,M.value=X.isVisible.value,X.whenVisible.then(()=>{D&&R.value===X&&(M.value=!0)}),Y(()=>{D=!1,X.destroy(),R.value===X&&(R.value=null)})},{immediate:!0}),Ue([V,l,a,T,()=>r.lazy,C],([xe,Ke,et,Y,ne,D])=>xe&&Y&&!et&&D?Ke?(ee(),void P()):ne?(G(),void P()):void(Ke||et||G()):(ee(),void P()),{flush:"post",immediate:!0}),vo(()=>{var xe;(xe=R.value)==null||xe.destroy(),R.value=null,(function(){const Ke=z;Ke&&(W(),z="",p?.markSettled(Ke))})()}),(xe,Ke)=>{var et,Y,ne,D,X;return g(),S("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":N.value&&!M.value?"true":void 0},[V.value?(g(),S("img",{key:0,src:O.value||void 0,alt:String((Y=(et=r.node.alt)!=null?et:r.node.title)!=null?Y:""),title:String((D=(ne=r.node.title)!=null?ne:r.node.alt)!=null?D:""),class:Be(["image-node__img",{"is-loading":!E.value&&!l.value,"is-loaded":E.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:r.lazy?"lazy":void 0,fetchpriority:E.value?"high":void 0,decoding:E.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(X=r.node.alt)!=null?X:y(ge)("image.preview"),onError:se,onLoad:oe,onClick:Q},null,42,que)):J("",!0),e.node.loading&&!a.value?(g(),S("span",Uue,[r.usePlaceholder?Tn(xe.$slots,"placeholder",{key:0,node:r.node,displaySrc:T.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[Ke[0]||(Ke[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(g(),S("span",Zue,I(e.node.raw),1))])):J("",!0),F.value&&!e.node.loading?(g(),S("span",Kue,[r.usePlaceholder?Tn(xe.$slots,"placeholder",{key:0,node:r.node,displaySrc:T.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[Ke[1]||(Ke[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(g(),S("span",Gue,I(e.node.raw),1))])):J("",!0),A.value?(g(),S("span",Yue,[Tn(xe.$slots,"error",{node:r.node,displaySrc:T.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[Ke[2]||(Ke[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,I(y(ge)("image.loadError")),1)],!0)])):J("",!0)],8,Wue)}}}),[["__scopeId","data-v-046e82ac"]]);Xa.install=e=>{e.component(Xa.__name,Xa)};const Xue={key:2},yl=Ge({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamHtmlPolicy",void 0),s=pn("markstreamNestedRendererProps",void 0),r=B(()=>{var h;return(h=o?.value)!=null?h:"safe"}),i=B(()=>{var h,m;const k=(h=s?.value)!=null?h:{};return gn(_t({},k),{customId:(m=t.customId)!=null?m:k.customId,htmlPolicy:r.value})}),l=mi({loader:()=>Promise.resolve().then(()=>Cv),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!of(String(t.node.type)))),u=B(()=>c.value?dv(t.node,r.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=B(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(g(),ce(ns(a.value),Vn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":i.value.isDark}),{default:ue(()=>[d.value?(g(),ce(y(l),Vn({key:0},i.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(g(),ce(y(l),Vn({key:1},i.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(g(),ce(ns(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(g(),S("span",Xue,I(p.value),1)):J("",!0)}}),wx=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Jue(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return gn(_t(_t({},wx),n),{enabled:(t=n.enabled)==null||t})}return _t({},wx)}function mv(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function jL(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let r=3;for(;o[r]===s;)r+=1;return o.slice(r).trim()}function yx(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function Que(e){var t;return e.diff===!0||yx(e.language)||yx(jL(String((t=e.raw)!=null?t:"")))}function e2e(e,t,n){const o=(function(s){const r=jL(s);if(!r)return"";const i=r.split(/\s+/).filter(Boolean);if(!i.length)return"";const l=i[0]==="diff"?i.slice(1):i;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const t2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],n2e={key:0,translate:"no",class:"markstream-pre__diff-code"},o2e={class:"markstream-pre__diff-pane-content"},s2e={class:"markstream-pre__diff-number","aria-hidden":"true"},r2e={class:"markstream-pre__diff-content"},i2e={class:"markstream-pre__diff-content-inner"},l2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},a2e=["textContent"],c2e=["textContent"],Tr=Ge({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(oe,Q){const ge=String(oe??"");return Q?ge:ge.replace(/\r\n$|\n$|\r$/,"")}const o=B(()=>{var oe,Q,ge;const xe=String((Q=(oe=t.node)==null?void 0:oe.language)!=null?Q:"");return String((ge=String(xe).split(/\s+/g)[0])!=null?ge:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=B(()=>`language-${o.value}`),r=B(()=>{var oe;return t.loading===!0||((oe=t.node)==null?void 0:oe.loading)===!0}),i=B(()=>{var oe;return n((oe=t.node)==null?void 0:oe.code,r.value)});let l="",a=1;const c=B(()=>(function(oe){let Q=0,ge=1;oe.startsWith(l)&&(Q=l.length,ge=a,Q>0&&oe[Q-1]==="\r"&&oe[Q]===` +
        `};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const k=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(k)},f=(h,m)=>{const k=h;if(k.src[k.pos]!=="[")return!1;const x=c.exec(k.src.slice(k.pos));if(!x)return!1;const v=k.src.slice(Math.max(0,k.pos-120),k.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(v))return!1;const w=k.src.slice(k.pos+x[0].length);if(w.startsWith("](")||w.startsWith("(")||d(w))return!1;if(!m){const b=x[1],M=k.push("reference","span",0);M.content=b,M.markup=x[0],M.raw=x[0]}return k.pos+=x[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(h,m)=>{const x=String(h[m].content??"");return`${x}`};const p=n.use.bind(n);return n.use=((...h)=>(o.__markstreamHasCustomParserExtensions=!0,p(...h))),n}function Oce({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function _L({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Oce({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Pce={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Hce(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function xL(e){const t=Hce(e);return Pce[t]??t}function Dce(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>xL(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Vce(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Wce(e){return Vce(e)?.join("\0")??""}function qce(e,t){return`${Wce(e)}\0\0${Dce(t)?.join("\0")??""}`}function tc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function K_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Uce=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,p=this.pendingChars<=0;if(this.source+=d,p){const h=G_();this.startedAt=f&&this.hasStarted?h-this.normalizedStartDelayMs:h,this.lastTick=h,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=G_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,k=Yce(h/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(k-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const x=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=Gce(this.source.slice(this.visible.length),x,this.segmenter);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=tc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,tc(o,1e3,1)),this.normalizedTargetLatencyMs=tc(s,900,1),this.normalizedCatchUpLatencyMs=tc(i,350,1),this.normalizedCatchUpThreshold=K_(r,600),this.normalizedStartDelayMs=K_(a,80),this.maxCommitFps=Math.trunc(tc(l,30,1)),this.maxCharsPerCommit=Math.trunc(tc(c,80,1)),this.flushOnFinish=u,this.segmenter=Kce(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Zce(e={},t){const n=new Uce(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Kce(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Gce(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function G_(){return typeof performance<"u"?performance.now():Date.now()}function Yce(e,t,n){return Math.min(n,Math.max(t,e))}var Xce=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Z8=Symbol.for("markstream-vue:node-lifecycle");function lqe(){}const cv=new Map;let SL="material";const Sc=new Map,Y_=new Map;let K8=null;function Jce(e){cv.set(e.id,e)}function Qce(e){const t=cv.get(SL);if(!t)return;const n=t.core[e];if(n)return n;const o=Sc.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!Sc.has(t.id)&&tue(t)}function eue(){var e,t;return(t=(e=cv.get(SL))==null?void 0:e.fallback)!=null?t:""}function tue(e){return Xce(this,null,function*(){var t,n,o;if(Sc.has(e.id))return(t=Sc.get(e.id))!=null?t:null;let s=Y_.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Sc.set(e.id,i),K8?.(),i)).catch(()=>(Sc.set(e.id,null),null)),Y_.set(e.id,s)),s})}const X_='',J_='',nue={id:"material",core:{"":J_,plain:'',text:J_,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:X_,csharp:X_,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>ps(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},oue=jo(0);K8=()=>{oue.value++},Jce(nue);const sue={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function $p(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=sue[n])!=null?t:n}function aqe(e){const t=$p(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function cqe(e){return Qce($p(e))||eue()}const Q_={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var Np=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let fi=null,s0=!1,i0=null,zp=dv;function of(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function uv(){try{const e=globalThis;return of(e?.katex)}catch{return null}}function dv(){return Np(null,null,function*(){const e=uv();if(e)return e;const t=yield ps(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ps(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return of(t)})}function CL(e){const t=Promise.resolve(e).then(n=>{var o;return i0===t&&n?(fi=(o=of(n))!=null?o:n,fi):null}).catch(()=>null).finally(()=>{i0===t&&(i0=null)});return i0=t,s0=!0,t}function iue(e){zp=e,fi=null,s0=!1,i0=null}function rue(e){iue(dv)}function ML(){return typeof zp=="function"}function uqe(){var e;const t=zp;if(!t||t===dv)return null;if(fi)return fi;const n=uv();if(n)return fi=n,fi;if(s0)return null;try{const o=t();return o?typeof o?.then=="function"?(CL(o),null):(fi=(e=of(o))!=null?e:o,fi):null}catch{return null}}function AL(){return Np(this,null,function*(){var e;const t=uv();if(t)return fi=t,fi;if(fi)return fi;if(i0)return i0;if(s0)return null;const n=zp;if(!n)return s0=!0,null;try{const o=n();if(typeof o?.then=="function")return CL(o);if(o)return fi=(e=of(o))!=null?e:o,s0=!0,fi}catch{}return s0=!0,null})}function EL(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Va=null,Ra=null;const qs=new Map,Kl=new Map;let Bd=5;const p0=new Set;function J2(){if(qs.size{const{id:n,html:o,error:s}=t.data,i=qs.get(n);if(i)if(qs.delete(n),clearTimeout(i.timeoutId),i.cleanup(),J2(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Kl.set(a,o),Kl.size>200){const c=Kl.keys().next().value;Kl.delete(c)}}i.aborted||i.resolve(o)}},Va.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of qs.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));qs.clear(),TL()}}function aue(){var e;for(const t of qs.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));qs.clear(),TL(),Va&&((e=Va.terminate)==null||e.call(Va)),Va=null,Ra=null}function cue(e,t=!0,n=2e3,o){return Np(this,null,function*(){performance.now();const s=EL(e);if(!ML()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ra)return Promise.reject(Ra);const i=`${t?"d":"i"}:${s}`,r=Kl.get(i);if(r)return J2(),Promise.resolve(r);const l=Va||(Ra=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ra.name="WorkerInitError",Ra.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ra);if(qs.size>=Bd){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=qs.size,a.max=Bd,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=qs.get(u);if(!m)return;qs.delete(u),m.cleanup();const k=new Error("Worker render timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT",m.aborted||m.reject(k),J2()},n);d=()=>{const m=qs.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const k=new Error("Aborted");k.name="AbortError",c(k)},o&&o.addEventListener("abort",d,{once:!0});const p=a,h=c;qs.set(u,{resolve:m=>{p(m)},reject:m=>{h(m)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:s,displayMode:t})}catch(m){const k=qs.get(u);qs.delete(u),clearTimeout(f),k?.cleanup(),k?.reject(m),J2()}})})}function dqe(e,t=!0,n){const o=`${t?"d":"i"}:${EL(e)}`;if(Kl.set(o,n),Kl.size>200){const s=Kl.keys().next().value;Kl.delete(s)}}const uue="WORKER_BUSY";function due(e=2e3,t){return qs.size{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),p0.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},p0.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",o(c)},e),queueMicrotask(()=>J2()),t&&(r=()=>{if(i)return;i=!0,a();const c=new Error("Aborted");c.name="AbortError",o(c)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const l2={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function fqe(e){return Np(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!ML()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:l2.timeout,c=(i=o.waitTimeout)!=null?i:l2.waitTimeout,u=(r=o.backoffMs)!=null?r:l2.backoffMs,d=(l=o.maxRetries)!=null?l:l2.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):l2.maxRetries,p=o.signal;let h=0;for(;;){if(p?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield cue(t,n,a,p)}catch(m){if(m?.code!==uue||h>=f)throw m;if(h++,yield due(c,p).catch(()=>{}),p?.aborted){const k=new Error("Aborted");throw k.name="AbortError",k}u>0&&(yield new Promise(k=>globalThis.setTimeout(k,u*h)))}}})}function Cc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function fue(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function w5(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=fue(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function y5(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function IL(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function k5(e,t=360,n=500){return IL(e,t,n)}function b5(e,t=360,n=500){return IL(e,t,n)}var pue=Object.defineProperty,hue=Object.defineProperties,mue=Object.getOwnPropertyDescriptors,ex=Object.getOwnPropertySymbols,gue=Object.prototype.hasOwnProperty,vue=Object.prototype.propertyIsEnumerable,tx=(e,t,n)=>t in e?pue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LL=(e,t)=>{for(var n in t||(t={}))gue.call(t,n)&&tx(e,n,t[n]);if(ex)for(var n of ex(t))vue.call(t,n)&&tx(e,n,t[n]);return e},nx=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const _5=()=>ps(()=>import("./mermaid.core-4ur3W-UG.js").then(e=>e.cb),__vite__mapDeps([4,5]));let Ll=null,Mc=_5,E2=null,G8=!1,Y8=!1,T2=0;function wue(e){Mc=e,T2++,Ll=null,E2=null,G8=!1,Y8=!1}function yue(e){wue(_5)}function ox(){return typeof Mc=="function"}function sx(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=LL({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},hue(n,mue(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function ix(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=LL({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function pqe(){return nx(this,null,function*(){if(Ll)return Ll;const e=(function(){try{const o=globalThis;return sx(o?.mermaid)}catch{return null}})();if(e)return Ll=e,ix(Ll),Ll;const t=Mc,n=T2;return t?t===_5&&G8?null:E2||(E2=nx(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===_5)return n===T2&&t===Mc&&(G8=!0,(function(i){Y8||(Y8=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===T2&&t===Mc&&(E2=null)}return n!==T2||t!==Mc?null:o?(Ll=sx(o),ix(Ll),Ll):null}),E2):null})}let Ai=null,Fa=null;const Or=new Map,q1=new Map;function c4(e){for(const t of Or.values())t.reject(e);Or.clear(),q1.clear()}let rx=5,lx=!1;const kue="WORKER_BUSY",ax="MERMAID_DISABLED";function bue(e){if(Ai&&Ai!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",c4(n)}Ai=e,Fa=null;const t=e;Ai.onmessage=n=>{if(Ai!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Or.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Ai.onerror=n=>{var o,s;if(Ai===t)if(Or.size!==0){try{lx?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}c4(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Ai.onmessageerror=n=>{var o,s;if(Ai===t)if(Or.size!==0){try{lx?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}c4(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function _ue(){var e;if(Ai)try{c4(new Error("Worker cleared")),(e=Ai.terminate)==null||e.call(Ai)}catch{}Ai=null,Fa=null}function $L(e,t,n,o){if(!ox()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=ax,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=q1.get(s);return i||(i=(function(r,l,a=1400){if(!ox()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=ax,Promise.reject(u)}if(Fa)return Promise.reject(Fa);const c=Ai||(Fa=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Fa.name="WorkerInitError",Fa.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(Fa);if(Or.size>=rx){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=kue,u.inFlight=Or.size,u.max=rx,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let p,h=!1;const m=()=>{h||(h=!0,p!=null&&globalThis.clearTimeout(p),Or.delete(f))},k={resolve:x=>{m(),u(x)},reject:x=>{m(),d(x)}};Or.set(f,k);try{c.postMessage({id:f,action:r,payload:l})}catch(x){return Or.delete(f),void d(x)}p=globalThis.setTimeout(()=>{const x=new Error("Worker call timed out");x.name="WorkerTimeout",x.code="WORKER_TIMEOUT";const v=Or.get(f);v&&v.reject(x)},a)})})(e,t,n),q1.set(s,i),i.then(()=>{q1.get(s)===i&&q1.delete(s)},()=>{q1.get(s)===i&&q1.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(i,o)}function hqe(e,t,n=1400,o){return $L("canParse",{code:e,theme:t},n,o)}function mqe(e,t,n=1400,o){return $L("findPrefix",{code:e,theme:t},n,o)}var xue=Object.defineProperty,Sue=Object.defineProperties,Cue=Object.getOwnPropertyDescriptors,cx=Object.getOwnPropertySymbols,Mue=Object.prototype.hasOwnProperty,Aue=Object.prototype.propertyIsEnumerable,ux=(e,t,n)=>t in e?xue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_t=(e,t)=>{for(var n in t||(t={}))Mue.call(t,n)&&ux(e,n,t[n]);if(cx)for(var n of cx(t))Aue.call(t,n)&&ux(e,n,t[n]);return e},gn=(e,t)=>Sue(e,Cue(t)),Eo=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Eue="__global__",Gh="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",X8=(()=>{const e=globalThis;if(e[Gh])return e[Gh];const t={scopedCustomComponents:{},revision:jo(0)};return e[Gh]=t,t})(),dx=X8.revision,Tue=Symbol("markstreamCustomComponents"),Iue=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function sf(e){return Iue.has(String(e).trim().toLowerCase())}function Lue(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Yh(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([xr(n),xr(Lue(n))]))!s||sf(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function ws(e){const t=pn(Tue,null);return B(()=>{var n;return dx.value,(function(o,s={}){return dx.value,_t(_t(_t({},Yh(X8.scopedCustomComponents[Eue]||{})),Yh(s)),Yh((function(i){return i&&X8.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const $ue=["aria-label"],Nue={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},zue={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},to=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ki=to(Ge({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(g(),S("svg",zue,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(g(),S("svg",Nue,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,$ue))}),[["__scopeId","data-v-be21ab83"]]);Ki.install=e=>{e.component(Ki.__name,Ki)};const Bue={class:"emoji-node"},Ni=to(Ge({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("span",Bue,I(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Ni.install=e=>{e.component(Ni.__name,Ni)};const Rue=["id"],Fue=["title"],Gi=to(Ge({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(g(),S("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+I(e.node.id)+"]",9,Fue)],8,Rue))}}),[["__scopeId","data-v-c1463a29"]]);Gi.install=e=>{e.component(Gi.__name,Gi)};const NL=(()=>{try{return!1}catch{}return!1})();function Xh(e){NL&&console.warn(e)}function fx(e,t="safe",n){return av(e,t,n)}function zL(e){return vce(e)}function Jh(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function fv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=a4((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),Jh(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Jh(r.value)]):Object.entries(s).map(([r,l])=>[r,Jh(l)]):null,t,n);var s;if(!o)return;const i=zL(X2(o));return Object.keys(i).length>0?i:void 0}function px(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function a2(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Qh(e,t,n,o,s,i,r=!1){const l=(function(d,f){return vL(d,f)})(e,o);if(Qd.has(e.toLowerCase())||!l&&pL(e,i))return null;if(!l&&lv(e,i))return r?[px(e,t,!0)]:[px(e,t),...n,``];const a=av(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=zL(a);return hn(d,gn(_t({},f),{key:u}),n.length>0?n:void 0)}return hn(e,gn(_t({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function BL(e,t){return kce(e,t)}function x5(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=Qh(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);a2(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let p=-1;for(let h=c.length-1;h>=0;h--)if(c[h].tagName.toLowerCase()===f){p=h;break}if(p!==-1)for(;c.length>p;){const h=c.pop(),m=Qh(h.tagName,h.attrs||{},h.children,r,h.autoKey,l);c.length>0?a2(c[c.length-1].children,m):a2(u,m),h.tagName.toLowerCase()!==f&&c.length>p&&Xh(`Auto-closing unclosed tag: <${h.tagName}>`)}else Xh(`Ignoring closing tag with no matching opening tag: `)}for(;c.length>0;){const d=c.pop(),f=Qh(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?a2(c[c.length-1].children,f):a2(u,f),Xh(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(wL(e),t,n)}catch(s){return o=s,NL&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const jue=["innerHTML"],Yi=to(Ge({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=pn("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=ws(()=>t.customId),i=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Vc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=x5(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!BL(l,s.value))return{mode:"html",content:Vc(l,o.value)};const a=x5(l,s.value,o.value);return a===null?{mode:"html",content:Vc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(g(),S("span",{key:0,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[Z(y(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(g(),S("span",{key:1,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},I(r.value.content),3)):(g(),S("span",{key:2,class:Be(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,jue))}}),[["__scopeId","data-v-d17f12b0"]]);Yi.install=e=>{e.component(Yi.__name,Yi)};const Oue={class:"inline-code"},Pue={key:0},ii=to(Ge({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Kd(),o=pn("markstreamFade",void 0),s=pn("markstreamTextStreamState",void 0),i=pn("markstreamStreamVersion",void 0),r=B(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var v;return String((v=t.node.code)!=null?v:"")}),c=B(()=>!l.value),u=B(()=>{var v;const w=(v=n["index-key"])!=null?v:n.indexKey;return w==null||w===""?"":String(w)}),d=U(t.node.code),f=U(""),p=U(0);let h;function m(){h?.(),h=void 0}function k(){m(),f.value&&(d.value=d.value+f.value,f.value="")}Ue([()=>t.node.code,u,l],([v])=>{const w=String(v??""),b=u.value,M=_L({nextContent:w,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(p.value+=1,(function(){if(!f.value||h||!i)return;const R=i.value;h=Ue(()=>i.value,z=>{z!==R&&k()},{flush:"sync"})})()):f.value||m(),b&&s?.set(b,w)},{immediate:!0}),fu(m);const x=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,w)=>(g(),S("code",Oue,[c.value?(g(),S(Me,{key:0},[He(I(a.value),1)],64)):(g(),S(Me,{key:1},[d.value?(g(),S("span",Pue,I(d.value),1)):J("",!0),f.value?(g(),S("span",{key:1,class:Be(["inline-code-stream-delta",[x.value]]),onAnimationend:k},I(f.value),35)):J("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);ii.install=e=>{e.component(ii.__name,ii)};const J8=U(!1),hx=U(""),mx=U("top"),Q2=U(null),ed=U(null),Q8=U(null),e7=U(null),gx=U(null);let u4=null,d4=null,t7=0;function RL(){u4&&(clearTimeout(u4),u4=null),d4&&(clearTimeout(d4),d4=null)}let C3=!1,M3=null,vx=!1;function Hue(e,t,n="top",o=!1,s,i){if(!e)return;const r=++t7;RL();const l=()=>Eo(null,null,function*(){var a,c;if(yield(function(){return Eo(this,null,function*(){if(!C3&&!vx&&typeof document<"u"){M3!=null||(M3=Eo(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ps(()=>import("./vue.runtime.esm-bundler-zQ6SDzgy.js"),[]),ps(()=>import("./Tooltip-D-x_6nZf.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),u({setup:()=>()=>{var h;return d(f,{visible:J8.value,"anchor-el":Q2.value,content:hx.value,placement:mx.value,id:ed.value,originX:Q8.value,originY:e7.value,isDark:(h=gx.value)!=null?h:void 0})}}).mount(p),C3=!0}));try{yield M3}catch(u){C3=!1,M3=null,vx=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),C3&&r===t7){ed.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Q2.value=e,hx.value=t,mx.value=n,Q8.value=(a=s?.x)!=null?a:null,e7.value=(c=s?.y)!=null?c:null,gx.value=typeof i=="boolean"?i:null,J8.value=!0;try{e.setAttribute("aria-describedby",ed.value)}catch{}}});o?l():u4=setTimeout(l,80)}function Due(e=!1){t7+=1,RL();const t=()=>{if(Q2.value&&ed.value)try{Q2.value.removeAttribute("aria-describedby")}catch{}J8.value=!1,Q2.value=null,ed.value=null,Q8.value=null,e7.value=null};e?t():d4=setTimeout(t,120)}const Vue={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Wue=Symbol("markstreamI18nFallback");function FL(e,t){var n;return(n=t?.[e])!=null?n:Vue[e]}const n7=(e,t)=>{var n;return(n=FL(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function wx(e,t){return{t(n){const o=FL(n,t);if(e.te&&o!=null&&!e.te(n))return n7(n,t);const s=e.t(n);return s===n&&o!=null?n7(n,t):s}}}function que(){const e=(function(){var n,o,s;try{const i=gs(),r=Wue,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=gs(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const c=i?.$te;return{t:r.bind(i),te:typeof c=="function"?c.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return wx(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return wx({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>n7(n,e)}}const jL=Symbol("ViewportPriority"),OL=Symbol("ViewportPriorityOptions"),PL=Symbol("OffscreenHeavyNodeDeferral"),Uue=B(()=>!1),y0="400px";function pv(){return pn(OL,void 0)}function hv(){return pn(PL,Uue)}function Zue(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?U(t):t,r=s?(n=window.requestIdleCallback)!=null?n:z=>window.setTimeout(()=>z({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:z=>window.clearTimeout(z):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let p=null,h=null;function m(z){if(!z)return"viewport";let $=a.get(z);return $||($=c++,a.set(z,$)),String($)}function k(){if(p!=null){try{l?.(p)}catch{}p=null}}function x(z){if(z){const $=u.get(z);if($&&!$.targets.size){try{$.io.disconnect()}catch{}u.delete(z)}}d.size||f.size||k()}function v(z){const $=d.get(z);if(!$)return;const E=u.get($.bucketKey);if(!$.visible.value){$.visible.value=!0;try{$.resolve()}catch{}}try{E?.io.unobserve(z)}catch{}E?.targets.delete(z),d.delete(z),f.delete(z),x($.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&p==null&&f.size&&(p=r(()=>{p=null;const z=f.values().next().value;z&&(f.delete(z),v(z),f.size&&w())},{timeout:1200}))}function b(z,$){if(!s||typeof IntersectionObserver>"u")return null;const E=(function(V,A){var F,j,q;return{root:(F=e?.(V??null))!=null?F:null,rootMargin:(j=A?.rootMargin)!=null?j:y0,threshold:(q=A?.threshold)!=null?q:0}})(z,$),T=[m((N=E).root),N.rootMargin,N.threshold].join("\0");var N;const C=u.get(T);if(C)return{key:T,bucket:C};let O;try{O=new IntersectionObserver(V=>{for(const A of V)(A.isIntersecting||A.intersectionRatio>0)&&v(A.target)},{root:E.root,rootMargin:E.rootMargin,threshold:E.threshold})}catch{return null}const H={io:O,targets:new Map};return u.set(T,H),{key:T,bucket:H}}function M(){if(s&&i.value)for(const[z,$]of Array.from(d.entries())){const E=b(z,$.opts);if(!E){v(z);continue}if(E.key===$.bucketKey)continue;const T=$.bucketKey,N=u.get(T);try{N?.io.unobserve(z)}catch{}N?.targets.delete(z),$.bucketKey=E.key,E.bucket.targets.set(z,$),E.bucket.io.observe(z),x(T)}}Ue(i,z=>{if(!z){for(const $ of Array.from(d.keys()))v($);k()}},{flush:"sync"});const R=(z,$)=>{const E=U(!1);let T,N=!1;const C=new Promise(A=>{T=()=>{N||(N=!0,A())}}),O=()=>{const A=d.get(z);if(!A)return f.delete(z),void x();const F=u.get(A.bucketKey);try{F?.io.unobserve(z)}catch{}F?.targets.delete(z),d.delete(z),f.delete(z),x(A.bucketKey)};if(!s||!i.value)return E.value=!0,T(),{isVisible:E,whenVisible:C,destroy:O};const H=b(z,$);if(!H)return E.value=!0,T(),{isVisible:E,whenVisible:C,destroy:O};const V={resolve:T,visible:E,bucketKey:H.key,opts:$};return d.set(z,V),H.bucket.targets.set(z,V),H.bucket.io.observe(z),s&&h==null&&(h=window.requestAnimationFrame(()=>{h=null,M()})),$?.allowIdle!==!1&&(f.add(z),w()),{isVisible:E,whenVisible:C,destroy:O}};return R.refresh=M,jn(jL,R),R}function mv(){var e,t;const n=pn(jL,void 0);if(n)return n;const o=new WeakMap,s=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{if(!p)return;const h=s.get(p);if(h&&!h.targets.size){try{h.io.disconnect()}catch{}s.delete(p)}},d=p=>{const h=o.get(p);if(!h)return;const m=s.get(h.bucketKey);if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{m?.io.unobserve(p)}catch{}o.delete(p),m?.targets.delete(p),i.delete(p),u(h.bucketKey),i.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),d(p),i.size&&f())},{timeout:1200}))};return(p,h)=>{const m=U(!1);let k,x=!1;const v=new Promise(M=>{k=()=>{x||(x=!0,M())}}),w=()=>{const M=o.get(p);if(!M)return i.delete(p),void(i.size||c());const R=s.get(M.bucketKey);try{R?.io.unobserve(p)}catch{}o.delete(p),R?.targets.delete(p),i.delete(p),u(M.bucketKey),i.size||c()},b=(M=>{var R,z;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const $=(O=>{var H,V;return[(H=O?.rootMargin)!=null?H:y0,(V=O?.threshold)!=null?V:0].join("\0")})(M),E=s.get($);if(E)return{key:$,bucket:E};const T=(R=M?.rootMargin)!=null?R:y0;let N;try{N=new IntersectionObserver(O=>{for(const H of O)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:T,threshold:(z=M?.threshold)!=null?z:0})}catch{return null}const C={io:N,targets:new Set};return s.set($,C),{key:$,bucket:C}})(h);return b?(o.set(p,{resolve:k,visible:m,bucketKey:b.key}),b.bucket.targets.add(p),b.bucket.io.observe(p),h?.allowIdle!==!1&&(i.add(p),f()),{isVisible:m,whenVisible:v,destroy:w}):(m.value=!0,k(),{isVisible:m,whenVisible:v,destroy:w})}}function Kue(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Gue=["data-markstream-viewport-pending"],Yue=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Xue={key:1,class:"image-placeholder"},Jue={key:1,class:"image-node__raw-text"},Que={key:2,class:"image-shimmer-overlay"},e2e={key:1,class:"image-node__raw-text"},t2e={key:3,class:"image-error"},Xa=to(Ge({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=U(!1),a=U(!1),c=U(""),u=U("primary"),d=U(null),f=Kd(),p=pn(Z8,null),h=mv(),m=pv(),k=hv(),x=B(()=>Db(i.node.src)),v=B(()=>Db(i.fallbackSrc)),w=(s=(o=(n=gs())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),b=typeof window<"u"&&w?.getAttribute("src")===(x.value||v.value),M=U(typeof window>"u"||b||!k.value),R=jo(null);let z="",$=null;const E=B(()=>c.value),T=B(()=>!i.lazy),N=B(()=>typeof window<"u"&&k.value&&!b),C=B(()=>!N.value||M.value),O=B(()=>C.value?E.value:""),H=B(()=>{var xe,Ke;return(Ke=(xe=m?.value.heavyBlockMargin)!=null?xe:m?.value.rootMargin)!=null?Ke:y0}),V=B(()=>!i.node.loading&&u.value!=="failed"&&c.value.length>0),A=B(()=>u.value==="failed"),F=B(()=>(!T.value||N.value&&!M.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),j=B(()=>Kue(i,f));function q(xe=j.value){xe&&d.value&&p?.reportHeight(xe,d.value.offsetHeight)}function P(xe=j.value){xe&&vt(()=>{q(xe)})}function W(){$&&(clearTimeout($),$=null)}function G(){const xe=j.value;xe&&z!==xe&&(z&&p?.markSettled(z),W(),z=xe,p?.markPending(xe),typeof window<"u"&&($=window.setTimeout(()=>{z===xe&&(P(xe),ee())},8e3)))}function ee(){return Eo(this,null,function*(){const xe=z;xe&&(W(),z="",yield vt(),q(xe),p?.markSettled(xe))})}function se(){if(u.value==="primary"&&v.value&&v.value!==c.value)return u.value="fallback",c.value=v.value,l.value=!1,a.value=!1,void P();u.value="failed",a.value=!0,r("error",c.value),P()}function oe(){l.value=!0,a.value=!1,r("load",E.value),P()}function Q(xe){xe.preventDefault(),l.value&&!a.value&&r("click",[xe,E.value])}const{t:ge}=que();return Ue([x,v,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||x.value?(c.value=x.value,void(u.value="primary")):v.value?(c.value=v.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Ue([d,N],([xe,Ke],et,Y)=>{var ne;if((ne=R.value)==null||ne.destroy(),R.value=null,!Ke||M.value)return void(M.value=!0);if(!xe)return void(M.value=!1);let D=!0;const X=h(xe,{rootMargin:H.value,allowIdle:!1});R.value=X,M.value=X.isVisible.value,X.whenVisible.then(()=>{D&&R.value===X&&(M.value=!0)}),Y(()=>{D=!1,X.destroy(),R.value===X&&(R.value=null)})},{immediate:!0}),Ue([V,l,a,E,()=>i.lazy,C],([xe,Ke,et,Y,ne,D])=>xe&&Y&&!et&&D?Ke?(ee(),void P()):ne?(G(),void P()):void(Ke||et||G()):(ee(),void P()),{flush:"post",immediate:!0}),vo(()=>{var xe;(xe=R.value)==null||xe.destroy(),R.value=null,(function(){const Ke=z;Ke&&(W(),z="",p?.markSettled(Ke))})()}),(xe,Ke)=>{var et,Y,ne,D,X;return g(),S("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":N.value&&!M.value?"true":void 0},[V.value?(g(),S("img",{key:0,src:O.value||void 0,alt:String((Y=(et=i.node.alt)!=null?et:i.node.title)!=null?Y:""),title:String((D=(ne=i.node.title)!=null?ne:i.node.alt)!=null?D:""),class:Be(["image-node__img",{"is-loading":!T.value&&!l.value,"is-loaded":T.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:T.value?"high":void 0,decoding:T.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(X=i.node.alt)!=null?X:y(ge)("image.preview"),onError:se,onLoad:oe,onClick:Q},null,42,Yue)):J("",!0),e.node.loading&&!a.value?(g(),S("span",Xue,[i.usePlaceholder?En(xe.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ke[0]||(Ke[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(g(),S("span",Jue,I(e.node.raw),1))])):J("",!0),F.value&&!e.node.loading?(g(),S("span",Que,[i.usePlaceholder?En(xe.$slots,"placeholder",{key:0,node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ke[1]||(Ke[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(g(),S("span",e2e,I(e.node.raw),1))])):J("",!0),A.value?(g(),S("span",t2e,[En(xe.$slots,"error",{node:i.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ke[2]||(Ke[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,I(y(ge)("image.loadError")),1)],!0)])):J("",!0)],8,Gue)}}}),[["__scopeId","data-v-046e82ac"]]);Xa.install=e=>{e.component(Xa.__name,Xa)};const n2e={key:2},yl=Ge({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamHtmlPolicy",void 0),s=pn("markstreamNestedRendererProps",void 0),i=B(()=>{var h;return(h=o?.value)!=null?h:"safe"}),r=B(()=>{var h,m;const k=(h=s?.value)!=null?h:{};return gn(_t({},k),{customId:(m=t.customId)!=null?m:k.customId,htmlPolicy:i.value})}),l=mr({loader:()=>Promise.resolve().then(()=>Mv),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!sf(String(t.node.type)))),u=B(()=>c.value?fv(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var h;return String((h=t.node.content)!=null?h:"")}),p=B(()=>{var h,m;return String((m=(h=t.node.content)!=null?h:t.node.raw)!=null?m:"")});return(h,m)=>a.value&&c.value?(g(),ce(ns(a.value),Vn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ue(()=>[d.value?(g(),ce(y(l),Vn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(g(),ce(y(l),Vn({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(g(),ce(ns(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(g(),S("span",n2e,I(p.value),1)):J("",!0)}}),yx=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function o2e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return gn(_t(_t({},yx),n),{enabled:(t=n.enabled)==null||t})}return _t({},yx)}function gv(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function HL(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function kx(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function s2e(e){var t;return e.diff===!0||kx(e.language)||kx(HL(String((t=e.raw)!=null?t:"")))}function i2e(e,t,n){const o=(function(s){const i=HL(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const r2e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],l2e={key:0,translate:"no",class:"markstream-pre__diff-code"},a2e={class:"markstream-pre__diff-pane-content"},c2e={class:"markstream-pre__diff-number","aria-hidden":"true"},u2e={class:"markstream-pre__diff-content"},d2e={class:"markstream-pre__diff-content-inner"},f2e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},p2e=["textContent"],h2e=["textContent"],Ei=Ge({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(oe,Q){const ge=String(oe??"");return Q?ge:ge.replace(/\r\n$|\n$|\r$/,"")}const o=B(()=>{var oe,Q,ge;const xe=String((Q=(oe=t.node)==null?void 0:oe.language)!=null?Q:"");return String((ge=String(xe).split(/\s+/g)[0])!=null?ge:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=B(()=>`language-${o.value}`),i=B(()=>{var oe;return t.loading===!0||((oe=t.node)==null?void 0:oe.loading)===!0}),r=B(()=>{var oe;return n((oe=t.node)==null?void 0:oe.code,i.value)});let l="",a=1;const c=B(()=>(function(oe){let Q=0,ge=1;oe.startsWith(l)&&(Q=l.length,ge=a,Q>0&&oe[Q-1]==="\r"&&oe[Q]===` `&&Q++);for(let xe=Q;xei.value.split(/\r\n|\n|\r/));let d=0,f="";const p=B(()=>{const oe=c.value;oe{var oe;return t.showLineNumbers===!0&&((oe=t.node)==null?void 0:oe.diff)===!0}),m=B(()=>h.value&&t.diffInline===!0),k=B(()=>{const oe=Number(t.reservedHeightPx);if(!Number.isFinite(oe)||oe<=0)return;const Q=`${Math.ceil(oe)}px`;return r.value?{maxHeight:Q,overflow:"auto"}:{height:Q,minHeight:Q,maxHeight:Q,overflow:"auto"}}),x=["diff ","index ","--- ","+++ ","@@ "];function w(oe){return String(oe??"").trim().length===0}function v(oe,Q="context",ge={}){const xe=w(oe);return{code:oe,kind:xe&&Q!=="hunk"&&Q!=="spacer"&&!ge.preserveBlankKind?"context":Q,empty:xe}}function b(oe){const Q=n(oe,r.value);return Q?Q.split(/\r\n|\n|\r/):[]}function M(oe,Q){return!w(oe[Q])||Qx.some(ge=>Q.startsWith(ge)))}function T(oe,Q){return Q||!oe.startsWith(" ")||oe.startsWith(" ")?oe:` ${oe}`}function E(oe,Q){const ge=oe.length,xe=Q.length,Ke=[];let et=0;for(;et=et&&D>=et&&oe[ne]===Q[D];)Y.unshift({originalIndex:ne,modifiedIndex:D}),ne--,D--;const X=ne-et+1,ve=D-et+1;if(X<=0||ve<=0||r.value||(X+1)*(ve+1)>15e5)return Ke.concat(Y);const fe=ve+1,pe=new Uint32Array((X+1)*(ve+1));for(let Ce=X-1;Ce>=0;Ce--)for(let me=ve-1;me>=0;me--){const be=Ce*fe+me;if(oe[et+Ce]===Q[et+me])pe[be]=pe[(Ce+1)*fe+me+1]+1;else{const re=pe[(Ce+1)*fe+me],ke=pe[Ce*fe+me+1];pe[be]=re>=ke?re:ke}}const te=[];let de=0,ye=0;for(;de=pe[de*fe+ye+1]?de++:ye++;return Ke.concat(te,Y)}function N(oe){var Q;const ge=(function(){var D,X;const ve=t.diffHideUnchangedRegions;if(ve==null||ve===!1)return null;const fe=ve===!0?{}:ve;return fe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((D=fe.contextLineCount)!=null?D:2)),minimumLineCount:Math.max(1,Math.floor((X=fe.minimumLineCount)!=null?X:4))}})();if(!ge||oe.length<1||oe.length>2||oe.length===2&&oe[0].lines.length!==oe[1].lines.length)return oe;const xe=oe[0].lines,Ke=(Q=oe[1])==null?void 0:Q.lines,et=D=>xe[D].kind==="context"&&(Ke===void 0||Ke[D].kind==="context"&&xe[D].code===Ke[D].code),Y=[];let ne=0;for(;ne=ge.minimumLineCount){const ve=D+(D===0?0:ge.contextLineCount),fe=X-(X===xe.length?0:ge.contextLineCount);fe-ve>=ge.minimumLineCount&&Y.push({start:ve,end:fe})}ne===D&&ne++}return Y.length?oe.map((D,X)=>{const ve=[];let fe=0;for(const pe of Y)ve.push(...D.lines.slice(fe,pe.start)),ve.push({code:X===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${D.key}-collapsed-${pe.start}-${pe.end}`,number:""}),fe=pe.end;return ve.push(...D.lines.slice(fe)),gn(_t({},D),{lines:ve})}):oe}const C=B(()=>{var oe,Q,ge,xe;if(!h.value)return[];const Ke=(function(X){const ve=X.some(pe=>R(pe)),fe=X.some(pe=>z(pe));return ve&&fe||(function(){var pe,te,de,ye;if(o.value==="diff")return!0;const Ce=(ye=(de=String((te=(pe=t.node)==null?void 0:pe.raw)!=null?te:"").split(/\r?\n/,1)[0])==null?void 0:de.trim())!=null?ye:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(ve||fe)})(u.value),et=(function(){var X,ve;return((X=t.node)==null?void 0:X.originalCode)!=null||((ve=t.node)==null?void 0:ve.updatedCode)!=null})();if(m.value){const X=et?(function(ve,fe){const pe=b(ve),te=b(fe),de=E(pe,te);if(de.length>0){const ke=[];let Fe=0,at=0;for(const dt of de){for(;Fe=Ce&&be>=Ce&&pe[me]===te[be];)re.unshift(gn(_t({},v(te[be])),{key:`inline-suffix-${be}`,number:be+1})),me--,be--;for(let ke=Ce;ke<=me;ke++)ye.push(gn(_t({},v(pe[ke],"removed",{preserveBlankKind:M(pe,ke)})),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Ce;ke<=be;ke++)ye.push(gn(_t({},v(te[ke],"added",{preserveBlankKind:M(te,ke)})),{key:`inline-added-source-${ke}`,number:ke+1}));return ye.concat(re)})((oe=t.node)==null?void 0:oe.originalCode,(Q=t.node)==null?void 0:Q.updatedCode):(function(ve){const fe=[];let pe=1,te=1;const de=$(ve);for(const[ye,Ce]of ve.entries())if(Ce.startsWith("@@")){const me=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);me&&(pe=Number(me[1]),te=Number(me[2])),fe.push(gn(_t({},v(Ce,"hunk")),{key:`inline-hunk-${ye}`,number:""}))}else if(R(Ce))fe.push(gn(_t({},v(T(Ce.slice(1),de),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ye}`,number:pe++}));else if(z(Ce))fe.push(gn(_t({},v(T(Ce.slice(1),de),"added",{preserveBlankKind:!0})),{key:`inline-added-${ye}`,number:te++}));else{const me=de&&Ce.startsWith(" ")?Ce.slice(1):Ce;fe.push(gn(_t({},v(me)),{key:`inline-context-${ye}`,number:te})),pe++,te++}return fe})(u.value);return N([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:X}])}if(!Ke&&et)return(function(X,ve){const fe=b(X),pe=b(ve),te=E(fe,pe),de=[],ye=[];let Ce=0,me=0,be=0;const re=(ke,Fe)=>{const at=Math.max(ke-Ce,Fe-me);for(let dt=0;dtgn(_t({},X),{key:`original-${ve}`,number:ve+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ne.map((X,ve)=>gn(_t({},X),{key:`modified-${ve}`,number:ve+1}))}])}),O=B(()=>C.value.some(oe=>oe.lines.some(Q=>Q.kind==="collapsed"))),H=B(()=>{const oe=o.value;return oe?`Code block: ${oe}`:"Code block"}),V=U(null),A=U([]);let F=null,j=!1,q=null;function P(oe){const Q=Number.parseFloat(String(oe??""));return Number.isFinite(Q)&&Q>0?Q:0}function W(oe,Q){var ge;if(!oe)return Q;if(oe.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const xe=oe.querySelector(".markstream-pre__diff-content"),Ke=xe?.getBoundingClientRect(),et=(ge=Ke?.height)!=null?ge:0;return Math.max(Q,Math.ceil(et))}function G(){j||typeof window>"u"||(F!=null&&window.cancelAnimationFrame(F),F=window.requestAnimationFrame(()=>{F=null,j||(function(){var oe,Q;F=null;const ge=V.value;if(!ge||!h.value||m.value||!ge.classList.contains("is-wrap"))return void(A.value.length&&(A.value=[]));const xe=(function(ve){const fe=window.getComputedStyle(ve),pe=P(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(pe>0)return pe;const te=P(fe.lineHeight);return te>0?te:18})(ge),Ke=Array.from(ge.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),et=Array.from(ge.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ke.length,et.length),ne=[];for(let ve=0;ve{const pe=X[fe];return pe&&Math.abs(ve.rowHeight-pe.rowHeight)<=.5&&Math.abs(ve.originalHeight-pe.originalHeight)<=.5&&Math.abs(ve.modifiedHeight-pe.modifiedHeight)<=.5})||(A.value=ne)})()}))}function ee(oe){q?.disconnect(),q=null,oe&&h.value&&!m.value&&typeof ResizeObserver<"u"&&(q=new ResizeObserver(()=>{G()}),q.observe(oe))}function se(oe,Q){const ge=A.value[oe];if(!ge)return;const xe=Q==="original"?ge.originalHeight:ge.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ge.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(xe)}px`}}return Ue(V,oe=>{ee(oe),vt(()=>G())},{flush:"post"}),Ue([h,m,C],()=>{ee(V.value),vt(()=>G())},{flush:"post",immediate:!0}),vo(()=>{j=!0,F!=null&&(window.cancelAnimationFrame(F),F=null),q?.disconnect(),q=null}),(oe,Q)=>(g(),S("pre",{ref_key:"preRef",ref:V,style:Wt(k.value),class:Be([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":h.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":O.value}]),"aria-busy":r.value,"aria-label":H.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[h.value?(g(),S("code",n2e,[(g(!0),S(Me,null,rt(C.value,ge=>(g(),S("span",{key:ge.key,class:Be(["markstream-pre__diff-pane",ge.className])},[_("span",o2e,[(g(!0),S(Me,null,rt(ge.lines,(xe,Ke)=>(g(),S("span",{key:xe.key,class:Be(["markstream-pre__diff-line",[`markstream-pre__diff-line--${xe.kind}`,{"markstream-pre__diff-line--empty":xe.empty}]]),style:Wt(se(Ke,ge.key))},[Q[0]||(Q[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",s2e,I(xe.number),1),_("span",r2e,[_("span",i2e,I(xe.code),1)])],6))),128))])],2))),128))])):(g(),S(Me,{key:1},[t.showLineNumbers?(g(),S("span",l2e,[_("span",{class:"markstream-pre__line-numbers-text",textContent:I(p.value)},null,8,a2e)])):J("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:I(i.value)},null,8,c2e)],64))],14,t2e))}});Tr.install=e=>{e.component(Tr.__name,Tr)};const u2e={key:0},Ko=to(Ge({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Zd(),o=pn("markstreamFade",void 0),s=pn("markstreamTextStreamState",void 0),r=pn("markstreamStreamVersion",void 0),i=B(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=B(()=>typeof i.value=="boolean"?i.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var k;const x=(k=n["index-key"])!=null?k:n.indexKey;return x==null||x===""?"":String(x)}),c=U(t.node.content),u=U(""),d=U(0);let f;function p(){f?.(),f=void 0}function h(){p(),u.value&&(c.value=c.value+u.value,u.value="")}Ue([()=>t.node.content,a,l],([k])=>{const x=String(k??""),w=a.value,v=yL({nextContent:x,persistedContent:w?s?.get(w):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=v.settledContent,u.value=v.streamedDelta,v.appended?(d.value+=1,(function(){if(!u.value||f||!r)return;const b=r.value;f=Ue(()=>r.value,M=>{M!==b&&h()},{flush:"sync"})})()):u.value||p(),w&&s?.set(w,x)},{immediate:!0}),du(p);const m=B(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,x)=>(g(),S("span",{class:Be([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(g(),S("span",u2e,I(c.value),1)):J("",!0),u.value?(g(),S("span",{key:1,class:Be(["text-node-stream-delta",[m.value]]),onAnimationend:h},I(u.value),35)):J("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function E2(e,t,n){return Ge({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:r}){var i,l;const a=hv(),c=fv(),u=pv(),d=typeof window<"u"&&((l=(i=gs())==null?void 0:i.vnode.el)==null?void 0:l.nodeType)===1,f=U(typeof window>"u"||d||!u.value),p=jo(null);let h=null;function m(k){const x=k&&"$el"in k?k.$el:k;p.value=x instanceof HTMLElement?x:null}return typeof window<"u"&&Ue([p,u],([k,x],w,v)=>{if(h?.destroy(),h=null,!x||f.value)return void(f.value=!0);if(!k)return;let b=!0;const M=a(k,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});h=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{b&&h===M&&(f.value=!0)}),v(()=>{b=!1,M.destroy(),h===M&&(h=null)})},{immediate:!0}),vo(()=>{h?.destroy(),h=null}),()=>hn(f.value?t:n,gn(_t({},s),{ref:m}),r)}})}Ko.install=e=>{e.component(Ko.__name,Ko)};const x5=Ge({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,r,i,l,a,c;const u=Lp(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=J_[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):J_[""]),f=Que(n.node),p=e2e(String((i=(r=n.node)==null?void 0:r.raw)!=null?i:""),d,f),h=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:mv(h??{},typeof window>"u"?0:window.innerWidth)),k=h?.diffAppearance,x=k==="dark"||k!=="light"&&n.isDark===!0,w=typeof h?.fontSize=="number"&&Number.isFinite(h.fontSize)&&h.fontSize>0?h.fontSize:12,v=typeof h?.lineHeight=="number"&&Number.isFinite(h.lineHeight)&&h.lineHeight>0?h.lineHeight:w===12?18:Math.max(12,Math.round(1.5*w)),b=typeof h?.tabSize=="number"&&Number.isFinite(h.tabSize)&&h.tabSize>0?h.tabSize:4,M=f?0:8,R=typeof((a=h?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(h.padding.top)&&h.padding.top>=0?h.padding.top:M,z=typeof((c=h?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(h.padding.bottom)&&h.padding.bottom>=0?h.padding.bottom:M,$=typeof h?.fontFamily=="string"?h.fontFamily.trim():"",T=_t(_t({fontSize:`${w}px`,lineHeight:`${v}px`,tabSize:b,paddingTop:`${R}px`,paddingBottom:`${z}px`,"--markstream-pre-line-number-top":`${R}px`},f?{"--markstream-pre-diff-line-height":`${v}px`}:{}),$?{"--markstream-code-font-family":$}:{}),E=()=>hn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[hn("svg",{class:"action-icon"})]),N=n.isShowPreview!==!1&&(u==="html"||u==="svg"),C=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||N&&n.showPreviewButton!==!1,O=V=>{if(V!=null)return typeof V=="number"?`${V}px`:String(V)},H=_t(_t(_t({"--markstream-code-layout-character-width":"1ch"},O(n.minWidth)?{minWidth:O(n.minWidth)}:{}),O(n.maxWidth)?{maxWidth:O(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return hn("div",gn(_t({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":x,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:hn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[hn("div",{class:"code-header-main"},[hn("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),hn("div",{class:"code-header-copy"},[hn("div",{class:"code-header-title"},p.title),p.caption?hn("div",{class:"code-header-caption"},p.caption):null])]),hn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?hn("div",{class:"code-diff-stats","aria-hidden":"true"},[hn("span",{class:"code-diff-stat removed"},"-0"),hn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:E(),n.showCollapseButton===!1?null:E(),C?hn("div",{class:"relative"},[E()]):null])]),hn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[hn(Tr,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?Jue(h?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:T,"data-markstream-code-loading":"1"})]),hn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[hn("div",{class:"loading-skeleton"},[hn("div",{class:"skeleton-line"}),hn("div",{class:"skeleton-line"}),hn("div",{class:"skeleton-line short"})])]),hn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),Qh=E2("ViewportDeferredCodeBlockNode",mi({loader:()=>To(null,null,function*(){try{return(yield ps(()=>import("./CodeBlockNode-DRvGmu0B.js"),__vite__mapDeps([6,7]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Tr}}),loadingComponent:x5,delay:0,suspensible:!1}),x5),Xi=mi(()=>To(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,r;return hn(Ko,gn(_t({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(r=t.node.raw)!=null?r:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield SL(),(yield ps(()=>import("./index7-ptJtrPOf.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,r;return hn(Ko,gn(_t({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(r=t.node.raw)!=null?r:`$${(s=t.node.content)!=null?s:""}$`}}))}})),OL=mi(()=>To(null,null,function*(){try{return yield SL(),(yield ps(()=>import("./index6-DUfXjQxg.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return hn(Ko,gn(_t({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),hr=to(Ge({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(g(),S("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},I(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);hr.install=e=>{e.component(hr.__name,hr)};const d2e={class:"superscript-node"},zr=to(Ge({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,emphasis:wr,footnote_reference:Gr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,emoji:Nr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("sup",d2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);zr.install=e=>{e.component(zr.__name,zr)};const f2e={class:"subscript-node"},Br=to(Ge({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,emphasis:wr,footnote_reference:Gr,strikethrough:gr,highlight:Xr,insert:Rr,superscript:zr,emoji:Nr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("sub",f2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Br.install=e=>{e.component(Br.__name,Br)};const p2e={class:"strong-node"},mr=to(Ge({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,emphasis:wr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,footnote_reference:Gr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("strong",p2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:i,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);mr.install=e=>{e.component(mr.__name,mr)};const h2e={class:"strikethrough-node"},gr=to(Ge({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,emphasis:wr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,footnote_reference:Gr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("del",h2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);gr.install=e=>{e.component(gr.__name,gr)};const m2e=["href","title","aria-label","aria-hidden","target","rel"],g2e=["aria-hidden"],v2e={class:"link-text-wrapper relative inline-flex"},w2e={class:"leading-[normal] link-text"},vr=to(Ge({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=pn("markstreamShowTooltips",void 0),o=B(()=>{const x=n?.value;return typeof x=="boolean"?x:t.showTooltip}),s=B(()=>{var x,w,v,b,M;const R=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",z=(x=t.animationOpacity)!=null?x:.35,$=Math.max(.12,Math.min(.5*z,z)),T={"--underline-height":`${(w=t.underlineHeight)!=null?w:2}px`,"--underline-bottom":R,"--underline-opacity":String(z),"--underline-rest-opacity":String($),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(T["--link-color"]=t.color),T}),r=ws(()=>t.customId),i=B(()=>_t({text:Ko,strong:mr,strikethrough:gr,emphasis:wr,image:Xa,html_inline:Yr,inline_code:rr},r.value)),l=Zd(),a=B(()=>{var x,w;const v=(x=t.node)==null?void 0:x.attrs;if(!v||typeof v!="object")return{};const b={};if(Array.isArray(v))for(const M of v)Array.isArray(M)&&M[0]&&(b[String(M[0])]=String((w=M[1])!=null?w:""));else for(const[M,R]of Object.entries(v))M&&R!=null&&R!==!1&&(b[M]=R===!0?"":String(R));return dx(b,"safe","a")}),c=B(()=>_t(_t({},l),a.value)),u=B(()=>{var x,w;return dx({href:String((w=(x=t.node)==null?void 0:x.href)!=null?w:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const x=c.value.target;return(typeof x=="string"?x.trim():String(x??"").trim())||(pie(u.value)?"_blank":void 0)}),f=B(()=>{var x;return String((x=d.value)!=null?x:"").trim().toLowerCase()==="_blank"}),p=B(()=>{if(!u.value)return;const x=c.value.rel,w=new Set((typeof x=="string"?x:String(x??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(w).filter(b=>b.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),h=B(()=>{const x=_t({},c.value);return delete x.title,delete x.href,delete x.target,delete x.rel,x});function m(){o.value&&Fue()}const k=B(()=>{var x,w;const v=(x=t.node)==null?void 0:x.title;return typeof v=="string"&&v.trim().length>0?v:String((w=u.value)!=null?w:"")});return(x,w)=>{var v,b;return e.node.loading?(g(),S("span",Vn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:s.value}),[_("span",v2e,[_("span",w2e,[Z(y(Ko),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),w[1]||(w[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,g2e)):(g(),S("a",Vn({key:0,class:"link-node",href:u.value,title:o.value?"":k.value,"aria-label":`Link: ${k.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:s.value,onMouseenter:w[0]||(w[0]=M=>(function(R){var z,$,T,E;if(!o.value)return;const N=R,C=N?.clientX!=null&&N?.clientY!=null?{x:N.clientX,y:N.clientY}:void 0,O=((z=t.node)==null?void 0:z.title)||(($=u.value)!=null&&$.includes("xn--")&&((E=(T=t.node)==null?void 0:T.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";Rue(R.currentTarget,O,"top",!1,C)})(M)),onMouseleave:m}),[(g(!0),S(Me,null,rt(e.node.children,(M,R)=>(g(),ce(y(yl),{key:`${e.indexKey||"emphasis"}-${R}`,components:i.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${R}`},null,8,["components","node","custom-id","index-key"]))),128))],16,m2e))}}}),[["__scopeId","data-v-367e6ca4"]]);vr.install=e=>{e.component(vr.__name,vr)};const y2e={class:"insert-node"},Rr=to(Ge({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,emphasis:wr,strikethrough:gr,highlight:Xr,subscript:Br,superscript:zr,emoji:Nr,footnote_reference:Gr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("ins",y2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Rr.install=e=>{e.component(Rr.__name,Rr)};const k2e={class:"highlight-node"},Xr=to(Ge({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,emphasis:wr,strikethrough:gr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,footnote_reference:Gr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("mark",k2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Xr.install=e=>{e.component(Xr.__name,Xr)};const b2e={class:"emphasis-node"},wr=to(Ge({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:rr,link:vr,html_inline:Yr,strong:mr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,footnote_reference:Gr,math_inline:Xi,reference:hr},n.value));return(s,r)=>(g(),S("em",b2e,[(g(!0),S(Me,null,rt(e.node.children,(i,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:i,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);wr.install=e=>{e.component(wr.__name,wr)};const _2e={class:"hard-break"},Ja=to(Ge({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("br",_2e))}),[["__scopeId","data-v-50c58f70"]]);Ja.install=e=>{e.component(Ja.__name,Ja)};const Bd=Ge({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Nt({checkbox:Kr,checkbox_input:Kr,emoji:Nr,emphasis:wr,hardbreak:Ja,highlight:Xr,inline_code:rr,insert:Rr,link:vr,reference:hr,strikethrough:gr,strong:mr,subscript:Br,superscript:zr,text:Ko}),o=ws(()=>t.customId),s=B(()=>{const r=o.value;return Object.keys(r).length>0?_t(_t({},n),r):n});return(r,i)=>(g(!0),S(Me,null,rt(e.nodes,(l,a)=>(g(),ce(y(yl),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function n7(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(n7)}function S5(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(n7))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(n7)?s:null}function k0(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const x2e=["cite"],S2e={key:0,dir:"auto",class:"paragraph-node"},C2e=["custom-id"],d4=to(Ge({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),r=B(()=>S5(t.node.children,!o.value)),i=B(()=>t.fade!==!1||s.value?null:k0(r.value));return jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade)),(l,a)=>(g(),S("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[r.value?(g(),S("p",S2e,[i.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(i.value),9,C2e)):(g(),ce(y(Bd),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(g(),ce(y(Fr),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,x2e))}}),[["__scopeId","data-v-abfecebc"]]);d4.install=e=>{e.component(d4.__name,d4)};const M2e={class:"definition-list"},A2e={class:"definition-term"},T2e={class:"definition-desc"},f4=to(Ge({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(g(),S("dl",M2e,[(g(!0),S(Me,null,rt(t.node.items,(s,r)=>(g(),S(Me,{key:r},[_("dt",A2e,[Z(y(Fr),{"index-key":`definition-term-${t.indexKey}-${r}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=i=>n.$emit("copy",i))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",T2e,[Z(y(Fr),{"index-key":`definition-desc-${t.indexKey}-${r}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=i=>n.$emit("copy",i))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);f4.install=e=>{e.component(f4.__name,f4)};const E2e=["href","title"],ed=to(Ge({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const r=`fnref-${String((s=t.node.id)!=null?s:"")}`,i=document.getElementById(r);i&&i.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(g(),S("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,E2e))}}),[["__scopeId","data-v-e1eb37b6"]]);ed.install=e=>{e.component(ed.__name,ed)};const I2e=["id"],L2e={class:"flex-1"},p4=Ge({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(g(),S("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",L2e,[Z(y(Fr),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,I2e))}});p4.install=e=>{e.component(p4.__name,p4)};const $2e=["custom-id"],o7=to(Ge({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:k0(t.node.children)),r=B(()=>_t({text:Ko,inline_code:rr,link:vr,image:Xa,strong:mr,emphasis:wr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,checkbox:Kr,checkbox_input:Kr,footnote_reference:Gr,hardbreak:Ja,math_inline:Xi,reference:hr},n.value));return(i,l)=>(g(),ce(ns(`h${e.node.level}`),Vn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ue(()=>[s.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(s.value),9,$2e)):(g(!0),S(Me,{key:1},rt(e.node.children,(a,c)=>(g(),ce(y(yl),{key:c,components:r.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),zp=o7;zp.install=e=>{e.component(o7.__name,o7)};const N2e={key:0,dir:"auto",class:"paragraph-node"},z2e=["custom-id"],B2e={dir:"auto",class:"paragraph-node"},R2e=["custom-id"],Vc=to(Ge({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var p;return(p=t.node)!=null?p:t.item}),o=ws(()=>t.customId),s=B(()=>!!o.value.paragraph),r=B(()=>!!o.value.text),i=B(()=>{var p;return S5((p=n.value)==null?void 0:p.children,!s.value)}),l=B(()=>{var p;if(s.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const k=h.slice(1);if(!k.every(w=>w?.type==="list"))return null;const x=S5([m]);return x?{paragraphChildren:x,nestedLists:k}:null});function a(){return t.fade===!1&&!r.value}const c=B(()=>a()?k0(i.value):null),u=B(()=>{var p;return a()?k0((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade)),(p,h)=>{var m,k;return g(),S("li",Vn({class:"list-item",dir:"auto"},f.value),[i.value?(g(),S("p",N2e,[c.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(c.value),9,z2e)):(g(),ce(y(Bd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(g(),S(Me,{key:1},[_("p",B2e,[u.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(u.value),9,R2e)):(g(),ce(y(Bd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(g(!0),S(Me,null,rt(l.value.nestedLists,(x,w)=>(g(),ce(y(Fr),{key:w,nodes:[x],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${w}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=v=>p.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(g(),ce(y(Fr),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(k=(m=n.value)==null?void 0:m.children)!=null?k:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=x=>p.$emit("copy",x))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Vc.install=e=>{e.component(Vc.__name,Vc)};const Wc=to(Ge({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ws(()=>e.customId),n=B(()=>t.value.list_item||Vc);return(o,s)=>(g(),ce(ns(e.node.ordered?"ol":"ul"),{class:Be(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ue(()=>[(g(!0),S(Me,null,rt(e.node.items,(r,i)=>{var l;return g(),ce(ns(n.value),Vn({key:`${e.indexKey||"list"}-${i}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:r,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${i}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+i:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Wc.install=e=>{e.component(Wc.__name,Wc)};const F2e={key:2,class:"html-block-node__raw"},j2e=["innerHTML"],O2e={key:1,class:"html-block-node__placeholder"},td=to(Ge({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=pn("markstreamHtmlPolicy",void 0),o=pn("markstreamNestedRendererProps",void 0),s=B(()=>{var C,O;return(O=(C=t.htmlPolicy)!=null?C:n?.value)!=null?O:"safe"}),r=B(()=>{var C,O;const H=(C=o?.value)!=null?C:{};return gn(_t({},H),{customId:(O=t.customId)!=null?O:H.customId,htmlPolicy:s.value})}),i=mi({loader:()=>Promise.resolve().then(()=>Cv),suspensible:!1}),l=B(()=>{const C=l4(t.node.attrs,s.value);if(!C)return;const O=Y2(C);return Object.keys(O).length>0?O:void 0}),a=B(()=>{const C=String(t.node.tag||"").trim(),O=l4(t.node.attrs,s.value,C);if(!O)return;const H=Y2(O);return Object.keys(H).length>0?H:void 0}),c=ws(()=>t.customId),u=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=U(null),f=U(typeof window>"u"),p=U(t.node.content),h=B(()=>Array.isArray(t.node.children)?t.node.children:[]),m=B(()=>String(t.node.tag||"div")),k=B(()=>{var C;if(m.value.trim().toLowerCase()!=="details"||(C=t.node.attrs)!=null&&C.some(([H])=>String(H).toLowerCase()==="open"))return null;const O=h.value[0];return O?.type==="html_block"&&String(O.tag||"").toLowerCase()==="summary"?O:null}),x=B(()=>{var C;return k0((C=k.value)==null?void 0:C.children)}),w=B(()=>{const C=k.value;if(!C)return;const O=l4(C.attrs,s.value,"summary");if(!O)return;const H=Y2(O);return Object.keys(H).length>0?H:void 0}),v=B(()=>x.value==null?h.value:h.value.slice(1)),b=B(()=>{const C=m.value.trim().toLowerCase();return lI.has(C)||iv(C,s.value)}),M=B(()=>h.value.length>0&&!!t.node.tag&&!b.value),R=B(()=>{var C,O,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(C=p.value)!=null?C:""};const V=(O=p.value)!=null?O:t.node.content;if(!V)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Dc(V,s.value)};if(t.node.loading){const F=_5(V,c.value,s.value);return F===null?{mode:"text",content:(H=t.node.raw)!=null?H:V}:{mode:"dynamic",nodes:F}}if(!$L(V,c.value))return{mode:"html",content:Dc(V,s.value)};const A=_5(V,c.value,s.value);return A===null?{mode:"html",content:Dc(V,s.value)}:{mode:"dynamic",nodes:A}}),z=hv(),$=fv(),T=pv(),E=jo(null),N=!!t.node.loading;return typeof window<"u"?(Ue([()=>d.value,()=>$?.value.heavyBlockMargin,()=>$?.value.rootMargin],([C],O,H)=>{var V,A,F,j;if((A=(V=E.value)==null?void 0:V.destroy)==null||A.call(V),E.value=null,!N)return f.value=!0,void(p.value=t.node.content);if(!C)return void(f.value=!1);let q=!0;const P=(j=(F=$?.value.heavyBlockMargin)!=null?F:$?.value.rootMargin)!=null?j:y0,W=z(C,{rootMargin:P,allowIdle:!T.value});E.value=W,f.value=f.value||W.isVisible.value,W.whenVisible.then(()=>{q&&E.value===W&&(f.value=!0)}),H(()=>{q=!1,W.destroy(),E.value===W&&(E.value=null)})},{immediate:!0}),Ue(()=>t.node.content,C=>{N&&!f.value||(p.value=C)})):f.value=!0,vo(()=>{var C,O;(O=(C=E.value)==null?void 0:C.destroy)==null||O.call(C),E.value=null}),(C,O)=>(g(),ce(ns(M.value?m.value:"div"),Vn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":y(T)&&!f.value?"true":void 0},M.value?a.value:void 0),{default:ue(()=>[f.value?(g(),S(Me,{key:0},[R.value.mode==="structured"?(g(),S(Me,{key:0},[x.value!==null?(g(),S(Me,{key:0},[_("summary",HB(yA(w.value)),I(x.value),17),v.value.length?(g(),ce(y(i),Vn({key:0},r.value,{nodes:v.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):J("",!0)],64)):(g(),ce(y(i),Vn({key:1},r.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):R.value.mode==="dynamic"?(g(),ce(y(u),{key:1,nodes:R.value.nodes},null,8,["nodes"])):R.value.mode==="text"?(g(),S("pre",F2e,I(R.value.content),1)):(g(),S("div",Vn({key:3},l.value,{innerHTML:R.value.content}),null,16,j2e))],64)):(g(),S("div",O2e,[Tn(C.$slots,"placeholder",{node:e.node},()=>[O[0]||(O[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),O[1]||(O[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),O[2]||(O[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);td.install=e=>{e.component(td.__name,td)};const P2e={dir:"auto",class:"paragraph-node"},H2e=["custom-id"],h0=to(Ge({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamHtmlPolicy",void 0),s=pn("markstreamFade",void 0),r=pn("markstreamParseOptions",void 0),i=pn("markstreamCustomMarkdownIt",void 0),l=pn("markstreamNestedRendererProps",void 0),a=B(()=>{var $;return($=o?.value)!=null?$:"safe"}),c=B(()=>{var $;return($=t.parseOptions)!=null?$:r?.value}),u=B(()=>{var $;return($=t.customMarkdownIt)!=null?$:i?.value}),d=B(()=>{var $,T;return(T=t.customHtmlTags)!=null?T:($=l?.value)==null?void 0:$.customHtmlTags}),f=B(()=>{var $,T;const E=($=l?.value)!=null?$:{};return gn(_t({},E),{customId:(T=t.customId)!=null?T:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=mi({loader:()=>Promise.resolve().then(()=>Cv),suspensible:!1});function h($){var T;return $.type==="text"&&String((T=$.content)!=null?T:"").trim()===""}const m=B(()=>t.node.children.filter($=>!h($))),k=B(()=>m.value.length>0&&m.value.every($=>$.type==="image"||(function(T){var E;const N=(function(C){return C.type==="link"&&Array.isArray(C.children)?C.children.filter(O=>!h(O)):[]})(T);return N.length===1&&((E=N[0])==null?void 0:E.type)==="image"})($))),x=B(()=>new Set(E0(d.value))),w=B(()=>{if(!k.value||m.value.length<=1)return t.node.children;const $=[];for(let T=0;T0,C=t.node.children.slice(T+1).some(O=>!h(O));N&&C&&$.push(gn(_t({},E),{content:" ",raw:" "}))}return $}),v=B(()=>s?.value===!1&&!n.value.text),b=B(()=>v.value?k0(w.value):null);function M($,T){return{node:$,"index-key":`${t.indexKey}-${T}`,"custom-id":t.customId,"custom-html-tags":d.value}}const R=B(()=>_t({inline_code:rr,image:Xa,link:vr,hardbreak:Ja,emphasis:wr,strong:mr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,html_inline:Yr,html_block:td,emoji:Nr,checkbox:Kr,math_inline:Xi,checkbox_input:Kr,reference:hr,footnote_anchor:ed,footnote_reference:Gr,text:Ko},n.value)),z=B(()=>w.value.map(($,T)=>{var E;const N=(function(C){var O,H,V,A;if(C.type==="html_block"||C.type==="html_inline"){const F=String((O=C.tag)!=null?O:"").trim().toLowerCase()||fI(C.content);if(F&&!x.value.has(F)&&pI((H=C.content)!=null?H:C.raw,F)){const j=String((A=(V=C.content)!=null?V:C.raw)!=null?A:"");return{child:{type:"text",content:j,raw:j},component:Ko,isCustomComponent:!1}}}return{child:C,component:R.value[C.type],isCustomComponent:!!(n.value[C.type]&&!of(String(C.type)))}})($);return gn(_t({},N),{index:T,key:`${t.indexKey||"paragraph"}-${T}`,customAttrs:N.isCustomComponent?dv(N.child,a.value):void 0,hasSlotChildren:Array.isArray(N.child.children)&&N.child.children.length>0,slotContent:String((E=N.child.content)!=null?E:""),originalChild:$})}));return($,T)=>(g(),S("p",P2e,[b.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(b.value),9,H2e)):(g(!0),S(Me,{key:1},rt(z.value,E=>{return g(),S(Me,{key:E.key},[k.value&&h(E.originalChild)?(g(),S(Me,{key:0},[He(I((N=E.originalChild,String((C=N.content)!=null?C:""))),1)],64)):E.isCustomComponent?(g(),ce(ns(E.component),Vn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ue(()=>[E.hasSlotChildren?(g(),ce(y(p),Vn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(g(),ce(y(p),Vn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(g(),ce(ns(E.component),Vn({key:2,ref_for:!0},M(E.child,E.index)),null,16))],64);var N,C}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);h0.install=e=>{e.component(h0.__name,h0)};const D2e={class:"table-node-wrapper"},V2e=["aria-busy"],W2e={key:0},q2e=["custom-id"],U2e=["aria-label","onPointerdown"],Z2e=["custom-id"],K2e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},nd=to(Ge({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var x;return(x=t.node.loading)!=null&&x}),o=B(()=>{var x;return(x=t.node.rows)!=null?x:[]}),s=U(null),r=U([]);let i=null;const l=B(()=>t.node.header.cells.length),a=B(()=>r.value.some(x=>Number.isFinite(x)&&x>0)),c=B(()=>a.value?r.value.map(x=>x>0?{width:`${x}px`}:void 0):[]);jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade));const u=ws(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),p=new WeakMap;function h(x){const w=t.fade===!1&&!d.value,v=!f.value,b=p.get(x);if(b?.children===x.children&&b.textFastPath===w&&b.paragraphFastPath===v)return b.info;const M=S5(x.children,v,!0),R={simpleChildren:M,plainText:M&&w?k0(M):null};return p.set(x,{children:x.children,textFastPath:w,paragraphFastPath:v,info:R}),R}function m(x){if(!i)return;x.preventDefault();const w=i.startWidth+i.nextStartWidth,v=Math.min(48,Math.floor(w/2)),b=Math.max(v,Math.min(w-v,Math.round(i.startWidth+x.clientX-i.startX))),M=[...i.widths];M[i.index]=b,M[i.index+1]=w-b,r.value=M}function k(){i&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),i=null)}return Ue(l,()=>{k(),r.value=[]}),vo(k),(x,w)=>(g(),S("div",D2e,[_("table",{ref_key:"tableRef",ref:s,class:Be(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(g(),S("colgroup",W2e,[(g(!0),S(Me,null,rt(e.node.header.cells,(v,b)=>(g(),S("col",{key:b,style:Wt(c.value[b])},null,4))),128))])):J("",!0),_("thead",null,[_("tr",null,[(g(!0),S(Me,null,rt(e.node.header.cells,(v,b)=>(g(),S("th",{key:b,dir:"auto",class:Be([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[h(v).plainText!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(h(v).plainText),9,q2e)):h(v).simpleChildren?(g(),ce(y(Bd),{key:1,nodes:h(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(g(),ce(y(Fr),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:w[0]||(w[0]=M=>x.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b(function(R,z){if(z.button!==0)return;const $=(function(){var N;const C=(N=s.value)==null?void 0:N.querySelectorAll("thead th");return Array.from(C??[],O=>Math.round(O.getBoundingClientRect().width))})(),T=$[R],E=$[R+1];T&&E&&(z.preventDefault(),i={index:R,startX:z.clientX,startWidth:T,nextStartWidth:E,widths:$},r.value=$,window.addEventListener("pointermove",m),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k))})(b,M)},null,40,U2e)):J("",!0)],2))),128))])]),_("tbody",null,[(g(!0),S(Me,null,rt(o.value,(v,b)=>(g(),S("tr",{key:b},[(g(!0),S(Me,null,rt(v.cells,(M,R)=>(g(),S("td",{key:R,class:Be([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(M).plainText!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(h(M).plainText),9,Z2e)):h(M).simpleChildren?(g(),ce(y(Bd),{key:1,nodes:h(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${R}`},null,8,["nodes","custom-id","index-key"])):(g(),ce(y(Fr),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:w[1]||(w[1]=z=>x.$emit("copy",z))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,V2e),Z(gi,{name:"table-node-fade"},{default:ue(()=>[n.value?(g(),S("div",K2e,[Tn(x.$slots,"loading",{isLoading:n.value},()=>[w[2]||(w[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),w[3]||(w[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):J("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);nd.install=e=>{e.component(nd.__name,nd)};const G2e={class:"hr-node"},h4=to({},[["render",function(e,t){return g(),S("hr",G2e)}],["__scopeId","data-v-39b2349c"]]);h4.install=e=>{e.component(h4.__name,h4)};const Y2e={class:"unknown-node"},s7=Ge({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(g(),S("div",Y2e,I(e.node.raw),1))}),m4=to(Ge({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),o=ws(()=>t.customId),s=B(()=>_t({text:Ko,paragraph:h0,heading:zp,inline_code:rr,link:vr,image:Xa,strong:mr,emphasis:wr,strikethrough:gr,insert:Rr,subscript:Br,superscript:zr,checkbox:Kr,checkbox_input:Kr,hardbreak:Ja,math_inline:Xi,reference:hr,list:Wc,math_block:OL,table:nd},o.value));return(r,i)=>(g(),S("div",Vn({class:n.value},e.node.attrs),[(g(!0),S(Me,null,rt(e.node.children,(l,a)=>{return g(),ce(ns((c=l.type,s.value[c]||s7)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);m4.install=e=>{e.component(m4.__name,m4)};const X2e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],kx=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function J2e(e){if(e<=255)return X2e[e];let t=0,n=kx.length-1;for(;t<=n;){const o=t+n>>1,s=kx[o];if(es[1]))return s[2];t=o+1}}return"L"}const Q2e=/[ \t\n\r\f]+/g,ede=/[\t\n\r\f]| {2,}|^ | $/;let em=null;const tde=new RegExp("\\p{Script=Arabic}","u"),a1=new RegExp("\\p{M}","u"),gv=new RegExp("\\p{Nd}","u");function bx(e){return tde.test(e)}function _x(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function ml(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&o<=57343){if(_x(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(_x(n))return!0}}return!1}const nde=new Set([" "," ","⁠","\uFEFF"]),ode=new Set(["-","‐","–","—"]);function PL(e,t){return!((function(n){const o=od(n);return o!==null&&nde.has(o)})(e)||t&&((function(n){const o=od(n);return o!==null&&(vv.has(o)||b0.has(o))})(e)||(function(n){const o=od(n);return o!==null&&ode.has(o)})(e)))}const vv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Bp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),wv=new Set(["'","’"]),b0=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),sde=new Set([":",".","،","؛"]),rde=new Set(["၏"]),ide=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function lde(e){if(yv(e))return!0;let t=!1;for(const n of e)if(b0.has(n)||M5(n))t=!0;else if(!t||!a1.test(n))return!1;return t}function ade(e){for(const t of e)if(!vv.has(t)&&!b0.has(t))return!1;return e.length>0}function cde(e){if(yv(e))return!0;for(const t of e)if(!(Bp.has(t)||wv.has(t)||a1.test(t)||M5(t)))return!1;return e.length>0}function yv(e){let t=!1;for(const n of e)if(n!=="\\"&&!a1.test(n)){if(!(Bp.has(n)||b0.has(n)||wv.has(n)))return!1;t=!0}return t}function C5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const r=e.charCodeAt(s);return r>=55296&&r<=56319?s:n}function od(e){if(e.length===0)return null;const t=C5(e,e.length);return e.slice(t)}const ude=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function M5(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s=o[s]&&n<=o[s+1])return!0;return!1})(t,ude)}function dde(e){const t=(function(n){for(const o of n)if(!a1.test(o))return o;return null})(e);return t!==null&&gv.test(t)}function fde(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(a1.test(o))n--;else{if(!Bp.has(o)&&!wv.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function pde(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function xx(e,t,n,o){const s=t[o],r=e[o];if(s==null)return r;const i=n[o];if(r.length===i)return r;const l=s.repeat(i);return e[o]=l,l}function Sx(e,t){return e&&t!==null&&sde.has(t)}function hde(e){const t=od(e);return t!==null&&rde.has(t)}function mde(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function r7(e){let t=e.length;for(;t>0;){const n=C5(e,t),o=e.slice(n,t);if(ide.has(o))return!0;if(!b0.has(o))return!1;t=n}return!1}function gde(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const vde=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fi(e){return e.length===1?e[0]:e.join("")}function wde(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Fi(n)}function yde(e,t,n,o){if(!vde.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let r=null,i=[],l=n,a=!1,c=0;for(const u of e){const d=gde(u,o),f=d==="text"&&t;r===null||d!==r||f!==a?(r!==null&&s.push({text:Fi(i),isWordLike:a,kind:r,start:l}),r=d,i=[u],l=n+c,a=f,c+=u.length):(i.push(u),c+=u.length)}return r!==null&&s.push({text:Fi(i),isWordLike:a,kind:r,start:l}),s}function tm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const kde=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function bde(e,t){const n=e.texts[t];return!!n.startsWith("www.")||kde.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Mde.has(e)&&!Cde.test(e)&&Sde.test(e)}function Cx(e){let t=!1;for(const n of e)if(!a1.test(n)){if(!HL(n))return!1;t=!0}return t}function Ade(e,t,n,o){const s=!t&&Cx(e),r=!o&&Cx(n),i=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=C5(u,d),p=u.slice(f,d);if(!a1.test(p))return p;d=f}return null})(a);return c!==null&&M5(c)})(e),l=(t||i)&&(function(a){for(let c=a.length;c>0;){const u=C5(a,c),d=a.slice(u,c);if(!a1.test(d))return HL(d)||M5(d);c=u}return!1})(e);return!!(s||r||l)&&!ml(e)&&!ml(n)&&(t||s||i)&&(o||r)}function Mx(e){for(const t of e)if(gv.test(t))return!0;return!1}function g4(e){if(e.length===0)return!1;for(const t of e)if(!gv.test(t)&&!xde.has(t))return!1;return!0}function Tde(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;sr.value.split(/\r\n|\n|\r/));let d=0,f="";const p=B(()=>{const oe=c.value;oe{var oe;return t.showLineNumbers===!0&&((oe=t.node)==null?void 0:oe.diff)===!0}),m=B(()=>h.value&&t.diffInline===!0),k=B(()=>{const oe=Number(t.reservedHeightPx);if(!Number.isFinite(oe)||oe<=0)return;const Q=`${Math.ceil(oe)}px`;return i.value?{maxHeight:Q,overflow:"auto"}:{height:Q,minHeight:Q,maxHeight:Q,overflow:"auto"}}),x=["diff ","index ","--- ","+++ ","@@ "];function v(oe){return String(oe??"").trim().length===0}function w(oe,Q="context",ge={}){const xe=v(oe);return{code:oe,kind:xe&&Q!=="hunk"&&Q!=="spacer"&&!ge.preserveBlankKind?"context":Q,empty:xe}}function b(oe){const Q=n(oe,i.value);return Q?Q.split(/\r\n|\n|\r/):[]}function M(oe,Q){return!v(oe[Q])||Qx.some(ge=>Q.startsWith(ge)))}function E(oe,Q){return Q||!oe.startsWith(" ")||oe.startsWith(" ")?oe:` ${oe}`}function T(oe,Q){const ge=oe.length,xe=Q.length,Ke=[];let et=0;for(;et=et&&D>=et&&oe[ne]===Q[D];)Y.unshift({originalIndex:ne,modifiedIndex:D}),ne--,D--;const X=ne-et+1,ve=D-et+1;if(X<=0||ve<=0||i.value||(X+1)*(ve+1)>15e5)return Ke.concat(Y);const fe=ve+1,pe=new Uint32Array((X+1)*(ve+1));for(let Ce=X-1;Ce>=0;Ce--)for(let me=ve-1;me>=0;me--){const be=Ce*fe+me;if(oe[et+Ce]===Q[et+me])pe[be]=pe[(Ce+1)*fe+me+1]+1;else{const ie=pe[(Ce+1)*fe+me],ke=pe[Ce*fe+me+1];pe[be]=ie>=ke?ie:ke}}const te=[];let de=0,ye=0;for(;de=pe[de*fe+ye+1]?de++:ye++;return Ke.concat(te,Y)}function N(oe){var Q;const ge=(function(){var D,X;const ve=t.diffHideUnchangedRegions;if(ve==null||ve===!1)return null;const fe=ve===!0?{}:ve;return fe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((D=fe.contextLineCount)!=null?D:2)),minimumLineCount:Math.max(1,Math.floor((X=fe.minimumLineCount)!=null?X:4))}})();if(!ge||oe.length<1||oe.length>2||oe.length===2&&oe[0].lines.length!==oe[1].lines.length)return oe;const xe=oe[0].lines,Ke=(Q=oe[1])==null?void 0:Q.lines,et=D=>xe[D].kind==="context"&&(Ke===void 0||Ke[D].kind==="context"&&xe[D].code===Ke[D].code),Y=[];let ne=0;for(;ne=ge.minimumLineCount){const ve=D+(D===0?0:ge.contextLineCount),fe=X-(X===xe.length?0:ge.contextLineCount);fe-ve>=ge.minimumLineCount&&Y.push({start:ve,end:fe})}ne===D&&ne++}return Y.length?oe.map((D,X)=>{const ve=[];let fe=0;for(const pe of Y)ve.push(...D.lines.slice(fe,pe.start)),ve.push({code:X===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${D.key}-collapsed-${pe.start}-${pe.end}`,number:""}),fe=pe.end;return ve.push(...D.lines.slice(fe)),gn(_t({},D),{lines:ve})}):oe}const C=B(()=>{var oe,Q,ge,xe;if(!h.value)return[];const Ke=(function(X){const ve=X.some(pe=>R(pe)),fe=X.some(pe=>z(pe));return ve&&fe||(function(){var pe,te,de,ye;if(o.value==="diff")return!0;const Ce=(ye=(de=String((te=(pe=t.node)==null?void 0:pe.raw)!=null?te:"").split(/\r?\n/,1)[0])==null?void 0:de.trim())!=null?ye:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(ve||fe)})(u.value),et=(function(){var X,ve;return((X=t.node)==null?void 0:X.originalCode)!=null||((ve=t.node)==null?void 0:ve.updatedCode)!=null})();if(m.value){const X=et?(function(ve,fe){const pe=b(ve),te=b(fe),de=T(pe,te);if(de.length>0){const ke=[];let Fe=0,at=0;for(const dt of de){for(;Fe=Ce&&be>=Ce&&pe[me]===te[be];)ie.unshift(gn(_t({},w(te[be])),{key:`inline-suffix-${be}`,number:be+1})),me--,be--;for(let ke=Ce;ke<=me;ke++)ye.push(gn(_t({},w(pe[ke],"removed",{preserveBlankKind:M(pe,ke)})),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Ce;ke<=be;ke++)ye.push(gn(_t({},w(te[ke],"added",{preserveBlankKind:M(te,ke)})),{key:`inline-added-source-${ke}`,number:ke+1}));return ye.concat(ie)})((oe=t.node)==null?void 0:oe.originalCode,(Q=t.node)==null?void 0:Q.updatedCode):(function(ve){const fe=[];let pe=1,te=1;const de=$(ve);for(const[ye,Ce]of ve.entries())if(Ce.startsWith("@@")){const me=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);me&&(pe=Number(me[1]),te=Number(me[2])),fe.push(gn(_t({},w(Ce,"hunk")),{key:`inline-hunk-${ye}`,number:""}))}else if(R(Ce))fe.push(gn(_t({},w(E(Ce.slice(1),de),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ye}`,number:pe++}));else if(z(Ce))fe.push(gn(_t({},w(E(Ce.slice(1),de),"added",{preserveBlankKind:!0})),{key:`inline-added-${ye}`,number:te++}));else{const me=de&&Ce.startsWith(" ")?Ce.slice(1):Ce;fe.push(gn(_t({},w(me)),{key:`inline-context-${ye}`,number:te})),pe++,te++}return fe})(u.value);return N([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:X}])}if(!Ke&&et)return(function(X,ve){const fe=b(X),pe=b(ve),te=T(fe,pe),de=[],ye=[];let Ce=0,me=0,be=0;const ie=(ke,Fe)=>{const at=Math.max(ke-Ce,Fe-me);for(let dt=0;dtgn(_t({},X),{key:`original-${ve}`,number:ve+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:ne.map((X,ve)=>gn(_t({},X),{key:`modified-${ve}`,number:ve+1}))}])}),O=B(()=>C.value.some(oe=>oe.lines.some(Q=>Q.kind==="collapsed"))),H=B(()=>{const oe=o.value;return oe?`Code block: ${oe}`:"Code block"}),V=U(null),A=U([]);let F=null,j=!1,q=null;function P(oe){const Q=Number.parseFloat(String(oe??""));return Number.isFinite(Q)&&Q>0?Q:0}function W(oe,Q){var ge;if(!oe)return Q;if(oe.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const xe=oe.querySelector(".markstream-pre__diff-content"),Ke=xe?.getBoundingClientRect(),et=(ge=Ke?.height)!=null?ge:0;return Math.max(Q,Math.ceil(et))}function G(){j||typeof window>"u"||(F!=null&&window.cancelAnimationFrame(F),F=window.requestAnimationFrame(()=>{F=null,j||(function(){var oe,Q;F=null;const ge=V.value;if(!ge||!h.value||m.value||!ge.classList.contains("is-wrap"))return void(A.value.length&&(A.value=[]));const xe=(function(ve){const fe=window.getComputedStyle(ve),pe=P(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(pe>0)return pe;const te=P(fe.lineHeight);return te>0?te:18})(ge),Ke=Array.from(ge.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),et=Array.from(ge.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ke.length,et.length),ne=[];for(let ve=0;ve{const pe=X[fe];return pe&&Math.abs(ve.rowHeight-pe.rowHeight)<=.5&&Math.abs(ve.originalHeight-pe.originalHeight)<=.5&&Math.abs(ve.modifiedHeight-pe.modifiedHeight)<=.5})||(A.value=ne)})()}))}function ee(oe){q?.disconnect(),q=null,oe&&h.value&&!m.value&&typeof ResizeObserver<"u"&&(q=new ResizeObserver(()=>{G()}),q.observe(oe))}function se(oe,Q){const ge=A.value[oe];if(!ge)return;const xe=Q==="original"?ge.originalHeight:ge.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ge.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(xe)}px`}}return Ue(V,oe=>{ee(oe),vt(()=>G())},{flush:"post"}),Ue([h,m,C],()=>{ee(V.value),vt(()=>G())},{flush:"post",immediate:!0}),vo(()=>{j=!0,F!=null&&(window.cancelAnimationFrame(F),F=null),q?.disconnect(),q=null}),(oe,Q)=>(g(),S("pre",{ref_key:"preRef",ref:V,style:Wt(k.value),class:Be([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":h.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":O.value}]),"aria-busy":i.value,"aria-label":H.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[h.value?(g(),S("code",l2e,[(g(!0),S(Me,null,it(C.value,ge=>(g(),S("span",{key:ge.key,class:Be(["markstream-pre__diff-pane",ge.className])},[_("span",a2e,[(g(!0),S(Me,null,it(ge.lines,(xe,Ke)=>(g(),S("span",{key:xe.key,class:Be(["markstream-pre__diff-line",[`markstream-pre__diff-line--${xe.kind}`,{"markstream-pre__diff-line--empty":xe.empty}]]),style:Wt(se(Ke,ge.key))},[Q[0]||(Q[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",c2e,I(xe.number),1),_("span",u2e,[_("span",d2e,I(xe.code),1)])],6))),128))])],2))),128))])):(g(),S(Me,{key:1},[t.showLineNumbers?(g(),S("span",f2e,[_("span",{class:"markstream-pre__line-numbers-text",textContent:I(p.value)},null,8,p2e)])):J("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:I(r.value)},null,8,h2e)],64))],14,r2e))}});Ei.install=e=>{e.component(Ei.__name,Ei)};const m2e={key:0},Ko=to(Ge({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Kd(),o=pn("markstreamFade",void 0),s=pn("markstreamTextStreamState",void 0),i=pn("markstreamStreamVersion",void 0),r=B(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var k;const x=(k=n["index-key"])!=null?k:n.indexKey;return x==null||x===""?"":String(x)}),c=U(t.node.content),u=U(""),d=U(0);let f;function p(){f?.(),f=void 0}function h(){p(),u.value&&(c.value=c.value+u.value,u.value="")}Ue([()=>t.node.content,a,l],([k])=>{const x=String(k??""),v=a.value,w=_L({nextContent:x,persistedContent:v?s?.get(v):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=w.settledContent,u.value=w.streamedDelta,w.appended?(d.value+=1,(function(){if(!u.value||f||!i)return;const b=i.value;f=Ue(()=>i.value,M=>{M!==b&&h()},{flush:"sync"})})()):u.value||p(),v&&s?.set(v,x)},{immediate:!0}),fu(p);const m=B(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,x)=>(g(),S("span",{class:Be([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(g(),S("span",m2e,I(c.value),1)):J("",!0),u.value?(g(),S("span",{key:1,class:Be(["text-node-stream-delta",[m.value]]),onAnimationend:h},I(u.value),35)):J("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function I2(e,t,n){return Ge({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=mv(),c=pv(),u=hv(),d=typeof window<"u"&&((l=(r=gs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=U(typeof window>"u"||d||!u.value),p=jo(null);let h=null;function m(k){const x=k&&"$el"in k?k.$el:k;p.value=x instanceof HTMLElement?x:null}return typeof window<"u"&&Ue([p,u],([k,x],v,w)=>{if(h?.destroy(),h=null,!x||f.value)return void(f.value=!0);if(!k)return;let b=!0;const M=a(k,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});h=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{b&&h===M&&(f.value=!0)}),w(()=>{b=!1,M.destroy(),h===M&&(h=null)})},{immediate:!0}),vo(()=>{h?.destroy(),h=null}),()=>hn(f.value?t:n,gn(_t({},s),{ref:m}),i)}})}Ko.install=e=>{e.component(Ko.__name,Ko)};const S5=Ge({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,c;const u=$p(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=Q_[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):Q_[""]),f=s2e(n.node),p=i2e(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),h=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:gv(h??{},typeof window>"u"?0:window.innerWidth)),k=h?.diffAppearance,x=k==="dark"||k!=="light"&&n.isDark===!0,v=typeof h?.fontSize=="number"&&Number.isFinite(h.fontSize)&&h.fontSize>0?h.fontSize:12,w=typeof h?.lineHeight=="number"&&Number.isFinite(h.lineHeight)&&h.lineHeight>0?h.lineHeight:v===12?18:Math.max(12,Math.round(1.5*v)),b=typeof h?.tabSize=="number"&&Number.isFinite(h.tabSize)&&h.tabSize>0?h.tabSize:4,M=f?0:8,R=typeof((a=h?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(h.padding.top)&&h.padding.top>=0?h.padding.top:M,z=typeof((c=h?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(h.padding.bottom)&&h.padding.bottom>=0?h.padding.bottom:M,$=typeof h?.fontFamily=="string"?h.fontFamily.trim():"",E=_t(_t({fontSize:`${v}px`,lineHeight:`${w}px`,tabSize:b,paddingTop:`${R}px`,paddingBottom:`${z}px`,"--markstream-pre-line-number-top":`${R}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),$?{"--markstream-code-font-family":$}:{}),T=()=>hn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[hn("svg",{class:"action-icon"})]),N=n.isShowPreview!==!1&&(u==="html"||u==="svg"),C=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||N&&n.showPreviewButton!==!1,O=V=>{if(V!=null)return typeof V=="number"?`${V}px`:String(V)},H=_t(_t(_t({"--markstream-code-layout-character-width":"1ch"},O(n.minWidth)?{minWidth:O(n.minWidth)}:{}),O(n.maxWidth)?{maxWidth:O(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return hn("div",gn(_t({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":x,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:hn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[hn("div",{class:"code-header-main"},[hn("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),hn("div",{class:"code-header-copy"},[hn("div",{class:"code-header-title"},p.title),p.caption?hn("div",{class:"code-header-caption"},p.caption):null])]),hn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?hn("div",{class:"code-diff-stats","aria-hidden":"true"},[hn("span",{class:"code-diff-stat removed"},"-0"),hn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:T(),n.showCollapseButton===!1?null:T(),C?hn("div",{class:"relative"},[T()]):null])]),hn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[hn(Ei,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?o2e(h?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:E,"data-markstream-code-loading":"1"})]),hn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[hn("div",{class:"loading-skeleton"},[hn("div",{class:"skeleton-line"}),hn("div",{class:"skeleton-line"}),hn("div",{class:"skeleton-line short"})])]),hn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),em=I2("ViewportDeferredCodeBlockNode",mr({loader:()=>Eo(null,null,function*(){try{return(yield ps(()=>import("./CodeBlockNode-BWayTGpE.js"),__vite__mapDeps([6,7]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Ei}}),loadingComponent:S5,delay:0,suspensible:!1}),S5),Xr=mr(()=>Eo(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return hn(Ko,gn(_t({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield AL(),(yield ps(()=>import("./index7-CvZQjD-I.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return hn(Ko,gn(_t({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),DL=mr(()=>Eo(null,null,function*(){try{return yield AL(),(yield ps(()=>import("./index6-CkL1tSTM.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return hn(Ko,gn(_t({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),hi=to(Ge({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(g(),S("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},I(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);hi.install=e=>{e.component(hi.__name,hi)};const g2e={class:"superscript-node"},zi=to(Ge({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,emphasis:wi,footnote_reference:Gi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,emoji:Ni,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("sup",g2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);zi.install=e=>{e.component(zi.__name,zi)};const v2e={class:"subscript-node"},Bi=to(Ge({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,emphasis:wi,footnote_reference:Gi,strikethrough:gi,highlight:Xi,insert:Ri,superscript:zi,emoji:Ni,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("sub",v2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Bi.install=e=>{e.component(Bi.__name,Bi)};const w2e={class:"strong-node"},mi=to(Ge({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,emphasis:wi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,footnote_reference:Gi,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("strong",w2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);mi.install=e=>{e.component(mi.__name,mi)};const y2e={class:"strikethrough-node"},gi=to(Ge({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,emphasis:wi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,footnote_reference:Gi,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("del",y2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);gi.install=e=>{e.component(gi.__name,gi)};const k2e=["href","title","aria-label","aria-hidden","target","rel"],b2e=["aria-hidden"],_2e={class:"link-text-wrapper relative inline-flex"},x2e={class:"leading-[normal] link-text"},vi=to(Ge({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=pn("markstreamShowTooltips",void 0),o=B(()=>{const x=n?.value;return typeof x=="boolean"?x:t.showTooltip}),s=B(()=>{var x,v,w,b,M;const R=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",z=(x=t.animationOpacity)!=null?x:.35,$=Math.max(.12,Math.min(.5*z,z)),E={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":R,"--underline-opacity":String(z),"--underline-rest-opacity":String($),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=ws(()=>t.customId),r=B(()=>_t({text:Ko,strong:mi,strikethrough:gi,emphasis:wi,image:Xa,html_inline:Yi,inline_code:ii},i.value)),l=Kd(),a=B(()=>{var x,v;const w=(x=t.node)==null?void 0:x.attrs;if(!w||typeof w!="object")return{};const b={};if(Array.isArray(w))for(const M of w)Array.isArray(M)&&M[0]&&(b[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,R]of Object.entries(w))M&&R!=null&&R!==!1&&(b[M]=R===!0?"":String(R));return fx(b,"safe","a")}),c=B(()=>_t(_t({},l),a.value)),u=B(()=>{var x,v;return fx({href:String((v=(x=t.node)==null?void 0:x.href)!=null?v:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const x=c.value.target;return(typeof x=="string"?x.trim():String(x??"").trim())||(wre(u.value)?"_blank":void 0)}),f=B(()=>{var x;return String((x=d.value)!=null?x:"").trim().toLowerCase()==="_blank"}),p=B(()=>{if(!u.value)return;const x=c.value.rel,v=new Set((typeof x=="string"?x:String(x??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(v).filter(b=>b.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),h=B(()=>{const x=_t({},c.value);return delete x.title,delete x.href,delete x.target,delete x.rel,x});function m(){o.value&&Due()}const k=B(()=>{var x,v;const w=(x=t.node)==null?void 0:x.title;return typeof w=="string"&&w.trim().length>0?w:String((v=u.value)!=null?v:"")});return(x,v)=>{var w,b;return e.node.loading?(g(),S("span",Vn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},y(l),{style:s.value}),[_("span",_2e,[_("span",x2e,[Z(y(Ko),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,b2e)):(g(),S("a",Vn({key:0,class:"link-node",href:u.value,title:o.value?"":k.value,"aria-label":`Link: ${k.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},h.value,{style:s.value,onMouseenter:v[0]||(v[0]=M=>(function(R){var z,$,E,T;if(!o.value)return;const N=R,C=N?.clientX!=null&&N?.clientY!=null?{x:N.clientX,y:N.clientY}:void 0,O=((z=t.node)==null?void 0:z.title)||(($=u.value)!=null&&$.includes("xn--")&&((T=(E=t.node)==null?void 0:E.text)!=null&&T.includes("://"))?t.node.text:u.value)||"";Hue(R.currentTarget,O,"top",!1,C)})(M)),onMouseleave:m}),[(g(!0),S(Me,null,it(e.node.children,(M,R)=>(g(),ce(y(yl),{key:`${e.indexKey||"emphasis"}-${R}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${R}`},null,8,["components","node","custom-id","index-key"]))),128))],16,k2e))}}}),[["__scopeId","data-v-367e6ca4"]]);vi.install=e=>{e.component(vi.__name,vi)};const S2e={class:"insert-node"},Ri=to(Ge({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,emphasis:wi,strikethrough:gi,highlight:Xi,subscript:Bi,superscript:zi,emoji:Ni,footnote_reference:Gi,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("ins",S2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ri.install=e=>{e.component(Ri.__name,Ri)};const C2e={class:"highlight-node"},Xi=to(Ge({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,emphasis:wi,strikethrough:gi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,footnote_reference:Gi,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("mark",C2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Xi.install=e=>{e.component(Xi.__name,Xi)};const M2e={class:"emphasis-node"},wi=to(Ge({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>_t({text:Ko,inline_code:ii,link:vi,html_inline:Yi,strong:mi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,footnote_reference:Gi,math_inline:Xr,reference:hi},n.value));return(s,i)=>(g(),S("em",M2e,[(g(!0),S(Me,null,it(e.node.children,(r,l)=>(g(),ce(y(yl),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);wi.install=e=>{e.component(wi.__name,wi)};const A2e={class:"hard-break"},Ja=to(Ge({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(g(),S("br",A2e))}),[["__scopeId","data-v-50c58f70"]]);Ja.install=e=>{e.component(Ja.__name,Ja)};const Rd=Ge({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Nt({checkbox:Ki,checkbox_input:Ki,emoji:Ni,emphasis:wi,hardbreak:Ja,highlight:Xi,inline_code:ii,insert:Ri,link:vi,reference:hi,strikethrough:gi,strong:mi,subscript:Bi,superscript:zi,text:Ko}),o=ws(()=>t.customId),s=B(()=>{const i=o.value;return Object.keys(i).length>0?_t(_t({},n),i):n});return(i,r)=>(g(!0),S(Me,null,it(e.nodes,(l,a)=>(g(),ce(y(yl),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function o7(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(o7)}function C5(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(o7))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(o7)?s:null}function k0(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const E2e=["cite"],T2e={key:0,dir:"auto",class:"paragraph-node"},I2e=["custom-id"],f4=to(Ge({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ws(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),i=B(()=>C5(t.node.children,!o.value)),r=B(()=>t.fade!==!1||s.value?null:k0(i.value));return jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade)),(l,a)=>(g(),S("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(g(),S("p",T2e,[r.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(r.value),9,I2e)):(g(),ce(y(Rd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(g(),ce(y(Fi),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,E2e))}}),[["__scopeId","data-v-abfecebc"]]);f4.install=e=>{e.component(f4.__name,f4)};const L2e={class:"definition-list"},$2e={class:"definition-term"},N2e={class:"definition-desc"},p4=to(Ge({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(g(),S("dl",L2e,[(g(!0),S(Me,null,it(t.node.items,(s,i)=>(g(),S(Me,{key:i},[_("dt",$2e,[Z(y(Fi),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",N2e,[Z(y(Fi),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);p4.install=e=>{e.component(p4.__name,p4)};const z2e=["href","title"],td=to(Ge({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(g(),S("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,z2e))}}),[["__scopeId","data-v-e1eb37b6"]]);td.install=e=>{e.component(td.__name,td)};const B2e=["id"],R2e={class:"flex-1"},h4=Ge({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(g(),S("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",R2e,[Z(y(Fi),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,B2e))}});h4.install=e=>{e.component(h4.__name,h4)};const F2e=["custom-id"],s7=to(Ge({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:k0(t.node.children)),i=B(()=>_t({text:Ko,inline_code:ii,link:vi,image:Xa,strong:mi,emphasis:wi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,checkbox:Ki,checkbox_input:Ki,footnote_reference:Gi,hardbreak:Ja,math_inline:Xr,reference:hi},n.value));return(r,l)=>(g(),ce(ns(`h${e.node.level}`),Vn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ue(()=>[s.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(s.value),9,F2e)):(g(!0),S(Me,{key:1},it(e.node.children,(a,c)=>(g(),ce(y(yl),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Bp=s7;Bp.install=e=>{e.component(s7.__name,s7)};const j2e={key:0,dir:"auto",class:"paragraph-node"},O2e=["custom-id"],P2e={dir:"auto",class:"paragraph-node"},H2e=["custom-id"],Wc=to(Ge({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var p;return(p=t.node)!=null?p:t.item}),o=ws(()=>t.customId),s=B(()=>!!o.value.paragraph),i=B(()=>!!o.value.text),r=B(()=>{var p;return C5((p=n.value)==null?void 0:p.children,!s.value)}),l=B(()=>{var p;if(s.value)return null;const h=(p=n.value)==null?void 0:p.children;if(!Array.isArray(h)||h.length<2)return null;const m=h[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const k=h.slice(1);if(!k.every(v=>v?.type==="list"))return null;const x=C5([m]);return x?{paragraphChildren:x,nestedLists:k}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?k0(r.value):null),u=B(()=>{var p;return a()?k0((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade)),(p,h)=>{var m,k;return g(),S("li",Vn({class:"list-item",dir:"auto"},f.value),[r.value?(g(),S("p",j2e,[c.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(c.value),9,O2e)):(g(),ce(y(Rd),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(g(),S(Me,{key:1},[_("p",P2e,[u.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(u.value),9,H2e)):(g(),ce(y(Rd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(g(!0),S(Me,null,it(l.value.nestedLists,(x,v)=>(g(),ce(y(Fi),{key:v,nodes:[x],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:h[0]||(h[0]=w=>p.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(g(),ce(y(Fi),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(k=(m=n.value)==null?void 0:m.children)!=null?k:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:h[1]||(h[1]=x=>p.$emit("copy",x))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Wc.install=e=>{e.component(Wc.__name,Wc)};const qc=to(Ge({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ws(()=>e.customId),n=B(()=>t.value.list_item||Wc);return(o,s)=>(g(),ce(ns(e.node.ordered?"ol":"ul"),{class:Be(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ue(()=>[(g(!0),S(Me,null,it(e.node.items,(i,r)=>{var l;return g(),ce(ns(n.value),Vn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);qc.install=e=>{e.component(qc.__name,qc)};const D2e={key:2,class:"html-block-node__raw"},V2e=["innerHTML"],W2e={key:1,class:"html-block-node__placeholder"},nd=to(Ge({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=pn("markstreamHtmlPolicy",void 0),o=pn("markstreamNestedRendererProps",void 0),s=B(()=>{var C,O;return(O=(C=t.htmlPolicy)!=null?C:n?.value)!=null?O:"safe"}),i=B(()=>{var C,O;const H=(C=o?.value)!=null?C:{};return gn(_t({},H),{customId:(O=t.customId)!=null?O:H.customId,htmlPolicy:s.value})}),r=mr({loader:()=>Promise.resolve().then(()=>Mv),suspensible:!1}),l=B(()=>{const C=a4(t.node.attrs,s.value);if(!C)return;const O=X2(C);return Object.keys(O).length>0?O:void 0}),a=B(()=>{const C=String(t.node.tag||"").trim(),O=a4(t.node.attrs,s.value,C);if(!O)return;const H=X2(O);return Object.keys(H).length>0?H:void 0}),c=ws(()=>t.customId),u=Ge({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=U(null),f=U(typeof window>"u"),p=U(t.node.content),h=B(()=>Array.isArray(t.node.children)?t.node.children:[]),m=B(()=>String(t.node.tag||"div")),k=B(()=>{var C;if(m.value.trim().toLowerCase()!=="details"||(C=t.node.attrs)!=null&&C.some(([H])=>String(H).toLowerCase()==="open"))return null;const O=h.value[0];return O?.type==="html_block"&&String(O.tag||"").toLowerCase()==="summary"?O:null}),x=B(()=>{var C;return k0((C=k.value)==null?void 0:C.children)}),v=B(()=>{const C=k.value;if(!C)return;const O=a4(C.attrs,s.value,"summary");if(!O)return;const H=X2(O);return Object.keys(H).length>0?H:void 0}),w=B(()=>x.value==null?h.value:h.value.slice(1)),b=B(()=>{const C=m.value.trim().toLowerCase();return uI.has(C)||lv(C,s.value)}),M=B(()=>h.value.length>0&&!!t.node.tag&&!b.value),R=B(()=>{var C,O,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(C=p.value)!=null?C:""};const V=(O=p.value)!=null?O:t.node.content;if(!V)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:Vc(V,s.value)};if(t.node.loading){const F=x5(V,c.value,s.value);return F===null?{mode:"text",content:(H=t.node.raw)!=null?H:V}:{mode:"dynamic",nodes:F}}if(!BL(V,c.value))return{mode:"html",content:Vc(V,s.value)};const A=x5(V,c.value,s.value);return A===null?{mode:"html",content:Vc(V,s.value)}:{mode:"dynamic",nodes:A}}),z=mv(),$=pv(),E=hv(),T=jo(null),N=!!t.node.loading;return typeof window<"u"?(Ue([()=>d.value,()=>$?.value.heavyBlockMargin,()=>$?.value.rootMargin],([C],O,H)=>{var V,A,F,j;if((A=(V=T.value)==null?void 0:V.destroy)==null||A.call(V),T.value=null,!N)return f.value=!0,void(p.value=t.node.content);if(!C)return void(f.value=!1);let q=!0;const P=(j=(F=$?.value.heavyBlockMargin)!=null?F:$?.value.rootMargin)!=null?j:y0,W=z(C,{rootMargin:P,allowIdle:!E.value});T.value=W,f.value=f.value||W.isVisible.value,W.whenVisible.then(()=>{q&&T.value===W&&(f.value=!0)}),H(()=>{q=!1,W.destroy(),T.value===W&&(T.value=null)})},{immediate:!0}),Ue(()=>t.node.content,C=>{N&&!f.value||(p.value=C)})):f.value=!0,vo(()=>{var C,O;(O=(C=T.value)==null?void 0:C.destroy)==null||O.call(C),T.value=null}),(C,O)=>(g(),ce(ns(M.value?m.value:"div"),Vn({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":y(E)&&!f.value?"true":void 0},M.value?a.value:void 0),{default:ue(()=>[f.value?(g(),S(Me,{key:0},[R.value.mode==="structured"?(g(),S(Me,{key:0},[x.value!==null?(g(),S(Me,{key:0},[_("summary",qB(_A(v.value)),I(x.value),17),w.value.length?(g(),ce(y(r),Vn({key:0},i.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):J("",!0)],64)):(g(),ce(y(r),Vn({key:1},i.value,{nodes:h.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):R.value.mode==="dynamic"?(g(),ce(y(u),{key:1,nodes:R.value.nodes},null,8,["nodes"])):R.value.mode==="text"?(g(),S("pre",D2e,I(R.value.content),1)):(g(),S("div",Vn({key:3},l.value,{innerHTML:R.value.content}),null,16,V2e))],64)):(g(),S("div",W2e,[En(C.$slots,"placeholder",{node:e.node},()=>[O[0]||(O[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),O[1]||(O[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),O[2]||(O[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);nd.install=e=>{e.component(nd.__name,nd)};const q2e={dir:"auto",class:"paragraph-node"},U2e=["custom-id"],h0=to(Ge({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ws(()=>t.customId),o=pn("markstreamHtmlPolicy",void 0),s=pn("markstreamFade",void 0),i=pn("markstreamParseOptions",void 0),r=pn("markstreamCustomMarkdownIt",void 0),l=pn("markstreamNestedRendererProps",void 0),a=B(()=>{var $;return($=o?.value)!=null?$:"safe"}),c=B(()=>{var $;return($=t.parseOptions)!=null?$:i?.value}),u=B(()=>{var $;return($=t.customMarkdownIt)!=null?$:r?.value}),d=B(()=>{var $,E;return(E=t.customHtmlTags)!=null?E:($=l?.value)==null?void 0:$.customHtmlTags}),f=B(()=>{var $,E;const T=($=l?.value)!=null?$:{};return gn(_t({},T),{customId:(E=t.customId)!=null?E:T.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),p=mr({loader:()=>Promise.resolve().then(()=>Mv),suspensible:!1});function h($){var E;return $.type==="text"&&String((E=$.content)!=null?E:"").trim()===""}const m=B(()=>t.node.children.filter($=>!h($))),k=B(()=>m.value.length>0&&m.value.every($=>$.type==="image"||(function(E){var T;const N=(function(C){return C.type==="link"&&Array.isArray(C.children)?C.children.filter(O=>!h(O)):[]})(E);return N.length===1&&((T=N[0])==null?void 0:T.type)==="image"})($))),x=B(()=>new Set(T0(d.value))),v=B(()=>{if(!k.value||m.value.length<=1)return t.node.children;const $=[];for(let E=0;E0,C=t.node.children.slice(E+1).some(O=>!h(O));N&&C&&$.push(gn(_t({},T),{content:" ",raw:" "}))}return $}),w=B(()=>s?.value===!1&&!n.value.text),b=B(()=>w.value?k0(v.value):null);function M($,E){return{node:$,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const R=B(()=>_t({inline_code:ii,image:Xa,link:vi,hardbreak:Ja,emphasis:wi,strong:mi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,html_inline:Yi,html_block:nd,emoji:Ni,checkbox:Ki,math_inline:Xr,checkbox_input:Ki,reference:hi,footnote_anchor:td,footnote_reference:Gi,text:Ko},n.value)),z=B(()=>v.value.map(($,E)=>{var T;const N=(function(C){var O,H,V,A;if(C.type==="html_block"||C.type==="html_inline"){const F=String((O=C.tag)!=null?O:"").trim().toLowerCase()||mI(C.content);if(F&&!x.value.has(F)&&gI((H=C.content)!=null?H:C.raw,F)){const j=String((A=(V=C.content)!=null?V:C.raw)!=null?A:"");return{child:{type:"text",content:j,raw:j},component:Ko,isCustomComponent:!1}}}return{child:C,component:R.value[C.type],isCustomComponent:!!(n.value[C.type]&&!sf(String(C.type)))}})($);return gn(_t({},N),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:N.isCustomComponent?fv(N.child,a.value):void 0,hasSlotChildren:Array.isArray(N.child.children)&&N.child.children.length>0,slotContent:String((T=N.child.content)!=null?T:""),originalChild:$})}));return($,E)=>(g(),S("p",q2e,[b.value!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(b.value),9,U2e)):(g(!0),S(Me,{key:1},it(z.value,T=>{return g(),S(Me,{key:T.key},[k.value&&h(T.originalChild)?(g(),S(Me,{key:0},[He(I((N=T.originalChild,String((C=N.content)!=null?C:""))),1)],64)):T.isCustomComponent?(g(),ce(ns(T.component),Vn({key:1,ref_for:!0},T.customAttrs,{node:T.child,loading:T.child.loading,"index-key":T.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ue(()=>[T.hasSlotChildren?(g(),ce(y(p),Vn({key:0,ref_for:!0},f.value,{nodes:T.child.children,"index-key":T.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):T.slotContent?(g(),ce(y(p),Vn({key:1,ref_for:!0},f.value,{content:T.slotContent,final:!T.child.loading,"index-key":`${T.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(g(),ce(ns(T.component),Vn({key:2,ref_for:!0},M(T.child,T.index)),null,16))],64);var N,C}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);h0.install=e=>{e.component(h0.__name,h0)};const Z2e={class:"table-node-wrapper"},K2e=["aria-busy"],G2e={key:0},Y2e=["custom-id"],X2e=["aria-label","onPointerdown"],J2e=["custom-id"],Q2e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},od=to(Ge({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=B(()=>{var x;return(x=t.node.loading)!=null&&x}),o=B(()=>{var x;return(x=t.node.rows)!=null?x:[]}),s=U(null),i=U([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(x=>Number.isFinite(x)&&x>0)),c=B(()=>a.value?i.value.map(x=>x>0?{width:`${x}px`}:void 0):[]);jn("markstreamShowTooltips",B(()=>t.showTooltips)),jn("markstreamFade",B(()=>t.fade));const u=ws(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),p=new WeakMap;function h(x){const v=t.fade===!1&&!d.value,w=!f.value,b=p.get(x);if(b?.children===x.children&&b.textFastPath===v&&b.paragraphFastPath===w)return b.info;const M=C5(x.children,w,!0),R={simpleChildren:M,plainText:M&&v?k0(M):null};return p.set(x,{children:x.children,textFastPath:v,paragraphFastPath:w,info:R}),R}function m(x){if(!r)return;x.preventDefault();const v=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(v/2)),b=Math.max(w,Math.min(v-w,Math.round(r.startWidth+x.clientX-r.startX))),M=[...r.widths];M[r.index]=b,M[r.index+1]=v-b,i.value=M}function k(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),r=null)}return Ue(l,()=>{k(),i.value=[]}),vo(k),(x,v)=>(g(),S("div",Z2e,[_("table",{ref_key:"tableRef",ref:s,class:Be(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(g(),S("colgroup",G2e,[(g(!0),S(Me,null,it(e.node.header.cells,(w,b)=>(g(),S("col",{key:b,style:Wt(c.value[b])},null,4))),128))])):J("",!0),_("thead",null,[_("tr",null,[(g(!0),S(Me,null,it(e.node.header.cells,(w,b)=>(g(),S("th",{key:b,dir:"auto",class:Be([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[h(w).plainText!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(h(w).plainText),9,Y2e)):h(w).simpleChildren?(g(),ce(y(Rd),{key:1,nodes:h(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(g(),ce(y(Fi),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[0]||(v[0]=M=>x.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b(function(R,z){if(z.button!==0)return;const $=(function(){var N;const C=(N=s.value)==null?void 0:N.querySelectorAll("thead th");return Array.from(C??[],O=>Math.round(O.getBoundingClientRect().width))})(),E=$[R],T=$[R+1];E&&T&&(z.preventDefault(),r={index:R,startX:z.clientX,startWidth:E,nextStartWidth:T,widths:$},i.value=$,window.addEventListener("pointermove",m),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k))})(b,M)},null,40,X2e)):J("",!0)],2))),128))])]),_("tbody",null,[(g(!0),S(Me,null,it(o.value,(w,b)=>(g(),S("tr",{key:b},[(g(!0),S(Me,null,it(w.cells,(M,R)=>(g(),S("td",{key:R,class:Be([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[h(M).plainText!==null?(g(),S("span",{key:0,class:"text-node","custom-id":t.customId},I(h(M).plainText),9,J2e)):h(M).simpleChildren?(g(),ce(y(Rd),{key:1,nodes:h(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${R}`},null,8,["nodes","custom-id","index-key"])):(g(),ce(y(Fi),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=z=>x.$emit("copy",z))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,K2e),Z(gr,{name:"table-node-fade"},{default:ue(()=>[n.value?(g(),S("div",Q2e,[En(x.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):J("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);od.install=e=>{e.component(od.__name,od)};const ede={class:"hr-node"},m4=to({},[["render",function(e,t){return g(),S("hr",ede)}],["__scopeId","data-v-39b2349c"]]);m4.install=e=>{e.component(m4.__name,m4)};const tde={class:"unknown-node"},i7=Ge({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(g(),S("div",tde,I(e.node.raw),1))}),g4=to(Ge({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),o=ws(()=>t.customId),s=B(()=>_t({text:Ko,paragraph:h0,heading:Bp,inline_code:ii,link:vi,image:Xa,strong:mi,emphasis:wi,strikethrough:gi,insert:Ri,subscript:Bi,superscript:zi,checkbox:Ki,checkbox_input:Ki,hardbreak:Ja,math_inline:Xr,reference:hi,list:qc,math_block:DL,table:od},o.value));return(i,r)=>(g(),S("div",Vn({class:n.value},e.node.attrs),[(g(!0),S(Me,null,it(e.node.children,(l,a)=>{return g(),ce(ns((c=l.type,s.value[c]||i7)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);g4.install=e=>{e.component(g4.__name,g4)};const nde=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],bx=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function ode(e){if(e<=255)return nde[e];let t=0,n=bx.length-1;for(;t<=n;){const o=t+n>>1,s=bx[o];if(es[1]))return s[2];t=o+1}}return"L"}const sde=/[ \t\n\r\f]+/g,ide=/[\t\n\r\f]| {2,}|^ | $/;let tm=null;const rde=new RegExp("\\p{Script=Arabic}","u"),a1=new RegExp("\\p{M}","u"),vv=new RegExp("\\p{Nd}","u");function _x(e){return rde.test(e)}function xx(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function ml(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&o<=57343){if(xx(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(xx(n))return!0}}return!1}const lde=new Set([" "," ","⁠","\uFEFF"]),ade=new Set(["-","‐","–","—"]);function VL(e,t){return!((function(n){const o=sd(n);return o!==null&&lde.has(o)})(e)||t&&((function(n){const o=sd(n);return o!==null&&(wv.has(o)||b0.has(o))})(e)||(function(n){const o=sd(n);return o!==null&&ade.has(o)})(e)))}const wv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Rp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),yv=new Set(["'","’"]),b0=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),cde=new Set([":",".","،","؛"]),ude=new Set(["၏"]),dde=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function fde(e){if(kv(e))return!0;let t=!1;for(const n of e)if(b0.has(n)||A5(n))t=!0;else if(!t||!a1.test(n))return!1;return t}function pde(e){for(const t of e)if(!wv.has(t)&&!b0.has(t))return!1;return e.length>0}function hde(e){if(kv(e))return!0;for(const t of e)if(!(Rp.has(t)||yv.has(t)||a1.test(t)||A5(t)))return!1;return e.length>0}function kv(e){let t=!1;for(const n of e)if(n!=="\\"&&!a1.test(n)){if(!(Rp.has(n)||b0.has(n)||yv.has(n)))return!1;t=!0}return t}function M5(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function sd(e){if(e.length===0)return null;const t=M5(e,e.length);return e.slice(t)}const mde=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function A5(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s=o[s]&&n<=o[s+1])return!0;return!1})(t,mde)}function gde(e){const t=(function(n){for(const o of n)if(!a1.test(o))return o;return null})(e);return t!==null&&vv.test(t)}function vde(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(a1.test(o))n--;else{if(!Rp.has(o)&&!yv.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function wde(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function Sx(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function Cx(e,t){return e&&t!==null&&cde.has(t)}function yde(e){const t=sd(e);return t!==null&&ude.has(t)}function kde(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function r7(e){let t=e.length;for(;t>0;){const n=M5(e,t),o=e.slice(n,t);if(dde.has(o))return!0;if(!b0.has(o))return!1;t=n}return!1}function bde(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const _de=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fr(e){return e.length===1?e[0]:e.join("")}function xde(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Fr(n)}function Sde(e,t,n,o){if(!_de.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=bde(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Fr(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Fr(r),isWordLike:a,kind:i,start:l}),s}function nm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Cde=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mde(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Cde.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Lde.has(e)&&!Ide.test(e)&&Tde.test(e)}function Mx(e){let t=!1;for(const n of e)if(!a1.test(n)){if(!WL(n))return!1;t=!0}return t}function $de(e,t,n,o){const s=!t&&Mx(e),i=!o&&Mx(n),r=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=M5(u,d),p=u.slice(f,d);if(!a1.test(p))return p;d=f}return null})(a);return c!==null&&A5(c)})(e),l=(t||r)&&(function(a){for(let c=a.length;c>0;){const u=M5(a,c),d=a.slice(u,c);if(!a1.test(d))return WL(d)||A5(d);c=u}return!1})(e);return!!(s||i||l)&&!ml(e)&&!ml(n)&&(t||s||r)&&(o||i)}function Ax(e){for(const t of e)if(vv.test(t))return!0;return!1}function v4(e){if(e.length===0)return!1;for(const t of e)if(!vv.test(t)&&!Ede.has(t))return!1;return!0}function Nde(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(r.length===0)return{normalized:r,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const i=(function(a,c,u){var d,f,p;const h=(em===null&&(em=new Intl.Segmenter(void 0,{granularity:"word"})),em);let m=0;const k=[],x=[],w=[],v=[],b=[],M=[],R=[],z=[],$=[],T=[],E=[],N=[];for(const A of h.segment(a))for(const F of yde(A.segment,(d=A.isWordLike)!=null&&d,A.index,u)){let j=function(){M[Q]!==null&&(x[Q]=[xx(k,M,R,Q)],M[Q]=null),x[Q].push(F.text),w[Q]=w[Q]||F.isWordLike,z[Q]=z[Q]||W,$[Q]=$[Q]||G,T[Q]=se,E[Q]=oe,N[Q]=Sx($[Q],ee)};const q=F.kind==="text",P=pde(F.text,F.isWordLike,F.kind),W=ml(F.text),G=bx(F.text),ee=od(F.text),se=r7(F.text),oe=hde(F.text),Q=m-1;c.carryCJKAfterClosingQuote&&q&&m>0&&v[Q]==="text"&&W&&z[Q]&&T[Q]||q&&m>0&&v[Q]==="text"&&ade(F.text)&&z[Q]||q&&m>0&&v[Q]==="text"&&E[Q]?j():q&&m>0&&v[Q]==="text"&&F.isWordLike&&G&&N[Q]?(j(),w[Q]=!0):P!==null&&m>0&&v[Q]==="text"&&M[Q]===P?R[Q]=((f=R[Q])!=null?f:1)+1:q&&!F.isWordLike&&m>0&&v[Q]==="text"&&!z[Q]&&(lde(F.text)||F.text==="-"&&w[Q])?j():(k[m]=F.text,x[m]=[F.text],w[m]=F.isWordLike,v[m]=F.kind,b[m]=F.start,M[m]=P,R[m]=P===null?0:1,z[m]=W,$[m]=G,T[m]=se,E[m]=oe,N[m]=Sx(G,ee),m++)}for(let A=0;Anull);let O=-1;for(let A=m-1;A>=0;A--){const F=k[A];if(F.length!==0){if(v[A]==="text"&&!w[A]&&O>=0&&v[O]==="text"&&(cde(F)||F==="-"&&dde(k[O]))){const j=(p=C[O])!=null?p:[];j.push(F),C[O]=j,b[O]=b[A],k[A]="";continue}O=A}}for(let A=0;AW+1){F.push(Fi(oe)),j.push(ge),q.push("text"),P.push(A.starts[W]),W=Q;continue}}F.push(G),j.push(se),q.push(ee),P.push(A.starts[W]),W++}return{len:F.length,texts:F,isWordLike:j,kinds:q,starts:P}})((function(A){const F=[],j=[],q=[],P=[];for(let W=0;W1;for(let oe=0;oe=A.len||tm(A.kinds[ee]))continue;const se=[],oe=A.starts[ee];let Q=ee;for(;Q0&&(F.push(Fi(se)),j.push(!0),q.push("text"),P.push(oe),W=Q-1)}return{len:F.length,texts:F,isWordLike:j,kinds:q,starts:P}})((function(A){const F=A.texts.slice(),j=A.isWordLike.slice(),q=A.kinds.slice(),P=A.starts.slice();for(let G=0;G=0&&!PL(c.texts[v-1],u)&&w(v),m<0&&(m=v),k=k||ml(b))}return w(c.len),{len:d.length,texts:d,isWordLike:f,kinds:p,starts:h}})(r,i,t.breakKeepAllAfterPunctuation):i;return _t({normalized:r,chunks:Tde(l,s)},l)}let nc=null;const Ax=new Map;let oc=null;const Ide=new RegExp("\\p{Emoji_Presentation}","u"),Lde=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let nm=null;const Tx=new Map;function i7(){if(nc!==null)return nc;if(typeof OffscreenCanvas<"u")return nc=new OffscreenCanvas(1,1).getContext("2d"),nc;if(typeof document<"u")return nc=document.createElement("canvas").getContext("2d"),nc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Aa(e,t){let n=t.get(e);return n===void 0&&(n={width:i7().measureText(e).width,containsCJK:ml(e)},t.set(e,n)),n}function A5(){if(oc!==null)return oc;if(typeof navigator>"u")return oc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},oc;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return oc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},oc}function DL(){return nm===null&&(nm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),nm}function $de(e){return Ide.test(e)||e.includes("️")}function O1(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(r){let i=0;const l=DL();for(const a of l.segment(r))$de(a.segment)&&i++;return i})(o)),s.emojiCount})(e,t)*n}function Nde(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function Ex(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function Ix(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function kv(e,t){return t===0?0:e+t}function Rde(e,t,n,o,s){return kv(o,t==="tab"?s+(function(r,i){return r.letterSpacing!==0&&r.spacingGraphemeCounts[i]>0?r.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function Lx(e,t,n,o){return kv(o,t==="tab"?0:e.lineEndFitAdvances[n])}function $x(e,t,n,o,s){return kv(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function Fde(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function jde(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function M3(e,t,n){let o=t;for(;oj){if(fe!==null&&te>D){Q(ne,te,de),ye=te,pe=M3(fe,pe,ye+1),te=-1,de=0;continue}Q(),xe(ne,ye,Ce)}else P+=Ce,G=ne,ee=ye+1;else xe(ne,ye,Ce);const me=ye+1;fe!==null&&fe[pe]===me&&(te=me,de=P,pe++),ye++}W&&G===ne&&ee===ve.length&&(G=ne+1,ee=0)}let Y=0;for(;Y=H.length)));){const ne=H[Y],D=Ex(V[Y]);if(W)if(P+ne>j){if(D){Ke(Y,ne),Q(Y+1,0,P-ne),Y++;continue}if(se>=0){if(G>se||G===se&&ee>0){Q();continue}Q(se,0,oe);continue}if(ne>j&&A[Y]!==null){Q(),et(Y,0),Y++;continue}Q()}else Ke(Y,ne),D&&(se=Y+1,oe=P-ne),Y++;else ne>j&&A[Y]!==null?et(Y,0):ge(Y,ne),D&&(se=Y+1,oe=P-ne),Y++}return W&&Q(),q})(n,o);const{widths:s,kinds:r,breakableFitAdvances:i,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(s.length===0||c.length===0)return 0;const u=A5(),d=o+u.lineFitEpsilon;let f=0,p=0,h=!1,m=0,k=0,x=-1,w=0,v=null;function b(){x=-1,w=0,v=null}function M(C=m,O=k,H){f++,p=0,h=!1,b()}function R(C,O){h=!0,m=C+1,k=0,p=O}function z(C,O,H){h=!0,m=C,k=O+1,p=H}function $(C,O){h?(p+=O,m=C+1,k=0):R(C,O)}function T(C,O,H,V,A,F){if(!O)return;const j=Lx(n,C,H,A);$x(n,C,H,A,V),x=H+1,w=p-F+j,v=C}function E(C,O){var H;const V=i[C],A=(H=l[C])!=null?H:null;let F=A===null?-1:M3(A,0,O+1),j=-1,q=O;for(;qd){if(A!==null&&j>O){M(C,j),q=j,F=M3(A,F,q+1),j=-1;continue}M(),z(C,q,P)}else p=ee,m=C,k=q+1}else z(C,q,P);const W=q+1;A!==null&&A[F]===W&&(j=W,F++),q++}h&&m===C&&k===V.length&&(m=C+1,k=0)}function N(C){f++,b()}for(let C=0;C=O.endSegmentIndex)));){const V=r[H],A=Ex(V),F=Bde(n,h,H),j=V==="tab"?zde(p+F,n.tabStopAdvance):s[H],q=F+j,P=Rde(n,V,H,F,j);if(V!=="soft-hyphen")if(h){if(p+P>d){const W=p+Lx(n,V,H,F);if($x(n,V,H,F,j),v==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&w<=d){M(x,0);continue}if(A&&W<=d){$(H,q),M(H+1,0),H++;continue}if(x>=0&&w<=d){if(m>x||m===x&&k>0){M();continue}const G=x;M(G,0),H=G;continue}if(P>d&&i[H]!==null){M(),E(H,0),H++;continue}M();continue}$(H,q),T(V,A,H,j,F,q),H++}else P>d&&i[H]!==null?E(H,0):R(H,j),T(V,A,H,j,F,q),H++;else h&&(m=H+1,k=0,x=H+1,w=p+a,v=V),H++}h&&(O.consumedEndSegmentIndex,M(O.consumedEndSegmentIndex,0))}return f})(e,t)}let om=null;function bv(){return om===null&&(om=new Intl.Segmenter(void 0,{granularity:"grapheme"})),om}function Pde(e,t){const n=[];let o=[],s=0,r=!1,i=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],r=!1,i=!1,l=!1)}function c(d,f,p){o=[d],s=f,r=p,i=r7(d),l=Bp.has(d)}function u(d,f){o.push(d),r=r||f;const p=r7(d);i=d.length===1&&b0.has(d)&&i||p,l=!1}for(const d of bv().segment(e)){const f=d.segment,p=ml(f);o.length!==0?l||vv.has(f)||b0.has(f)||t.carryCJKAfterClosingQuote&&p&&i?u(f,p):r||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function Hde(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,r=!1;function i(l){if(!(s<0)){if(r)s+1===l?o.push(t[s]):(function(a,c){const u=t[a].start,d=c=0&&!PL(t[l-1].text,n)&&i(l),s<0&&(s=l),r=r||ml(a.text)}return i(t.length),o}function Nx(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=bv();for(const s of o.segment(e))n++;return n}function Dde(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Vde(e,t,n,o,s){const r=A5(),{cache:i,emojiCorrection:l}=(function(N,C){i7().font=N;const O=(function(A){let F=Ax.get(A);return F||(F=new Map,Ax.set(A,F)),F})(N),H=(function(A){const F=A.match(/(\d+(?:\.\d+)?)\s*px/);return F?parseFloat(F[1]):16})(N),V=C?(function(A,F){let j=Tx.get(A);if(j!==void 0)return j;const q=i7();q.font=A;const P=q.measureText("😀").width;if(j=0,P>F+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=A,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const G=W.getBoundingClientRect().width;document.body.removeChild(W),P-G>.5&&(j=P-G)}return Tx.set(A,j),j})(N,H):0;return{cache:O,fontSize:H,emojiCorrection:V}})(t,(a=e.normalized,Lde.test(a)));var a;const c=O1("-",Aa("-",i),l)+(s===0?0:2*s),u=8*O1(" ",Aa(" ",i),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],p=[],h=[],m=[];let k=e.chunks.length<=1&&!d;const x=null,w=[],v=[],b=[],M=null,R=Array.from({length:e.len});function z(N,C,O,H,V,A,F,j,q){V!=="text"&&V!=="space"&&V!=="zero-width-break"&&(k=!1),f.push(C),p.push(O),h.push(H),m.push(V),w.push(F),v.push(j),d&&b.push(q)}function $(N,C,O,H,V){const A=Aa(N,i),F=d?Nx(N,C):0,j=(function(G,ee,se){return ee>1?G+(ee-1)*se:G})(O1(N,A,l),F,s),q=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:j,P=q===0?0:q+(F>0?s:0),W=C==="space"||C==="zero-width-break"?0:j;if(V&&H&&N.length>1){let G="sum-graphemes";s!==0?G="segment-prefixes":g4(N)?G="pair-context":r.preferPrefixWidthsForBreakableRuns&&(G="segment-prefixes");const ee=(function(oe,Q,ge,xe,Ke){if(Q.breakableFitAdvances!==void 0&&Q.breakableFitMode===Ke)return Q.breakableFitAdvances;Q.breakableFitMode=Ke;const et=DL(),Y=[];for(const ve of et.segment(oe))Y.push(ve.segment);if(Y.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(Ke==="sum-graphemes"){const ve=[];for(const fe of Y){const pe=Aa(fe,ge);ve.push(O1(fe,pe,xe))}return Q.breakableFitAdvances=ve,Q.breakableFitAdvances}if(Ke==="pair-context"||Y.length>96){const ve=[];let fe=null,pe=0;for(const te of Y){const de=O1(te,Aa(te,ge),xe);if(fe===null)ve.push(de);else{const ye=fe+te,Ce=Aa(ye,ge);ve.push(O1(ye,Ce,xe)-pe)}fe=te,pe=de}return Q.breakableFitAdvances=ve,Q.breakableFitAdvances}const ne=[];let D="",X=0;for(const ve of Y){D+=ve;const fe=O1(D,Aa(D,ge),xe);ne.push(fe-X),X=fe}return Q.breakableFitAdvances=ne,Q.breakableFitAdvances})(N,A,i,l,G),se=ee===null||o==="keep-all"?null:(function(oe){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(oe))return null;const Q=[];let ge=0;for(const xe of bv().segment(oe))ge++,Dde(xe.segment)&&Q.push(ge);return Q.length===0?null:Q})(N);return void z(N,j,P,W,C,O,ee,se,F)}z(N,j,P,W,C,O,null,null,F)}for(let N=0;N=55296&&oe<=56319&&se+1=56320&&Ke<=57343&&(Q=Ke-56320+(oe-55296<<10)+65536,ge=2)}const xe=J2e(Q);xe!=="R"&&xe!=="AL"&&xe!=="AN"||(j=!0);for(let Ke=0;Ke=0&&F[oe]==="ET";oe--)F[oe]="EN";for(oe=se+1;oe0?F[se-1]:G)!=="L"?"R":"L";if(Q===((oe{const e=globalThis;if(e[sm])return e[sm];const t={configs:{},controllers:{},revision:jo(0),preparedCache:new Map,blockEstimateCache:new Map};return e[sm]=t,t})();let a2=null;const rm=_s.revision;function zx(e){var t;return e&&(t=_s.configs[e])!=null?t:null}function Bx(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function qde(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function im(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const r of e){if(!qde(r))return null;r.type==="text"?s+=String((t=r.content)!=null?t:""):r.type==="emoji"?s+=String((o=(n=r.name)!=null?n:r.raw)!=null?o:""):r.type==="hardbreak"&&(s+=` -`)}return s.length>0?s:null}function lm(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var r;if(a2!=null)return a2;if(typeof document>"u")return!1;try{const i=document.createElement("canvas");return a2=!!((r=i.getContext)!=null&&r.call(i,"2d")),a2}catch{return a2=!1,!1}})())return null;try{const r=Math.round(100*t)/100,i=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,r,e].join("\0"),l=_s.blockEstimateCache.get(i);if(l)return _s.blockEstimateCache.delete(i),_s.blockEstimateCache.set(i,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(p,h,m){const k=`${m}\0${h}\0${p}`,x=_s.preparedCache.get(k);if(x)return _s.preparedCache.delete(k),_s.preparedCache.set(k,x),x.prepared;const w=(function(v,b,M){return(function(R,z,$,T){var E,N;const C=(E=T?.wordBreak)!=null?E:"normal",O=(N=T?.letterSpacing)!=null?N:0;return Vde(Ede(R,A5(),T?.whiteSpace,C),z,!1,C,O)})(v,b,0,M)})(p,h,{whiteSpace:m});for(_s.preparedCache.set(k,{prepared:w});_s.preparedCache.size>240;){const v=_s.preparedCache.keys().next().value;if(!v)break;_s.preparedCache.delete(v)}return w})(e,n.font,a),u=(function(p,h,m){const k=Ode(p,h);return{lineCount:k,height:k*m}})(c,Math.max(24,r-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(_s.blockEstimateCache.set(i,{height:f,contentHeight:Math.round(d)});_s.blockEstimateCache.size>4e3;){const p=_s.blockEstimateCache.keys().next().value;if(!p)break;_s.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function VL(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const r=im(e.children);return r&&n.paragraph?lm(r,t,n.paragraph):null}if(e.type==="heading"){const r=Number(e.level||0),i=im(e.children),l=n.headings[r];return i&&l?lm(i,t,l):null}if(e.type==="list_item"){const r=Array.isArray(e.children)?e.children:[];if(r.length!==1||((o=r[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const i=im((s=r[0])==null?void 0:s.children);return i?lm(i,t,n.listItem):null}if(e.type==="list"){const r=Array.isArray(e.items)?e.items:[];if(!r.length)return null;let i=Math.max(0,n.listWrapperOverhead);for(const l of r){const a=VL(l,t,n);if(!a)return null;i+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(i)),contentHeight:Math.max(1,Math.round(i))}}return null}function c2(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function P1(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function am(e,t,n=0){return e.diff?mv(t??{},n)?(function(o){const s=P1(o.raw);if(s){const r=s.split(/\r?\n/);return o.originalCode!=null||o.updatedCode!=null?Math.max(1,r.filter(i=>!Wde.some(l=>i.startsWith(l))).length):Math.max(1,r.length)}return c2(P1(o.originalCode))+c2(P1(o.updatedCode))})(e):(function(o){const s=o.originalCode,r=o.updatedCode;if(s!=null||r!=null)return Math.max(c2(P1(s)),c2(P1(r)));const i=P1(o.code).split(/\r?\n/);let l=0,a=0;for(const c of i)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):c2(P1(e.code,e.loading===!0))}function Ude(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function cm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,r=Bx(o.lineHeight,1.5*Bx(o.fontSize,16)),i=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Ude(o),lineHeight:r,wrapperOverhead:Math.max(0,s-r),widthAdjustment:Math.max(0,i-l),whiteSpace:n}}const Zde=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Rx(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const r=Object.getOwnPropertyDescriptors(e);for(const[i,l]of Object.entries(r))Zde.has(i)||s.has(i)||l.enumerable&&"value"in l&&(o[i]=l.value);return o}function Fx(e,t,n,o){var s;const r=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),i=(function(f,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):0})(n,r);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=i);const l=Math.max(0,r-i),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const p=o.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-i);hd&&(e.scrollTop=c)}function jx(e,t){let n=0,o=null,s=null;const r=()=>{const i=s;s=null,o=null,i&&(n=Date.now(),e(...i))};return function(...i){const l=Date.now(),a=t-(l-n);s=i,a<=0?(o&&(clearTimeout(o),o=null),n=l,s=null,e(...i)):o||(o=setTimeout(r,a))}}function Ox(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const WL=Symbol("MarkstreamMathBlockMinHeightCache");function nqe(){return pn(WL,null)}const Kde=new Set(["text","inline_code","emoji","footnote_reference"]),Gde=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function u2(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function H1(e,t,n,o=22){const s=String(e??"");if(!s)return n;const r=Math.max(18,Math.floor(Math.max(320,t)/8)),i=s.split(/\r?\n/).length,l=Math.ceil(s.length/r),a=Math.max(1,i,l);return Math.max(n,Math.ceil(a*o+12))}function qL(e){var t;if(!e||typeof e!="object")return!1;const n=e,o=String((t=n.type)!=null?t:"");if(Kde.has(o))return!0;if(!Gde.has(o))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(qL)}function l7(e){var t,n,o,s,r,i,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((o=(n=c.content)!=null?n:c.raw)!=null?o:"");if(u==="inline_code")return String((i=(r=(s=c.code)!=null?s:c.content)!=null?r:c.raw)!=null?i:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const p=c[f];if(Array.isArray(p)){const h=p.map(l7).filter(Boolean).join(" ");h&&d.push(h)}}return d.join(" ").replace(/\s+/g," ").trim()}function UL(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const o=t[n];return Array.isArray(o)&&o.some(UL)})}function Yde(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),o=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),r=Math.max(1,o,s);return 30+26*Math.max(0,r-1)}function Xde(e,t){var n,o,s,r,i,l,a,c,u,d,f,p,h,m;if(!e||typeof e!="object")return 32;const k=e,x=String((n=k.type)!=null?n:""),w=Number.isFinite(t)&&t>0?t:640;switch(x){case"heading":return(function(v){var b;const M=Number((b=v.level)!=null?b:v.depth);return M>=4?20:M===3?30:M===2?32:44})(k);case"paragraph":return(function(v,b){const M=String(v??"");if(!M)return 28;const R=Math.max(18,Math.floor(Math.max(320,b)/8)),z=M.split(/\r?\n/).length,$=Math.ceil(M.length/R);return Math.max(1,z,$)<=1?28:H1(M,b,34)})(String((s=(o=k.raw)!=null?o:k.content)!=null?s:""),w);case"list":return(function(v,b){var M;const R=Array.isArray(v.items)?v.items:[];if(!R.length)return 48;const z=Math.max(48,30*R.length+12);let $=12;for(const N of R)$+=Yde(l7(N)||String((M=N.raw)!=null?M:""),b);const T=Math.max(0,$-z);if(R.length>20){const N=Math.round(2.4*R.length);return Math.round(z+Math.max(N,Math.min(T,3*R.length)))}if(T<=0)return z;const E=R.length>8?8*R.length:T;return Math.round(z+Math.min(T,E))})(k,w);case"list_item":return H1(String((i=(r=k.raw)!=null?r:k.content)!=null?i:""),w,34);case"blockquote":return H1(String((a=(l=k.raw)!=null?l:k.content)!=null?a:""),w,56);case"table":return(function(v,b){const M=[...v.header?[v.header]:[],...Array.isArray(v.rows)?v.rows:[]];if(!M.length){const R=Array.isArray(v.children)?v.children.length:3;return Math.max(120,38*R+48)}return Math.max(120,Math.round(4+M.reduce((R,z)=>R+(function($,T){const E=Math.max(1,$.length),N=Math.max(80,(T-32)/E),C=Math.max(10,Math.floor(N/8)),O=Math.max(1,...$.map(H=>{var V;const A=l7(H)||String((V=H?.raw)!=null?V:"");return Math.ceil(A.length/C)||1}));return 54+34*Math.max(0,O-1)+(E<=3&&$.some(UL)?14:0)})((function($){var T;return Array.isArray($?.cells)&&(T=$.cells)!=null?T:[]})(z),b),0)))})(k,w);case"code_block":{const v=String((c=k.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=k.code)!=null?u:k.raw)!=null?d:"");return v==="mermaid"?y5(v5(b)):v==="infographic"?k5(w5(b)):H1(b,w,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(v,b){var M,R,z;const $=v.match(/^\s*]*)>/i);return $&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=$[1])!=null?M:"")?H1(((z=(R=v.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:R[1])==null?void 0:z.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):H1(v,b,96)})(String((p=(f=k.raw)!=null?f:k.content)!=null?p:""),w);case"thematic_break":return 24;default:return H1(String((m=(h=k.raw)!=null?h:k.content)!=null?m:""),w,40)}}function Px(e,t,n){return Math.min(Math.max(e,t),n)}const Jde=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Qde=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],efe=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),ZL=["raw","content","code","originalCode","updatedCode"],Hx=new WeakMap,Dx=new WeakMap;let tfe=1;function Bi(){return typeof performance<"u"?performance.now():Date.now()}function Vx(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function qr(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Hx.get(t);return n||(n=tfe++,Hx.set(t,n)),String(n)}function Wx(e,t,n,o={}){var s,r;const i=o.includeFinal!==!1,l={md:qr(t),customMarkdownIt:qr(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(r=e.streamParse)!=null?r:"auto",validateLink:qr(e.validateLink),preTransformTokens:qr(e.preTransformTokens),postTransformTokens:qr(e.postTransformTokens),postTransformNodes:qr(e.postTransformNodes)};return i&&(l.final=e.final===!0),JSON.stringify(l)}function qx(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function Ux(e){const t=KL(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function KL(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function GL(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function _v(e){const t=String(e??"");return`${t.length}:${GL(t)}`}function a7(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(i){return i.length<=8192?_v(i):`${i.length}:${GL(i.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${qr(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${qr(o)}`;const r=qr(o);if(t.set(o,r),Array.isArray(e)){const i=e.slice(0,200);return`a:${e.length}:${i.map(l=>a7(l,t,n+1)).join(",")}`}if(typeof e=="object"){const i=e,l=Object.keys(i).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${a7(i[c],t,n+1)}`).join(";")}`}return typeof e}function T5(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function YL(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>T5(o)?c1(o,t,n+1):YL(o,t,n+1)).join(",")}`:T5(e)?c1(e,t,n):a7(e,t,n)}function nfe(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!ZL.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${_v(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${qr(s)}`:efe.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${YL(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${qr(s)}`:""}).filter(Boolean).join(";")}function ofe(e){return ZL.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${_v(n)}`:""}).filter(Boolean).join(";")}function c1(e,t=new WeakMap,n=0){const o=Dx.get(e);if(o)return o;const s=e,r=t.get(s);if(r)return`node-cycle:${r}`;if(n>=6)return`node:${e.type}:${qr(s)}`;const i=qr(s);t.set(s,i);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>c1(h,c,u+1)).join("|"):"";return[a.type,ofe(d),nfe(d,c,u),f.length,p].join(":")})(e,t,n);return Dx.set(s,l),l}function XL(e,t){return c1(e)===c1(t)}function xv(e,t,n){const o=Bi(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Bi()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function Zx(e,t,n){return xv(t,n,()=>c1(e))}function JL(e,t,n){return Zx(e,n,"stabilizeSignatureMs")===Zx(t,n,"stabilizeSignatureMs")}function A3(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Kx(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Gx(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function sfe(e,t){return e.length===t.length&&e===t}function Sv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(r.length!==i.length)return!1;for(let u=0;u{o=Sv(e,t)}),o??JL(e,t,n)}function lfe(e,t){const n={};for(const o of Jde){const s=e[o],r=t?.[o];typeof s=="number"&&(n[o]=s-(typeof r=="number"?r:0))}return n}function afe(e,t){var n;const o=U_(t.instanceMsgId),s=new Map,r=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),i=U(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let H="",V=0,A=!1,F=!1,j=!1,q=!1;function P(){H="",V=0,A=!1,F=!1,j=!1,q=!1}function W(G){let ee=!1;for(let se=0;se{if(!G||!ee.startsWith(G)||ee.length<=G.length)return P(),[!0,0];let se=0;H!==G&&(P(),W(G),se=G.length);const oe=ee.slice(G.length),Q=W(oe);return H=ee,[Q,se+oe.length]}})();let p,h=0,m=0,k=Bi(),x=-1,w=0;function v(H){x=Number.isInteger(H)?H:0,w+=1}function b(){p&&(clearTimeout(p),p=void 0)}function M(){b();const H=t.renderContent.value;i.value!==H&&(i.value=H),k=Bi()}Ue([t.renderContent,t.effectiveFinal,r],([H,V,A])=>{i.value!==H&&(!A||V||(function(F,j){if(!F&&j||j.length<=80||j.length0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,c,u){var d,f,p;const h=(tm===null&&(tm=new Intl.Segmenter(void 0,{granularity:"word"})),tm);let m=0;const k=[],x=[],v=[],w=[],b=[],M=[],R=[],z=[],$=[],E=[],T=[],N=[];for(const A of h.segment(a))for(const F of Sde(A.segment,(d=A.isWordLike)!=null&&d,A.index,u)){let j=function(){M[Q]!==null&&(x[Q]=[Sx(k,M,R,Q)],M[Q]=null),x[Q].push(F.text),v[Q]=v[Q]||F.isWordLike,z[Q]=z[Q]||W,$[Q]=$[Q]||G,E[Q]=se,T[Q]=oe,N[Q]=Cx($[Q],ee)};const q=F.kind==="text",P=wde(F.text,F.isWordLike,F.kind),W=ml(F.text),G=_x(F.text),ee=sd(F.text),se=r7(F.text),oe=yde(F.text),Q=m-1;c.carryCJKAfterClosingQuote&&q&&m>0&&w[Q]==="text"&&W&&z[Q]&&E[Q]||q&&m>0&&w[Q]==="text"&&pde(F.text)&&z[Q]||q&&m>0&&w[Q]==="text"&&T[Q]?j():q&&m>0&&w[Q]==="text"&&F.isWordLike&&G&&N[Q]?(j(),v[Q]=!0):P!==null&&m>0&&w[Q]==="text"&&M[Q]===P?R[Q]=((f=R[Q])!=null?f:1)+1:q&&!F.isWordLike&&m>0&&w[Q]==="text"&&!z[Q]&&(fde(F.text)||F.text==="-"&&v[Q])?j():(k[m]=F.text,x[m]=[F.text],v[m]=F.isWordLike,w[m]=F.kind,b[m]=F.start,M[m]=P,R[m]=P===null?0:1,z[m]=W,$[m]=G,E[m]=se,T[m]=oe,N[m]=Cx(G,ee),m++)}for(let A=0;Anull);let O=-1;for(let A=m-1;A>=0;A--){const F=k[A];if(F.length!==0){if(w[A]==="text"&&!v[A]&&O>=0&&w[O]==="text"&&(hde(F)||F==="-"&&gde(k[O]))){const j=(p=C[O])!=null?p:[];j.push(F),C[O]=j,b[O]=b[A],k[A]="";continue}O=A}}for(let A=0;AW+1){F.push(Fr(oe)),j.push(ge),q.push("text"),P.push(A.starts[W]),W=Q;continue}}F.push(G),j.push(se),q.push(ee),P.push(A.starts[W]),W++}return{len:F.length,texts:F,isWordLike:j,kinds:q,starts:P}})((function(A){const F=[],j=[],q=[],P=[];for(let W=0;W1;for(let oe=0;oe=A.len||nm(A.kinds[ee]))continue;const se=[],oe=A.starts[ee];let Q=ee;for(;Q0&&(F.push(Fr(se)),j.push(!0),q.push("text"),P.push(oe),W=Q-1)}return{len:F.length,texts:F,isWordLike:j,kinds:q,starts:P}})((function(A){const F=A.texts.slice(),j=A.isWordLike.slice(),q=A.kinds.slice(),P=A.starts.slice();for(let G=0;G=0&&!VL(c.texts[w-1],u)&&v(w),m<0&&(m=w),k=k||ml(b))}return v(c.len),{len:d.length,texts:d,isWordLike:f,kinds:p,starts:h}})(i,r,t.breakKeepAllAfterPunctuation):r;return _t({normalized:i,chunks:Nde(l,s)},l)}let nc=null;const Ex=new Map;let oc=null;const Bde=new RegExp("\\p{Emoji_Presentation}","u"),Rde=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let om=null;const Tx=new Map;function l7(){if(nc!==null)return nc;if(typeof OffscreenCanvas<"u")return nc=new OffscreenCanvas(1,1).getContext("2d"),nc;if(typeof document<"u")return nc=document.createElement("canvas").getContext("2d"),nc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Aa(e,t){let n=t.get(e);return n===void 0&&(n={width:l7().measureText(e).width,containsCJK:ml(e)},t.set(e,n)),n}function E5(){if(oc!==null)return oc;if(typeof navigator>"u")return oc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},oc;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return oc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},oc}function qL(){return om===null&&(om=new Intl.Segmenter(void 0,{granularity:"grapheme"})),om}function Fde(e){return Bde.test(e)||e.includes("️")}function O1(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=qL();for(const a of l.segment(i))Fde(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function jde(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function Ix(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function Lx(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function bv(e,t){return t===0?0:e+t}function Hde(e,t,n,o,s){return bv(o,t==="tab"?s+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function $x(e,t,n,o){return bv(o,t==="tab"?0:e.lineEndFitAdvances[n])}function Nx(e,t,n,o,s){return bv(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function Dde(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Vde(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function A3(e,t,n){let o=t;for(;oj){if(fe!==null&&te>D){Q(ne,te,de),ye=te,pe=A3(fe,pe,ye+1),te=-1,de=0;continue}Q(),xe(ne,ye,Ce)}else P+=Ce,G=ne,ee=ye+1;else xe(ne,ye,Ce);const me=ye+1;fe!==null&&fe[pe]===me&&(te=me,de=P,pe++),ye++}W&&G===ne&&ee===ve.length&&(G=ne+1,ee=0)}let Y=0;for(;Y=H.length)));){const ne=H[Y],D=Ix(V[Y]);if(W)if(P+ne>j){if(D){Ke(Y,ne),Q(Y+1,0,P-ne),Y++;continue}if(se>=0){if(G>se||G===se&&ee>0){Q();continue}Q(se,0,oe);continue}if(ne>j&&A[Y]!==null){Q(),et(Y,0),Y++;continue}Q()}else Ke(Y,ne),D&&(se=Y+1,oe=P-ne),Y++;else ne>j&&A[Y]!==null?et(Y,0):ge(Y,ne),D&&(se=Y+1,oe=P-ne),Y++}return W&&Q(),q})(n,o);const{widths:s,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(s.length===0||c.length===0)return 0;const u=E5(),d=o+u.lineFitEpsilon;let f=0,p=0,h=!1,m=0,k=0,x=-1,v=0,w=null;function b(){x=-1,v=0,w=null}function M(C=m,O=k,H){f++,p=0,h=!1,b()}function R(C,O){h=!0,m=C+1,k=0,p=O}function z(C,O,H){h=!0,m=C,k=O+1,p=H}function $(C,O){h?(p+=O,m=C+1,k=0):R(C,O)}function E(C,O,H,V,A,F){if(!O)return;const j=$x(n,C,H,A);Nx(n,C,H,A,V),x=H+1,v=p-F+j,w=C}function T(C,O){var H;const V=r[C],A=(H=l[C])!=null?H:null;let F=A===null?-1:A3(A,0,O+1),j=-1,q=O;for(;qd){if(A!==null&&j>O){M(C,j),q=j,F=A3(A,F,q+1),j=-1;continue}M(),z(C,q,P)}else p=ee,m=C,k=q+1}else z(C,q,P);const W=q+1;A!==null&&A[F]===W&&(j=W,F++),q++}h&&m===C&&k===V.length&&(m=C+1,k=0)}function N(C){f++,b()}for(let C=0;C=O.endSegmentIndex)));){const V=i[H],A=Ix(V),F=Pde(n,h,H),j=V==="tab"?Ode(p+F,n.tabStopAdvance):s[H],q=F+j,P=Hde(n,V,H,F,j);if(V!=="soft-hyphen")if(h){if(p+P>d){const W=p+$x(n,V,H,F);if(Nx(n,V,H,F,j),w==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&v<=d){M(x,0);continue}if(A&&W<=d){$(H,q),M(H+1,0),H++;continue}if(x>=0&&v<=d){if(m>x||m===x&&k>0){M();continue}const G=x;M(G,0),H=G;continue}if(P>d&&r[H]!==null){M(),T(H,0),H++;continue}M();continue}$(H,q),E(V,A,H,j,F,q),H++}else P>d&&r[H]!==null?T(H,0):R(H,j),E(V,A,H,j,F,q),H++;else h&&(m=H+1,k=0,x=H+1,v=p+a,w=V),H++}h&&(O.consumedEndSegmentIndex,M(O.consumedEndSegmentIndex,0))}return f})(e,t)}let sm=null;function _v(){return sm===null&&(sm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),sm}function qde(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,p){o=[d],s=f,i=p,r=r7(d),l=Rp.has(d)}function u(d,f){o.push(d),i=i||f;const p=r7(d);r=d.length===1&&b0.has(d)&&r||p,l=!1}for(const d of _v().segment(e)){const f=d.segment,p=ml(f);o.length!==0?l||wv.has(f)||b0.has(f)||t.carryCJKAfterClosingQuote&&p&&r?u(f,p):i||p?(a(),c(f,d.index,p)):u(f,p):c(f,d.index,p)}return a(),n}function Ude(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(l){if(!(s<0)){if(i)s+1===l?o.push(t[s]):(function(a,c){const u=t[a].start,d=c=0&&!VL(t[l-1].text,n)&&r(l),s<0&&(s=l),i=i||ml(a.text)}return r(t.length),o}function zx(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=_v();for(const s of o.segment(e))n++;return n}function Zde(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Kde(e,t,n,o,s){const i=E5(),{cache:r,emojiCorrection:l}=(function(N,C){l7().font=N;const O=(function(A){let F=Ex.get(A);return F||(F=new Map,Ex.set(A,F)),F})(N),H=(function(A){const F=A.match(/(\d+(?:\.\d+)?)\s*px/);return F?parseFloat(F[1]):16})(N),V=C?(function(A,F){let j=Tx.get(A);if(j!==void 0)return j;const q=l7();q.font=A;const P=q.measureText("😀").width;if(j=0,P>F+.5&&typeof document<"u"&&document.body!==null){const W=document.createElement("span");W.style.font=A,W.style.display="inline-block",W.style.visibility="hidden",W.style.position="absolute",W.textContent="😀",document.body.appendChild(W);const G=W.getBoundingClientRect().width;document.body.removeChild(W),P-G>.5&&(j=P-G)}return Tx.set(A,j),j})(N,H):0;return{cache:O,fontSize:H,emojiCorrection:V}})(t,(a=e.normalized,Rde.test(a)));var a;const c=O1("-",Aa("-",r),l)+(s===0?0:2*s),u=8*O1(" ",Aa(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],p=[],h=[],m=[];let k=e.chunks.length<=1&&!d;const x=null,v=[],w=[],b=[],M=null,R=Array.from({length:e.len});function z(N,C,O,H,V,A,F,j,q){V!=="text"&&V!=="space"&&V!=="zero-width-break"&&(k=!1),f.push(C),p.push(O),h.push(H),m.push(V),v.push(F),w.push(j),d&&b.push(q)}function $(N,C,O,H,V){const A=Aa(N,r),F=d?zx(N,C):0,j=(function(G,ee,se){return ee>1?G+(ee-1)*se:G})(O1(N,A,l),F,s),q=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:j,P=q===0?0:q+(F>0?s:0),W=C==="space"||C==="zero-width-break"?0:j;if(V&&H&&N.length>1){let G="sum-graphemes";s!==0?G="segment-prefixes":v4(N)?G="pair-context":i.preferPrefixWidthsForBreakableRuns&&(G="segment-prefixes");const ee=(function(oe,Q,ge,xe,Ke){if(Q.breakableFitAdvances!==void 0&&Q.breakableFitMode===Ke)return Q.breakableFitAdvances;Q.breakableFitMode=Ke;const et=qL(),Y=[];for(const ve of et.segment(oe))Y.push(ve.segment);if(Y.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(Ke==="sum-graphemes"){const ve=[];for(const fe of Y){const pe=Aa(fe,ge);ve.push(O1(fe,pe,xe))}return Q.breakableFitAdvances=ve,Q.breakableFitAdvances}if(Ke==="pair-context"||Y.length>96){const ve=[];let fe=null,pe=0;for(const te of Y){const de=O1(te,Aa(te,ge),xe);if(fe===null)ve.push(de);else{const ye=fe+te,Ce=Aa(ye,ge);ve.push(O1(ye,Ce,xe)-pe)}fe=te,pe=de}return Q.breakableFitAdvances=ve,Q.breakableFitAdvances}const ne=[];let D="",X=0;for(const ve of Y){D+=ve;const fe=O1(D,Aa(D,ge),xe);ne.push(fe-X),X=fe}return Q.breakableFitAdvances=ne,Q.breakableFitAdvances})(N,A,r,l,G),se=ee===null||o==="keep-all"?null:(function(oe){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(oe))return null;const Q=[];let ge=0;for(const xe of _v().segment(oe))ge++,Zde(xe.segment)&&Q.push(ge);return Q.length===0?null:Q})(N);return void z(N,j,P,W,C,O,ee,se,F)}z(N,j,P,W,C,O,null,null,F)}for(let N=0;N=55296&&oe<=56319&&se+1=56320&&Ke<=57343&&(Q=Ke-56320+(oe-55296<<10)+65536,ge=2)}const xe=ode(Q);xe!=="R"&&xe!=="AL"&&xe!=="AN"||(j=!0);for(let Ke=0;Ke=0&&F[oe]==="ET";oe--)F[oe]="EN";for(oe=se+1;oe0?F[se-1]:G)!=="L"?"R":"L";if(Q===((oe{const e=globalThis;if(e[im])return e[im];const t={configs:{},controllers:{},revision:jo(0),preparedCache:new Map,blockEstimateCache:new Map};return e[im]=t,t})();let c2=null;const rm=_s.revision;function Bx(e){var t;return e&&(t=_s.configs[e])!=null?t:null}function Rx(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Yde(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function lm(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!Yde(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=` +`)}return s.length>0?s:null}function am(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(c2!=null)return c2;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return c2=!!((i=r.getContext)!=null&&i.call(r,"2d")),c2}catch{return c2=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=_s.blockEstimateCache.get(r);if(l)return _s.blockEstimateCache.delete(r),_s.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(p,h,m){const k=`${m}\0${h}\0${p}`,x=_s.preparedCache.get(k);if(x)return _s.preparedCache.delete(k),_s.preparedCache.set(k,x),x.prepared;const v=(function(w,b,M){return(function(R,z,$,E){var T,N;const C=(T=E?.wordBreak)!=null?T:"normal",O=(N=E?.letterSpacing)!=null?N:0;return Kde(zde(R,E5(),E?.whiteSpace,C),z,!1,C,O)})(w,b,0,M)})(p,h,{whiteSpace:m});for(_s.preparedCache.set(k,{prepared:v});_s.preparedCache.size>240;){const w=_s.preparedCache.keys().next().value;if(!w)break;_s.preparedCache.delete(w)}return v})(e,n.font,a),u=(function(p,h,m){const k=Wde(p,h);return{lineCount:k,height:k*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(_s.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});_s.blockEstimateCache.size>4e3;){const p=_s.blockEstimateCache.keys().next().value;if(!p)break;_s.blockEstimateCache.delete(p)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function UL(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=lm(e.children);return i&&n.paragraph?am(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=lm(e.children),l=n.headings[i];return r&&l?am(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=lm((s=i[0])==null?void 0:s.children);return r?am(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=UL(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function u2(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function P1(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function cm(e,t,n=0){return e.diff?gv(t??{},n)?(function(o){const s=P1(o.raw);if(s){const i=s.split(/\r?\n/);return o.originalCode!=null||o.updatedCode!=null?Math.max(1,i.filter(r=>!Gde.some(l=>r.startsWith(l))).length):Math.max(1,i.length)}return u2(P1(o.originalCode))+u2(P1(o.updatedCode))})(e):(function(o){const s=o.originalCode,i=o.updatedCode;if(s!=null||i!=null)return Math.max(u2(P1(s)),u2(P1(i)));const r=P1(o.code).split(/\r?\n/);let l=0,a=0;for(const c of r)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):u2(P1(e.code,e.loading===!0))}function Xde(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function um(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=Rx(o.lineHeight,1.5*Rx(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Xde(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Jde=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Fx(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Jde.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}function jx(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,p){return Number.isFinite(f)?Math.min(Math.max(0,f),p):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const p=o.getNormalizedScrollTop(e,t,!1),h=Math.abs(p-r);hd&&(e.scrollTop=c)}function Ox(e,t){let n=0,o=null,s=null;const i=()=>{const r=s;s=null,o=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);s=r,a<=0?(o&&(clearTimeout(o),o=null),n=l,s=null,e(...r)):o||(o=setTimeout(i,a))}}function Px(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const ZL=Symbol("MarkstreamMathBlockMinHeightCache");function gqe(){return pn(ZL,null)}const Qde=new Set(["text","inline_code","emoji","footnote_reference"]),efe=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function d2(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function H1(e,t,n,o=22){const s=String(e??"");if(!s)return n;const i=Math.max(18,Math.floor(Math.max(320,t)/8)),r=s.split(/\r?\n/).length,l=Math.ceil(s.length/i),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*o+12))}function KL(e){var t;if(!e||typeof e!="object")return!1;const n=e,o=String((t=n.type)!=null?t:"");if(Qde.has(o))return!0;if(!efe.has(o))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(KL)}function a7(e){var t,n,o,s,i,r,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((o=(n=c.content)!=null?n:c.raw)!=null?o:"");if(u==="inline_code")return String((r=(i=(s=c.code)!=null?s:c.content)!=null?i:c.raw)!=null?r:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const p=c[f];if(Array.isArray(p)){const h=p.map(a7).filter(Boolean).join(" ");h&&d.push(h)}}return d.join(" ").replace(/\s+/g," ").trim()}function GL(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const o=t[n];return Array.isArray(o)&&o.some(GL)})}function tfe(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),o=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),i=Math.max(1,o,s);return 30+26*Math.max(0,i-1)}function nfe(e,t){var n,o,s,i,r,l,a,c,u,d,f,p,h,m;if(!e||typeof e!="object")return 32;const k=e,x=String((n=k.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(x){case"heading":return(function(w){var b;const M=Number((b=w.level)!=null?b:w.depth);return M>=4?20:M===3?30:M===2?32:44})(k);case"paragraph":return(function(w,b){const M=String(w??"");if(!M)return 28;const R=Math.max(18,Math.floor(Math.max(320,b)/8)),z=M.split(/\r?\n/).length,$=Math.ceil(M.length/R);return Math.max(1,z,$)<=1?28:H1(M,b,34)})(String((s=(o=k.raw)!=null?o:k.content)!=null?s:""),v);case"list":return(function(w,b){var M;const R=Array.isArray(w.items)?w.items:[];if(!R.length)return 48;const z=Math.max(48,30*R.length+12);let $=12;for(const N of R)$+=tfe(a7(N)||String((M=N.raw)!=null?M:""),b);const E=Math.max(0,$-z);if(R.length>20){const N=Math.round(2.4*R.length);return Math.round(z+Math.max(N,Math.min(E,3*R.length)))}if(E<=0)return z;const T=R.length>8?8*R.length:E;return Math.round(z+Math.min(E,T))})(k,v);case"list_item":return H1(String((r=(i=k.raw)!=null?i:k.content)!=null?r:""),v,34);case"blockquote":return H1(String((a=(l=k.raw)!=null?l:k.content)!=null?a:""),v,56);case"table":return(function(w,b){const M=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!M.length){const R=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*R+48)}return Math.max(120,Math.round(4+M.reduce((R,z)=>R+(function($,E){const T=Math.max(1,$.length),N=Math.max(80,(E-32)/T),C=Math.max(10,Math.floor(N/8)),O=Math.max(1,...$.map(H=>{var V;const A=a7(H)||String((V=H?.raw)!=null?V:"");return Math.ceil(A.length/C)||1}));return 54+34*Math.max(0,O-1)+(T<=3&&$.some(GL)?14:0)})((function($){var E;return Array.isArray($?.cells)&&(E=$.cells)!=null?E:[]})(z),b),0)))})(k,v);case"code_block":{const w=String((c=k.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=k.code)!=null?u:k.raw)!=null?d:"");return w==="mermaid"?k5(w5(b)):w==="infographic"?b5(y5(b)):H1(b,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,b){var M,R,z;const $=w.match(/^\s*]*)>/i);return $&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=$[1])!=null?M:"")?H1(((z=(R=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:R[1])==null?void 0:z.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):H1(w,b,96)})(String((p=(f=k.raw)!=null?f:k.content)!=null?p:""),v);case"thematic_break":return 24;default:return H1(String((m=(h=k.raw)!=null?h:k.content)!=null?m:""),v,40)}}function Hx(e,t,n){return Math.min(Math.max(e,t),n)}const ofe=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],sfe=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],ife=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),YL=["raw","content","code","originalCode","updatedCode"],Dx=new WeakMap,Vx=new WeakMap;let rfe=1;function Br(){return typeof performance<"u"?performance.now():Date.now()}function Wx(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function qi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=Dx.get(t);return n||(n=rfe++,Dx.set(t,n)),String(n)}function qx(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:qi(t),customMarkdownIt:qi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:qi(e.validateLink),preTransformTokens:qi(e.preTransformTokens),postTransformTokens:qi(e.postTransformTokens),postTransformNodes:qi(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function Ux(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function Zx(e){const t=XL(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function XL(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function JL(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function xv(e){const t=String(e??"");return`${t.length}:${JL(t)}`}function c7(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?xv(r):`${r.length}:${JL(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${qi(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${qi(o)}`;const i=qi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>c7(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${c7(r[c],t,n+1)}`).join(";")}`}return typeof e}function T5(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function QL(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>T5(o)?c1(o,t,n+1):QL(o,t,n+1)).join(",")}`:T5(e)?c1(e,t,n):c7(e,t,n)}function lfe(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!YL.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${xv(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${qi(s)}`:ife.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${QL(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${qi(s)}`:""}).filter(Boolean).join(";")}function afe(e){return YL.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${xv(n)}`:""}).filter(Boolean).join(";")}function c1(e,t=new WeakMap,n=0){const o=Vx.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${qi(s)}`;const r=qi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],p=f.length?f.slice(0,200).map(h=>c1(h,c,u+1)).join("|"):"";return[a.type,afe(d),lfe(d,c,u),f.length,p].join(":")})(e,t,n);return Vx.set(s,l),l}function e$(e,t){return c1(e)===c1(t)}function Sv(e,t,n){const o=Br(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Br()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function Kx(e,t,n){return Sv(t,n,()=>c1(e))}function t$(e,t,n){return Kx(e,n,"stabilizeSignatureMs")===Kx(t,n,"stabilizeSignatureMs")}function E3(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Gx(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Yx(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function cfe(e,t){return e.length===t.length&&e===t}function Cv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u{o=Cv(e,t)}),o??t$(e,t,n)}function ffe(e,t){const n={};for(const o of ofe){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function pfe(e,t){var n;const o=Z_(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=U(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let H="",V=0,A=!1,F=!1,j=!1,q=!1;function P(){H="",V=0,A=!1,F=!1,j=!1,q=!1}function W(G){let ee=!1;for(let se=0;se{if(!G||!ee.startsWith(G)||ee.length<=G.length)return P(),[!0,0];let se=0;H!==G&&(P(),W(G),se=G.length);const oe=ee.slice(G.length),Q=W(oe);return H=ee,[Q,se+oe.length]}})();let p,h=0,m=0,k=Br(),x=-1,v=0;function w(H){x=Number.isInteger(H)?H:0,v+=1}function b(){p&&(clearTimeout(p),p=void 0)}function M(){b();const H=t.renderContent.value;r.value!==H&&(r.value=H),k=Br()}Ue([t.renderContent,t.effectiveFinal,i],([H,V,A])=>{r.value!==H&&(!A||V||(function(F,j){if(!F&&j||j.length<=80||j.length\s*|`{3,}|~{3,})/.test(q))||q.endsWith(` -`)&&!(function(P){const W=qx(P);if(Ux(W))return!1;const G=KL(W);return G.length>=2&&G.some(ee=>ee.trim())})(j))})(i.value,H)?M():(function(){if(m+=1,p)return;const F=Math.max(0,(function(j){const q=j.parseCoalesceMs;return typeof q=="number"&&Number.isFinite(q)&&q>=0?q:80})(e)-(Bi()-k));F<=0?M():p=setTimeout(M,F)})())},{flush:"sync",immediate:!0}),du(b);const R=B(()=>{var H,V,A,F;return yie(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(F=(A=(V=t.customComponentsMap)==null?void 0:V.value)!=null?A:{},Object.entries(F).map(([j,q])=>{const P=xi(j);return q==null||!P||of(P)||iI.has(P)||Jd.has(P)?"":P}).filter(Boolean)))}),z=B(()=>{const{key:H,tags:V}=kie(R.value);if(!H)return o;const A=s.get(H);if(A)return A;const F=U_(t.instanceMsgId,{customHtmlTags:V});return s.set(H,F),F}),$=B(()=>{const H=z.value;if(!e.customMarkdownIt)return H;const V=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,V.__markstreamHasCustomParserExtensions=!0,V}),T=B(()=>{var H,V;const A=(H=e.parseOptions)!=null?H:{},F=t.effectiveFinal.value,j=R.value,q=F!=null,P=j.length>0;return q||P||A.streamParse==null?_t(_t(gn(_t({},A),{streamParse:(V=A.streamParse)==null||V}),q?{final:F}:{}),P?{customHtmlTags:j}:{}):A}),E=B(()=>{var H;return new Set(((H=T.value.customHtmlTags)!=null?H:[]).map(V=>String(V).trim().toLowerCase()).filter(Boolean))}),N=B(()=>Wx(T.value,$.value,e.customMarkdownIt,{includeFinal:!0})),C=B(()=>Wx(T.value,$.value,e.customMarkdownIt,{includeFinal:!1}));Ue([N,C],([H,V],[A,F])=>{A&&(H===A&&V===F||(M(),V!==F&&(l=[],u="")))},{flush:"sync"});const O=B(()=>{var H,V,A,F,j,q,P,W,G,ee,se;if((H=e.nodes)!=null&&H.length)return l=[],u="",v(0),Nt(e.nodes.slice());const oe=i.value;if(!oe)return l=[],u="",v(-1),[];const Q=t.debugPerformanceEnabled.value,ge=Q?Bi():0,xe=$.value,Ke=N.value,et=C.value;a&&Ke!==a&&(function(at){var dt,$t;($t=(dt=at.stream)==null?void 0:dt.reset)==null||$t.call(dt)})(xe),c&&et!==c&&(l=[],u="");const Y=Object.keys((A=(V=t.customComponentsMap)==null?void 0:V.value)!=null?A:{}).length>0||typeof T.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const ne=!Y&&l.length>0&&oe.startsWith(u)&&et===c,D=Q?Vx(xe):null,X=Q?{}:void 0,ve=Gx(xe),fe=!ve&&!Y,pe=_t(_t(gn(_t({},T.value),{__reuseStableTopLevelNodes:fe}),ve?{__disableStreamParse:!0}:{}),X?{__timing:X}:{}),te=lL(oe,xe,pe),de=Q?Bi():0,ye=Q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ce,me=Q?A3(te.length):void 0,be=0,re=0,ke=0;if(ne){const at=Q?Bi():0,[dt,$t]=(function(Qt){var Dt,en;const[kn,In]=Qt.scanGlobalReferenceAppend(Qt.previousContent,Qt.content),Mn=Qt.parseOptions;return[Qt.previousDirtyStartIndex>0&&Mn.final!==!0&&!Qt.customMarkdownIt&&!Gx(Qt.md)&&!kn&&typeof Mn.preTransformTokens!="function"&&typeof Mn.postTransformTokens!="function"&&typeof Mn.postTransformNodes!="function"&&((en=(Dt=Mn.customHtmlTags)==null?void 0:Dt.length)!=null?en:0)===0?Qt.previousDirtyStartIndex:0,In]})({content:oe,previousContent:u,previousDirtyStartIndex:x,parseOptions:T.value,customMarkdownIt:e.customMarkdownIt,md:xe,scanGlobalReferenceAppend:f});ke=$t;const Tt=dt<=0;if(ye){const Qt=(function(Dt,en,kn,In={}){var Mn;if(!en.length)return{nodes:Dt,metrics:A3(Dt.length)};const Re=(Mn=In.scanStartIndex)!=null?Mn:0,lt=In.reuseDirtyTail!==!1,tt=(function(Rt,on,an,sn=0){const Yn=Math.min(Rt.length,on.length);for(let Kt=Math.min(Yn,Math.max(0,sn));Ktc1(at[Tt]))})(Ce,ye,re):(function(at,dt=0){for(let $t=Math.max(0,dt);$t((j=D?.total)!=null?j:0);t.logPerf(dt?"parse(stream)":"parse(sync)",_t(_t(_t({rendererId:t.instanceMsgId,ms:Math.round(Bi()-ge),nodes:Ce.length,contentLength:oe.length,parseCommitCount:h,parseCoalescedCount:m,nodeReuseMs:Fe,referenceDefinitionScanChars:ke,signatureMs:(q=ye?.signatureMs)!=null?q:0,stabilizeSignatureMs:(P=ye?.stabilizeSignatureMs)!=null?P:0,primeSignatureMs:(W=ye?.primeSignatureMs)!=null?W:0,signatureCallCount:(G=ye?.signatureCallCount)!=null?G:0,stabilizeSignatureCallCount:(ee=ye?.stabilizeSignatureCallCount)!=null?ee:0,primeSignatureCallCount:(se=ye?.primeSignatureCallCount)!=null?se:0,stabilizeMs:be},me??{}),X?Object.fromEntries(Qde.map($t=>{var Tt;return[$t,(Tt=X[$t])!=null?Tt:0]})):{}),at?{streamMode:at.lastMode,streamDelta:lfe(at,D),streamStats:at}:{}))}return Nt(Ce)});return{effectiveCustomHtmlTags:R,effectiveCustomHtmlTagsSet:E,mdBase:z,mdInstance:$,mergedParseOptions:T,getParsedNodesDirtyStartIndex:()=>x,getParsedNodesRevision:()=>w,parsedNodes:O}}function cfe(e){const{isClient:t}=e,n=U(new Set),o=new Map,s=new Map,r=new Map;function i(c){if(!t)return;const u=r.get(c);u!=null&&(window.clearTimeout(u),r.delete(c))}function l(){if(t)for(const c of r.values())window.clearTimeout(c);r.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:r,clearVisibilityFallback:i,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&i(c),(function(f,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const k=n.value,x=k.has(f);if(p){if(x)return;const v=new Set(k);return v.add(f),void(n.value=v)}if(!x)return;const w=new Set(k);w.delete(f),n.value=w})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of s.entries())f{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},i=s.subscribe(r);r();const l=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>o.value&&a.value);return G7()&&du(()=>{i(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const dfe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},Yx=/auto|scroll|overlay/i;function ffe(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return Yx.test(t)||Yx.test(n)}function pfe(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const hfe={class:"m-0 p-0"},mfe=["data-probe"],gfe=to(Ge(gn(_t({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,r;return(r=(s=t.headingNodes)==null?void 0:s[o])!=null?r:null}return(o,s)=>(g(),S("div",{class:"height-estimation-probes",style:Wt({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:r=>e.setParagraphWrapper(r),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[Z(y(h0),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:r=>e.setListItemWrapper(r),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",hfe,[Z(y(Vc),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:r=>e.setListWrapper(r),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[Z(y(Wc),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(g(),S(Me,null,rt(6,r=>_("div",{key:`probe-heading-${r}`,ref_for:!0,ref:i=>e.setHeadingWrapper(r,i),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${r}`},[Z(y(zp),{node:n(r),"index-key":`probe-heading-${r}`},null,8,["node","index-key"])],10,mfe)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),Xx=Ge({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return k5((o=Sc(e.estimatedPreviewHeightPx))!=null?o:w5(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return hn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?hn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[hn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[hn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),hn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),hn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>hn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,hn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[hn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),hn("div",{class:"absolute inset-0"},[hn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),Jx=Ge({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return y5((o=Sc(e.estimatedPreviewHeightPx))!=null?o:v5(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return hn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?hn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[hn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[hn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),hn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>hn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[hn("span",{class:"action-icon block"})])))]):null,hn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[hn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),hn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),vfe={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Ns(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const wfe=["data-custom-id"],yfe=["data-node-index","data-node-type"],Qx="typewriter-simple-cursor-target",QL=to(Ge(gn(_t({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function r(L){if(!(typeof Event<"u"&&L instanceof Event))return typeof L=="string"&&s("copy-code",L),void s("copy",L)}const i=gs(),l=pn("markstreamNestedRendererProps",void 0);function a(L){const K=i?.vnode.props;return!!K&&(Object.prototype.hasOwnProperty.call(K,L)||Object.prototype.hasOwnProperty.call(K,String(L).replace(/[A-Z]/g,le=>`-${le.toLowerCase()}`)))}function c(L){var K,le;const ae=o[L];return a(L)?ae:(le=(K=l?.value)==null?void 0:K[L])!=null?le:ae}const u=B(()=>{return(L=c("mode"))==="chat"||L==="minimal"||L==="docs"?L:"docs";var L}),d=B(()=>Ox(c("typewriter"))),f=B(()=>d.value!=="off"),p=B(()=>c("domMode")==="minimal"?"minimal":"full"),h=B(()=>{return(L={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":L.codeRenderer==="pre"||L.codeRenderer==="shiki"||L.codeRenderer==="monaco"?L.codeRenderer:L.renderCodeBlocksAsPre===!1||L.mode==="docs"?"monaco":"pre";var L}),m=B(()=>vfe[u.value]),k=B(()=>{var L;return(L=c("showTooltips"))!=null?L:m.value.showTooltips}),x=B(()=>{var L;return(L=c("fade"))!=null?L:m.value.fade}),w=B(()=>{var L;return(L=c("batchRendering"))!=null?L:m.value.batchRendering}),v=B(()=>{var L;return(L=c("initialRenderBatchSize"))!=null?L:m.value.initialRenderBatchSize}),b=B(()=>{var L;return(L=c("renderBatchSize"))!=null?L:m.value.renderBatchSize}),M=B(()=>{var L;return(L=c("renderBatchDelay"))!=null?L:m.value.renderBatchDelay}),R=B(()=>{var L;return(L=c("renderBatchBudgetMs"))!=null?L:m.value.renderBatchBudgetMs}),z=B(()=>{var L;return(L=c("renderBatchIdleTimeoutMs"))!=null?L:m.value.renderBatchIdleTimeoutMs}),$=B(()=>{var L;return(L=c("deferNodesUntilVisible"))!=null?L:m.value.deferNodesUntilVisible}),T=B(()=>{var L;return(L=c("maxLiveNodes"))!=null?L:m.value.maxLiveNodes}),E=B(()=>{var L;return(L=c("liveNodeBuffer"))!=null?L:m.value.liveNodeBuffer}),N=B(()=>{var L;return(L=c("nodeVirtual"))!=null?L:m.value.nodeVirtual}),C={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return p.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return k.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return o.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return x.value},get batchRendering(){return w.value},get initialRenderBatchSize(){return v.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return R.value},get renderBatchIdleTimeoutMs(){return z.value},get deferNodesUntilVisible(){return $.value},get maxLiveNodes(){return T.value},get liveNodeBuffer(){return E.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function O(L){s("height-change",L)}function H(L){s("virtual-state-change",L)}function V(L){s("anchor-change",L)}const A=U(),F=U(null),j=U(null),q=U(null),P=Rs({1:null,2:null,3:null,4:null,5:null,6:null}),W=U(!1),G=new Map,ee=U(0),se=U(0),oe=U({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function Q(L,K){return typeof L!="string"?K:L.trim()||K}function ge(L){const K=Number(L);return Number.isFinite(K)&&K>0?Math.max(1,Math.trunc(K)):640}const xe=B(()=>{var L;const K=(L=C.viewportPriorityOptions)!=null?L:{},le=Q(K.rootMargin,y0);return{rootMargin:le,heavyBlockMargin:Q(K.heavyBlockMargin,le),maxTargets:ge(K.maxTargets)}}),Ke=B(()=>{var L;return(L=xe.value.rootMargin)!=null?L:y0}),et=B(()=>{var L;return(L=xe.value.maxTargets)!=null?L:640});function Y(){var L,K;if(((L=o.virtualScroll)==null?void 0:L.enabled)!==!0)return null;const le=(K=o.virtualScroll)==null?void 0:K.scrollRoot;return ne(typeof le=="function"?le():le)}function ne(L){return L?typeof HTMLElement<"u"&&L instanceof HTMLElement?L:typeof L=="object"&&"value"in L?ne(L.value):typeof L=="object"&&"$el"in L?ne(L.$el):null:null}jn(RL,xe);const{isClient:D,renderAsFragment:X,debugPerformanceEnabled:ve,resolvedShowTooltips:fe,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:te,ownsTypewriterCursor:de}=(function(L){const K=typeof window<"u",le=Zd(),ae=pn("markstreamHtmlPolicy",void 0),we=pn("markstreamTypewriterCursor",void 0),Ne=pn("markstreamSmoothStreaming",void 0),Oe=B(()=>L.renderAsFragment===!0),Ve=B(()=>!!(L.debugPerformance&&K&&typeof console<"u")),st=B(()=>{var ot;if(typeof L.showTooltips=="boolean")return L.showTooltips;const Pe=(ot=le.showTooltips)!=null?ot:le["show-tooltips"];return Pe===""||Pe===!0||Pe==="true"||Pe!==!1&&Pe!=="false"&&void 0}),We=B(()=>{var ot,Pe;return(Pe=(ot=L.htmlPolicy)!=null?ot:ae?.value)!=null?Pe:"safe"}),Ye=B(()=>we?.value!==!0);return{isClient:K,renderAsFragment:Oe,debugPerformanceEnabled:Ve,resolvedShowTooltips:st,resolvedHtmlPolicy:We,inheritedSmoothStreaming:Ne,inheritedTypewriterCursor:we,ownsTypewriterCursor:Ye}})(C),{resolveViewportRoot:ye,resolveScrollContainer:Ce,isReverseFlexScrollRoot:me,getNormalizedScrollTop:be,getOffsetTopWithinRoot:re}=(function(L,K){function le(){var Ve,st;return(st=(Ve=K.scrollRoot)==null?void 0:Ve.call(K))!=null?st:null}function ae(Ve){if(typeof window>"u")return null;const st=le();if(st)return st;const We=Ve??L.value;if(!We)return null;const Ye=We.ownerDocument||document,ot=Ye.scrollingElement||Ye.documentElement;let Pe=We;for(;Pe&&Pe!==Ye.body&&Pe!==ot;){if(ffe(window.getComputedStyle(Pe))&&pfe(Pe))return Pe;Pe=Pe.parentElement}return null}function we(Ve){if(!K.isClient)return!1;try{const st=window.getComputedStyle(Ve);return!!(st.display||"").toLowerCase().includes("flex")&&(st.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ne(Ve,st,We){var Ye,ot;if(We)return Oe(st);const Pe=Ve.scrollTop;if(!we(Ve))return Pe;const Xe=Pe<0?-Pe:Pe;return Math.max(0,((Ye=Ve.scrollHeight)!=null?Ye:0)-((ot=Ve.clientHeight)!=null?ot:0))-Xe}function Oe(Ve){var st,We,Ye,ot,Pe;const Xe=Number((st=Ve.scrollingElement)==null?void 0:st.scrollTop),ft=Number((Ye=(We=Ve.documentElement)==null?void 0:We.scrollTop)!=null?Ye:0),ut=Number((Pe=(ot=Ve.body)==null?void 0:ot.scrollTop)!=null?Pe:0);return Math.max(0,Number.isFinite(Xe)?Xe:0,Number.isFinite(ft)?ft:0,Number.isFinite(ut)?ut:0)}return{resolveViewportRoot:ae,resolveScrollContainer:function(Ve){var st,We,Ye,ot;const Pe=le();if(Pe)return Pe;const Xe=ae((st=Ve??L.value)!=null?st:null);if(Xe)return Xe;const ft=(ot=(Ye=Ve?.ownerDocument)!=null?Ye:(We=L.value)==null?void 0:We.ownerDocument)!=null?ot:typeof document<"u"?document:null;return ft?.scrollingElement||ft?.documentElement||null},isReverseFlexScrollRoot:we,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:function(Ve,st){const We=st.ownerDocument||Ve.ownerDocument||document;if((function(Xe,ft){return Xe===ft.documentElement||Xe===ft.body||Xe===ft.scrollingElement})(st,We))return Ve.getBoundingClientRect().top+Oe(We);const Ye=st.getBoundingClientRect(),ot=Ve.getBoundingClientRect(),Pe=Ne(st,We,!1);return ot.top-Ye.top+Pe}}})(A,{isClient:D,scrollRoot:Y});jn("markstreamShowTooltips",fe),jn("markstreamHtmlPolicy",pe),jn("markstreamTypewriter",f),jn("markstreamFade",B(()=>C.fade!==!1)),jn("markstreamTypewriterCursor",B(()=>!0)),jn("markstreamTextStreamState",G),jn("markstreamStreamVersion",ee),jn("markstreamParseOptions",B(()=>C.parseOptions)),jn("markstreamCustomMarkdownIt",B(()=>C.customMarkdownIt));const{smoothStreamingEnabled:ke,renderContent:Fe,requestedFinal:at,effectiveFinal:dt}=(function(L,K){const le=ufe(_t(_t({},dfe),L.smoothStreamingOptions)),ae=B(()=>{var Pe,Xe,ft;return L.smoothStreaming!==!1&&!((Pe=L.nodes)!=null&&Pe.length)&&(L.smoothStreaming===!0||!((Xe=K.inheritedSmoothStreaming)!=null&&Xe.value))&&(L.smoothStreaming===!0||Ox(L.typewriter)!=="off"||((ft=L.maxLiveNodes)!=null?ft:0)<=0)}),we=U(!K.isClient||L.smoothStreaming===!0);xn(()=>{we.value=!0});const Ne=B(()=>we.value&&ae.value),Oe=B(()=>{var Pe;return Ne.value?le.visible.value:(Pe=L.content)!=null?Pe:""}),Ve=B(()=>{var Pe,Xe;const ft=(Pe=L.parseOptions)!=null?Pe:{};return(Xe=L.final)!=null?Xe:ft.final}),st=B(()=>{const Pe=Ve.value;return Ne.value&&Pe!=null?!!Pe&&le.caughtUp.value:Pe});let We=0,Ye=!1;function ot(){We=0,Ye=!1}return Ue([()=>L.content,()=>L.nodes,Ne,Ve],([Pe,Xe,ft,ut])=>{if(Xe?.length)return ot(),void le.reset("");const Et=Pe??"";if(!ft)return ot(),le.reset(Et),void(ut&&le.finish({flush:!0}));const yt=le.source.value;if(Et){if(Et!==yt)if(Et.startsWith(yt)){const Ot=Et.slice(yt.length),Ht=le.pendingChars.value;Ot.length<=8?(We++,Ye||We>=2&&Ht<=8?(Ye=!0,le.reset(Et)):le.enqueue(Ot)):(ot(),le.enqueue(Ot))}else ot(),le.reset(Et)}else ot(),le.reset("");ut&&le.finish()},{immediate:!0}),{smoothStream:le,smoothStreamingEligible:ae,smoothStreamingEnabled:Ne,renderContent:Oe,requestedFinal:Ve,effectiveFinal:st}})(C,{isClient:D,inheritedSmoothStreaming:te}),$t=at.value===!0;jn("markstreamSmoothStreaming",ke);const Tt=U(!1),Qt=U(!1),Dt=U(!1);let en="",kn=!1,In=null;function Mn(){D&&In!=null&&(window.clearTimeout(In),In=null)}function Re(){Tt.value=!1,Mn()}function lt(L,K){if(!ve.value)return;const le=(function(){if(!ve.value)return null;const ae=on(tt),we=on(ht),Ne=Math.max(Rt,we);if(ae<=0&&Ne<=0)return null;const Oe={total:ae,maxPerFrame:Ne,byLabel:(Ve=tt,Object.fromEntries(Array.from(Ve.entries()).sort((st,We)=>We[1]-st[1]||st[0].localeCompare(We[0]))))};var Ve;return tt.clear(),ht.clear(),Rt=0,Oe})();console.info(`[markstream-vue][perf] ${L}`,le?gn(_t({},K),{layoutReads:le}):K)}Ue([()=>C.indexKey,()=>C.customId],()=>{var L,K;Re(),Qt.value=!1,Dt.value=!((L=o.nodes)!=null&&L.length)&&at.value!==!0&&!!o.content,en=(K=Fe.value)!=null?K:"",kn=en.length>0},{flush:"sync"}),Ue([()=>o.content,()=>o.nodes,at],([L,K,le])=>{!K?.length&&le!==!0&&L&&(Dt.value=!0)},{flush:"sync",immediate:!0}),Ue([Fe,()=>o.nodes,at],([L,K,le])=>{const ae=L??"";return K?.length||le===!0?(Re(),Qt.value=!1,en=ae,void(kn=!0)):(ae.length>0&&(Dt.value=!0),kn?(en&&ae.length>en.length&&ae.startsWith(en)?(Tt.value=!0,Qt.value=!0,D&&(Mn(),In=window.setTimeout(()=>{var we;In=null,dt.value===!0||(we=o.nodes)!=null&&we.length||(q0(),Tt.value=!1,Sl())},1200))):(ae.length"u")return null;const Ne=window;if(Ne.__markstreamLayoutReadPerformance)return Ne.__markstreamLayoutReadPerformance;const Oe={total:0,maxPerFrame:0,byLabel:{}};return Ne.__markstreamLayoutReadPerformance=Oe,Oe})();we&&(we.total=Number(we.total||0)+1,we.byLabel[ae]=Number(we.byLabel[ae]||0)+1,we.currentFrameTotal=Number(we.currentFrameTotal||0)+1,we.frameScheduled||(we.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>sn(we),0):queueMicrotask(()=>sn(we)):window.requestAnimationFrame(()=>sn(we))))})(L),bt||(bt=!0,D&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(an):typeof queueMicrotask!="function"?setTimeout(an,0):queueMicrotask(an)))}function Kt(L,K){return Yn(L),K()}const no=C.customId?`renderer-${C.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,As=(function(L){const K=new Map;return{scope:L,cache:K,clear:()=>K.clear()}})(no),ys=no;jn(WL,As);const ao=ws(()=>C.customId),{effectiveCustomHtmlTagsSet:co,mergedParseOptions:oo,parsedNodes:Ct,getParsedNodesDirtyStartIndex:so,getParsedNodesRevision:Bn}=afe(C,{instanceMsgId:no,renderContent:Fe,effectiveFinal:dt,smoothStreamingEnabled:ke,debugPerformanceEnabled:ve,customComponentsMap:ao,logPerf:lt});Ue(Ct,()=>{Tt.value||As.clear(),ee.value+=1},{immediate:!0});const Pn=B(()=>({customId:C.customId,customHtmlTags:oo.value.customHtmlTags,parseOptions:C.parseOptions,customMarkdownIt:C.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:C.viewportPriority,viewportPriorityOptions:xe.value,mode:u.value,domMode:C.domMode,codeRenderer:h.value,codeBlockStream:C.codeBlockStream,codeBlockDarkTheme:C.codeBlockDarkTheme,codeBlockLightTheme:C.codeBlockLightTheme,codeBlockMonacoOptions:C.codeBlockMonacoOptions,renderCodeBlocksAsPre:C.renderCodeBlocksAsPre,codeBlockMinWidth:C.codeBlockMinWidth,codeBlockMaxWidth:C.codeBlockMaxWidth,codeBlockProps:C.codeBlockProps,mermaidProps:C.mermaidProps,d2Props:C.d2Props,infographicProps:C.infographicProps,showTooltips:fe.value,themes:C.themes,langs:C.langs,isDark:C.isDark,typewriter:f.value,smoothStreamingOptions:C.smoothStreamingOptions,parseCoalesceMs:C.parseCoalesceMs,fade:C.fade}));jn("markstreamNestedRendererProps",Pn);const js=B(()=>Ct.value),Os=B(()=>Ct.value.length),Ts=U(null),ks=U(null),Lo=U(null),Ro=U(null),Ze=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Qe=!Ze&&C.customId?zx(C.customId):null,ct=B(()=>Qe?(rm.value,zx(C.customId)):null),mn=B(()=>{var L;return!!(!X.value&&C.customId&&!Ze&&((L=ct.value)!=null&&L.enabled))}),_o=B(()=>!!(D&&mn.value)),Un=B(()=>{var L;return!!(!X.value&&((L=o.virtualScroll)!=null&&L.enabled))}),Ps=B(()=>Un.value),Je=U(!1);xn(()=>{Je.value=!0});const ze=B(()=>!!(D&&Un.value));jn("markstreamHostScrollManaged",ze);const wt=B(()=>!!(Je.value&&ze.value)),Mt=B(()=>_o.value||ze.value),tn=B(()=>_o.value||wt.value),Xn=B(()=>{var L;return Mt.value&&((L=ct.value)==null?void 0:L.textEstimation)!==!1});function Jn(){const L=se.value||Kt("getMeasuredContainerWidth.clientWidth",()=>{var K;return((K=A.value)==null?void 0:K.clientWidth)||0});return Number.isFinite(L)&&L>0?L:0}const Es=B(()=>{const L=Jn();return L>0?Math.max(1,Math.round(L)):640}),Xo=B(()=>{var L,K;return!(dt.value!==!0||Un.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(L=o.nodes)!=null&&L.length||Dt.value||!(((K=C.maxLiveNodes)!=null?K:0)<=0))}),ro=B(()=>{var L;return Xo.value?50:Math.max(1,(L=C.maxLiveNodes)!=null?L:320)}),uo=B(()=>{var L;return Xo.value?16:Math.max(0,(L=C.liveNodeBuffer)!=null?L:60)}),vn=B(()=>{var L;return!X.value&&C.nodeVirtual!==!1&&!(((L=C.maxLiveNodes)!=null?L:0)<=0&&!Xo.value)&&(C.nodeVirtual===!0?Ct.value.length>0:Ct.value.length>ro.value)}),Hs=B(()=>vn.value||_o.value||ze.value),bs=B(()=>C.viewportPriority!==!1),Ci=B(()=>!!bs.value&&!W.value);var ir;ir=B(()=>bs.value),jn(FL,ir);const Is=B(()=>{var L;return!(X.value||C.deferNodesUntilVisible===!1||((L=C.maxLiveNodes)!=null?L:0)<=0||vn.value||Ct.value.length>900||C.viewportPriority===!1)}),Ys=Due(L=>{var K;return ye((K=L??A.value)!=null?K:null)},bs),{requestFrame:io,cancelFrame:Io,hasIdleCallback:yr,isTestEnv:kr}=(function(L){const K=L.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,le=L.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ae=L.isClient&&typeof window.requestIdleCallback=="function",we=(function(){var Ne;if(typeof globalThis>"u"||!("process"in globalThis))return;const Oe=(Ne=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ne.value;return Oe?.env})();return{requestFrame:K,cancelFrame:le,hasIdleCallback:ae,isTestEnv:we?.NODE_ENV==="test"}})({isClient:D}),si=B(()=>dt.value===!0&&!Un.value),{resolvedBatchSize:Or,resolvedInitialBatch:Pr,batchingEnabled:Ee,incrementalRenderingActive:Ae,renderedCount:De,previousRenderContext:Ut,adaptiveBatchSize:dn,previousBatchConfig:zn}=(function(L,K){var le;const ae=B(()=>{var ot;const Pe=Math.trunc((ot=L.renderBatchSize)!=null?ot:80);return Number.isFinite(Pe)?Math.max(0,Pe):0}),we=B(()=>{var ot;const Pe=Math.trunc((ot=L.initialRenderBatchSize)!=null?ot:ae.value);return Number.isFinite(Pe)?Math.max(0,Pe):ae.value}),Ne=B(()=>!K.renderAsFragment.value&&L.batchRendering!==!1&&ae.value>0&&K.isClient&&!K.isTestEnv),Oe=U(0),Ve=U({key:L.indexKey,total:0}),st=U(Math.max(1,ae.value||1)),We=B(()=>{var ot,Pe,Xe;return Ne.value&&!((ot=K.continuousStreaming)!=null&&ot.value)&&!((Pe=K.forceFullRenderFinalContent)!=null&&Pe.value)&&((Xe=L.maxLiveNodes)!=null?Xe:0)<=0}),Ye=U({batchSize:ae.value,initial:we.value,delay:(le=L.renderBatchDelay)!=null?le:16,enabled:We.value});return{resolvedBatchSize:ae,resolvedInitialBatch:we,batchingEnabled:Ne,incrementalRenderingActive:We,renderedCount:Oe,previousRenderContext:Ve,adaptiveBatchSize:st,previousBatchConfig:Ye}})(C,{isClient:D,isTestEnv:kr,renderAsFragment:X,forceFullRenderFinalContent:si,continuousStreaming:B(()=>Qt.value&&dt.value!==!0)}),So=B(()=>{var L;return!X.value&&C.batchRendering!==!1&&Or.value>0&&!kr&&((L=C.maxLiveNodes)!=null?L:0)<=0&&!si.value}),Jo=B(()=>So.value),Qo=B(()=>Mt.value||Jo.value),Mi=B(()=>{var L;return Qo.value&&((L=ct.value)==null?void 0:L.codeBlockEstimation)!==!1}),es=new Map,is=new Map,ie=new WeakMap;let _e=null;const Ie=new WeakMap,je=new Map,nt=[];let kt=[],Pt=[],jt=-1;const Ln=jo(nt),cn=new Set,Rn=U(0);let wo=0;const qt=U(0),$n=B(()=>(qt.value,Array.from(es.entries()).sort((L,K)=>L[0]-K[0]))),Nn=U(null),qe=U(null);let he,$e=null,bn=0,ri=null;function Ls(){he.markFallbackHeightPrefixDirty()}function $0(L){return he.getFallbackNodeHeight(L)}function ua(L,K){return he.estimateHeightRange(L,K)}function bu(L){return he.estimateIndexForOffset(L)}const{activeRestoreAnchor:da,getRelativeScrollTopWithinContainer:n6,setRelativeScrollTopWithinContainer:kl,resolveAnchorOffset:_u,clearRestoreReconcile:N0,scheduleRestoreReconcile:_1,captureRestoreAnchor:df,restoreAnchor:ff,getAnchorDrift:xu}=(function(L){const{isClient:K,containerRef:le,parsedNodeCount:ae,requestFrame:we,cancelFrame:Ne,resolveScrollContainer:Oe,getNormalizedScrollTop:Ve,getOffsetTopWithinRoot:st,isReverseFlexScrollRoot:We,estimateIndexForOffset:Ye,estimateHeightRange:ot,getFallbackNodeHeight:Pe,clamp:Xe}=L,ft=U(null);let ut=null,Et=[];function yt(){const nn=Oe(),_n=le.value;if(!nn||!_n)return null;const En=nn.ownerDocument||_n.ownerDocument||document;if(nn===En.documentElement||nn===En.body||nn===En.scrollingElement){const fo=_n.getBoundingClientRect();return Math.max(0,-fo.top)}return Math.max(0,Ve(nn,En,!1)-st(_n,nn))}function Ot(nn){var _n;const En=Oe(),fo=le.value;if(!En||!fo)return;const Vs=Math.max(0,nn),$s=En.ownerDocument||fo.ownerDocument||document,$i=$s.defaultView||(typeof window<"u"?window:null);if(En===$s.documentElement||En===$s.body||En===$s.scrollingElement){const tl=Ve(En,$s,!0)+fo.getBoundingClientRect().top;return void((_n=$i?.scrollTo)==null||_n.call($i,0,Math.max(0,tl+Vs)))}Fx(En,$s,st(fo,En)+Vs,{isReverseFlexScrollRoot:tl=>{var Ku;return(Ku=We?.(tl))!=null&&Ku},getNormalizedScrollTop:Ve})}function Ht(nn){const _n=ae.value,En=Xe(nn.nodeIndex,0,Math.max(0,_n-1));return ot(0,En)+Math.max(0,nn.offsetWithinNodePx)}function Jt(){if(ut!=null&&(Ne?.(ut),ut=null),K)for(const nn of Et)window.clearTimeout(nn);Et=[]}function Gt(nn){const _n=Ht(nn),En=yt();En!=null&&Math.abs(En-_n)<=.5||Ot(_n)}return{activeRestoreAnchor:ft,getRelativeScrollTopWithinContainer:yt,setRelativeScrollTopWithinContainer:Ot,resolveAnchorOffset:Ht,clearRestoreReconcile:Jt,applyRestoreAnchor:Gt,scheduleRestoreReconcile:function(){ft.value&&K&&ut==null&&(ut=we?we(()=>{ut=null,ft.value&&Gt(ft.value)}):null,ut==null&&ft.value&&Gt(ft.value))},captureRestoreAnchor:function(){const nn=yt(),_n=ae.value;if(nn==null||_n<=0)return null;const En=Xe(Ye(nn+1),0,_n-1),fo=ot(0,En),Vs=Pe(En);return{nodeIndex:En,offsetWithinNodePx:Xe(nn-fo,0,Math.max(0,Vs-1))}},restoreAnchor:function(nn){const _n=ae.value;if(ft.value={nodeIndex:Xe(nn.nodeIndex,0,Math.max(0,_n-1)),offsetWithinNodePx:Math.max(0,nn.offsetWithinNodePx)},Jt(),Gt(ft.value),K)for(const En of[0,120,280,480])Et.push(window.setTimeout(()=>{ft.value&&Gt(ft.value)},En))},getAnchorDrift:function(nn){const _n=yt();return _n==null?null:_n-Ht(nn)}}})({isClient:D,containerRef:A,parsedNodeCount:Os,requestFrame:io,cancelFrame:Io,resolveScrollContainer:()=>Nn.value||Ce(),getNormalizedScrollTop:be,getOffsetTopWithinRoot:re,isReverseFlexScrollRoot:me,estimateIndexForOffset:bu,estimateHeightRange:ua,getFallbackNodeHeight:$0,clamp:Ds}),{nodeHeights:fa,heightStats:Xs,heightTreeSize:x1,heightSumTree:o6,heightKnownTree:pa,averageNodeHeight:Ai,resetHeightMeasurements:pf,pruneHeightMeasurements:hf,rebuildHeightTrees:bl,recordNodeHeight:mf,removeNodeHeights:s6,exportHeightCache:ha,importHeightCache:z0,fenwickRangeSum:Su}=(function(L={}){const K=Rs({}),le=Rs({total:0,count:0}),ae=U(0),we=U([]),Ne=U([]);function Oe(){for(const Pe of Object.keys(K))delete K[Number(Pe)];le.total=0,le.count=0,ae.value=0,we.value=[],Ne.value=[]}function Ve(Pe,Xe,ft){for(let ut=Xe+1;ut0;ut-=ut&-ut)ft+=Pe[ut];return ft}function We(Pe){ae.value=Pe;const Xe=new Array(Pe+1).fill(0),ft=new Array(Pe+1).fill(0);for(const[ut,Et]of Object.entries(K)){const yt=Number(ut),Ot=Number(Et);!Number.isFinite(yt)||yt<0||yt>=Pe||!Number.isFinite(Ot)||Ot<=0||(Ve(Xe,yt,Ot),Ve(ft,yt,1))}we.value=Xe,Ne.value=ft}function Ye(Pe){if(!Number.isInteger(Pe)||Pe<0)return!1;const Xe=K[Pe];if(!Number.isFinite(Xe)||Xe<=0)return!1;if(delete K[Pe],le.total=Math.max(0,le.total-Xe),le.count=Math.max(0,le.count-1),ae.value>Pe){const ft=we.value,ut=Ne.value;ft.length&&ut.length&&(Ve(ft,Pe,-Xe),Ve(ut,Pe,-1))}return!0}const ot=B(()=>le.count>0?Math.max(12,le.total/le.count):32);return{nodeHeights:K,heightStats:le,heightTreeSize:ae,heightSumTree:we,heightKnownTree:Ne,averageNodeHeight:ot,resetHeightMeasurements:Oe,pruneHeightMeasurements:function(Pe){if(Pe<=0)return void Oe();let Xe=0,ft=0;for(const[ut,Et]of Object.entries(K)){const yt=Number(ut),Ot=Number(Et);!Number.isFinite(yt)||yt<0||yt>=Pe||!Number.isFinite(Ot)||Ot<=0?delete K[yt]:(Xe+=Ot,ft++)}le.total=Xe,le.count=ft},rebuildHeightTrees:We,recordNodeHeight:function(Pe,Xe,ft={}){(function(ut,Et,yt={}){var Ot;if(!Number.isFinite(Et)||Et<=0)return!1;const Ht=K[ut];if(Ht&&(yt.allowShrink===!1&&Etut){const Jt=we.value,Gt=Ne.value;if(Jt.length&&Gt.length)if(Ht){const nn=Et-Ht;nn!==0&&Ve(Jt,ut,nn)}else Ve(Jt,ut,Et),Ve(Gt,ut,1)}yt.notify!==!1&&((Ot=L.onHeightRecorded)==null||Ot.call(L))})(Pe,Xe,gn(_t({},ft),{notify:!0}))},removeNodeHeight:function(Pe,Xe={}){var ft;const ut=Ye(Pe);return ut&&Xe.notify!==!1&&((ft=L.onHeightRecorded)==null||ft.call(L)),ut},removeNodeHeights:function(Pe,Xe={}){var ft;let ut=0;for(const Et of Pe)Ye(Number(Et))&&ut++;return ut>0&&Xe.notify!==!1&&((ft=L.onHeightRecorded)==null||ft.call(L)),ut},exportHeightCache:function(){return Object.entries(K).map(([Pe,Xe])=>({index:Number(Pe),height:Number(Xe)})).filter(Pe=>Number.isFinite(Pe.index)&&Pe.index>=0&&Number.isFinite(Pe.height)&&Pe.height>0).sort((Pe,Xe)=>Pe.index-Xe.index)},importHeightCache:function(Pe,Xe={}){var ft;if(!Array.isArray(Pe))return;const ut=ae.value;let Et=!1;if(Xe.mode!=="merge"){const yt=Object.keys(K);if(yt.length>0){for(const Ot of yt)delete K[Number(Ot)];Et=!0}}for(const yt of Pe){const Ot=Number(yt.index),Ht=Number(yt.height);if(!Number.isInteger(Ot)||Ot<0||ut>0&&Ot>=ut||!Number.isFinite(Ht)||Ht<=0)continue;const Jt=K[Ot];Jt&&Math.abs(Jt-Ht)<=1||(K[Ot]=Ht,Et=!0)}Et&&((function(){let yt=0,Ot=0;const Ht=ae.value;for(const[Jt,Gt]of Object.entries(K)){const nn=Number(Jt),_n=Number(Gt);!Number.isFinite(nn)||nn<0||Ht>0&&nn>=Ht||!Number.isFinite(_n)||_n<=0?delete K[nn]:(yt+=_n,Ot++)}le.total=yt,le.count=Ot})(),ut>0&&We(ut),(ft=L.onHeightRecorded)==null||ft.call(L))},fenwickRangeSum:function(Pe,Xe,ft){if(ft<=Xe)return 0;const ut=st(Pe,ft-1);return Xe<=0?ut:ut-st(Pe,Xe-1)}}})({onHeightRecorded:()=>{Ls(),ze.value&&Du(),da.value&&_1(),qe.value&&D0(),Mo("node-resize")}});function gf(L){Number.isInteger(L)&&L>=0&&cn.add(L)}function Cu(L){for(const K of L)gf(Number(K))}function Qi(L){wo++;let K=!0;try{const le=L();return K=le!==!1,le}finally{wo--,wo===0&&K&&Rn.value++}}function Mu(){kt=[],Pt=[],jt=-1,cn.clear(),Ln.value=nt}function Ti(){Mu(),Qi(()=>pf()),je.clear()}function vf(L){!Number.isInteger(L)||L<0||L>=Ct.value.length||je.set(L,Lu(L))}function Au(L,K,le={}){const ae=fa[L];gf(L),mf(L,K,le);const we=fa[L];return Object.is(ae,we)?(cn.delete(L),!1):(we&&we>0?vf(L):ae&&je.delete(L),!0)}function wf(L,K){const le=Kt("getNodeLayoutHeight.slot.offsetHeight",()=>{var ae,we;return(we=(ae=es.get(L))==null?void 0:ae.offsetHeight)!=null?we:0});return le>0?le:Kt("getNodeLayoutHeight.content.offsetHeight",()=>K.offsetHeight)}function Tu(L,K={}){K.mode!=="merge"?Mu():Cu(L.map(le=>le.index)),Qi(()=>z0(L,K)),$6()}const Se=B(()=>Is.value&&Ci.value),it=B(()=>{var L;return!X.value&&C.batchRendering!==!1&&Or.value>0&&((L=C.maxLiveNodes)!=null?L:0)<=0}),pt=B(()=>!X.value&&$t&&dt.value===!0&&!vn.value&&!Un.value&&!mn.value&&!Se.value&&!it.value),un=B(()=>!!Ys&&Se.value),Co=B(()=>vn.value||ze.value),{focusIndex:Vo,liveRange:Wo,updateLiveRange:S1}=(function(L,K){const{parsedNodeCount:le,virtualizationEnabled:ae,maxLiveNodesResolved:we,liveNodeBufferResolved:Ne,clamp:Oe}=K,Ve=Ne??B(()=>{var Ye;return Math.max(0,(Ye=L.liveNodeBuffer)!=null?Ye:60)}),st=U(0),We=Rs({start:0,end:0});return{liveNodeBufferResolved:Ve,focusIndex:st,liveRange:We,updateLiveRange:function(){const Ye=le.value;if(!ae.value||Ye===0)return We.start=0,void(We.end=Ye);const ot=Math.min(we.value,Ye),Pe=Ve.value,Xe=Oe(st.value-Pe,0,Math.max(0,Ye-ot));We.start=Xe,We.end=Math.min(Ye,Xe+ot)}}})(C,{parsedNodeCount:Os,virtualizationEnabled:vn,maxLiveNodesResolved:ro,liveNodeBufferResolved:uo,clamp:Ds}),Hr=new Map,Ei=new Map,Ii=new Map,yf=[],_l=new Map,ma=new Set,F9=U(0);let r6=!1;const j9=B(()=>(F9.value,ma.size)),Dr=new Map,el=new Map,O9=U(0),i6=B(()=>{O9.value;let L=0;for(const K of Dr.values())L+=Math.max(0,K);return L});let Vr=null;const kf=B(()=>{if(!vn.value)return Ct.value.length;const L=uo.value,K=Math.max(Wo.end+L,Pr.value),le=Math.min(Ct.value.length,K);return Math.max(De.value,le)});function bf(){r6||(r6=!0,queueMicrotask(()=>{r6=!1,F9.value+=1}))}function P9(L,K,le="node-resize"){if(!D||typeof window>"u")return null;const ae=window.setTimeout(()=>{ma.delete(ae)&&bf();try{K()}finally{Mo(le)}},Math.max(0,L));return ma.add(ae),bf(),ae}function _f(L){D&&L!=null&&(ma.delete(L)&&bf(),window.clearTimeout(L))}function H9(){if(D&&typeof window<"u")for(const L of ma)window.clearTimeout(L);ma.size&&(ma.clear(),bf()),yf.length=0,Ii.clear()}function Hz(L){F.value=L}function Dz(L){j.value=L}function Vz(L){q.value=L}const{cancelScheduledFocusSync:l6,scheduleFocusSync:Li}=(function(L){const{isClient:K,containerRef:le,virtualizationEnabled:ae,requestFrame:we,cancelFrame:Ne,syncFocusToScroll:Oe}=L;let Ve=null;function st(){var Ye,ot,Pe;return(Pe=(ot=(Ye=le.value)==null?void 0:Ye.ownerDocument)==null?void 0:ot.defaultView)!=null?Pe:typeof window<"u"?window:null}function We(){if(!Ve)return;const Ye=st();Ve.viaTimeout?Ye?Ye.clearTimeout(Ve.id):clearTimeout(Ve.id):Ne?.(Ve.id),Ve=null}return{cancelScheduledFocusSync:We,scheduleFocusSync:function(Ye={}){if(!ae.value)return;if(!K)return void Oe(!0);if(Ye.immediate)return We(),void Oe(!0);if(Ve)return;const ot=()=>{Ve=null,Oe()};if(we)return void(Ve={id:we(ot),viaTimeout:!1});const Pe=st();Ve={id:Pe?Pe.setTimeout(ot,16):setTimeout(ot,16),viaTimeout:!0}}}})({isClient:D,containerRef:A,virtualizationEnabled:vn,requestFrame:io,cancelFrame:Io,syncFocusToScroll:function(L=!1){var K;if(!vn.value)return;const le=Nn.value||Ce();if(!le)return;const ae=le.ownerDocument||((K=A.value)==null?void 0:K.ownerDocument)||document,we=ae?.defaultView||(typeof window<"u"?window:null),Ne=le===ae?.documentElement||le===ae?.body,Oe=Ct.value.length;if(Oe<=0)return;if(!Ne&&Oe>0&&me(le)){const ut=Kt("syncFocusToScroll.clientHeight",()=>le.clientHeight||0),Et=Kt("syncFocusToScroll.scrollTop",()=>le.scrollTop),yt=Et<0?-Et:Et;return void Cf(Ds((Ve=Math.max(0,yt)+.5*Math.max(0,ut),he.estimateIndexForOffsetFromEnd(Ve)),0,Math.max(0,Oe-1)),L)}var Ve;const st=(function(ut,Et,yt,Ot){const Ht=A.value;if(!Ht)return null;const Jt=Ot?0:Kt("syncFocusToScroll.model.root.getBoundingClientRect",()=>ut.getBoundingClientRect().top),Gt=Kt("syncFocusToScroll.model.container.getBoundingClientRect",()=>Ht.getBoundingClientRect().top),nn=Math.max(0,Jt-Gt),_n=Ot?Kt("syncFocusToScroll.model.viewport.clientHeight",()=>{var En,fo,Vs,$s;return($s=(Vs=(fo=yt?.innerHeight)!=null?fo:(En=Et.documentElement)==null?void 0:En.clientHeight)!=null?Vs:ut.clientHeight)!=null?$s:0}):Kt("syncFocusToScroll.model.root.clientHeight",()=>ut.clientHeight);return Ds(bu(nn+.5*Math.max(0,_n)),0,Math.max(0,Ct.value.length-1))})(le,ae,we,Ne);if(st!=null)return void Cf(st,L);const We=Ne?null:Kt("syncFocusToScroll.root.getBoundingClientRect",()=>le.getBoundingClientRect()),Ye=Ne?0:We.top,ot=Ne?Kt("syncFocusToScroll.viewport.clientHeight",()=>{var ut,Et;return(Et=(ut=we?.innerHeight)!=null?ut:le.clientHeight)!=null?Et:0}):We.bottom,Pe=$n.value;let Xe=null,ft=null;for(const[ut,Et]of Pe){if(!Et)continue;const yt=Kt("syncFocusToScroll.slot.getBoundingClientRect",()=>Et.getBoundingClientRect());yt.bottom<=Ye||yt.top>=ot||(Xe==null&&(Xe=ut),ft=ut)}if(Xe==null||ft==null){const ut=A.value;if(!ut)return;const Et=Ne?{top:0}:Kt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>le.getBoundingClientRect()),yt=Kt("syncFocusToScroll.fallback.scrollTop",()=>be(le,ae,Ne)),Ot=Ne?(()=>{const Jt=Kt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>ut.getBoundingClientRect()),Gt=(Ne?0:Et.top)-Jt.top;return Math.max(0,Gt)})():(()=>{const Jt=re(ut,le);return Math.max(0,yt-Jt)})(),Ht=Ne?Kt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Jt,Gt,nn,_n;return(_n=(nn=(Gt=we?.innerHeight)!=null?Gt:(Jt=ae?.documentElement)==null?void 0:Jt.clientHeight)!=null?nn:le.clientHeight)!=null?_n:0}):Kt("syncFocusToScroll.fallback.root.clientHeight",()=>le.clientHeight);return void Cf(Ds(bu(Ot+.5*Math.max(0,Ht)),0,Math.max(0,Ct.value.length-1)),!0)}Cf(Math.round((Xe+ft)/2),L)}}),{visibleNodeIndices:a6,nodeVisibilityHandles:B0,nodeVisibilityWatchStops:xf,nodeVisibilityFallbackTimers:D9,clearVisibilityFallback:Sf,markNodeVisible:ga,cleanupNodeVisibility:Wz,destroyNodeVisibilityState:c6}=cfe({isClient:D,shouldTrackVisibleNodeIndices:()=>Se.value,shouldCleanupNodeVisibility:()=>vn.value,onNodeMarkedVisible:L=>{vn.value?Li():Vo.value=Ds(L,0,Math.max(0,Ct.value.length-1))},onNodeVisibilityCleaned:L=>{es.delete(L)&&gw()}}),{cleanupScrollListener:V9,setupScrollListener:qz}=(function(L){const{isClient:K,virtualizationEnabled:le,listenerEnabled:ae,scrollRootElement:we,resolveScrollContainer:Ne,scheduleFocusSync:Oe,onScroll:Ve}=L;let st=null,We=null;function Ye(){st&&(st(),st=null),We=null,we.value=null}function ot(Pe){const Xe=L.getScrollTop?L.getScrollTop(Pe):Pe.scrollTop;return Math.max(0,Number.isFinite(Xe)?Math.abs(Xe):0)}return{cleanupScrollListener:Ye,setupScrollListener:function(){if(!K)return;if(!((Pe=ae?.value)!=null?Pe:le.value))return void Ye();var Pe;const Xe=Ne();if(!Xe)return void Ye();if(we.value===Xe&&st)return;Ye(),We=ot(Xe);const ft=()=>{if(Ve?.(),le.value){const ut=(function(Et){const yt=ot(Et),Ot=We;We=yt;const Ht=Math.max(480,.75*(Et.clientHeight||0));return Ot==null?yt>Ht?{immediate:!0}:void 0:Math.abs(yt-Ot)>Ht?{immediate:!0}:void 0})(Xe);ut?Oe(ut):Oe()}};Xe.addEventListener("scroll",ft,{passive:!0}),we.value=Xe,st=()=>{Xe.removeEventListener("scroll",ft)}}}})({isClient:D,virtualizationEnabled:vn,listenerEnabled:Co,scrollRootElement:Nn,resolveScrollContainer:Ce,scheduleFocusSync:Li,onScroll:function(){const L=qe.value;if(!L)return;const K=Iu();if(!K||(function(ae){if(Ru()>=bn)return ri=null,!1;const we=ri;if(we==null)return!0;const Ne=Math.abs(ae.scrollTop-we)<=2;return Ne||(ri=null),Ne})(K))return;const le=sw(K);le!=null?(le<-32||Math.abs(Math.max(0,le)-Math.max(0,L.distanceFromBottomPx))>32)&&H0("restore"):H0("restore")},getScrollTop:L=>{var K;const le=L.ownerDocument||((K=A.value)==null?void 0:K.ownerDocument)||document,ae=L===le.documentElement||L===le.body||L===le.scrollingElement;return Kt("scrollListener.getScrollTop",()=>be(L,le,ae))}});function Cf(L,K=!1){const le=Ds(L,0,Math.max(0,Ct.value.length-1));!K&&Math.abs(le-Vo.value)<=1||(Vo.value=le,S1())}function Ds(L,K,le){return Math.min(Math.max(L,K),le)}function u6(L=Ct.value.length){const K=so();return!Number.isInteger(K)||K<0?L:Ds(K,0,L)}function d6(L){return L?.firstElementChild}function W9(L,K){var le;return L?(le=L.matches)!=null&&le.call(L,K)?L:L.querySelector(K):null}function Uz(L,K){L<1||L>6||(P[L]=K)}function q9(){if(!Mt.value)return void(se.value=0);const L=Kt("updateExperimentContainerWidth.clientWidth",()=>{var K,le;return(le=(K=A.value)==null?void 0:K.clientWidth)!=null?le:0});se.value=L>0?L:0}let Eu=null;function f6(){Eu?.disconnect(),Eu=null}const U9=E2("ViewportDeferredMarkdownCodeBlockNode",mi({loader:()=>To(null,null,function*(){return(yield ps(()=>import("./index5-D2VkNHFs.js"),__vite__mapDeps([8,6,7]))).default}),loadingComponent:x5,delay:0,suspensible:!1}),x5);function Z9(L){return L===U9}const K9=B(()=>h.value==="pre"?Tr:h.value==="shiki"?U9:Qh);function G9(){var L;return((L=C.codeBlockProps)==null?void 0:L.showHeader)!==!1}function Y9(L,K,le){const ae=fa[K],we=typeof ae=="number"&&ae>0;if(Xn.value&&!we&&!(function(Ne){return!!ao.value.paragraph&&(Ne.type==="paragraph"||Ne.type==="list_item"||Ne.type==="list")})(L)){const Ne=VL(L,le,oe.value);if(Ne)return Ne}if(Mi.value&&L.type==="code_block"){const Ne=(function(Oe){if(Oe.type!=="code_block")return null;const Ve=Tw(Oe,Bf(Oe));return Z9(Ve)?"markdown":Ve===Tr?"pre":Ve===K9.value||Ve===Qh?"monaco":null})(L);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return(function(Oe,Ve){var st,We,Ye;if(!Oe||Oe.type!=="code_block")return null;const ot=Ve.rendererKind,Pe=ot!=="pre"&&Ve.showHeader!==!1,Xe=!!Oe.diff;let ft=0,ut=500;if(ot==="monaco"){const yt=(st=Ve.monacoOptions)!=null?st:{},Ot=am(Oe,yt,Ve.width),Ht=(function(Gt){const nn=typeof Gt?.fontSize=="number"&&Gt.fontSize>0?Gt.fontSize:12;return typeof Gt?.lineHeight=="number"&&Gt.lineHeight>0?Gt.lineHeight:Math.round(1.5*nn)})(yt),Jt=(function(Gt,nn){var _n,En;const fo=typeof((_n=Gt?.padding)==null?void 0:_n.top)=="number"?Gt.padding.top:nn?0:8,Vs=typeof((En=Gt?.padding)==null?void 0:En.bottom)=="number"?Gt.padding.bottom:nn?0:8;return Math.max(0,fo)+Math.max(0,Vs)})(yt,Xe);ut=typeof yt.MAX_HEIGHT=="number"&&yt.MAX_HEIGHT>0?yt.MAX_HEIGHT:500,ft=Math.round(Ot*Ht+Jt)}else if(ot==="markdown"){const yt=am(Oe);ft=Math.round(21*yt+32)}else{const yt=am(Oe);ft=Math.round(28*yt),ut=Number.POSITIVE_INFINITY}const Et=Math.max(1,Math.min(ft,ut));return _t({kind:"code-block",height:Math.round(Et+(Pe?40:0)),contentHeight:Et,rendererKind:ot},Xe&&ot==="monaco"?{diffInline:mv((We=Ve.monacoOptions)!=null?We:{},(Ye=Ve.width)!=null?Ye:0)}:{})})(L,{rendererKind:Ne,monacoOptions:C.codeBlockMonacoOptions,showHeader:G9(),width:le})}return null}FM(()=>{if(Rn.value,wo>0)return;const L=Ct.value,K=Bn();if(!L.length||!Qo.value)return kt=[],Pt=[],jt=-1,cn.clear(),void(Ln.value=nt);const le=se.value||Kt("estimatedNodeHeights.clientWidth",()=>{var We;return((We=A.value)==null?void 0:We.clientWidth)||0});if(!Number.isFinite(le)||le<=0)return kt=[],Pt=[],jt=-1,cn.clear(),void(Ln.value=nt);const ae=(function(We){return[Math.round(We),Xn.value,Mi.value,oe.value,C.codeBlockMonacoOptions,G9(),h.value,ao.value,rm.value]})(le),we=kt.length<=L.length&&(Oe=ae,(Ne=Pt).length===Oe.length&&Ne.every((We,Ye)=>Object.is(We,Oe[Ye])));var Ne,Oe;const Ve=we&&jt===K?L.length:we?u6(L.length):0,st=we?Array.from(cn):[];kt.length=L.length;for(let We=Ve;We=0&&WeLn.value);he=(function(L){let K=!0,le=[0],ae="";function we(Ye){var ot;const Pe=L.nodeHeights[Ye];if(Number.isFinite(Pe)&&Pe>0)return Pe;const Xe=L.parsedNodes.value[Ye],ft=Xe?.type,ut=!!((ot=L.hasCustomParagraphComponent)!=null&&ot.call(L)),Et=L.estimatedNodeHeights.value[Ye],yt=Et?.height;if(!(function(Ht,Jt,Gt){return!!(Gt&&Jt?.kind==="simple-text"&&(Ht==="paragraph"||Ht==="list_item"||Ht==="list"))})(ft,Et,ut)&&Number.isFinite(yt)&&yt>0)return yt;const Ot=Xde(Xe,L.getContainerWidth()||640);return ft==="heading"||ft==="paragraph"&&Ot<=28&&(function(Ht,Jt){if(Jt)return!1;const Gt=Ht.children;return!Array.isArray(Gt)||!Gt.length||Gt.every(qL)})(Xe,ut)?Ot:Math.max(L.averageNodeHeight.value,Ot)}function Ne(){var Ye;const ot=L.parsedNodes.value.length,Pe=L.getPrefixCacheKeyParts().join(":");if(!K&&ae===Pe)return le;const Xe=new Array(ot+1);Xe[0]=0;for(let ft=0;ft=((ot=ft[Xe])!=null?ot:0))return Xe-1;let ut=0,Et=Xe-1,yt=Xe-1;for(;ut<=Et;){const Ot=ut+Et>>1;((Pe=ft[Ot+1])!=null?Pe:0)>=Ye?(yt=Ot,Et=Ot-1):ut=Ot+1}return yt}function Ve(Ye,ot){var Pe,Xe;if(Ye>=ot)return 0;if(L.heightEstimationActive.value)return(function(Et,yt){var Ot,Ht;const Jt=L.parsedNodes.value.length,Gt=Px(Math.trunc(Et),0,Jt),nn=Px(Math.trunc(yt),Gt,Jt);if(Gt>=nn)return 0;const _n=Ne();return((Ot=_n[nn])!=null?Ot:0)-((Ht=_n[Gt])!=null?Ht:0)})(Ye,ot);if(L.heightTreeSize.value!==L.parsedNodes.value.length){let Et=0;for(let yt=Ye;ytGt<=0?0:L.fenwickRangeSum(ut,0,Gt)+(Gt-L.fenwickRangeSum(Et,0,Gt))*ft;let Ot=0,Ht=Pe.length-1,Jt=Pe.length-1;for(;Ot<=Ht;){const Gt=Ot+Ht>>1;yt(Gt+1)>=Ye?(Jt=Gt,Ht=Gt-1):Ot=Gt+1}return Jt}let Xe=Ye;for(let ft=0;ft0||Ye++}return Ye}return{markFallbackHeightPrefixDirty:function(){K=!0},getFallbackNodeHeight:we,estimateHeightRange:Ve,estimateIndexForOffset:st,estimateIndexForOffsetFromEnd:function(Ye){var ot,Pe;const Xe=L.parsedNodes.value;if(!Xe.length)return 0;if(Ye<=0)return Math.max(0,Xe.length-1);if(L.heightEstimationActive.value){const ut=(ot=Ne()[Xe.length])!=null?ot:0;return Oe(Math.max(0,ut-Ye))}if(L.heightTreeSize.value===Xe.length){const ut=Ve(0,Xe.length);return st(Math.max(0,ut-Ye))}let ft=Ye;for(let ut=Xe.length-1;ut>=0;ut--){const Et=(Pe=L.nodeHeights[ut])!=null?Pe:L.averageNodeHeight.value;if(ft<=Et)return ut;ft-=Et}return 0},getEstimatedNodeHeightCount:We,buildVirtualHeightSummary:function(Ye){var ot;const Pe=L.parsedNodes.value.length;return{totalNodes:Pe,measuredCount:L.heightStats.count,estimatedCount:We(),averageNodeHeight:L.averageNodeHeight.value,topSpacerHeight:Ye.topSpacerHeight,bottomSpacerHeight:Ye.bottomSpacerHeight,estimatedTotalHeight:Ve(0,Pe),width:(ot=Ye.width)!=null?ot:L.getContainerWidth()}}}})({parsedNodes:Ct,nodeHeights:fa,heightStats:Xs,heightTreeSize:x1,heightSumTree:o6,heightKnownTree:pa,averageNodeHeight:Ai,heightEstimationActive:Mt,estimatedNodeHeights:R0,getContainerWidth:Jn,hasCustomParagraphComponent:()=>!!ao.value.paragraph,getPrefixCacheKeyParts:()=>{var L;const K=u2(se.value||Kt("getFallbackHeightPrefix.clientWidth",()=>{var ae;return((ae=A.value)==null?void 0:ae.clientWidth)||0})),le=((L=o.virtualScroll)==null?void 0:L.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[Ct.value.length,Xs.count,Math.round(Xs.total),Math.round(100*Ai.value),le,K,Mt.value?1:0,rm.value,ee.value,ao.value.paragraph?1:0]},fenwickRangeSum:Su}),Ue(()=>Ct.value.length,L=>{var K;Ls(),L<=0?Ti():(Lhf(K))),L!==x1.value&&bl(L))},{immediate:!0});const Zz=B(()=>{if(!vn.value)return Ct.value.map((ae,we)=>({node:ae,index:we}));const L=Ct.value.length,K=Ds(Wo.start,0,L),le=Ds(Wo.end,K,L);return Ct.value.slice(K,le).map((ae,we)=>({node:ae,index:K+we}))}),p6=B(()=>vn.value?ua(0,Math.min(Wo.start,Ct.value.length)):0),h6=B(()=>{if(!vn.value)return 0;const L=Ct.value.length;return ua(Math.min(Wo.end,L),L)});function X9(){return he.buildVirtualHeightSummary({topSpacerHeight:p6.value,bottomSpacerHeight:h6.value,width:C1()})}function Kz(){const L=Ct.value,K=X9();return gn(_t({},K),{probe:{paragraphReady:!!oe.value.paragraph,listItemReady:!!oe.value.listItem,listWrapperOverhead:oe.value.listWrapperOverhead,headingReadyLevels:Object.entries(oe.value.headings).filter(([,le])=>!!le).map(([le])=>Number(le))},nodes:L.map((le,ae)=>{var we,Ne,Oe,Ve,st,We,Ye,ot,Pe;return{index:ae,type:le.type,estimateKind:(Ne=(we=R0.value[ae])==null?void 0:we.kind)!=null?Ne:null,rendererKind:(Ve=(Oe=R0.value[ae])==null?void 0:Oe.rendererKind)!=null?Ve:null,estimatedHeight:(We=(st=R0.value[ae])==null?void 0:st.height)!=null?We:null,estimatedContentHeight:(ot=(Ye=R0.value[ae])==null?void 0:Ye.contentHeight)!=null?ot:null,measuredHeight:(Pe=fa[ae])!=null?Pe:null}})})}function m6(){return o.indexKey!=null?String(o.indexKey):Un.value?`virtual-${$o()}`:"markdown-renderer"}function J9(L){const K=String(L),le=`${m6()}-`;if(!K.startsWith(le))return null;const ae=K.slice(le.length).match(/^(\d+)(?:$|-)/);if(!ae)return null;const we=Number(ae[1]);return!Number.isInteger(we)||we<0||we>=Ct.value.length?null:we}function $o(){var L,K,le;const ae=(L=o.virtualScroll)==null?void 0:L.sessionKey;return String(ae!=null&&ae!==""?ae:(le=(K=o.indexKey)!=null?K:C.customId)!=null?le:no)}function ls(){var L;const K=(L=o.virtualScroll)==null?void 0:L.threadKey;return K==null||K===""?void 0:String(K)}const Gz=B(()=>{var L,K,le;return(le=ls())!=null?le:String((K=(L=o.indexKey)!=null?L:C.customId)!=null?K:no)});function g6(L){var K;return(L??"")===((K=ls())!=null?K:"")}function xl(){var L,K,le;return K=(L=o.virtualScroll)==null?void 0:L.measurementKey,le=(function(){const ae=h.value;return(function(we){var Ne,Oe;const Ve=we.renderer,st=Ve==="monaco"?we.codeBlockMonacoOptions:void 0,We=we.codeBlockProps,Ye=Ve==="shiki";return[we.isDark?"dark":"light",Ve==="monaco"?"code-rich":Ve==="pre"?"code-pre":"code-shiki",we.codeBlockStream===!1?"code-static":"code-stream",Ns(we.codeBlockMinWidth),Ns(we.codeBlockMaxWidth),...Ye?[Pce((Ne=We?.themes)!=null?Ne:we.themes,(Oe=We?.langs)!=null?Oe:we.langs)]:[],Ns(st?.fontSize),Ns(st?.lineHeight),Ns(st?.fontFamily),Ns(st?.tabSize),Ns(st?.MAX_HEIGHT),Ns(st?.wordWrap),Ns(st?.wrappingIndent),Ns(st?.padding),Ns(We?.showHeader),Ns(We?.showCopyButton),Ns(We?.showExpandButton),Ns(We?.showPreviewButton),Ns(We?.showCollapseButton),Ns(We?.showFontSizeButtons)].join("\0")})({renderer:ae,isDark:C.isDark,codeBlockStream:C.codeBlockStream,codeBlockMinWidth:C.codeBlockMinWidth,codeBlockMaxWidth:C.codeBlockMaxWidth,codeBlockMonacoOptions:ae==="monaco"?C.codeBlockMonacoOptions:void 0,codeBlockProps:C.codeBlockProps,themes:ae==="shiki"?C.themes:void 0,langs:ae==="shiki"?C.langs:void 0})})(),[K==null?"":String(K),le].join("\0")}function C1(){return Jn()}const Mf=B(()=>u2(C1())),Wr=B(()=>[xl(),Mf.value].join("\0")),Yz=B(()=>{var L;return Un.value?["virtual",(L=ls())!=null?L:"",$o(),Wr.value].join("\0"):o.indexKey});function F0(){O9.value+=1}function v6(L){return!(!L||!Number.isInteger(L.index)||L.index<0||L.index>=Ct.value.length||L.sessionKey!==$o()||L.threadKey!==ls()||L.layoutEpochKey!==Wr.value)}function Q9(L){const K=String(L),le=el.get(K);return le?v6(le)?le.index:null:J9(K)}function ew(L="async-node"){(Dr.size||el.size)&&(Dr.clear(),el.clear(),F0(),Mo(L))}const j0=pn(U8,null),w6={reportHeight(L,K){if(!ze.value)return;const le=Q9(L);if(le==null)return;const ae=Hr.get(le);if(!ae)return;const we=Number(K),Ne=wf(le,ae);(function(Oe,Ve,st={}){Qi(()=>Au(Oe,Ve,st))})(le,Number.isFinite(we)&&we>0?Math.max(we,Ne||0):Ne)},markPending(L){if(!ze.value)return;const K=J9(L);K!=null&&(function(le,ae){var we;const Ne=el.get(le);if(Ne&&v6(Ne))return Dr.set(le,Math.max(0,(we=Dr.get(le))!=null?we:0)+1),F0(),void Mo("async-node");Dr.set(le,1),el.set(le,(function(Oe){return{index:Oe,sessionKey:$o(),threadKey:ls(),layoutEpochKey:Wr.value}})(ae)),F0(),Mo("async-node")})(String(L),K)},markSettled(L){if(!ze.value)return;const K=String(L),le=Q9(L);(le!=null||(function(ae){return Dr.has(String(ae))})(K))&&(function(ae){var we;const Ne=(we=Dr.get(ae))!=null?we:0;return!(Ne<=0||(Ne<=1?(Dr.delete(ae),el.delete(ae)):Dr.set(ae,Ne-1),F0(),Ne===1&&Mo("async-node"),0))})(K)&&le!=null&&Sl()}};function Xz(){let L=0;for(const K of Hr.values())L+=Kt("getVisibleDomHeight.offsetHeight",()=>{var le;return(le=K?.offsetHeight)!=null?le:0});return Math.ceil(Math.max(0,L))}jn(U8,{reportHeight(L,K){w6.reportHeight(L,K),j0?.reportHeight(L,K)},markPending(L){w6.markPending(L),j0?.markPending(L)},markSettled(L){w6.markSettled(L),j0?.markSettled(L)}});let y6,k6=null,O0=null;function Af(L){return L!==!1&&L!=null&&L!==""}function tw(){return vn.value?(function(){if(!vn.value)return!0;const L=Ct.value.length,K=Ds(Wo.start,0,L),le=Ds(Wo.end,K,L);if(K>=le)return!0;for(let ae=K;ae=kf.value}function b6(){return dt.value===!0&&!Tt.value&&i6.value===0&&ma.size===0&&_l.size===0&&Vr==null&&tw()}function nw(){var L,K;if(((L=o.virtualScroll)==null?void 0:L.settleMode)!=="manual"||k6===$o()&&y6===ls())return!0;const le=(K=o.virtualScroll)==null?void 0:K.settledToken;return!!Af(le)&&O0===Vu(le)}function _6(){return b6()&&nw()}function Jz(L,K){return K.totalNodes<=0?L==="final"?"final":"estimate":K.measuredCount>=K.totalNodes?L==="final"?"final":"measured":K.measuredCount>0||K.estimatedCount>0?"mixed":"estimate"}function M1(L="manual",K){const le=X9(),ae=(function(we){return we||(dt.value!==!0?Ct.value.length>0?"streaming":"estimating":!tw()||_l.size>0||Vr!=null?"measuring":_6()?"settled":"settling")})(K);return{sessionKey:$o(),threadKey:ls(),phase:ae,nodeCount:le.totalNodes,liveRange:{start:Wo.start,end:Wo.end},renderedCount:De.value,measuredCount:le.measuredCount,estimatedCount:le.estimatedCount,averageNodeHeight:le.averageNodeHeight,topSpacerHeight:le.topSpacerHeight,bottomSpacerHeight:le.bottomSpacerHeight,visibleDomHeight:Xz(),totalHeight:ow(),width:le.width,final:dt.value===!0,stable:_6(),confidence:Jz(ae,le),reason:L}}function Iu(){const L=Nn.value||Ce(),K=A.value;if(!L||!K)return null;const le=L.ownerDocument||K.ownerDocument||document,ae=L===le.documentElement||L===le.body||L===le.scrollingElement,we=Kt("getScrollBox.scrollTop",()=>be(L,le,ae)),Ne=Kt("getScrollBox.scrollHeight",()=>{var Ve,st,We,Ye,ot;return ae?Math.max((st=(Ve=le.documentElement)==null?void 0:Ve.scrollHeight)!=null?st:0,(Ye=(We=le.body)==null?void 0:We.scrollHeight)!=null?Ye:0,(ot=L.scrollHeight)!=null?ot:0):L.scrollHeight}),Oe=Kt("getScrollBox.clientHeight",()=>{var Ve;return ae?((Ve=le.documentElement)==null?void 0:Ve.clientHeight)||L.clientHeight||0:L.clientHeight});return{root:L,doc:le,isViewportRoot:ae,scrollTop:we,scrollHeight:Ne,clientHeight:Oe}}function ow(){const L=Ct.value.length,K=Math.max(0,ua(0,L)),le=Kt("getRendererLogicalHeight.offsetHeight",()=>{var we,Ne;return(Ne=(we=A.value)==null?void 0:we.offsetHeight)!=null?Ne:0}),ae=Math.max(0,le>0?le:Kt("getRendererLogicalHeight.scrollHeight",()=>{var we,Ne;return(Ne=(we=A.value)==null?void 0:we.scrollHeight)!=null?Ne:0}));return L<=0?Math.ceil(le):vn.value?K>0?Math.max(1,Math.ceil(K),(function(){let we=p6.value+h6.value;for(const Ne of es.values())Ne&&(we+=Math.max(0,Kt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ne.offsetHeight||0)));return Math.ceil(Math.max(0,we))})(),(function(we,Ne){return we<=0||Ne<=0?0:Ne<=we+Math.max(512,.05*we)?Math.ceil(Ne):0})(K,ae)):Math.max(1,Math.ceil(ae)):ze.value?K>0||Xs.count>0||he.getEstimatedNodeHeightCount()>0?(Ae.value&&De.value,Math.max(1,Math.ceil(ae),Math.ceil(K))):Math.ceil(ae):Math.max(1,Math.ceil(ae),Math.ceil(K))}function sw(L){const K=A.value;if(!K)return null;const le=Kt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>K.getBoundingClientRect());return(function(we){return we.isViewportRoot?we.clientHeight:Kt("getViewportBottomInRoot.getBoundingClientRect",()=>we.root.getBoundingClientRect().bottom)})(L)-le.bottom}function Qz(L={}){const K=L.requireViewport!==!1,le=(function(Ne=64){const Oe=Iu(),Ve=A.value;if(!Oe||!Ve)return!1;const st=(function(Ye){if(Ye.isViewportRoot)return{top:0,bottom:Ye.clientHeight};const ot=Kt("getVirtualViewportRect.getBoundingClientRect",()=>Ye.root.getBoundingClientRect());return{top:ot.top,bottom:ot.bottom}})(Oe),We=Kt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ve.getBoundingClientRect());return We.bottom>=st.top-Ne&&We.top<=st.bottom+Ne})();if(K&&!le)return null;const ae=(function(){const Ne=Iu(),Oe=A.value;if(!Ne||!Oe||Math.max(0,Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight)>64)return null;const Ve=sw(Ne);return Ve==null?null:Ve>=-8&&Ve<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ve)}:null})();if(ae)return{anchor:ae,captured:!0};const we=df();if(we)return{anchor:{type:"node",nodeIndex:we.nodeIndex,offsetWithinNodePx:we.offsetWithinNodePx},captured:le};if(L.allowFallback===!0){const Ne=(function(){const Oe=Ct.value.length;return Oe<=0?null:{type:"node",nodeIndex:Ds(Vo.value,0,Math.max(0,Oe-1)),offsetWithinNodePx:0}})();return Ne?{anchor:Ne,captured:!1}:null}return null}function x6(L){let K=2166136261;for(let le=0;le>>0).toString(36)}function eB(L,K){let le=L;for(let ae=0;ae8192?`${ae.slice(0,8192)}...${ae.length}`:ae;return`${ae.length}:${x6(we)}`})(L)}`;if(typeof L=="function")return"fn";if(typeof L!="object")return typeof L;if(K.has(L))return"cycle";if(le>=6)return"max-depth";K.add(L);try{if(Array.isArray(L)){if(L.length<=160){const We=[];for(let Ye=0;Ye=Ve&&Oe.push(Ye)}return[`a:${L.length}`,`h=${Ne.join(",")}`,`t=${Oe.join(",")}`,`all=${(st>>>0).toString(36)}`].join(":")}const ae=L,we=Object.keys(ae).filter(Ne=>{const Oe=ae[Ne];return Ne!=="parent"&&Ne!=="el"&&Ne!=="component"&&(Oe==null||typeof Oe=="string"||typeof Oe=="number"||typeof Oe=="boolean"||tB.has(Ne))}).sort();return`o:${we.length}:${we.map(Ne=>`${Ne}=${Tf(ae[Ne],K,le+1)}`).join(";")}`}finally{K.delete(L)}}let S6=-1,C6="",A1=[2166136261];function Lu(L){const K=Ct.value[L];return K?x6(Tf(K)):""}function nB(L,K){let le=L;for(let ae=0;ae>>0}function M6(){var L,K;const le=ee.value;if(S6===le)return C6;const ae=Ct.value.length;let we=u6(ae);(S6!==le-1||we>ae||A1.length>>0).toString(36),S6=le,C6}function P0(L,K={}){var le;const ae=K.includeHeightCache===!0,we=(le=K.includeContentHash)!=null?le:ae,Ne=ae?(function(Ve){const st=(function(){var ut,Et;const yt=Number((Et=(ut=o.virtualScroll)==null?void 0:ut.heightCacheLimit)!=null?Et:5e3);return!Number.isFinite(yt)||yt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(yt))})();if(!Number.isFinite(st)||Ve.length<=st)return Ve;const We=new Map,Ye=ut=>{!ut||We.size>=st||We.set(ut.index,ut)},ot=Ct.value.length,Pe=Ds(Wo.start-2*uo.value,0,ot),Xe=Ds(Wo.end+2*uo.value,Pe,ot);for(const ut of Ve)ut.index>=Pe&&ut.index=0&&We.sizeut.index-Et.index).slice(0,st)})(ha().map(Ve=>{var st;const We=Ct.value[Ve.index];return We?gn(_t({},Ve),{nodeType:String((st=We.type)!=null?st:""),signature:Lu(Ve.index)}):null}).filter(Ve=>!!Ve)):[],Oe=Qz({allowFallback:K.allowAnchorFallback===!0,requireViewport:K.requireViewport});return Oe||Ne.length||K.includeEmptyState===!0?gn(_t({sessionKey:L.sessionKey,threadKey:L.threadKey},Oe?{anchor:Oe.anchor,anchorCaptured:Oe.captured}:{anchorCaptured:!1}),{metrics:L,width:L.width,contentHash:we?M6():void 0,measurementKey:xl()||void 0,heightCache:Ne.length?Ne:void 0}):null}function A6(L){var K,le;const ae=Iu();if(!ae)return;const we=(function(Ve){const st=A.value;if(!st)return null;const We=re(st,Ve.root),Ye=Ct.value.length,ot=Kt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>st.offsetHeight||0),Pe=Math.max(0,ot>0?ot:Ye>0?Kt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>st.scrollHeight||0):0),Xe=ow();return We+Math.max(Pe,Xe)})(ae);if(we==null)return;const Ne=Math.max(0,L.distanceFromBottomPx),Oe=Math.max(0,we-ae.clientHeight-Ne);(function(Ve){bn=Ru()+120,ri=Ve})(Oe),ae.isViewportRoot?(le=(K=ae.doc.defaultView)==null?void 0:K.scrollTo)==null||le.call(K,0,Oe):Fx(ae.root,ae.doc,Oe,{isReverseFlexScrollRoot:me,getNormalizedScrollTop:be})}const T6=[];function rw(){if(D)for($e!=null&&(Io?.($e),$e=null);T6.length;){const L=T6.pop();L!=null&&window.clearTimeout(L)}}function H0(L){const K=!!qe.value;qe.value=null,bn=0,ri=null,rw(),K&&L&&Mo(L)}function D0(){if(!qe.value||!D||$e!=null)return;const L=()=>{$e=null;const K=qe.value;K&&A6(K)};$e=io?io(L):null,$e==null&&L()}function iw(L,K={}){const le=Ct.value.length;return le<=0?[]:L.filter(ae=>!(!Number.isInteger(ae.index)||ae.index<0||ae.index>=le)&&!(!Number.isFinite(ae.height)||ae.height<=0)&&!(K.requireSignature&&!ae.signature)&&!(K.requireCompatibilityMetadata&&!ae.nodeType&&!ae.signature)&&(function(we){var Ne;const Oe=Ct.value[we.index];return!(!Oe||we.nodeType&&we.nodeType!==String((Ne=Oe.type)!=null?Ne:"")||we.signature&&we.signature!==Lu(we.index))})(ae))}function lw(L){const K=u2(C1()),le=u2(L);return K!==-1&&le!==-1&&K===le}function E6(L){var K;const le=Number(L?.width);if(Number.isFinite(le)&&le>0)return le;const ae=Number((K=L?.metrics)==null?void 0:K.width);return Number.isFinite(ae)&&ae>0?ae:null}function aw(L){var K;return L.sessionKey===$o()&&!!g6(L.threadKey)&&((K=L.measurementKey)!=null?K:"")===xl()&&!!lw(E6(L))&&!!(function(le){const ae=le.heightCache;return!!ae?.length&&(cw(le)?ae.some(we=>!!(we.nodeType||we.signature)):ae.some(we=>!!we.signature))})(L)}function cw(L){return!!(L.contentHash&&L.contentHash===M6())}function oB(L){return!cw(L)}let T1=null,E1=null,Ef=null,$u=null,Nu=null;function I6(L){var K;const le=L.map(we=>{var Ne,Oe;return[we.index,Math.round(10*we.height),(Ne=we.nodeType)!=null?Ne:"",(Oe=we.signature)!=null?Oe:""].join("")}).join(""),ae=u2(C1());return[(K=ls())!=null?K:"",$o(),xl(),Ct.value.length,ae,L.length,x6(le)].join(":")}function uw(L=(K=>(K=o.virtualScroll)==null?void 0:K.heightCache)()){if(!ze.value||!L?.length||Ct.value.length<=0||!lw((K=o.virtualScroll)==null?void 0:K.heightCacheWidth))return!1;var K;const le=iw(L,{requireSignature:!0});if(!le.length)return!1;const ae=I6(le);return ae===T1?(E1="standalone",!0):(Tu(le,{mode:"merge"}),Ls(),T1=ae,E1="standalone",ju(),Mo("restore"),!0)}function L6(L,K={}){var le,ae,we;if(!ze.value||!L||L.sessionKey!==$o()||!g6(L.threadKey)||Ct.value.length<=0)return!1;const Ne=!!((le=L.heightCache)!=null&&le.length)&&!If(),Oe=!L.anchor||L.anchorCaptured===!1&&K.allowUncapturedAnchor!==!0?null:L.anchor,Ve=K.restoreAnchor===!0&&!!Oe&&!If()&&Number(E6(L))>0;let st=!1;if((ae=L.heightCache)!=null&&ae.length&&aw(L)){const Ye=iw(L.heightCache,{requireCompatibilityMetadata:!L.contentHash,requireSignature:oB(L)});Ye.length&&(Tu(Ye,{mode:"merge"}),Ls(),T1=I6(Ye),E1="restore",ju(),st=!0)}if(Ne||Ve)return!1;if(!K.restoreAnchor||!Oe)return st&&Mo("restore"),!0;const We=(function(Ye,ot){var Pe;const Xe=Ye.anchor,ft=Xe?Xe.type==="bottom"?`bottom:${Math.round(Xe.distanceFromBottomPx)}`:`node:${Xe.nodeIndex}:${Math.round(Xe.offsetWithinNodePx)}`:"none";return[(Pe=ls())!=null?Pe:"",$o(),xl(),Mf.value,ot,ft].join(":")})(L,(we=K.restoreToken)!=null?we:"imperative");return Ef===We?(st&&Mo("restore"),!0):(Ef=We,(function(Ye){const ot=()=>{if(Ye.type==="node")return H0(),void ff({nodeIndex:Ye.nodeIndex,offsetWithinNodePx:Ye.offsetWithinNodePx});if(N0(),da.value=null,qe.value=Ye,rw(),A6(Ye),D)for(const Pe of[0,120,280,480])T6.push(window.setTimeout(()=>{const Xe=qe.value;Xe&&A6(Xe)},Pe))};(function(Pe){if(!vn.value)return!1;const Xe=Ct.value.length;return!(Xe<=0||(Vo.value=Pe.type==="node"?Ds(Pe.nodeIndex,0,Xe-1):Xe-1,S1(),0))})(Ye)?vt(ot):ot()})(Oe),Mo("restore"),!0)}function If(){const L=C1();return Number.isFinite(L)&&L>0}function dw(L){var K;return L.sessionKey===$o()&&!!g6(L.threadKey)&&(Ct.value.length<=0||!(!((K=L.heightCache)!=null&&K.length)||If())||!(!(L.anchor&&Number(E6(L))>0)||If()))}function $6(){je.clear();for(const L of Object.keys(fa)){const K=Number(L);Number.isInteger(K)&&K>=0&&K{let K=!1,le=null;const ae=()=>{K||(K=!0,le!=null&&window.clearTimeout(le),L())};if(io)return io(ae),void(le=window.setTimeout(ae,50));le=window.setTimeout(ae,0)})}function N6(L,K=ls(),le=Wr.value){return $o()===L&&ls()===K&&Wr.value===le}function z6(){return To(this,arguments,function*(L={}){var K,le,ae,we,Ne;const Oe=$o(),Ve=ls(),st=Wr.value,We=(K=L.frames)!=null?K:2,Ye=(le=L.timeoutMs)!=null?le:120,ot=(ae=L.reason)!=null?ae:"manual",Pe=L.expectedSettledTokenKey,Xe=L.flushPendingTimers===!0,ft=M1(ot),ut=()=>gn(_t({},ft),{phase:ft.final?"settling":ft.phase,stable:!1,confidence:ft.confidence==="final"?"mixed":ft.confidence,reason:ot}),Et=()=>N6(Oe,Ve,st)&&(Pe==null||Fu()===Pe);for(let Jt=0;Jtwindow.setTimeout(Gt,Jt))})(Ye),!Et()||(Xe&&H9(),Sl(),zu(),!Et()))return ut();const yt=b6();yt&&(k6=Oe,y6=Ve,((we=o.virtualScroll)==null?void 0:we.settleMode)==="manual"&&Pe!=null&&Af((Ne=o.virtualScroll)==null?void 0:Ne.settledToken)&&Fu()===Pe&&(O0=Vu(o.virtualScroll.settledToken)));const Ot=Et()&&yt&&nw(),Ht=M1(ot,Ot?"final":void 0);return O6(Ht,!0),Ht})}let B6="content",I1=null,L1=null,R6=0,Bu=null,V0=null,F6=null,j6=null;function Ru(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function pw(L){var K,le;const ae=Bu;if(!ae)return!0;const we=(le=(K=o.virtualScroll)==null?void 0:K.heightDiffThresholdPx)!=null?le:1;return Math.abs(L.totalHeight-ae.totalHeight)>we||L.sessionKey!==ae.sessionKey||L.phase!==ae.phase||L.stable!==ae.stable||L.final!==ae.final||L.threadKey!==ae.threadKey||L.nodeCount!==ae.nodeCount||L.measuredCount!==ae.measuredCount||L.width!==ae.width}function Fu(L=(K=>(K=o.virtualScroll)==null?void 0:K.settledToken)()){return Ns(L)}function hw(L,K){var le,ae;return[L,K.sessionKey,(le=K.threadKey)!=null?le:"",xl(),M6(),Ns((ae=o.virtualScroll)==null?void 0:ae.settledToken),Math.round(K.totalHeight),Math.round(K.width)].join("\0")}function ju(){F6=null,j6=null,V0=null}function sB(L){const K=L.heightCache;return K?.length?I6(K):""}function Ou(L){var K,le,ae;const we=L.metrics,Ne=L.anchor?(Oe=L.anchor).type==="bottom"?`bottom:${Math.round(Oe.distanceFromBottomPx)}`:`node:${Oe.nodeIndex}:${Math.round(Oe.offsetWithinNodePx)}`:"none";var Oe;return[L.sessionKey,(K=L.threadKey)!=null?K:"",(le=L.measurementKey)!=null?le:xl(),(ae=L.contentHash)!=null?ae:"",sB(L),Ne,L.anchorCaptured?1:0,we.liveRange.start,we.liveRange.end,we.renderedCount,we.nodeCount,Math.round(we.totalHeight),Math.round(we.width),we.phase,we.stable?1:0].join("\0")}function O6(L,K=!1){if(!ze.value||(function(Oe=!1){return!Oe&&Un.value&&!wt.value})(K))return;const le=K||pw(L),ae=(function(Oe,Ve=!1){return Ve||Oe.stable||Oe.phase==="final"?{state:P0(Oe,{includeHeightCache:!0})}:{state:P0(Oe)}})(L,K),we=ae.state,Ne=!!(we&&(le||(function(Oe,Ve=!1){return!!Ve||Ou(Oe)!==V0})(we,K)));if(le&&(O(L),Bu=L,R6=Ru()),we&&Ne&&(H(we),we.anchor&&V(we.anchor),V0=Ou(we)),L.stable){const Oe=hw("settled",L);if(Oe!==F6){F6=Oe;const Ve=P0(L,{includeHeightCache:!0});Ve&&(H(Ve),V0=Ou(Ve)),(function(st){s("render-settled",st)})(L)}}if(L.phase==="final"){const Oe=hw("final",L);if(Oe!==j6){j6=Oe;const Ve=P0(L,{includeHeightCache:!0});Ve&&(H(Ve),V0=Ou(Ve)),(function(st){s("render-final",st)})(L)}}}function P6(){I1!=null&&(Io?.(I1),I1=null),L1!=null&&D&&(window.clearTimeout(L1),L1=null)}function mw(){I1=null,L1=null,(function(L){if(_l.size>0||Vr!=null)return!0;switch(L){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(B6)&&(Sl(),zu()),O6(M1(B6))}function Mo(L){var K,le;if(!ze.value||(B6=L,I1!=null||L1!=null))return;const ae=Math.max(0,(le=(K=o.virtualScroll)==null?void 0:K.emitIntervalMs)!=null?le:32),we=Math.max(0,ae-(Ru()-R6)),Ne=()=>{L1=null,I1=io?io(mw):null,I1==null&&mw()};D&&we>0?L1=window.setTimeout(Ne,we):Ne()}function gw(){qt.value+=1}function Lf(L){if(Ae.value&&L>=De.value){const K=Ct.value[L],le=at.value===!0&&dt.value!==!0&&L>=Ct.value.length-2,ae=K?.type==="code_block"||K?.type==="image"||K?.type==="mermaid"||K?.type==="infographic";if(!le||ae)return!1}return!Se.value||L=et.value&&(W.value||(W.value=!0,c6()),!un.value||!Ys))return W0(L),void(K&&ga(L,!0));if(L{if(D9.delete(Ne),!Se.value||a6.value.has(Ne))return;const st=es.get(Ne);if(!st)return;const We=Ce(st),Ye=st.ownerDocument||document,ot=Ye.defaultView||window,Pe=!We||We===Ye.documentElement||We===Ye.body,Xe=!Pe&&We?Kt("nodeVisibilityFallback.root.getBoundingClientRect",()=>We.getBoundingClientRect()):null,ft=Pe?0:Xe.top,ut=Pe?Kt("nodeVisibilityFallback.clientHeight",()=>{var yt,Ot;return(Ot=(yt=ot.innerHeight)!=null?yt:We?.clientHeight)!=null?Ot:0}):Xe.bottom,Et=Kt("nodeVisibilityFallback.node.getBoundingClientRect",()=>st.getBoundingClientRect());Et.bottom>=ft-500&&Et.top<=ut+500&&ga(Ne,!0)},1800+Oe);D9.set(Ne,Ve)})(L);let we=null;we=Ue(()=>ae.isVisible.value,Ne=>{if(Ne){Sf(L),ga(L,!0),we?.(),xf.delete(L),B0.get(L)===ae&&B0.delete(L);try{ae.destroy()}catch{}}},{immediate:!0}),xf.set(L,we),vn.value&&Li()}function H6(){Vr=null,Qi(()=>{let L=!1;for(const[K,le]of _l)_l.delete(K),Hr.get(K)===le.el&&Ei.get(K)===le.version&&(L=Au(K,le.height,{allowShrink:le.allowShrink})||L);return L})}function q0(){Vr!=null&&(Io?.(Vr),Vr=null),_l.clear()}function Nf(L,K){(function(le,ae,we){var Ne;if(!Number.isFinite(we)||we<=0||Hr.get(le)!==ae)return;const Oe=Ei.get(le);if(Oe==null)return;const Ve=Ct.value[le],st=Tt.value&&dt.value!==!0&&!((Ne=o.nodes)!=null&&Ne.length)&&le>=Ct.value.length-2,We=!(Ve?.loading===!0||st),Ye=_l.get(le),ot=Ye?Ye.allowShrink&&We:We,Pe=Ye&&!ot?Math.max(Ye.height,we):we;_l.set(le,{height:Pe,allowShrink:ot,version:Oe,el:ae}),Vr==null&&(Vr=io?io(H6):null,Vr==null&&H6())})(L,K,wf(L,K))}function Sl(){for(const[L,K]of Hr)K&&Nf(L,K)}function vw(){_e?.disconnect(),_e=null,is.clear()}function D6(){for(;yf.length;)_f(yf.pop())}Ue(wt,L=>{L&&Mo("content")},{flush:"post"}),t({getVirtualMetrics:M1,captureVirtualState:function(L={}){var K;return P0(M1("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:L.allowFallbackAnchor===!0,requireViewport:L.requireViewport===!0,includeEmptyState:(K=L.includeEmptyState)==null||K})},restoreVirtualState:function(L,K={}){const le=K.restoreAnchor===!0,ae=K.restoreToken==null?"imperative":String(K.restoreToken);$u=L,Nu={restoreAnchor:le,restoreToken:ae,allowUncapturedAnchor:K.allowUncapturedAnchor===!0},!L6(L,{restoreAnchor:le,restoreToken:ae,allowUncapturedAnchor:K.allowUncapturedAnchor===!0})&&dw(L)||($u=null,Nu=null)},forceMeasure:function(L="manual"){return To(this,null,function*(){yield vt(),yield fw(),Sl(),zu(),yield vt();const K=M1(L);return O6(K,!0),K})},settle:z6,scrollToNode:function(L,K="start"){H0(),N0();const le=Ct.value.length;if(le<=0)return;const ae=Ds(L,0,le-1),we=()=>{var Ne;const Oe=_u({nodeIndex:ae,offsetWithinNodePx:0}),Ve=$0(ae),st=Iu(),We=(Ne=st?.clientHeight)!=null?Ne:0,Ye=n6();let ot=Oe;if(K==="center")ot=Oe-We/2+Ve/2;else if(K==="end")ot=Oe-We+Ve;else if(K==="nearest"&&Ye!=null){if(Oe>=Ye&&Oe+Ve<=Ye+We)return;ot=OeHs.value,L=>{if(!L){vw();for(const K of Ii.values())for(const le of K)_f(le);Ii.clear(),Ei.clear(),D6(),q0()}},{immediate:!0}),Ue(dt,L=>{L&&(function(){if(D&&dt.value&&Hr.size){D6();for(const K of[80,240,640]){const le=P9(K,()=>{for(const[ae,we]of Hr)we&&Nf(ae,we)},"final");le!=null&&yf.push(le)}}})(),Mo(L?"final":"content")});const rB=jx(()=>Mo("content"),16),iB=jx(()=>Mo("batch"),16);Ue([()=>Ct.value.length,()=>De.value],()=>{qe.value&&D0(),rB()},{flush:"post",immediate:!0}),Ue([()=>Wo.start,()=>Wo.end],()=>{iB()},{flush:"post"});const{cleanupBatchScheduler:lB}=(function(L){const{props:K,isClient:le,isTestEnv:ae,parsedNodesIdentity:we,parsedNodeCount:Ne,desiredRenderedCount:Oe,datasetKey:Ve,batchingEnabled:st,incrementalRenderingActive:We,resolvedBatchSize:Ye,resolvedInitialBatch:ot,renderedCount:Pe,adaptiveBatchSize:Xe,previousRenderContext:ft,previousBatchConfig:ut,requestFrame:Et,cancelFrame:yt,hasIdleCallback:Ot,cleanupNodeVisibility:Ht,onDatasetKeyChanged:Jt,onDatasetChanged:Gt}=L;let nn=null,_n="raf",En=null,fo=0,Vs=!1,$s=!1;const $i=new Set,tl=new Set;function Ku(){if(le){nn!=null&&(_n==="raf"&&yt?yt(nn):_n==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(nn):_n==="timeout"&&window.clearTimeout(nn),nn=null),fo+=1;for(const Js of $i)yt&&yt(Js);for(const Js of tl)window.clearTimeout(Js);$i.clear(),tl.clear(),En=null,Vs=!1,$s=!1}}function Df(){return typeof performance<"u"?performance.now():Date.now()}function Bw(Js){(function(Cl){var wa;if(!We.value)return;const Ml=Math.max(2,(wa=K.renderBatchBudgetMs)!=null?wa:6),Al=Math.max(1,Ye.value||1),Ni=Math.max(1,Math.floor(Al/4));Cl>1.5*Ml?Xe.value=Math.max(Ni,Math.floor(.8*Xe.value)):Cl<.6*Ml&&Xe.value=Ml)return;const Al=Math.max(1,Js),Ni=()=>{const K0=Df();nn=null;const Gu=En??Al;En=null;const G0=Df();Pe.value=Math.min(Ml,Pe.value+Gu),Ht(Pe.value),(function(G6,Vf){if(!le)return void Bw(Vf);Vs=!0;const Ow=++fo;vt().then(()=>{var Pw;if(Ow!==fo)return;const TB=Df(),EB=Math.max(Vf,TB-G6),Hw=()=>{Ow===fo&&Bw(EB)};if(Et){let N1=null,Y0=null,Vw=!1;const Ww=()=>{Vw||(Vw=!0,N1!==null&&($i.delete(N1),N1=null),Y0!==null&&(tl.delete(Y0),window.clearTimeout(Y0),Y0=null),Hw())};return N1=Et(()=>{Ww()}),$i.add(N1),Y0=window.setTimeout(()=>{N1!==null&&yt&&yt(N1),Ww()},Math.max(32,(Pw=K.renderBatchIdleTimeoutMs)!=null?Pw:120)),void tl.add(Y0)}const Dw=window.setTimeout(()=>{tl.delete(Dw),Hw()},0);tl.add(Dw)})})(K0,Df()-G0)};if(!le||_r.immediate)return void Ni();const ya=Math.max(0,(Cl=K.renderBatchDelay)!=null?Cl:16);if(En=En!=null?Math.max(En,Al):Al,nn==null){if(!ae&&Ot&&window.requestIdleCallback){const K0=Math.max(0,(wa=K.renderBatchIdleTimeoutMs)!=null?wa:120);return _n="idle",void(nn=window.requestIdleCallback(()=>Ni(),{timeout:K0}))}if(Et&&!ae)return _n="raf",void(nn=Et(()=>{ya===0?Ni():(_n="timeout",nn=window.setTimeout(()=>Ni(),ya))}));_n="timeout",nn=window.setTimeout(()=>Ni(),ya)}}function Fw(Js,_r={}){Vs?$s=!0:Js==null?jw():Rw(Js,_r)}function jw(){We.value&&Rw(st.value?Math.max(1,Math.round(Xe.value)):Math.max(1,Ye.value))}return Ue([we,Ne,Ve,We,Ye,ot,()=>K.renderBatchDelay],()=>{var Js;const _r=Ne.value,Cl=ft.value,wa=Ve.value,Ml=!Object.is(wa,Cl.key),Al=_r!==Cl.total,Ni=Ml||Al;ft.value={key:wa,total:_r};const ya=ut.value,K0=(Js=K.renderBatchDelay)!=null?Js:16,Gu=ya.batchSize!==Ye.value||ya.initial!==ot.value||ya.delay!==K0||ya.enabled!==We.value;ut.value={batchSize:Ye.value,initial:ot.value,delay:K0,enabled:We.value},Ml&&Jt(_r),(Ni||Gu||!We.value)&&Ku(),(Ni||Gu)&&(Xe.value=Math.max(1,Ye.value||1)),Ni&&Gt();const G0=Oe.value;if(!_r)return Pe.value=0,void Ht(0);if(!We.value)return Pe.value=G0,void Ht(Pe.value);const G6=Ml||Cl.total===0;Pe.value=G6||Gu?Math.min(G0,ot.value):Math.min(Pe.value,G0);const Vf=Math.max(1,ot.value||Ye.value||_r);Pe.value{We.value&&(typeof _r=="number"&&Js<=_r||Js>Pe.value&&Fw())}),{cleanupBatchScheduler:Ku}})({props:C,isClient:D,isTestEnv:kr,parsedNodesIdentity:js,parsedNodeCount:Os,desiredRenderedCount:kf,datasetKey:Yz,batchingEnabled:Ee,incrementalRenderingActive:Ae,resolvedBatchSize:Or,resolvedInitialBatch:Pr,renderedCount:De,adaptiveBatchSize:dn,previousRenderContext:Ut,previousBatchConfig:zn,requestFrame:io,cancelFrame:Io,hasIdleCallback:yr,cleanupNodeVisibility:Wz,onDatasetKeyChanged:L=>{q0(),Ti(),Ls(),ju(),L>0&&bl(L)},onDatasetChanged:()=>{vn.value&&Li({immediate:!0})}});Ue([Co,vn,()=>A.value,()=>Y()],([L,K])=>{if(!L)return V9(),void l6();qz(),K?Li({immediate:!0}):l6()},{flush:"post",immediate:!0}),Ue([()=>Ct.value.length,()=>vn.value],L=>To(null,[L],function*([K,le]){le&&K&&D&&(yield vt(),Li({immediate:!0}))}),{flush:"post"}),Ue(Mt,L=>{L&&(function(){var K;if(Ts.value&&ks.value&&Lo.value&&((K=Ro.value)!=null&&K[1]))return;const le=Nt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ae=Nt({type:"list_item",children:[le],raw:"- Probe paragraph text"}),we=Nt({type:"list",ordered:!1,items:[ae],raw:"- Probe paragraph text"});Ts.value=le,ks.value=ae,Lo.value=we;const Ne={1:null,2:null,3:null,4:null,5:null,6:null};for(let Oe=1;Oe<=6;Oe++)Ne[Oe]=Nt({type:"heading",level:Oe,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Oe)} Probe heading`});Ro.value=Ne})()},{immediate:!0}),Ue([()=>A.value,Mt],()=>{if(!Mt.value)return f6(),void(se.value=0);q9(),f6(),Mt.value&&A.value&&typeof ResizeObserver<"u"&&(Eu=new ResizeObserver(()=>{q9(),da.value&&_1(),qe.value&&D0(),Mo("resize")}),Eu.observe(A.value))},{immediate:!0}),Ue([Mt,Es,Wr],()=>To(null,null,function*(){if(!Mt.value)return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ls();yield vt(),(function(){if(!Mt.value||typeof window>"u")return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ls();const L={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},K=W9(d6(F.value),".paragraph-node");L.paragraph=cm(F.value,K,"pre-wrap");const le=d6(j.value),ae=le?.querySelector(".paragraph-node");L.listItem=cm(j.value,ae,"pre-wrap");const we=Kt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Oe,Ve;return(Ve=(Oe=q.value)==null?void 0:Oe.offsetHeight)!=null?Ve:0}),Ne=Kt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Oe,Ve;return(Ve=(Oe=j.value)==null?void 0:Oe.offsetHeight)!=null?Ve:0});L.listWrapperOverhead=Math.max(0,we-Ne);for(let Oe=1;Oe<=6;Oe++){const Ve=W9(d6(P[Oe]),`h${Oe}`);L.headings[Oe]=cm(P[Oe],Ve,"pre-wrap")}oe.value=L,Ls()})()}),{flush:"post",immediate:!0}),Ue(()=>Ct.value.length,()=>{vn.value&&Li({immediate:!0})}),Ue([Mt,se],()=>{Ls(),vn.value&&Li({immediate:!0}),da.value&&_1(),qe.value&&D0(),Mo("resize")},{immediate:!1}),Ue(()=>Se.value,L=>{if(L)for(const[K,le]of es)$f(K,le);else if(c6(),vn.value)Li({immediate:!0});else for(const[K,le]of es)le&&ga(K,!0)},{immediate:!1}),Ue([Ke,et,()=>Y()],()=>{var L;(L=Ys.refresh)==null||L.call(Ys);for(const[K,le]of es)$f(K,le)},{immediate:!1}),Ue([()=>C.viewportPriority,()=>Ct.value.length,et],([L,K,le])=>{if(L!==!1){if(W.value&&(K<=200||K<=le)){W.value=!1;for(const[ae,we]of es)$f(ae,we)}}else W.value=!1}),Ue(()=>De.value,()=>{vn.value&&Li({immediate:!0})}),Ue([Vo,ro,uo,()=>Ct.value.length,vn],()=>{S1()},{immediate:!0});let Pu=null,Hu=!1,U0=null;function Du(){Pu=null,k6=null,y6=void 0,O0=null,ju()}function V6(){q0(),Ti(),Ls(),je.clear();const L=Ct.value.length;L>0&&bl(L),$6()}function W6(){P6(),H9(),Bu=null,T1=null,E1=null,Ef=null,$u=null,Nu=null,Hu=!1,Du(),ew("restore"),N0(),H0()}function Vu(L){var K;return[(K=ls())!=null?K:"",$o(),xl(),Mf.value,Fu(L),Ct.value.length,Math.round(ua(0,Ct.value.length)),Math.round(C1()),Xs.count,Math.round(Xs.total)].join(":")}function ww(){return To(this,null,function*(){var L,K,le,ae;const we=(L=o.virtualScroll)==null?void 0:L.settledToken,Ne=Fu(we),Oe=$o(),Ve=ls(),st=Wr.value;if(ze.value&&((K=o.virtualScroll)==null?void 0:K.settleMode)==="manual"&&Af(we))if(b6()){if(Vu(we)!==O0&&!Hu){Hu=!0;try{const We=yield z6({reason:"manual",expectedSettledTokenKey:Ne}),Ye=Fu()===Ne;N6(Oe,Ve,st)&&We.sessionKey===Oe&&We.threadKey===Ve&&Ye&&We.stable&&We.phase==="final"&&(O0=Vu((le=o.virtualScroll)==null?void 0:le.settledToken))}finally{Hu=!1,yield vt();const We=(ae=o.virtualScroll)==null?void 0:ae.settledToken,Ye=Af(We)?Vu(We):"";N6(Oe,Ve,st)&&Ye&&O0!==Ye&&ww()}}}else Mo("manual")})}Ue(ze,(L,K)=>{if(L!==K){if(!L)return W6(),void P6();W6(),V6(),U0=Wr.value,Mo("content")}},{flush:"post"}),Ue([ze,Wr],([L,K])=>{L?U0!=null?U0!==K&&(U0=K,(function(le="resize"){q0(),Ti(),Ls(),je.clear();const ae=Ct.value.length;ae>0&&bl(ae),$6(),T1=null,E1=null,Ef=null,Bu=null,Hu=!1,Du(),uw(),vt(()=>{Sl(),da.value&&_1(),qe.value&&D0(),Mo(le)})})("resize")):U0=K:U0=null},{flush:"post",immediate:!0}),Ue([ze,()=>$o(),()=>ls()],([L])=>{L&&(W6(),V6(),ew("content"),Mo("content"))}),Ue([ze,()=>$o(),()=>ls(),Wr,()=>Ct.value.length],([L])=>{L&&(function(K="async-node"){let le=!1;for(const[ae,we]of Array.from(el.entries()))v6(we)||(el.delete(ae),Dr.delete(ae),le=!0);le&&(F0(),Mo(K))})("async-node")},{flush:"post"}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.sessionKey},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>o.indexKey,()=>ee.value],([L])=>{L&&(ju(),(function(K="content"){if(!ze.value)return;const le=[],ae=Ct.value.length,we=u6(ae);for(const Ne of Array.from(je.keys())){if(Ne>=ae){le.push(Ne);continue}if(Ne=ae&&je.delete(Ne);le.length&&((function(Ne,Oe={}){const Ve=Array.from(Ne,Number);Cu(Ve);let st=0;if(Qi(()=>(st=s6(Ve,Oe),st>0)),st>0)(function(We){for(const Ye of We)je.delete(Ye)})(Ve);else for(const We of Ve)cn.delete(We)})(le,{notify:!1}),Ls(),Du(),da.value&&_1(),qe.value&&D0(),Mo(K))})("content"))},{flush:"post",immediate:!0}),Ue([ze,()=>Ct.value.length,()=>$o(),()=>ls()],([L,K,le,ae],[we,Ne,Oe,Ve])=>{L&&we&&le===Oe&&ae===Ve&&K!==Ne&&Du()},{flush:"post"}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCache},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCacheWidth},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>Ct.value.length,()=>$o(),se],()=>{uw()},{flush:"post",immediate:!0}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreAnchor},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>Ct.value.length,()=>$o(),se],L=>To(null,[L],function*([K,le]){if(!K||!le)return;yield vt();const ae=(function(){var we;const Ne=(we=o.virtualScroll)==null?void 0:we.restoreAnchor;return Ne==null||Ne===!1?null:Ne===!0?"true":String(Ne)})();L6(le,{restoreAnchor:ae!=null,restoreToken:ae??void 0})}),{flush:"post",immediate:!0}),Ue([ze,se,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey}],([L])=>{var K;if(!L)return;const le=(K=o.virtualScroll)==null?void 0:K.restoreState;le&&T1&&E1==="restore"&&(aw(le)||(V6(),T1=null,E1=null,Mo("resize")))},{flush:"post"}),Ue([ze,()=>Ct.value.length,()=>$o(),se],L=>To(null,[L],function*([K]){var le;const ae=$u,we=Nu;K&&ae&&(yield vt(),!L6(ae,{restoreAnchor:we?.restoreAnchor===!0,restoreToken:(le=we?.restoreToken)!=null?le:"imperative",allowUncapturedAnchor:we?.allowUncapturedAnchor===!0})&&dw(ae)||($u=null,Nu=null))}),{flush:"post",immediate:!0}),Ue([ze,dt,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>$o(),()=>ls(),Wr,i6,j9,()=>De.value,kf,()=>Xs.count,()=>Xs.total],([L,K,le])=>{if(!L||K!==!0||le==="manual"||!_6())return;const ae=(function(){var we;const Ne=Ct.value.length;return[(we=ls())!=null?we:"",$o(),xl(),Mf.value,Ne,Math.round(ua(0,Ne)),Math.round(C1()),Xs.count,Math.round(Xs.total)].join(":")})();Pu!==ae&&(Pu=ae,z6({reason:"final"}).then(we=>{we.stable||Pu!==ae||(Pu=null)}))},{flush:"post",immediate:!0}),Ue([ze,dt,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settledToken},()=>$o(),()=>ls(),Wr,i6,j9,()=>De.value,kf,()=>Ct.value.length,()=>Xs.count,()=>Xs.total],()=>{ww()},{flush:"post",immediate:!0}),Ue([()=>Ct.value.length,vn,ro,uo,()=>Wo.start,()=>Wo.end],([L,K,le,ae,we,Ne])=>{ve.value&<("virtualization",{nodes:L,virtualization:K,maxLiveNodes:le,buffer:ae,focusIndex:Vo.value,scroll:K?(()=>{const Oe=Nn.value||Ce();return Oe?{reverse:me(Oe),scrollTop:Math.round(Oe.scrollTop),scrollTopAbs:Math.round(Math.abs(Oe.scrollTop)),scrollHeight:Math.round(Oe.scrollHeight),clientHeight:Math.round(Oe.clientHeight)}:null})():null,liveRange:{start:we,end:Ne},rendered:De.value})}),Ue([()=>C.customId],([L],K,le)=>{if(!L||Ze)return;const ae=(function(we,Ne){return we?(_s.controllers[we]=Ne,()=>{_s.controllers[we]===Ne&&delete _s.controllers[we]}):()=>{}})(L,{captureRestoreAnchor:df,restoreAnchor:ff,getAnchorDrift:xu,getReport:Kz});le(()=>{ae()})},{immediate:!0}),vo(()=>{(function(){if(ze.value)try{Sl(),zu();const L=M1("manual");pw(L)&&(O(L),Bu=L,R6=Ru());const K=P0(L,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});K&&(H(K),K.anchor&&V(K.anchor),V0=Ou(K))}catch{}})(),lB(),c6(),Mn(),vw();for(const L of Ii.values())for(const K of L)_f(K);Ii.clear(),Ei.clear(),je.clear(),D6(),q0(),f6(),N0(),H0(),P6(),V9(),l6()});const aB=E2("ViewportDeferredMermaidBlockNode",mi({loader:()=>To(null,null,function*(){try{return(yield ps(()=>import("./index11-Dosat3UT.js"),__vite__mapDeps([9,7]))).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',L),Tr}}),loadingComponent:Jx,delay:0}),Jx),cB=E2("ViewportDeferredInfographicBlockNode",mi({loader:()=>To(null,null,function*(){try{return(yield ps(()=>import("./index10-DRAKrY77.js"),[])).default}catch(L){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',L),Tr}}),loadingComponent:Xx,delay:0}),Xx),uB=E2("ViewportDeferredD2BlockNode",mi(()=>To(null,null,function*(){try{return(yield ps(()=>import("./index8-C_WD8tqJ.js"),[])).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',L),Tr}})),Tr),yw={text:Ko,paragraph:h0,heading:zp,code_block:Qh,list:Wc,list_item:Vc,blockquote:d4,table:nd,definition_list:f4,footnote:p4,footnote_reference:Gr,footnote_anchor:ed,admonition:v4,vmr_container:m4,hardbreak:Ja,link:vr,image:Xa,thematic_break:h4,math_inline:Xi,math_block:OL,strong:mr,emphasis:wr,strikethrough:gr,highlight:Xr,insert:Rr,subscript:Br,superscript:zr,emoji:Nr,checkbox:Kr,checkbox_input:Kr,inline_code:rr,html_inline:Yr,reference:hr,html_block:td},dB=B(()=>m6()),kw=B(()=>Rx(C.codeBlockProps)),fB=B(()=>Rx(C.codeBlockProps,{omit:["langs"]})),bw=B(()=>_t(_t({stream:C.codeBlockStream,darkTheme:C.codeBlockDarkTheme,lightTheme:C.codeBlockLightTheme,monacoOptions:C.codeBlockMonacoOptions,themes:C.themes,langs:h.value==="shiki"?C.langs:void 0,minWidth:C.codeBlockMinWidth,maxWidth:C.codeBlockMaxWidth},typeof fe.value=="boolean"?{showTooltips:fe.value}:{}),fB.value)),_w=B(()=>_t(gn(_t({},bw.value),{langs:C.langs}),kw.value));function xw(L){return typeof L=="boolean"?L:void 0}const pB=B(()=>{const L=C.codeBlockProps||{},K={},le=xw(L.showLineNumbers);le!==void 0&&(K.showLineNumbers=le);const ae=xw(L.diffInline);ae!==void 0&&(K.diffInline=ae);const we=(function(Ne){const Oe=Number(Ne);return Number.isFinite(Oe)&&Oe>0?Oe:void 0})(L.reservedHeightPx);return we!==void 0&&(K.reservedHeightPx=we),K}),hB=B(()=>_t(_t({stream:C.codeBlockStream,darkTheme:C.codeBlockDarkTheme,lightTheme:C.codeBlockLightTheme,themes:C.themes,langs:C.langs,minWidth:C.codeBlockMinWidth,maxWidth:C.codeBlockMaxWidth},typeof fe.value=="boolean"?{showTooltips:fe.value}:{}),kw.value)),mB=B(()=>_t({},C.mermaidProps||{})),Sw=B(()=>_t({},C.d2Props||{})),gB=B(()=>_t({},C.infographicProps||{})),Wu=B(()=>({typewriter:f.value,fade:C.fade,customHtmlTags:oo.value.customHtmlTags})),vB=B(()=>_t(_t({},Wu.value),typeof fe.value=="boolean"?{showTooltip:fe.value}:{})),wB=B(()=>_t(_t({},Wu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{})),yB=B(()=>_t(_t({},Wu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{})),kB=B(()=>_t(_t({},Wu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{}));function bB(L){return Array.isArray(L.children)&&L.children.length>0}const zf=B(()=>Zz.value.map(L=>{var K,le,ae,we,Ne,Oe,Ve,st;let We=(function(yt){var Ot,Ht,Jt,Gt,nn,_n,En;if(yt.type!=="code_block")return yt;const fo=yt,Vs=[String((Ot=fo.language)!=null?Ot:""),String((Ht=fo.loading)!=null?Ht:""),String((Jt=fo.diff)!=null?Jt:""),String((Gt=fo.code)!=null?Gt:""),String((nn=fo.originalCode)!=null?nn:""),String((_n=fo.updatedCode)!=null?_n:""),String((En=fo.raw)!=null?En:"")].join("\0"),$s=Ie.get(fo);if($s&&$s.signature===Vs)return $s.node;const $i=_t({},fo);return Ie.set(fo,{signature:Vs,node:$i}),$i})(L.node);const Ye=Bf(We);let ot=Tw(We,Ye);if((We.type==="html_block"||We.type==="html_inline")&&ot===yw[We.type]){const yt=We,Ot=String((K=yt.tag)!=null?K:"").trim().toLowerCase()||fI(yt.content);if(Ot){const Ht=ao.value[Ot];if(co.value.has(Ot)&&Ht)ot=Ht,We=gn(_t({},yt),{type:Ot,tag:Ot,content:_ie(yt.content,Ot)});else if(pI((le=yt.content)!=null?le:yt.raw,Ot)){const Jt=String((we=(ae=yt.content)!=null?ae:yt.raw)!=null?we:"");We.type==="html_inline"?(ot=Ko,We={type:"text",content:Jt,raw:Jt}):(ot=h0,We={type:"paragraph",children:[{type:"text",content:Jt,raw:Jt}],raw:Jt})}}}const Pe=We.type==="code_block"&&h.value==="pre"&&ot===Tr&&!q6(ao.value,Ye);let Xe=_t({},(function(yt,Ot,Ht){const Jt=Ot??Bf(yt);if(yt.type==="code_block"){const Gt=Jt?q6(ao.value,Jt):void 0;if(Ht&&h.value==="pre"&&!Gt&&Ht===Tr)return pB.value;if(Ht&&Jt&&Ht===Gt)return Jt==="mermaid"?Mw(yt):Jt==="infographic"?Aw(yt):Jt==="d2"||Jt==="d2lang"?Sw.value:_w.value;if(Ht&&Ht===ao.value.code_block)return _w.value;if(Z9(Ht))return hB.value}return Jt==="mermaid"?Mw(yt):Jt==="infographic"?Aw(yt):Jt==="d2"||Jt==="d2lang"?Sw.value:yt.type==="link"?vB.value:yt.type==="list"?wB.value:yt.type==="blockquote"?yB.value:yt.type==="table"?kB.value:yt.type==="code_block"?bw.value:Wu.value})(We,Ye,ot));const ft=Mt.value?R0.value[L.index]:null;We.type==="code_block"&&ft?.kind==="code-block"&&(Xe=gn(_t({},Xe),Pe?{reservedHeightPx:(Ne=ft.height)!=null?Ne:ft.contentHeight}:{estimatedHeightPx:ft.height,estimatedContentHeightPx:ft.contentHeight,estimatedDiffInline:ft.diffInline})),Pe||We.type!=="code_block"||Ye!=="mermaid"||Sc(Xe.estimatedPreviewHeightPx)!=null||(Xe=gn(_t({},Xe),{estimatedPreviewHeightPx:y5(v5(String((Oe=We.code)!=null?Oe:"")))})),Pe||We.type!=="code_block"||Ye!=="infographic"||Sc(Xe.estimatedPreviewHeightPx)!=null||(Xe=gn(_t({},Xe),{estimatedPreviewHeightPx:k5(w5(String((Ve=We.code)!=null?Ve:"")))})),We.type==="math_block"&&(Xe=gn(_t({},Xe),{cacheScope:ys}));const ut=(function(yt,Ot){const Ht=String(yt.type);return!of(Ht)&&ao.value[Ht]===Ot})(We,ot),Et=ut?dv(We,pe.value):void 0;return gn(_t({},L),{node:We,component:ot,bindings:Xe,customBindings:_t(_t({},Et??{}),Xe),rendersCustomNode:ut,hasSlotChildren:bB(We),slotContent:String((st=We.content)!=null?st:""),isCodeBlock:We.type==="code_block",indexKey:`${dB.value}-${L.index}`,vnodeKey:`${Gz.value}\0${L.index}\0${We.type}`})}));function Bf(L){var K;return L?.type==="code_block"?String((K=L.language)!=null?K:"").trim().toLowerCase():""}function q6(L,K){const le=K.trim().toLowerCase();if(le)for(const ae of[le,Lp(le),kL(le)]){const we=ae&&L[ae];if(we)return we}}function Cw(L,K,le,ae){var we,Ne;const Oe=_t({},L.value);return Sc(Oe.estimatedPreviewHeightPx)==null&&(Oe.estimatedPreviewHeightPx=ae(le(String((we=K?.code)!=null?we:"")),void 0,Oe.maxHeight==="none"?null:(Ne=Sc(Oe.maxHeight))!=null?Ne:void 0)),Oe}function Mw(L){return Cw(mB,L,v5,y5)}function Aw(L){return Cw(gB,L,w5,k5)}function Tw(L,K){if(!L)return s7;const le=ao.value,ae=le[String(L.type)];if(L.type==="code_block"){const we=K??Bf(L),Ne=we?q6(le,we):void 0;return Ne||(h.value==="pre"?le.code_block||Tr:we==="mermaid"?le.mermaid||aB:we==="infographic"?le.infographic||cB:we==="d2"||we==="d2lang"?le.d2||uB:ae||le.code_block||K9.value)}return ae||yw[String(L.type)]||s7}function U6(L){s("click",L)}function _B(L){var K;(K=L.target)!=null&&K.closest("[data-node-index]")&&s("mouseover",L)}function xB(L){var K;(K=L.target)!=null&&K.closest("[data-node-index]")&&s("mouseout",L)}function Ew(L){s("mouseover",L)}function Iw(L){s("mouseout",L)}const $1=U(null),br=U(!1),qu=U(null),SB=B(()=>!(C.domMode!=="minimal"||X.value||C.fade!==!1||f.value||br.value||So.value||vn.value||Ps.value||mn.value||Is.value||Object.keys(ao.value).length!==0));let Uu,Z0=null,Z6=0,Rf=0,Ff=0;const Lw=["code_block","admonition","table","math_block","html_block","image","thematic_break"],CB=new Set(Lw),$w=[".typewriter-cursor",".height-estimation-probes",...Lw.map(L=>`[data-node-type="${L}"]`),"script","style"].join(",");function Nw(L){if(!L||typeof L!="object")return!1;const K=L.type;return typeof K=="string"&&CB.has(K)}function jf(L){var K,le;if(!L||typeof L!="object")return 0;const ae=L,we=(le=(K=ae.raw)!=null?K:ae.content)!=null?le:ae.code;if(typeof we=="string")return we.length;const Ne=ae.children;if(Array.isArray(Ne))return Ne.reduce((Ve,st)=>Ve+jf(st),0);const Oe=ae.items;return Array.isArray(Oe)?Oe.reduce((Ve,st)=>Ve+jf(st),0):0}function Of(){Uu&&(clearTimeout(Uu),Uu=void 0)}function K6(){Z6+=1,Z0!=null&&(Io?.(Z0),Z0=null)}function Zu(){K6(),va(),$1.value&&($1.value.style.visibility="hidden")}function MB(L){var K;if(L.nodeType!==Node.TEXT_NODE||!((K=L.textContent)!=null?K:"").trim())return!1;const le=L.parentElement;return!!le&&!le.closest($w)}function AB(L){let K=L.lastChild;for(;K;){if(MB(K))return K;if(K.nodeType===Node.ELEMENT_NODE){const le=K;if(!le.matches($w)&&le.lastChild){K=le.lastChild;continue}}for(;K&&K!==L&&!K.previousSibling;)K=K.parentNode;if(!K||K===L)break;K=K.previousSibling}return null}function zw(){const L=zf.value;for(let K=L.length-1;K>=0;K--){const le=L[K];if(!le||Nw(le.node)||!Lf(le.index))continue;const ae=es.get(le.index);if(!ae)continue;const we=AB(ae);if(we)return we}return null}function va(){qu.value&&(qu.value.classList.remove(Qx),qu.value=null)}function Pf(){if(d.value!=="simple"||!D||!br.value||!A.value)return void va();const L=zw(),K=L?(function(le){var ae;const we=(ae=le.parentElement)==null?void 0:ae.closest(".text-node");return we instanceof HTMLElement?we:le.parentElement})(L):null;K!==qu.value&&(va(),K&&(K.classList.add(Qx),qu.value=K))}function Hf(){if(d.value!=="precise"||!D||!br.value||Z0!=null)return;const L=Z6,K=()=>{Z0=null,L===Z6&&(function(){var le,ae;if(d.value!=="precise"||!(D&&br.value&&A.value&&$1.value))return;const we=A.value,Ne=$1.value;Ne.style.visibility="hidden";const Oe=zw();if(!Oe)return;let Ve=0,st=0,We=20,Ye=!1;if(Oe?.textContent){const ot=Oe.textContent.length,Pe=document.createRange();Pe.setStart(Oe,Math.max(0,ot-1)),Pe.setEnd(Oe,ot);const Xe=typeof Pe.getClientRects=="function"?Pe.getClientRects():void 0,ft=(ae=Xe?.[Xe.length-1])!=null?ae:(le=Oe.parentElement)==null?void 0:le.getBoundingClientRect();if(ft){const ut=Kt("typewriterCursor.root.getBoundingClientRect",()=>we.getBoundingClientRect());Ve=ft.right-ut.left+we.scrollLeft,st=ft.top-ut.top+we.scrollTop,We=ft.height||We,Ye=!0}Pe.detach()}Ye&&(Ne.style.transform=`translate(${Math.max(0,Ve)}px, ${Math.max(0,st)}px)`,Ne.style.height=`${We}px`,Ne.style.visibility="visible")})()};io?Z0=io(K):K()}return Ue([Fe,()=>o.content,()=>o.nodes,()=>C.typewriter,dt],()=>To(null,null,function*(){var L,K;if(!D||X.value||!de.value)return;if(dt.value)return br.value=!1,Of(),void Zu();if((L=o.nodes)!=null&&L.length)return br.value=!1,Of(),Zu(),Rf=((K=o.content)!=null?K:"").length,void(Ff=Fe.value.length);const le=(function(){var Ve,st;return(Ve=o.nodes)!=null&&Ve.length?o.nodes.reduce((We,Ye)=>We+jf(Ye),0):((st=o.content)!=null?st:"").length})(),ae=(function(){var Ve;return(Ve=o.nodes)!=null&&Ve.length?o.nodes.reduce((st,We)=>st+jf(We),0):Fe.value.length})(),we=!Nw(Ct.value[Ct.value.length-1]),Ne=le>Rf,Oe=ae>Ff;if(!f.value||!we||!Ne&&!Oe)return f.value&&we||(br.value=!1,Zu()),Rf=le,void(Ff=ae);Rf=le,Ff=ae,br.value=!0,d.value==="precise"&&$1.value&&($1.value.style.visibility="hidden"),Of(),yield vt(),d.value==="simple"?Pf():(va(),Hf()),Uu=setTimeout(()=>{Uu=void 0,br.value=!1},3e3)}),{flush:"post",immediate:!0}),Ue(br,L=>To(null,null,function*(){L?(yield vt(),d.value!=="simple"?(va(),d.value==="precise"&&Hf()):Pf()):Zu()}),{flush:"post"}),Ue(d,()=>To(null,null,function*(){if(D&&!X.value&&de.value&&br.value){if(yield vt(),d.value==="simple")return K6(),void Pf();va(),d.value!=="precise"?Zu():Hf()}}),{flush:"post"}),Ue([()=>De.value,()=>Wo.start,()=>Wo.end],()=>To(null,null,function*(){D&&!X.value&&de.value&&br.value&&(yield vt(),d.value!=="simple"?(va(),d.value==="precise"&&Hf()):Pf())}),{flush:"post"}),vo(()=>{Of(),K6(),va(),As.clear()}),(L,K)=>{const le=KM("NodeRenderer",!0);return y(X)?(g(!0),S(Me,{key:0},rt(zf.value,ae=>(g(),S(Me,{key:ae.vnodeKey},[ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onClick:U6,onMouseover:Ew,onMouseout:Iw,onCopy:K[0]||(K[0]=we=>r(we)),onHandleArtifactClick:K[1]||(K[1]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onClick:U6,onMouseover:Ew,onMouseout:Iw,onCopy:K[2]||(K[2]=we=>r(we)),onHandleArtifactClick:K[3]||(K[3]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(g(),S("div",{key:1,ref_key:"containerRef",ref:A,class:Be(["markstream-vue markdown-renderer",[{dark:C.isDark},{virtualized:vn.value},{"virtual-scroll-coordinated":wt.value},{"stable-layout":pt.value},{"typewriter-simple-cursor":br.value&&d.value==="simple"}]]),"data-custom-id":C.customId,onClick:U6,onMouseover:_B,onMouseout:xB},[tn.value||vn.value?(g(),S(Me,{key:0},[tn.value?(g(),ce(gfe,{key:0,width:Es.value,"flow-root":vn.value||wt.value,"paragraph-node":Ts.value,"list-item-node":ks.value,"list-node":Lo.value,"heading-nodes":Ro.value,"set-paragraph-wrapper":Hz,"set-list-item-wrapper":Dz,"set-list-wrapper":Vz,"set-heading-wrapper":Uz},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):J("",!0),vn.value?(g(),S("div",{key:1,class:"node-spacer",style:Wt({height:`${p6.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],64)):J("",!0),SB.value?(g(!0),S(Me,{key:1},rt(zf.value,ae=>(g(),S(Me,{key:ae.vnodeKey},[Lf(ae.index)?(g(),ce(ns(ae.component),Vn({key:0,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onMouseover:K[4]||(K[4]=we=>s("mouseover",we)),onMouseout:K[5]||(K[5]=we=>s("mouseout",we)),onCopy:K[6]||(K[6]=we=>r(we)),onHandleArtifactClick:K[7]||(K[7]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"])):J("",!0)],64))),128)):(g(!0),S(Me,{key:2},rt(zf.value,ae=>(g(),S("div",{key:ae.vnodeKey,ref_for:!0,ref:we=>$f(ae.index,we),class:"node-slot","data-node-index":ae.index,"data-node-type":ae.node.type},[Lf(ae.index)?(g(),S("div",{key:0,ref_for:!0,ref:we=>(function(Ne,Oe){var Ve;Oe||(function(ot){const Pe=`${m6()}-${ot}`;let Xe=!1;for(const ft of Array.from(Dr.keys())){const ut=el.get(ft);(ut?.index===ot||ft===Pe||ft.startsWith(`${Pe}-`))&&(Dr.delete(ft),el.delete(ft),Xe=!0)}Xe&&(F0(),Mo("async-node"))})(Ne),_l.delete(Ne),(function(ot){var Pe;const Xe=((Pe=Ei.get(ot))!=null?Pe:0)+1;Ei.set(ot,Xe)})(Ne);const st=Ii.get(Ne);if(st){for(const ot of st)_f(ot);Ii.delete(Ne)}if((function(ot){const Pe=is.get(ot);Pe&&(_e?.unobserve(Pe),ie.delete(Pe),is.delete(ot))})(Ne),!Oe||!Hs.value)return Hr.delete(Ne),void Ei.delete(Ne);Hr.set(Ne,Oe);const We=()=>{Nf(Ne,Oe)};queueMicrotask(We);const Ye=(_e||typeof ResizeObserver>"u"||(_e=new ResizeObserver(ot=>{if(ot.length)for(const Pe of ot){const Xe=ie.get(Pe.target),ft=is.get(Xe??-1);Xe!=null&&ft&&Nf(Xe,ft)}else Sl()})),_e);if(Ye&&(is.set(Ne,Oe),ie.set(Oe,Ne),Ye.observe(Oe)),typeof window<"u"){const ot=((Ve=Ct.value[Ne])==null?void 0:Ve.type)==="code_block"?[16,80,240,800]:dt.value?[80]:[];if(ot.length){const Pe=ot.map(Xe=>P9(Xe,We,"node-resize")).filter(Xe=>Xe!=null);Pe.length&&Ii.set(Ne,Pe)}}})(ae.index,we),class:"node-content"},[ae.isCodeBlock?ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:1,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[12]||(K[12]=we=>r(we)),onHandleArtifactClick:K[13]||(K[13]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:2,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[14]||(K[14]=we=>r(we)),onHandleArtifactClick:K[15]||(K[15]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(gi,{key:0,name:"fade",css:C.fade!==!1,appear:C.fade!==!1},{default:ue(()=>[ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[8]||(K[8]=we=>r(we)),onHandleArtifactClick:K[9]||(K[9]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[10]||(K[10]=we=>r(we)),onHandleArtifactClick:K[11]||(K[11]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(g(),S("div",{key:1,class:"node-placeholder",style:Wt({height:`${$0(ae.index)}px`})},null,4))],8,yfe))),128)),br.value&&d.value==="precise"?(g(),S("span",{key:3,ref_key:"typewriterCursorRef",ref:$1,class:"typewriter-cursor","aria-hidden":"true"},null,512)):J("",!0),vn.value?(g(),S("div",{key:4,class:"node-spacer",style:Wt({height:`${h6.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],42,wfe))}}})),[["__scopeId","data-v-a9489508"]]),Fr=QL;Fr.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Fr.__name,Fr.name].filter(n=>!!n));for(const n of t)e.component(n,QL)};const Cv=Object.freeze(Object.defineProperty({__proto__:null,default:Fr},Symbol.toStringTag,{value:"Module"})),kfe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},bfe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},_fe={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},xfe={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Sfe={class:"admonition-title"},Cfe=["aria-expanded","aria-controls"],Mfe=["id"],v4=to(Ge({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,r=B(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),i=U(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(i.value=!i.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(g(),S("div",{class:Be(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(g(),S("svg",kfe,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(g(),S("svg",bfe,[...u[2]||(u[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(g(),S("svg",_fe,[...u[3]||(u[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(g(),S("svg",xfe,[...u[4]||(u[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):J("",!0),_("span",Sfe,I(r.value),1),o.node.collapsible?(g(),S("button",{key:4,class:"admonition-toggle","aria-expanded":!i.value,"aria-controls":`${a}-content`,onClick:l},[(g(),S("svg",{style:Wt({rotate:i.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Cfe)):J("",!0)]),Zn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[Z(y(Fr),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Mfe),[[Er,!i.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);v4.install=e=>{e.component(v4.__name,v4)};const c7=()=>ps(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let T3=null,E3=c7,I3=null,eS=!1,tS=!1;function oqe(){return To(this,null,function*(){if(T3)return T3;const e=E3;return e?e===c7&&eS?null:I3||(I3=To(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===c7)return e===E3&&(eS=!0,(function(o){tS||(tS=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===E3&&(I3=null)}return e!==E3?null:t?(T3=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),T3):null}),I3):null})}let L3=null,e$=null,$3=null;function sqe(){return typeof e$=="function"}function rqe(){return To(this,null,function*(){if(L3)return L3;const e=e$;return e?$3||($3=To(null,null,function*(){const t=yield e(),n=(function(o){var s,r,i;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((r=l.prototype)==null?void 0:r.render)=="function"?l:(i=o.Infographic)!=null?i:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(L3=n,L3):null}).finally(()=>{$3=null}),$3):null})}const iqe=Symbol("markstreamLanguageIconResolver"),t$=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],Afe=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),u7=[...t$].toSorted((e,t)=>t.length-e.length).join("|"),um=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${u7}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${u7})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?])`].join(""),"gi"),n$=/[),.;!?]+$/;function Tfe(e){const t=e.toLowerCase();return t$.some(n=>t.endsWith(`.${n}`))}function Efe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${u7}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const r=s.split("/").pop();r&&t.set(r,s)}return t}function Ife(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(n$,"");if(!s)return null;const r=s.split("/").pop()??s,i=s.includes("/"),l=Afe.has(r),a=Tfe(r);if(i&&!l&&!a)return null;if(!i&&!l){const d=t.aliases?.get(r);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Lfe(e,t={}){const n=[];um.lastIndex=0;let o;for(;(o=um.exec(e))!==null;){const s=o[0]??"",r=o[1]??"",i=s.indexOf(r);if(i<0)continue;const l=o[2]??o[3];let a=r+(l?s.slice(i+r.length):"");const c=a.replace(n$,""),u=a.length-c.length;a=c;const d=Ife(a,t);if(!d)continue;const f=o.index+i,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(um.lastIndex-=u)}return n}const $fe=12e4,Nfe=6e4,zfe=32,Bfe=3e4,nS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Rfe(e){let t=0,n=0,o=0;nS.lastIndex=0;let s;for(;(s=nS.exec(e))!==null;){const i=s[3]??"";t+=1,n+=i.length,o=Math.max(o,i.length)}return{codeRenderer:e.length>=$fe||n>=Nfe||t>=zfe||o>=Bfe?"pre":"shiki",codeFenceCount:t,codeChars:n}}function N3(e,t){let n=0;for(let o=t-1;o>=0&&e[o]==="\\";o--)n++;return n%2===1}const Ffe=/\s/,jfe=/\p{Nd}/u;function Qa(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function Ofe(e,t){if(t<=0)return;const n=e.codePointAt(t-1),o=n!==void 0&&n>=55296&&n<=56319&&t>1?t-2:t-1,s=e.codePointAt(o);return s===void 0?void 0:String.fromCodePoint(s)}function oS(e){return e!==void 0&&Ffe.test(e)}function nu(e){return e!==void 0&&jfe.test(e)}function E5(e){return e!==void 0&&e>="A"&&e<="Z"}const o$=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function Pfe(e,t){if(!E5(e[t-1]))return!1;let n=t-1;for(;n>0&&E5(e[n-1]);)n--;return o$.test(e.slice(n,t))||nu(Qa(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test(Qa(e,t+1)??"")}function Hfe(e,t){if(!E5(e[t-1]))return!1;let n=t-1;for(;n>0&&E5(e[n-1]);)n--;return o$.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}function Dfe(e,t){const n=e[t+1];return nu(Qa(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−")&&nu(Qa(e,t+2))}const Vfe=/^[-–—,;:~([/]$/;function Wfe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!nu(Qa(e,t+2)))return!1;const o=e[t-1];return o!==void 0&&Vfe.test(o)}const dm=String.raw`[,;:~\-–—/\s()=*×]|and|or`;function qfe(e){let t=e.replace(new RegExp(String.raw`^(?:${dm})+`,"u"),"");for(;;){const o=t.replace(new RegExp(String.raw`^\p{L}+(?:${dm})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(o===t)break;t=o}if(!/\p{Nd}/u.test(t))return!1;const n=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${n}(?:\p{L}+)?(?:(?:${dm})+${n}(?:\p{L}+)?)*$`,"u").test(t)}const sS=1,rS=2,iS=3,rl=-1;function Ufe(e){const t=e.length,n=new Uint8Array(t),o=new Int32Array(t+1).fill(rl),s=new Int32Array(t+1),r=new Int32Array(t+1),i=[],l=[];{const A=[];for(let P=0;P`*—–“”‘’'),c=[];for(const A of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))c.push(A.index);for(const A of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))c.push(A.index);for(const A of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(A.index===0||!/[\w~/.-]/.test(e[A.index-1]??""))&&c.push(A.index);c.sort((A,F)=>A-F);let u=-1;for(const A of c){if(AA+7&&!/[\w/?#@~.+&=%-]/.test(e[F+1]??""))break}}i.push([A,F]),u=F}const d=[];for(let A=0;A]/.test(W))continue;let G=rl,ee=rl;for(;j"){ee=j;break}if(!q&&se==="/"&&e[j+1]===">"){ee=j+1;break}if(!/\s/.test(se)){G=j;break}for(;j"){ee=j;break}if(q){G=j;break}if(oe==="/"&&e[j+1]===">"){ee=j+1;break}const Q=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(j));if(!Q){G=j;break}j+=Q[0].length;let ge=j;for(;ge`]+/.exec(e.slice(ge));if(!Ke){G=ge;break}j=ge+Ke[0].length}}}if(ee!==rl)d.push([A,ee+1]),A=ee;else if(G!==rl){const se=e.indexOf("<",A+1);A=(se!==-1&&se",A+2);G===-1?f=!1:(d.push([A,G+2]),A=G+1,j=!0)}else if(F==="!"){if(e[A+2]==="-"&&e[A+3]==="-"){if(p){const G=e.indexOf("-->",A+4);G===-1?p=!1:(d.push([A,G+3]),A=G+2,j=!0)}}else if(e.startsWith("[CDATA[",A+2)){if(h){const G=e.indexOf("]]>",A+9);G===-1?h=!1:(d.push([A,G+3]),A=G+2,j=!0)}}else if(m&&/[A-Z]/.test(e[A+2]??"")){const G=e.indexOf(">",A+3);G===-1?m=!1:(d.push([A,G+1]),A=G,j=!0)}}if(j)continue;if(F!==void 0&&/[a-zA-Z]/.test(F)){const G=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(A+1));if(G){let ee=A+1+G[0].length;for(;ee"&&e[ee]!=="<"&&!/\s/.test(e[ee]);)ee++;if(e[ee]===">"){d.push([A,ee+1]),A=ee;continue}}}if(F===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(F))continue;let q=A+1;for(;q"&&(d.push([A,q+1]),A=q)}}d.sort((A,F)=>A[0]-F[0]);const k=[];for(const A of d){const F=k.at(-1);F&&A[0]<=F[1]?F[1]=Math.max(F[1],A[1]):k.push([A[0],A[1]])}i.push(...k);const x=A=>{let F=0;for(;F=(l[F]?.[1]??0);)F++;const j=l[F];return j!==void 0&&A>=j[0]},w=A=>{let F=0;for(;F=(k[F]?.[1]??0);)F++;const j=k[F];return j!==void 0&&A>=j[0]},v=[];let b=null,M=0,R=!1;for(let A=0;A"&&(R=!1);continue}if(!(x(A)||w(A))){if(b!==null){e[A]===b&&(b=null);continue}if(v.length>0&&(e[A]==='"'||e[A]==="'")&&A>0&&/\s/.test(e[A-1]??""))b=e[A];else if(e[A]==="[")M++;else if(e[A]==="]")M>0&&e[A+1]==="("&&(v.push(A),R=e[A+2]==="<",A++),M=Math.max(0,M-1);else if(e[A]==="("&&v.length>0)v.push(-1);else if(e[A]===")"&&v.length>0){const F=v.pop();if(F!==void 0&&F>=0){const j=e.slice(F+2,A);(/\s/.exec(j)===null||j.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(j)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(j))&&i.push([F,A+1])}}}}i.sort((A,F)=>A[0]-F[0]);const z=[];for(const A of i){const F=z.at(-1);F&&A[0]<=F[1]?F[1]=Math.max(F[1],A[1]):z.push([A[0],A[1]])}const $=A=>{let F=0,j=z.length-1;for(;F<=j;){const q=F+j>>1,P=z[q];if(P===void 0)return!1;if(A=P[1])F=q+1;else return!0}return!1},T=new Uint8Array(t);{let A=-1,F=!1,j=!1,q=0;for(let P=0;P<=t;P++){const W=P0&&(G==="{"?q++:G==="}"&&q--)}}for(let A=0;A=0;A--)n[A]===iS&&(E=A),o[A]=E;const N=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,C=/[^\p{L}\p{Nd}\s]$/u,O=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,H=/(?:^|\s)[a-z]{2,}/,V=(A,F)=>{const j=Qa(e,A+1);if(j===void 0||!N.test(j))return!1;const q=o[A+1]??rl;if(q!==rl){const P=e.slice(A+1,q);return!(q-(A+1)===((e.codePointAt(A+1)??0)>65535?2:1))&&O.test(P)||/[,;:!?]$/.test(P)||/^[a-z]{2,}$/.test(P)?!1:(s[q]??0)-(s[A+1]??0)===0&&(r[q]??0)-(r[A+1]??0)===0}return C.test(F)||O.test(F)||H.test(F)};return(A,F=-1)=>{if(e[A]!=="$"||n[A]===sS||e[A+1]==="$"||e[A-1]==="$"&&F!==A||Pfe(e,A)||A+1>=t||oS(Qa(e,A+1)))return null;const j=o[A+1]??rl;if(j===rl||(s[j]??0)-(s[A+1]??0)>0||(r[j]??0)-(r[A+1]??0)>0)return null;const q=e.slice(A+1,j);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(q)||e[j+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(q)||nu(Ofe(e,A))&&qfe(q)||Dfe(e,A)&&(V(j,q)||Hfe(e,j)||/\s/.test(q)&&/\p{Nd}$/u.test(q)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(q)||!1)||e[j+1]==="$"&&!/\p{L}/u.test(q)&&C.test(q)?null:{content:q,end:j+1}}}const Zfe=/^---[ \t]*(?:\r\n|\n)/,Kfe=/^---[ \t]*$/;function Gfe(e){const t=Zfe.exec(e);if(t===null)return{frontmatter:null,body:e};let n=t[0].length;const o=n;for(;n<=e.length;){let s=e.indexOf(` -`,n);s===-1&&(s=e.length);let r=e.slice(n,s);if(r.endsWith("\r")&&(r=r.slice(0,-1)),Kfe.test(r)){const i=e.slice(o,n);if(i==="")return{frontmatter:null,body:e};const l=s\n]*>|[^()\s]+)\)/g,Yfe=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,Xfe=/^[a-zA-Z]:(?:[\\/]|%5c)/i,Jfe=/^[A-Za-z0-9._~-]$/,I5="pythinker-code://skill/";let aS;function cS(e){return e.replaceAll("%","%25").replaceAll("&","%26").replaceAll("<","%3C").replaceAll(">","%3E").replaceAll(/[[\]\\]/g,"\\$&").replaceAll(` -`,"%0A").replaceAll("\r","%0D")}function Qfe(e){return e.replaceAll(/\\([\\[\]])/g,"$1").replaceAll("%26","&").replaceAll("%3C","<").replaceAll("%3E",">").replaceAll("%0A",` -`).replaceAll("%0D","\r").replaceAll("%25","%")}function s$(e){let t="";for(const n of e){const o=n.codePointAt(0);o>127||Jfe.test(n)?t+=n:t+=`%${o.toString(16).toUpperCase().padStart(2,"0")}`}return t}function e3e(e){const t=e.split("/").map(s$).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function r$(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function uS(e){const t=r$(e);try{return decodeURIComponent(t)}catch{return t}}function t3e(e){const t=r$(e);return!t||t.startsWith("#")||t.startsWith("?")||t.startsWith("//")?null:t.startsWith(I5)&&t.length>I5.length?"skill":Yfe.test(t)&&!Xfe.test(t)?null:/(?:[\\/]|%5c)$/i.test(t)?"folder":"file"}function fm(e,t){if(!t)return;const n=e.at(-1);n?.type==="text"?n.value+=t:e.push({type:"text",value:t})}function Mv(e){if(e.kind==="skill")return`[${cS(e.name)}](${I5}${s$(e.name)})`;const t=e.kind==="folder"&&!/[\\/]$/.test(e.path)?`${e.path}/`:e.path;return`[${cS(e.name)}](${e3e(t)})`}function i$(e){const t=[];let n=0;lS.lastIndex=0;for(const o of e.matchAll(lS)){const s=o.index;fm(t,e.slice(n,s));const r=o[0],i=o[1],l=o[2],a=e[s-1]==="!"?null:t3e(l);if(a&&i){const c=a==="skill"?uS(l).slice(I5.length):void 0;t.push({type:"mention",attrs:{kind:a,name:c??Qfe(i),path:a==="skill"?"":uS(l)}})}else fm(t,r);n=s+r.length}return fm(t,e.slice(n)),t}function l$(e){const t=i$(e.args??"").filter(o=>o.type==="mention"&&o.attrs.kind==="skill"),n=t[0];return t.length===1&&n?.type==="mention"&&n.attrs.name===e.name}function a$(e,t){if(l$(e))return t.revivePill?e.args??"":null;if(e.name.includes(" "))return null;const n=e.args??"";return`/skill:${e.name}${n.length>0?` ${n}`:""}`}function n3e(e,t){return a$(e,t)!==null}function o3e(e){if(l$(e))return e.args??"";const t=Mv({kind:"skill",name:e.name,path:""});return e.args?`${t} ${e.args}`:t}function dS(e){return aS??=new Intl.Segmenter("und",{granularity:"grapheme"}),Array.from(aS.segment(e),({segment:t})=>t)}function c$(e){const t=dS(e);if(t.length<=32)return e;const n=e.lastIndexOf("."),s=(n>=0?dS(e.slice(n)).length:0)+4,r=31-s;return r<8?`${t.slice(0,31).join("")}…`:`${t.slice(0,r).join("")}…${t.slice(-s).join("")}`}function s3e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function r3e(e){return new Worker("/assets/mermaidParser.worker-DimdFOud.js",{type:"module",name:e?.name})}const i3e={key:0,class:"md-frontmatter"},l3e={key:1,class:"diff-wrap"},a3e={class:"diff-bar"},c3e=["aria-label","onClick"],u3e={class:"diff-pre"},d3e={key:0,class:"diff-sign"},f3e={class:"diff-text"},p3e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",z3="pythinker-code://skill/",fS="md-table-wide",pS="md-table-toggle",hS="md-table-fade",mS="md-table-toggle--show",h3e="md-table-at-end",m3e=26,gS="github-light",vS="github-dark",g3e=Ge({__name:"Markdown",props:{text:{},openFile:{},skills:{},streaming:{type:Boolean,default:!1}},setup(e){tue(),hue(),oue(),vue(),nue(new s3e),gue(new r3e);const t=new WeakMap;function n(Re,lt){if(Re.src[Re.pos]!=="$")return!1;let tt=t.get(Re);(!tt||tt.src!==Re.src)&&(tt={src:Re.src,match:Ufe(Re.src),lastEnd:-1},t.set(Re,tt));const ht=tt.match(Re.pos,tt.lastEnd);if(!ht||ht.end>Re.posMax)return!1;if(tt.lastEnd=ht.end,lt)return Re.pos=ht.end,!0;const bt=Re.push("math_inline","math",0);return bt.content=ht.content,bt.markup="$",bt.raw=Re.src.slice(Re.pos,ht.end),bt.loading=!1,Re.pos=ht.end,!0}function o(Re){return Re.set({typographer:!1}),Re.inline.ruler.disable("math"),Re.inline.ruler.before("escape","math",n),Re}const{t:s}=Lt(),r=pn("resolveImage"),i=U(null),l=e,a=B(()=>!l.streaming),c=B(()=>Gfe(l.text??"")),u=B(()=>c.value.body),d=B(()=>Efe(u.value)),f=B(()=>l.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Rfe(u.value)),p=vp(),h=B(()=>!l.streaming),m=Rs(new Map),k=new Set,x=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,w=/(]*?\bsrc=")([^"]+)(")/gi;function v(Re){return!/^(https?:|data:|blob:)/i.test(Re)}function b(Re){if(!r)return;const lt=[];for(const tt of[x,w]){tt.lastIndex=0;let ht;for(;(ht=tt.exec(Re))!==null;)lt.push(ht[2]??"")}for(const tt of lt)!tt||!v(tt)||m.has(tt)||k.has(tt)||(k.add(tt),r(tt).then(ht=>{m.set(tt,ht!==tt?ht:"")}).catch(()=>{m.set(tt,"")}).finally(()=>{k.delete(tt)}))}function M(Re){if(!r)return Re;const lt=tt=>{if(!v(tt))return null;const ht=m.get(tt);return ht===void 0?p3e:ht===""?null:ht};return Re.replace(x,(tt,ht,bt,Rt)=>{const on=lt(bt);return on===null?tt:`${ht}${on}${Rt}`}).replace(w,(tt,ht,bt,Rt)=>{const on=lt(bt);return on===null?tt:`${ht}${on}${Rt}`})}Ue(()=>u.value,Re=>b(Re),{immediate:!0});function R(){if(!i.value||!l.openFile||l.streaming)return;const Re=document.createTreeWalker(i.value,NodeFilter.SHOW_TEXT),lt=[];let tt=Re.nextNode();for(;tt;){const ht=tt,bt=ht.parentElement;bt&&!bt.closest("a, pre, .md-file-link, svg")&&ht.data.trim().length>0&<.push(ht),tt=Re.nextNode()}for(const ht of lt){const bt=Lfe(ht.data,{aliases:d.value});if(bt.length===0||!ht.parentNode)continue;const Rt=document.createDocumentFragment();let on=0;for(const an of bt){an.start>on&&Rt.append(document.createTextNode(ht.data.slice(on,an.start)));const sn=document.createElement("button");sn.type="button",sn.className="md-file-link",sn.textContent=an.text,sn.title=an.line?`${an.path}:${an.line}`:an.path,sn.addEventListener("click",Yn=>{Yn.preventDefault(),Yn.stopPropagation(),l.openFile?.({path:an.path,line:an.line})}),Rt.append(sn),on=an.end}onz3.length?"skill":Re.startsWith("#")||Re.startsWith("?")||Re.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(Re)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(Re)?null:Re.endsWith("/")||Re.endsWith("\\")||/%5c$/i.test(Re)?"folder":"file":null}function E(Re){try{return decodeURIComponent(Re.slice(z3.length))}catch{return Re.slice(z3.length)}}function N(Re){return Re.replace(/%0A/g,` -`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function C(){if(!i.value||l.streaming)return;const Re=i.value.querySelectorAll("a[href]");for(const lt of Re){if(lt.dataset.mdLinkHandled==="true"||lt.closest("svg")||lt.querySelector("img"))continue;const tt=lt.getAttribute("href")??"",ht=T(tt);if(ht===null)continue;lt.dataset.mdLinkHandled="true",lt.removeAttribute("title");const bt=ht==="skill"?tt:z(tt),Rt=N(lt.textContent??"");lt.classList.add("mention-pill",`mention-${ht}`),lt.dataset.mentionKind=ht,lt.dataset.mentionName=ht==="skill"?E(tt):Rt,lt.dataset.mentionPath=bt,(ht==="skill"||l.openFile)&<.removeAttribute("href"),(ht==="skill"||ht==="file"&&l.openFile)&&(lt.tabIndex=0,lt.setAttribute("role","button"));const on=c$(Rt),an=document.createElement("span");if(an.className="mention-pill-name",an.textContent=on,lt.replaceChildren(an),!lt.querySelector(".mention-pill-icon")){const sn=document.createElement("span");sn.className="mention-pill-icon",sn.setAttribute("aria-hidden","true"),sn.innerHTML=ht==="skill"?ji("sparkles","sm"):ht==="folder"?ji("folder","sm"):mu(bt,Rt),lt.prepend(sn)}lt.addEventListener("click",sn=>{ht!=="skill"&&!l.openFile||(sn.preventDefault(),sn.stopPropagation(),ht==="file"&&l.openFile?.({path:$(z(tt))}))}),ht==="file"&&l.openFile&<.addEventListener("keydown",sn=>{sn.key!=="Enter"&&sn.key!==" "||(sn.preventDefault(),sn.stopPropagation(),l.openFile?.({path:$(z(tt))}))}),fe(lt)}}function O(Re){const lt=Re.dataset.mentionKind??(Re.classList.contains("mention-skill")?"skill":Re.classList.contains("mention-folder")?"folder":"file"),tt=Re.dataset.mentionName??Re.querySelector(".mention-pill-name")?.textContent??"";return{kind:lt,name:tt,path:Re.dataset.mentionPath??""}}function H(Re,lt){let tt;return()=>{if(tt===void 0){const ht=getComputedStyle(document.documentElement).getPropertyValue(Re).trim(),bt=parseFloat(ht);tt=Number.isFinite(bt)?ht.endsWith("s")?bt*1e3:bt:lt}return tt}}const V=H("--space-1-5",6),A=H("--p-mention-tip-vmargin",12),F=H("--duration-tooltip",150),j=H("--duration-fast",120),q=H("--duration-flash",1e3),P=U(null);let W=null,G=0,ee=0;function se(Re){return P.value?.contains(Re)??!1}function oe(){let Re=P.value;return Re||(Re=document.createElement("div"),Re.className="mention-tip",Re.id="mention-tip",Re.setAttribute("role","tooltip"),Re.addEventListener("mouseenter",()=>window.clearTimeout(ee)),Re.addEventListener("mouseleave",()=>D()),Re.addEventListener("focusin",()=>window.clearTimeout(ee)),Re.addEventListener("focusout",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&(Re.contains(tt)||W?.contains(tt))||Y()}),document.body.append(Re),P.value=Re),Re}function Q(){const Re=P.value,lt=W;if(!Re||!lt)return;const tt=lt.getBoundingClientRect(),ht=V(),bt=A();let Rt=tt.top-ht-Re.offsetHeight;Rtlt.name===Re)}function xe(Re){const lt=document.createElement("div");lt.className="mention-tip-path";const tt=document.createElement("div");tt.className="mention-tip-path-text";const ht=Re.split(/([/\\])/);let bt=ht.length-1;for(;bt>0&&(ht[bt]===""||ht[bt]==="/"||ht[bt]==="\\");)bt--;for(let an=0;an{an.preventDefault(),an.stopPropagation(),ss(Re).then(sn=>{sn&&(Rt.innerHTML=ji("check","sm"),window.setTimeout(()=>{Rt.innerHTML=on},q()))})}),lt.append(Rt),lt}function Ke(Re){const lt=document.createElement("div");lt.className="mention-tip-skill";const tt=document.createElement("div");tt.className="mention-tip-head";const ht=document.createElement("span");if(ht.className="mention-tip-name",ht.textContent=Re.name,tt.append(ht),Re.path&&l.openFile){const bt=document.createElement("button");bt.type="button",bt.className="mention-tip-open",bt.setAttribute("aria-label",s("mention.openSkill")),bt.innerHTML=ji("external-link","sm");const Rt=Re.path;bt.addEventListener("click",on=>{on.preventDefault(),on.stopPropagation(),Y(),l.openFile?.({path:Rt})}),tt.append(bt)}if(lt.append(tt),Re.description){const bt=document.createElement("div");bt.className="mention-tip-desc",bt.textContent=Re.description,lt.append(bt)}return lt}function et(Re){const lt=oe();W?.removeAttribute("aria-describedby"),W=Re,Re.setAttribute("aria-describedby",lt.id);const tt=O(Re);lt.replaceChildren(tt.kind==="skill"?Ke(ge(tt.name)??{name:tt.name,description:""}):xe(tt.path||tt.name)),lt.classList.remove("positioned"),Q(),lt.classList.add("positioned"),lt.removeAttribute("inert")}function Y(){window.clearTimeout(G),window.clearTimeout(ee),W?.removeAttribute("aria-describedby"),W=null;const Re=P.value;Re?.classList.remove("positioned"),Re?.setAttribute("inert","")}function ne(Re){window.clearTimeout(ee),window.clearTimeout(G);const lt=P.value?.classList.contains("positioned")&&W===Re;G=window.setTimeout(()=>{Re.isConnected&&et(Re)},lt?0:F())}function D(){window.clearTimeout(G),window.clearTimeout(ee),ee=window.setTimeout(Y,j())}function X(Re){const lt=P.value;if(!(!lt||!lt.classList.contains("positioned")||!W)){if(Re.key==="Escape"){Re.target instanceof Node&<.contains(Re.target)&&W.focus(),Y(),Re.preventDefault(),Re.stopImmediatePropagation();return}if(Re.key==="Tab"&&Re.target instanceof Node&<.contains(Re.target)){const tt=Array.from(lt.querySelectorAll("button")),ht=tt[0],bt=tt[tt.length-1];(!Re.shiftKey&&Re.target===bt||Re.shiftKey&&Re.target===ht)&&(Re.preventDefault(),W.focus(),Y())}}}function ve(Re){const lt=Re.target;lt instanceof Node&&(se(lt)||W?.contains(lt))||Y()}function fe(Re){Re.addEventListener("mouseenter",()=>ne(Re)),Re.addEventListener("mouseleave",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&se(tt)||D()}),Re.addEventListener("focus",()=>ne(Re)),Re.addEventListener("blur",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&se(tt)||D()})}function pe(){Y()}function te(Re){return Re.querySelector(`button.${pS}`)}function de(Re){return Re.querySelector(`.${hS}`)}function ye(Re){const lt=te(Re);if(!lt)return;const tt=Re.querySelector("thead tr")??Re.querySelector("tr");if(!tt)return;const ht=tt.getBoundingClientRect(),bt=Re.getBoundingClientRect().top,Rt=Math.max(2,Math.round(ht.top-bt+(ht.height-m3e)/2));lt.style.top=`${Rt}px`,lt.style.right=`${Rt}px`}function Ce(Re){const lt=Re.querySelector("table");return lt!==null&<.scrollWidth>Re.clientWidth+1}function me(Re){const lt=`translateX(${Re.scrollLeft}px)`,tt=de(Re);tt&&(tt.style.transform=lt);const ht=te(Re);ht&&(ht.style.transform=lt);const bt=Re.scrollLeft+Re.clientWidth>=Re.scrollWidth-2;Re.classList.toggle(h3e,bt)}function be(Re){const lt=te(Re);if(!lt)return;const tt=Ce(Re),ht=Re.classList.contains(fS);lt.classList.toggle(mS,tt||ht),de(Re)?.classList.toggle(mS,tt),ye(Re),me(Re)}function re(Re){const lt=te(Re);if(lt)return lt;if(!Re.closest(".a-msg .msg"))return null;const tt=document.createElement("div");tt.className=hS,tt.setAttribute("aria-hidden","true");const ht=document.createElement("button");return ht.type="button",ht.className=pS,ht.innerHTML=ji("expand","sm"),ht.setAttribute("aria-label",s("conversation.widenTable")),ht.title=s("conversation.widenTable"),ht.addEventListener("click",bt=>{bt.preventDefault(),bt.stopPropagation(),ke(Re)}),Re.append(tt,ht),Re.addEventListener("scroll",()=>me(Re),{passive:!0}),be(Re),ht}function ke(Re){const lt=Re.classList.toggle(fS),tt=te(Re);if(tt){tt.innerHTML=ji(lt?"collapse":"expand","sm");const ht=s(lt?"conversation.restoreTableWidth":"conversation.widenTable");tt.setAttribute("aria-label",ht),tt.title=ht}be(Re),Re.dispatchEvent(new CustomEvent("pythinker-table-layout",{bubbles:!0}))}function Fe(){if(!(!i.value||l.streaming))for(const Re of i.value.querySelectorAll(".table-node-wrapper"))re(Re)}function at(){if(!(!i.value||l.streaming))for(const Re of i.value.querySelectorAll(".table-node-wrapper"))be(Re)}function dt(){Y(),vt().then(()=>{R(),C(),Fe()})}Ue(()=>l.text,dt),Ue(()=>l.streaming,dt);let $t=null,Tt=null;xn(()=>{dt(),i.value&&($t=new MutationObserver(dt),$t.observe(i.value,{childList:!0,subtree:!0}),typeof ResizeObserver<"u"&&(Tt=new ResizeObserver(at),Tt.observe(i.value))),window.addEventListener("scroll",pe,{capture:!0}),window.addEventListener("resize",pe),document.addEventListener("pointerdown",ve,{capture:!0}),document.addEventListener("keydown",X,{capture:!0})}),An(()=>{$t?.disconnect(),Tt?.disconnect(),window.removeEventListener("scroll",pe,{capture:!0}),window.removeEventListener("resize",pe),document.removeEventListener("pointerdown",ve,{capture:!0}),document.removeEventListener("keydown",X,{capture:!0}),Y(),P.value?.remove(),P.value=null});const Qt={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1,monacoOptions:{lineNumbers:!1,fontSize:13,fontFamily:"var(--font-mono)",padding:{top:12,bottom:12}}},Dt=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,en=B(()=>{const Re=M(u.value),lt=[];let tt=0;Dt.lastIndex=0;let ht;for(;(ht=Dt.exec(Re))!==null;){const Rt=ht[1]??"",on=Re.slice(tt,ht.index)+(Rt||"");on.trim()&<.push({kind:"md",text:on}),lt.push({kind:"diff",code:ht[2]??""}),tt=Dt.lastIndex}const bt=Re.slice(tt);return(bt.trim()||lt.length===0)&<.push({kind:"md",text:bt}),lt});function kn(Re){return Re.split(` -`).map(lt=>lt.startsWith("@@")?{type:"hunk",sign:"",text:lt}:/^\+(?!\+\+)/.test(lt)?{type:"add",sign:"+",text:lt.slice(1)}:/^-(?!--)/.test(lt)?{type:"del",sign:"-",text:lt.slice(1)}:lt.startsWith(" ")?{type:"ctx",sign:"",text:lt.slice(1)}:{type:"ctx",sign:"",text:lt})}const In=U(null);function Mn(Re,lt){ss(Re).then(tt=>{tt&&(In.value=lt,setTimeout(()=>{In.value=null},1400))})}return(Re,lt)=>(g(),S("div",{ref_key:"mdRef",ref:i,class:"md"},[c.value.frontmatter!==null?(g(),S("pre",i3e,I(c.value.frontmatter),1)):J("",!0),(g(!0),S(Me,null,rt(en.value,(tt,ht)=>(g(),S(Me,{key:ht},[tt.kind==="md"?(g(),ce(y(Fr),{key:0,content:tt.text,"custom-markdown-it":o,mode:"chat","code-renderer":f.value.codeRenderer,"is-dark":y(p),"code-block-light-theme":gS,"code-block-dark-theme":vS,themes:[gS,vS],"code-block-props":Qt,final:a.value,"smooth-streaming":e.streaming,"batch-rendering":h.value,"defer-nodes-until-visible":!1,onCopy:y(jP)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(g(),S("div",l3e,[_("div",a3e,[lt[0]||(lt[0]=_("span",{class:"diff-lang"},"diff",-1)),Z(Cn,{text:y(s)("filePreview.copyCode")},{default:ue(()=>[_("button",{class:"diff-copy","aria-label":y(s)("filePreview.copyCode"),onClick:bt=>Mn(tt.code,ht)},[Z(Le,{name:In.value===ht?"check":"copy",size:"sm"},null,8,["name"])],8,c3e)]),_:2},1032,["text"])]),_("pre",u3e,[_("code",null,[(g(!0),S(Me,null,rt(kn(tt.code),(bt,Rt)=>(g(),S("span",{key:Rt,class:Be(["diff-line",`diff-${bt.type}`])},[bt.type!=="hunk"?(g(),S("span",d3e,I(bt.sign),1)):J("",!0),_("span",f3e,I(bt.text),1)],2))),128))])])]))],64))),128))],512))}}),sa=mt(g3e,[["__scopeId","data-v-445dce9f"]]),v3e=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),w3e={class:"activity-notice",role:"status"},y3e={"aria-hidden":"true"},k3e={class:"an-label"},b3e=Ge({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(g(),S("div",w3e,[_("span",y3e,[Z(Go,{size:"sm"})]),_("span",k3e,I(e.label),1)]))}}),_3e=mt(b3e,[["__scopeId","data-v-5e7a6420"]]);function x3e(e,t="Yesterday"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),r=`${s(n.getHours())}:${s(n.getMinutes())}`,i=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(i&&l&&a)return r;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${r}`:i?`${s(n.getMonth()+1)}-${s(n.getDate())} ${r}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${r}`}catch{return e}}const S3e=Ge({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Lt(),o=U(!1),s=B(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),r=B(()=>o.value?s.value:x3e(t.time,n("conversation.yesterday")));function i(){o.value=!o.value}return(l,a)=>(g(),S("button",{type:"button",class:"msg-time",onClick:xt(i,["stop"])},I(r.value),1))}}),Av=mt(S3e,[["__scopeId","data-v-6761370d"]]);function C3e(e){return e.length===1?`0${e}`:e}function M3e(e,t){return`${String(Number(e))}:${C3e(t)}`}const wS=e=>/^\d+$/.test(e);function A3e(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,r,i,l]=n,a=r==="*"&&i==="*"&&l==="*",c=r==="*"&&i==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(wS(o)&&wS(s)&&c){const f=M3e(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const T3e=["data-turn-id"],E3e={class:"cn-bubble"},I3e={class:"cn-title"},L3e={key:0,class:"cn-prompt"},$3e={class:"cn-meta"},N3e={key:0,class:"cn-meta-item"},z3e={key:1,class:"cn-meta-item"},B3e=["aria-label"],R3e=["title"],F3e=Ge({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Lt(),o=B(()=>t.cron),s=B(()=>o.value?.missedCount!==void 0),r=B(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),i=B(()=>{const u=o.value?.cron;return u?A3e(u,n):""}),l=B(()=>s.value?"error":"ok"),a=B(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=B(()=>t.text??"");return(u,d)=>(g(),S("div",{class:Be(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",E3e,[_("span",I3e,I(r.value),1),c.value?(g(),S("span",L3e,I(c.value),1)):J("",!0)]),_("div",$3e,[Z(Le,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),i.value?(g(),S("span",N3e,I(i.value),1)):J("",!0),a.value?(g(),S("span",z3e,I(a.value),1)):J("",!0),_("span",{class:Be(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(g(),ce(Le,{key:0,name:"check",size:"sm"})):(g(),ce(Le,{key:1,name:"close",size:"sm"}))],10,B3e),o.value?.jobId?(g(),S("span",{key:2,class:"cn-meta-item cn-id",title:y(n)("conversation.cron.job",{id:o.value.jobId})},I(o.value.jobId),9,R3e)):J("",!0),e.createdAt?(g(),ce(Av,{key:3,time:e.createdAt},null,8,["time"])):J("",!0)])],10,T3e))}}),j3e=mt(F3e,[["__scopeId","data-v-d3807b0f"]]),u$="pythinkerWeb.taskNotification",O3e=/]*)>([\s\S]*?)<\/notification>/g,P3e=/([\w-]+)="([^"]*)"/g,H3e=/]*)>[\s\S]*?<\/output-file>/,D3e=/]*)>([\s\S]*?)<\/output-preview>/,V3e=/^Title: (.*)$/m,W3e=/^Severity: (.*)$/m;function w4(e){return e.replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function pm(e){const t={};for(const n of e.matchAll(P3e))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=w4(n[2]));return t}function hm(e){if(e===void 0)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function q3e(e,t,n){const o=pm(e),s=V3e.exec(t)?.[1]?.trim()??"",r=W3e.exec(t)?.[1]?.trim()??"";let i=t.split(` +`)&&!(function(P){const W=Ux(P);if(Zx(W))return!1;const G=XL(W);return G.length>=2&&G.some(ee=>ee.trim())})(j))})(r.value,H)?M():(function(){if(m+=1,p)return;const F=Math.max(0,(function(j){const q=j.parseCoalesceMs;return typeof q=="number"&&Number.isFinite(q)&&q>=0?q:80})(e)-(Br()-k));F<=0?M():p=setTimeout(M,F)})())},{flush:"sync",immediate:!0}),fu(b);const R=B(()=>{var H,V,A,F;return Sre(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(F=(A=(V=t.customComponentsMap)==null?void 0:V.value)!=null?A:{},Object.entries(F).map(([j,q])=>{const P=xr(j);return q==null||!P||sf(P)||cI.has(P)||Qd.has(P)?"":P}).filter(Boolean)))}),z=B(()=>{const{key:H,tags:V}=Cre(R.value);if(!H)return o;const A=s.get(H);if(A)return A;const F=Z_(t.instanceMsgId,{customHtmlTags:V});return s.set(H,F),F}),$=B(()=>{const H=z.value;if(!e.customMarkdownIt)return H;const V=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,V.__markstreamHasCustomParserExtensions=!0,V}),E=B(()=>{var H,V;const A=(H=e.parseOptions)!=null?H:{},F=t.effectiveFinal.value,j=R.value,q=F!=null,P=j.length>0;return q||P||A.streamParse==null?_t(_t(gn(_t({},A),{streamParse:(V=A.streamParse)==null||V}),q?{final:F}:{}),P?{customHtmlTags:j}:{}):A}),T=B(()=>{var H;return new Set(((H=E.value.customHtmlTags)!=null?H:[]).map(V=>String(V).trim().toLowerCase()).filter(Boolean))}),N=B(()=>qx(E.value,$.value,e.customMarkdownIt,{includeFinal:!0})),C=B(()=>qx(E.value,$.value,e.customMarkdownIt,{includeFinal:!1}));Ue([N,C],([H,V],[A,F])=>{A&&(H===A&&V===F||(M(),V!==F&&(l=[],u="")))},{flush:"sync"});const O=B(()=>{var H,V,A,F,j,q,P,W,G,ee,se;if((H=e.nodes)!=null&&H.length)return l=[],u="",w(0),Nt(e.nodes.slice());const oe=r.value;if(!oe)return l=[],u="",w(-1),[];const Q=t.debugPerformanceEnabled.value,ge=Q?Br():0,xe=$.value,Ke=N.value,et=C.value;a&&Ke!==a&&(function(at){var dt,$t;($t=(dt=at.stream)==null?void 0:dt.reset)==null||$t.call(dt)})(xe),c&&et!==c&&(l=[],u="");const Y=Object.keys((A=(V=t.customComponentsMap)==null?void 0:V.value)!=null?A:{}).length>0||typeof E.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const ne=!Y&&l.length>0&&oe.startsWith(u)&&et===c,D=Q?Wx(xe):null,X=Q?{}:void 0,ve=Yx(xe),fe=!ve&&!Y,pe=_t(_t(gn(_t({},E.value),{__reuseStableTopLevelNodes:fe}),ve?{__disableStreamParse:!0}:{}),X?{__timing:X}:{}),te=uL(oe,xe,pe),de=Q?Br():0,ye=Q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let Ce,me=Q?E3(te.length):void 0,be=0,ie=0,ke=0;if(ne){const at=Q?Br():0,[dt,$t]=(function(Qt){var Dt,en;const[kn,In]=Qt.scanGlobalReferenceAppend(Qt.previousContent,Qt.content),Mn=Qt.parseOptions;return[Qt.previousDirtyStartIndex>0&&Mn.final!==!0&&!Qt.customMarkdownIt&&!Yx(Qt.md)&&!kn&&typeof Mn.preTransformTokens!="function"&&typeof Mn.postTransformTokens!="function"&&typeof Mn.postTransformNodes!="function"&&((en=(Dt=Mn.customHtmlTags)==null?void 0:Dt.length)!=null?en:0)===0?Qt.previousDirtyStartIndex:0,In]})({content:oe,previousContent:u,previousDirtyStartIndex:x,parseOptions:E.value,customMarkdownIt:e.customMarkdownIt,md:xe,scanGlobalReferenceAppend:f});ke=$t;const Et=dt<=0;if(ye){const Qt=(function(Dt,en,kn,In={}){var Mn;if(!en.length)return{nodes:Dt,metrics:E3(Dt.length)};const Re=(Mn=In.scanStartIndex)!=null?Mn:0,lt=In.reuseDirtyTail!==!1,tt=(function(Rt,on,an,sn=0){const Yn=Math.min(Rt.length,on.length);for(let Kt=Math.min(Yn,Math.max(0,sn));Ktc1(at[Et]))})(Ce,ye,ie):(function(at,dt=0){for(let $t=Math.max(0,dt);$t((j=D?.total)!=null?j:0);t.logPerf(dt?"parse(stream)":"parse(sync)",_t(_t(_t({rendererId:t.instanceMsgId,ms:Math.round(Br()-ge),nodes:Ce.length,contentLength:oe.length,parseCommitCount:h,parseCoalescedCount:m,nodeReuseMs:Fe,referenceDefinitionScanChars:ke,signatureMs:(q=ye?.signatureMs)!=null?q:0,stabilizeSignatureMs:(P=ye?.stabilizeSignatureMs)!=null?P:0,primeSignatureMs:(W=ye?.primeSignatureMs)!=null?W:0,signatureCallCount:(G=ye?.signatureCallCount)!=null?G:0,stabilizeSignatureCallCount:(ee=ye?.stabilizeSignatureCallCount)!=null?ee:0,primeSignatureCallCount:(se=ye?.primeSignatureCallCount)!=null?se:0,stabilizeMs:be},me??{}),X?Object.fromEntries(sfe.map($t=>{var Et;return[$t,(Et=X[$t])!=null?Et:0]})):{}),at?{streamMode:at.lastMode,streamDelta:ffe(at,D),streamStats:at}:{}))}return Nt(Ce)});return{effectiveCustomHtmlTags:R,effectiveCustomHtmlTagsSet:T,mdBase:z,mdInstance:$,mergedParseOptions:E,getParsedNodesDirtyStartIndex:()=>x,getParsedNodesRevision:()=>v,parsedNodes:O}}function hfe(e){const{isClient:t}=e,n=U(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,p){if((m=(h=e.shouldTrackVisibleNodeIndices)==null?void 0:h.call(e))!=null&&!m)return;var h,m;const k=n.value,x=k.has(f);if(p){if(x)return;const w=new Set(k);return w.add(f),void(n.value=w)}if(!x)return;const v=new Set(k);v.delete(f),n.value=v})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,p]of s.entries())f{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>o.value&&a.value);return Y7()&&fu(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const gfe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},Xx=/auto|scroll|overlay/i;function vfe(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return Xx.test(t)||Xx.test(n)}function wfe(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const yfe={class:"m-0 p-0"},kfe=["data-probe"],bfe=to(Ge(gn(_t({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(g(),S("div",{class:"height-estimation-probes",style:Wt({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:i=>e.setParagraphWrapper(i),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[Z(y(h0),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:i=>e.setListItemWrapper(i),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",yfe,[Z(y(Wc),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:i=>e.setListWrapper(i),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[Z(y(qc),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(g(),S(Me,null,it(6,i=>_("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:Be(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[Z(y(Bp),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,kfe)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),Jx=Ge({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return b5((o=Cc(e.estimatedPreviewHeightPx))!=null?o:y5(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return hn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?hn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[hn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[hn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),hn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),hn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>hn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,hn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[hn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),hn("div",{class:"absolute inset-0"},[hn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),Qx=Ge({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return k5((o=Cc(e.estimatedPreviewHeightPx))!=null?o:w5(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return hn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?hn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[hn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[hn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),hn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>hn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[hn("span",{class:"action-icon block"})])))]):null,hn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[hn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),hn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),_fe={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Ns(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const xfe=["data-custom-id"],Sfe=["data-node-index","data-node-type"],eS="typewriter-simple-cursor-target",n$=to(Ge(gn(_t({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(L){if(!(typeof Event<"u"&&L instanceof Event))return typeof L=="string"&&s("copy-code",L),void s("copy",L)}const r=gs(),l=pn("markstreamNestedRendererProps",void 0);function a(L){const K=r?.vnode.props;return!!K&&(Object.prototype.hasOwnProperty.call(K,L)||Object.prototype.hasOwnProperty.call(K,String(L).replace(/[A-Z]/g,le=>`-${le.toLowerCase()}`)))}function c(L){var K,le;const ae=o[L];return a(L)?ae:(le=(K=l?.value)==null?void 0:K[L])!=null?le:ae}const u=B(()=>{return(L=c("mode"))==="chat"||L==="minimal"||L==="docs"?L:"docs";var L}),d=B(()=>Px(c("typewriter"))),f=B(()=>d.value!=="off"),p=B(()=>c("domMode")==="minimal"?"minimal":"full"),h=B(()=>{return(L={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":L.codeRenderer==="pre"||L.codeRenderer==="shiki"||L.codeRenderer==="monaco"?L.codeRenderer:L.renderCodeBlocksAsPre===!1||L.mode==="docs"?"monaco":"pre";var L}),m=B(()=>_fe[u.value]),k=B(()=>{var L;return(L=c("showTooltips"))!=null?L:m.value.showTooltips}),x=B(()=>{var L;return(L=c("fade"))!=null?L:m.value.fade}),v=B(()=>{var L;return(L=c("batchRendering"))!=null?L:m.value.batchRendering}),w=B(()=>{var L;return(L=c("initialRenderBatchSize"))!=null?L:m.value.initialRenderBatchSize}),b=B(()=>{var L;return(L=c("renderBatchSize"))!=null?L:m.value.renderBatchSize}),M=B(()=>{var L;return(L=c("renderBatchDelay"))!=null?L:m.value.renderBatchDelay}),R=B(()=>{var L;return(L=c("renderBatchBudgetMs"))!=null?L:m.value.renderBatchBudgetMs}),z=B(()=>{var L;return(L=c("renderBatchIdleTimeoutMs"))!=null?L:m.value.renderBatchIdleTimeoutMs}),$=B(()=>{var L;return(L=c("deferNodesUntilVisible"))!=null?L:m.value.deferNodesUntilVisible}),E=B(()=>{var L;return(L=c("maxLiveNodes"))!=null?L:m.value.maxLiveNodes}),T=B(()=>{var L;return(L=c("liveNodeBuffer"))!=null?L:m.value.liveNodeBuffer}),N=B(()=>{var L;return(L=c("nodeVirtual"))!=null?L:m.value.nodeVirtual}),C={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return p.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return k.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return o.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return x.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return R.value},get renderBatchIdleTimeoutMs(){return z.value},get deferNodesUntilVisible(){return $.value},get maxLiveNodes(){return E.value},get liveNodeBuffer(){return T.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function O(L){s("height-change",L)}function H(L){s("virtual-state-change",L)}function V(L){s("anchor-change",L)}const A=U(),F=U(null),j=U(null),q=U(null),P=Rs({1:null,2:null,3:null,4:null,5:null,6:null}),W=U(!1),G=new Map,ee=U(0),se=U(0),oe=U({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function Q(L,K){return typeof L!="string"?K:L.trim()||K}function ge(L){const K=Number(L);return Number.isFinite(K)&&K>0?Math.max(1,Math.trunc(K)):640}const xe=B(()=>{var L;const K=(L=C.viewportPriorityOptions)!=null?L:{},le=Q(K.rootMargin,y0);return{rootMargin:le,heavyBlockMargin:Q(K.heavyBlockMargin,le),maxTargets:ge(K.maxTargets)}}),Ke=B(()=>{var L;return(L=xe.value.rootMargin)!=null?L:y0}),et=B(()=>{var L;return(L=xe.value.maxTargets)!=null?L:640});function Y(){var L,K;if(((L=o.virtualScroll)==null?void 0:L.enabled)!==!0)return null;const le=(K=o.virtualScroll)==null?void 0:K.scrollRoot;return ne(typeof le=="function"?le():le)}function ne(L){return L?typeof HTMLElement<"u"&&L instanceof HTMLElement?L:typeof L=="object"&&"value"in L?ne(L.value):typeof L=="object"&&"$el"in L?ne(L.$el):null:null}jn(OL,xe);const{isClient:D,renderAsFragment:X,debugPerformanceEnabled:ve,resolvedShowTooltips:fe,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:te,ownsTypewriterCursor:de}=(function(L){const K=typeof window<"u",le=Kd(),ae=pn("markstreamHtmlPolicy",void 0),we=pn("markstreamTypewriterCursor",void 0),Ne=pn("markstreamSmoothStreaming",void 0),Oe=B(()=>L.renderAsFragment===!0),Ve=B(()=>!!(L.debugPerformance&&K&&typeof console<"u")),st=B(()=>{var ot;if(typeof L.showTooltips=="boolean")return L.showTooltips;const Pe=(ot=le.showTooltips)!=null?ot:le["show-tooltips"];return Pe===""||Pe===!0||Pe==="true"||Pe!==!1&&Pe!=="false"&&void 0}),We=B(()=>{var ot,Pe;return(Pe=(ot=L.htmlPolicy)!=null?ot:ae?.value)!=null?Pe:"safe"}),Ye=B(()=>we?.value!==!0);return{isClient:K,renderAsFragment:Oe,debugPerformanceEnabled:Ve,resolvedShowTooltips:st,resolvedHtmlPolicy:We,inheritedSmoothStreaming:Ne,inheritedTypewriterCursor:we,ownsTypewriterCursor:Ye}})(C),{resolveViewportRoot:ye,resolveScrollContainer:Ce,isReverseFlexScrollRoot:me,getNormalizedScrollTop:be,getOffsetTopWithinRoot:ie}=(function(L,K){function le(){var Ve,st;return(st=(Ve=K.scrollRoot)==null?void 0:Ve.call(K))!=null?st:null}function ae(Ve){if(typeof window>"u")return null;const st=le();if(st)return st;const We=Ve??L.value;if(!We)return null;const Ye=We.ownerDocument||document,ot=Ye.scrollingElement||Ye.documentElement;let Pe=We;for(;Pe&&Pe!==Ye.body&&Pe!==ot;){if(vfe(window.getComputedStyle(Pe))&&wfe(Pe))return Pe;Pe=Pe.parentElement}return null}function we(Ve){if(!K.isClient)return!1;try{const st=window.getComputedStyle(Ve);return!!(st.display||"").toLowerCase().includes("flex")&&(st.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ne(Ve,st,We){var Ye,ot;if(We)return Oe(st);const Pe=Ve.scrollTop;if(!we(Ve))return Pe;const Xe=Pe<0?-Pe:Pe;return Math.max(0,((Ye=Ve.scrollHeight)!=null?Ye:0)-((ot=Ve.clientHeight)!=null?ot:0))-Xe}function Oe(Ve){var st,We,Ye,ot,Pe;const Xe=Number((st=Ve.scrollingElement)==null?void 0:st.scrollTop),ft=Number((Ye=(We=Ve.documentElement)==null?void 0:We.scrollTop)!=null?Ye:0),ut=Number((Pe=(ot=Ve.body)==null?void 0:ot.scrollTop)!=null?Pe:0);return Math.max(0,Number.isFinite(Xe)?Xe:0,Number.isFinite(ft)?ft:0,Number.isFinite(ut)?ut:0)}return{resolveViewportRoot:ae,resolveScrollContainer:function(Ve){var st,We,Ye,ot;const Pe=le();if(Pe)return Pe;const Xe=ae((st=Ve??L.value)!=null?st:null);if(Xe)return Xe;const ft=(ot=(Ye=Ve?.ownerDocument)!=null?Ye:(We=L.value)==null?void 0:We.ownerDocument)!=null?ot:typeof document<"u"?document:null;return ft?.scrollingElement||ft?.documentElement||null},isReverseFlexScrollRoot:we,getNormalizedScrollTop:Ne,getOffsetTopWithinRoot:function(Ve,st){const We=st.ownerDocument||Ve.ownerDocument||document;if((function(Xe,ft){return Xe===ft.documentElement||Xe===ft.body||Xe===ft.scrollingElement})(st,We))return Ve.getBoundingClientRect().top+Oe(We);const Ye=st.getBoundingClientRect(),ot=Ve.getBoundingClientRect(),Pe=Ne(st,We,!1);return ot.top-Ye.top+Pe}}})(A,{isClient:D,scrollRoot:Y});jn("markstreamShowTooltips",fe),jn("markstreamHtmlPolicy",pe),jn("markstreamTypewriter",f),jn("markstreamFade",B(()=>C.fade!==!1)),jn("markstreamTypewriterCursor",B(()=>!0)),jn("markstreamTextStreamState",G),jn("markstreamStreamVersion",ee),jn("markstreamParseOptions",B(()=>C.parseOptions)),jn("markstreamCustomMarkdownIt",B(()=>C.customMarkdownIt));const{smoothStreamingEnabled:ke,renderContent:Fe,requestedFinal:at,effectiveFinal:dt}=(function(L,K){const le=mfe(_t(_t({},gfe),L.smoothStreamingOptions)),ae=B(()=>{var Pe,Xe,ft;return L.smoothStreaming!==!1&&!((Pe=L.nodes)!=null&&Pe.length)&&(L.smoothStreaming===!0||!((Xe=K.inheritedSmoothStreaming)!=null&&Xe.value))&&(L.smoothStreaming===!0||Px(L.typewriter)!=="off"||((ft=L.maxLiveNodes)!=null?ft:0)<=0)}),we=U(!K.isClient||L.smoothStreaming===!0);xn(()=>{we.value=!0});const Ne=B(()=>we.value&&ae.value),Oe=B(()=>{var Pe;return Ne.value?le.visible.value:(Pe=L.content)!=null?Pe:""}),Ve=B(()=>{var Pe,Xe;const ft=(Pe=L.parseOptions)!=null?Pe:{};return(Xe=L.final)!=null?Xe:ft.final}),st=B(()=>{const Pe=Ve.value;return Ne.value&&Pe!=null?!!Pe&&le.caughtUp.value:Pe});let We=0,Ye=!1;function ot(){We=0,Ye=!1}return Ue([()=>L.content,()=>L.nodes,Ne,Ve],([Pe,Xe,ft,ut])=>{if(Xe?.length)return ot(),void le.reset("");const Tt=Pe??"";if(!ft)return ot(),le.reset(Tt),void(ut&&le.finish({flush:!0}));const yt=le.source.value;if(Tt){if(Tt!==yt)if(Tt.startsWith(yt)){const Ot=Tt.slice(yt.length),Ht=le.pendingChars.value;Ot.length<=8?(We++,Ye||We>=2&&Ht<=8?(Ye=!0,le.reset(Tt)):le.enqueue(Ot)):(ot(),le.enqueue(Ot))}else ot(),le.reset(Tt)}else ot(),le.reset("");ut&&le.finish()},{immediate:!0}),{smoothStream:le,smoothStreamingEligible:ae,smoothStreamingEnabled:Ne,renderContent:Oe,requestedFinal:Ve,effectiveFinal:st}})(C,{isClient:D,inheritedSmoothStreaming:te}),$t=at.value===!0;jn("markstreamSmoothStreaming",ke);const Et=U(!1),Qt=U(!1),Dt=U(!1);let en="",kn=!1,In=null;function Mn(){D&&In!=null&&(window.clearTimeout(In),In=null)}function Re(){Et.value=!1,Mn()}function lt(L,K){if(!ve.value)return;const le=(function(){if(!ve.value)return null;const ae=on(tt),we=on(ht),Ne=Math.max(Rt,we);if(ae<=0&&Ne<=0)return null;const Oe={total:ae,maxPerFrame:Ne,byLabel:(Ve=tt,Object.fromEntries(Array.from(Ve.entries()).sort((st,We)=>We[1]-st[1]||st[0].localeCompare(We[0]))))};var Ve;return tt.clear(),ht.clear(),Rt=0,Oe})();console.info(`[markstream-vue][perf] ${L}`,le?gn(_t({},K),{layoutReads:le}):K)}Ue([()=>C.indexKey,()=>C.customId],()=>{var L,K;Re(),Qt.value=!1,Dt.value=!((L=o.nodes)!=null&&L.length)&&at.value!==!0&&!!o.content,en=(K=Fe.value)!=null?K:"",kn=en.length>0},{flush:"sync"}),Ue([()=>o.content,()=>o.nodes,at],([L,K,le])=>{!K?.length&&le!==!0&&L&&(Dt.value=!0)},{flush:"sync",immediate:!0}),Ue([Fe,()=>o.nodes,at],([L,K,le])=>{const ae=L??"";return K?.length||le===!0?(Re(),Qt.value=!1,en=ae,void(kn=!0)):(ae.length>0&&(Dt.value=!0),kn?(en&&ae.length>en.length&&ae.startsWith(en)?(Et.value=!0,Qt.value=!0,D&&(Mn(),In=window.setTimeout(()=>{var we;In=null,dt.value===!0||(we=o.nodes)!=null&&we.length||(q0(),Et.value=!1,Sl())},1200))):(ae.length"u")return null;const Ne=window;if(Ne.__markstreamLayoutReadPerformance)return Ne.__markstreamLayoutReadPerformance;const Oe={total:0,maxPerFrame:0,byLabel:{}};return Ne.__markstreamLayoutReadPerformance=Oe,Oe})();we&&(we.total=Number(we.total||0)+1,we.byLabel[ae]=Number(we.byLabel[ae]||0)+1,we.currentFrameTotal=Number(we.currentFrameTotal||0)+1,we.frameScheduled||(we.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>sn(we),0):queueMicrotask(()=>sn(we)):window.requestAnimationFrame(()=>sn(we))))})(L),bt||(bt=!0,D&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(an):typeof queueMicrotask!="function"?setTimeout(an,0):queueMicrotask(an)))}function Kt(L,K){return Yn(L),K()}const no=C.customId?`renderer-${C.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,As=(function(L){const K=new Map;return{scope:L,cache:K,clear:()=>K.clear()}})(no),ys=no;jn(ZL,As);const ao=ws(()=>C.customId),{effectiveCustomHtmlTagsSet:co,mergedParseOptions:oo,parsedNodes:Ct,getParsedNodesDirtyStartIndex:so,getParsedNodesRevision:Bn}=pfe(C,{instanceMsgId:no,renderContent:Fe,effectiveFinal:dt,smoothStreamingEnabled:ke,debugPerformanceEnabled:ve,customComponentsMap:ao,logPerf:lt});Ue(Ct,()=>{Et.value||As.clear(),ee.value+=1},{immediate:!0});const Pn=B(()=>({customId:C.customId,customHtmlTags:oo.value.customHtmlTags,parseOptions:C.parseOptions,customMarkdownIt:C.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:C.viewportPriority,viewportPriorityOptions:xe.value,mode:u.value,domMode:C.domMode,codeRenderer:h.value,codeBlockStream:C.codeBlockStream,codeBlockDarkTheme:C.codeBlockDarkTheme,codeBlockLightTheme:C.codeBlockLightTheme,codeBlockMonacoOptions:C.codeBlockMonacoOptions,renderCodeBlocksAsPre:C.renderCodeBlocksAsPre,codeBlockMinWidth:C.codeBlockMinWidth,codeBlockMaxWidth:C.codeBlockMaxWidth,codeBlockProps:C.codeBlockProps,mermaidProps:C.mermaidProps,d2Props:C.d2Props,infographicProps:C.infographicProps,showTooltips:fe.value,themes:C.themes,langs:C.langs,isDark:C.isDark,typewriter:f.value,smoothStreamingOptions:C.smoothStreamingOptions,parseCoalesceMs:C.parseCoalesceMs,fade:C.fade}));jn("markstreamNestedRendererProps",Pn);const js=B(()=>Ct.value),Os=B(()=>Ct.value.length),Es=U(null),ks=U(null),Lo=U(null),Ro=U(null),Ze=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Qe=!Ze&&C.customId?Bx(C.customId):null,ct=B(()=>Qe?(rm.value,Bx(C.customId)):null),mn=B(()=>{var L;return!!(!X.value&&C.customId&&!Ze&&((L=ct.value)!=null&&L.enabled))}),_o=B(()=>!!(D&&mn.value)),Un=B(()=>{var L;return!!(!X.value&&((L=o.virtualScroll)!=null&&L.enabled))}),Ps=B(()=>Un.value),Je=U(!1);xn(()=>{Je.value=!0});const ze=B(()=>!!(D&&Un.value));jn("markstreamHostScrollManaged",ze);const wt=B(()=>!!(Je.value&&ze.value)),Mt=B(()=>_o.value||ze.value),tn=B(()=>_o.value||wt.value),Xn=B(()=>{var L;return Mt.value&&((L=ct.value)==null?void 0:L.textEstimation)!==!1});function Jn(){const L=se.value||Kt("getMeasuredContainerWidth.clientWidth",()=>{var K;return((K=A.value)==null?void 0:K.clientWidth)||0});return Number.isFinite(L)&&L>0?L:0}const Ts=B(()=>{const L=Jn();return L>0?Math.max(1,Math.round(L)):640}),Xo=B(()=>{var L,K;return!(dt.value!==!0||Un.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(L=o.nodes)!=null&&L.length||Dt.value||!(((K=C.maxLiveNodes)!=null?K:0)<=0))}),io=B(()=>{var L;return Xo.value?50:Math.max(1,(L=C.maxLiveNodes)!=null?L:320)}),uo=B(()=>{var L;return Xo.value?16:Math.max(0,(L=C.liveNodeBuffer)!=null?L:60)}),vn=B(()=>{var L;return!X.value&&C.nodeVirtual!==!1&&!(((L=C.maxLiveNodes)!=null?L:0)<=0&&!Xo.value)&&(C.nodeVirtual===!0?Ct.value.length>0:Ct.value.length>io.value)}),Hs=B(()=>vn.value||_o.value||ze.value),bs=B(()=>C.viewportPriority!==!1),Cr=B(()=>!!bs.value&&!W.value);var ri;ri=B(()=>bs.value),jn(PL,ri);const Is=B(()=>{var L;return!(X.value||C.deferNodesUntilVisible===!1||((L=C.maxLiveNodes)!=null?L:0)<=0||vn.value||Ct.value.length>900||C.viewportPriority===!1)}),Ys=Zue(L=>{var K;return ye((K=L??A.value)!=null?K:null)},bs),{requestFrame:ro,cancelFrame:Io,hasIdleCallback:yi,isTestEnv:ki}=(function(L){const K=L.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,le=L.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ae=L.isClient&&typeof window.requestIdleCallback=="function",we=(function(){var Ne;if(typeof globalThis>"u"||!("process"in globalThis))return;const Oe=(Ne=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ne.value;return Oe?.env})();return{requestFrame:K,cancelFrame:le,hasIdleCallback:ae,isTestEnv:we?.NODE_ENV==="test"}})({isClient:D}),sr=B(()=>dt.value===!0&&!Un.value),{resolvedBatchSize:Oi,resolvedInitialBatch:Pi,batchingEnabled:Te,incrementalRenderingActive:Ae,renderedCount:De,previousRenderContext:Ut,adaptiveBatchSize:dn,previousBatchConfig:zn}=(function(L,K){var le;const ae=B(()=>{var ot;const Pe=Math.trunc((ot=L.renderBatchSize)!=null?ot:80);return Number.isFinite(Pe)?Math.max(0,Pe):0}),we=B(()=>{var ot;const Pe=Math.trunc((ot=L.initialRenderBatchSize)!=null?ot:ae.value);return Number.isFinite(Pe)?Math.max(0,Pe):ae.value}),Ne=B(()=>!K.renderAsFragment.value&&L.batchRendering!==!1&&ae.value>0&&K.isClient&&!K.isTestEnv),Oe=U(0),Ve=U({key:L.indexKey,total:0}),st=U(Math.max(1,ae.value||1)),We=B(()=>{var ot,Pe,Xe;return Ne.value&&!((ot=K.continuousStreaming)!=null&&ot.value)&&!((Pe=K.forceFullRenderFinalContent)!=null&&Pe.value)&&((Xe=L.maxLiveNodes)!=null?Xe:0)<=0}),Ye=U({batchSize:ae.value,initial:we.value,delay:(le=L.renderBatchDelay)!=null?le:16,enabled:We.value});return{resolvedBatchSize:ae,resolvedInitialBatch:we,batchingEnabled:Ne,incrementalRenderingActive:We,renderedCount:Oe,previousRenderContext:Ve,adaptiveBatchSize:st,previousBatchConfig:Ye}})(C,{isClient:D,isTestEnv:ki,renderAsFragment:X,forceFullRenderFinalContent:sr,continuousStreaming:B(()=>Qt.value&&dt.value!==!0)}),So=B(()=>{var L;return!X.value&&C.batchRendering!==!1&&Oi.value>0&&!ki&&((L=C.maxLiveNodes)!=null?L:0)<=0&&!sr.value}),Jo=B(()=>So.value),Qo=B(()=>Mt.value||Jo.value),Mr=B(()=>{var L;return Qo.value&&((L=ct.value)==null?void 0:L.codeBlockEstimation)!==!1}),es=new Map,rs=new Map,re=new WeakMap;let _e=null;const Ie=new WeakMap,je=new Map,nt=[];let kt=[],Pt=[],jt=-1;const Ln=jo(nt),cn=new Set,Rn=U(0);let wo=0;const qt=U(0),$n=B(()=>(qt.value,Array.from(es.entries()).sort((L,K)=>L[0]-K[0]))),Nn=U(null),qe=U(null);let he,$e=null,bn=0,ir=null;function Ls(){he.markFallbackHeightPrefixDirty()}function $0(L){return he.getFallbackNodeHeight(L)}function ua(L,K){return he.estimateHeightRange(L,K)}function _u(L){return he.estimateIndexForOffset(L)}const{activeRestoreAnchor:da,getRelativeScrollTopWithinContainer:o6,setRelativeScrollTopWithinContainer:kl,resolveAnchorOffset:xu,clearRestoreReconcile:N0,scheduleRestoreReconcile:_1,captureRestoreAnchor:ff,restoreAnchor:pf,getAnchorDrift:Su}=(function(L){const{isClient:K,containerRef:le,parsedNodeCount:ae,requestFrame:we,cancelFrame:Ne,resolveScrollContainer:Oe,getNormalizedScrollTop:Ve,getOffsetTopWithinRoot:st,isReverseFlexScrollRoot:We,estimateIndexForOffset:Ye,estimateHeightRange:ot,getFallbackNodeHeight:Pe,clamp:Xe}=L,ft=U(null);let ut=null,Tt=[];function yt(){const nn=Oe(),_n=le.value;if(!nn||!_n)return null;const Tn=nn.ownerDocument||_n.ownerDocument||document;if(nn===Tn.documentElement||nn===Tn.body||nn===Tn.scrollingElement){const fo=_n.getBoundingClientRect();return Math.max(0,-fo.top)}return Math.max(0,Ve(nn,Tn,!1)-st(_n,nn))}function Ot(nn){var _n;const Tn=Oe(),fo=le.value;if(!Tn||!fo)return;const Vs=Math.max(0,nn),$s=Tn.ownerDocument||fo.ownerDocument||document,$r=$s.defaultView||(typeof window<"u"?window:null);if(Tn===$s.documentElement||Tn===$s.body||Tn===$s.scrollingElement){const tl=Ve(Tn,$s,!0)+fo.getBoundingClientRect().top;return void((_n=$r?.scrollTo)==null||_n.call($r,0,Math.max(0,tl+Vs)))}jx(Tn,$s,st(fo,Tn)+Vs,{isReverseFlexScrollRoot:tl=>{var Gu;return(Gu=We?.(tl))!=null&&Gu},getNormalizedScrollTop:Ve})}function Ht(nn){const _n=ae.value,Tn=Xe(nn.nodeIndex,0,Math.max(0,_n-1));return ot(0,Tn)+Math.max(0,nn.offsetWithinNodePx)}function Jt(){if(ut!=null&&(Ne?.(ut),ut=null),K)for(const nn of Tt)window.clearTimeout(nn);Tt=[]}function Gt(nn){const _n=Ht(nn),Tn=yt();Tn!=null&&Math.abs(Tn-_n)<=.5||Ot(_n)}return{activeRestoreAnchor:ft,getRelativeScrollTopWithinContainer:yt,setRelativeScrollTopWithinContainer:Ot,resolveAnchorOffset:Ht,clearRestoreReconcile:Jt,applyRestoreAnchor:Gt,scheduleRestoreReconcile:function(){ft.value&&K&&ut==null&&(ut=we?we(()=>{ut=null,ft.value&&Gt(ft.value)}):null,ut==null&&ft.value&&Gt(ft.value))},captureRestoreAnchor:function(){const nn=yt(),_n=ae.value;if(nn==null||_n<=0)return null;const Tn=Xe(Ye(nn+1),0,_n-1),fo=ot(0,Tn),Vs=Pe(Tn);return{nodeIndex:Tn,offsetWithinNodePx:Xe(nn-fo,0,Math.max(0,Vs-1))}},restoreAnchor:function(nn){const _n=ae.value;if(ft.value={nodeIndex:Xe(nn.nodeIndex,0,Math.max(0,_n-1)),offsetWithinNodePx:Math.max(0,nn.offsetWithinNodePx)},Jt(),Gt(ft.value),K)for(const Tn of[0,120,280,480])Tt.push(window.setTimeout(()=>{ft.value&&Gt(ft.value)},Tn))},getAnchorDrift:function(nn){const _n=yt();return _n==null?null:_n-Ht(nn)}}})({isClient:D,containerRef:A,parsedNodeCount:Os,requestFrame:ro,cancelFrame:Io,resolveScrollContainer:()=>Nn.value||Ce(),getNormalizedScrollTop:be,getOffsetTopWithinRoot:ie,isReverseFlexScrollRoot:me,estimateIndexForOffset:_u,estimateHeightRange:ua,getFallbackNodeHeight:$0,clamp:Ds}),{nodeHeights:fa,heightStats:Xs,heightTreeSize:x1,heightSumTree:s6,heightKnownTree:pa,averageNodeHeight:Ar,resetHeightMeasurements:hf,pruneHeightMeasurements:mf,rebuildHeightTrees:bl,recordNodeHeight:gf,removeNodeHeights:i6,exportHeightCache:ha,importHeightCache:z0,fenwickRangeSum:Cu}=(function(L={}){const K=Rs({}),le=Rs({total:0,count:0}),ae=U(0),we=U([]),Ne=U([]);function Oe(){for(const Pe of Object.keys(K))delete K[Number(Pe)];le.total=0,le.count=0,ae.value=0,we.value=[],Ne.value=[]}function Ve(Pe,Xe,ft){for(let ut=Xe+1;ut0;ut-=ut&-ut)ft+=Pe[ut];return ft}function We(Pe){ae.value=Pe;const Xe=new Array(Pe+1).fill(0),ft=new Array(Pe+1).fill(0);for(const[ut,Tt]of Object.entries(K)){const yt=Number(ut),Ot=Number(Tt);!Number.isFinite(yt)||yt<0||yt>=Pe||!Number.isFinite(Ot)||Ot<=0||(Ve(Xe,yt,Ot),Ve(ft,yt,1))}we.value=Xe,Ne.value=ft}function Ye(Pe){if(!Number.isInteger(Pe)||Pe<0)return!1;const Xe=K[Pe];if(!Number.isFinite(Xe)||Xe<=0)return!1;if(delete K[Pe],le.total=Math.max(0,le.total-Xe),le.count=Math.max(0,le.count-1),ae.value>Pe){const ft=we.value,ut=Ne.value;ft.length&&ut.length&&(Ve(ft,Pe,-Xe),Ve(ut,Pe,-1))}return!0}const ot=B(()=>le.count>0?Math.max(12,le.total/le.count):32);return{nodeHeights:K,heightStats:le,heightTreeSize:ae,heightSumTree:we,heightKnownTree:Ne,averageNodeHeight:ot,resetHeightMeasurements:Oe,pruneHeightMeasurements:function(Pe){if(Pe<=0)return void Oe();let Xe=0,ft=0;for(const[ut,Tt]of Object.entries(K)){const yt=Number(ut),Ot=Number(Tt);!Number.isFinite(yt)||yt<0||yt>=Pe||!Number.isFinite(Ot)||Ot<=0?delete K[yt]:(Xe+=Ot,ft++)}le.total=Xe,le.count=ft},rebuildHeightTrees:We,recordNodeHeight:function(Pe,Xe,ft={}){(function(ut,Tt,yt={}){var Ot;if(!Number.isFinite(Tt)||Tt<=0)return!1;const Ht=K[ut];if(Ht&&(yt.allowShrink===!1&&Ttut){const Jt=we.value,Gt=Ne.value;if(Jt.length&&Gt.length)if(Ht){const nn=Tt-Ht;nn!==0&&Ve(Jt,ut,nn)}else Ve(Jt,ut,Tt),Ve(Gt,ut,1)}yt.notify!==!1&&((Ot=L.onHeightRecorded)==null||Ot.call(L))})(Pe,Xe,gn(_t({},ft),{notify:!0}))},removeNodeHeight:function(Pe,Xe={}){var ft;const ut=Ye(Pe);return ut&&Xe.notify!==!1&&((ft=L.onHeightRecorded)==null||ft.call(L)),ut},removeNodeHeights:function(Pe,Xe={}){var ft;let ut=0;for(const Tt of Pe)Ye(Number(Tt))&&ut++;return ut>0&&Xe.notify!==!1&&((ft=L.onHeightRecorded)==null||ft.call(L)),ut},exportHeightCache:function(){return Object.entries(K).map(([Pe,Xe])=>({index:Number(Pe),height:Number(Xe)})).filter(Pe=>Number.isFinite(Pe.index)&&Pe.index>=0&&Number.isFinite(Pe.height)&&Pe.height>0).sort((Pe,Xe)=>Pe.index-Xe.index)},importHeightCache:function(Pe,Xe={}){var ft;if(!Array.isArray(Pe))return;const ut=ae.value;let Tt=!1;if(Xe.mode!=="merge"){const yt=Object.keys(K);if(yt.length>0){for(const Ot of yt)delete K[Number(Ot)];Tt=!0}}for(const yt of Pe){const Ot=Number(yt.index),Ht=Number(yt.height);if(!Number.isInteger(Ot)||Ot<0||ut>0&&Ot>=ut||!Number.isFinite(Ht)||Ht<=0)continue;const Jt=K[Ot];Jt&&Math.abs(Jt-Ht)<=1||(K[Ot]=Ht,Tt=!0)}Tt&&((function(){let yt=0,Ot=0;const Ht=ae.value;for(const[Jt,Gt]of Object.entries(K)){const nn=Number(Jt),_n=Number(Gt);!Number.isFinite(nn)||nn<0||Ht>0&&nn>=Ht||!Number.isFinite(_n)||_n<=0?delete K[nn]:(yt+=_n,Ot++)}le.total=yt,le.count=Ot})(),ut>0&&We(ut),(ft=L.onHeightRecorded)==null||ft.call(L))},fenwickRangeSum:function(Pe,Xe,ft){if(ft<=Xe)return 0;const ut=st(Pe,ft-1);return Xe<=0?ut:ut-st(Pe,Xe-1)}}})({onHeightRecorded:()=>{Ls(),ze.value&&Vu(),da.value&&_1(),qe.value&&D0(),Mo("node-resize")}});function vf(L){Number.isInteger(L)&&L>=0&&cn.add(L)}function Mu(L){for(const K of L)vf(Number(K))}function Qr(L){wo++;let K=!0;try{const le=L();return K=le!==!1,le}finally{wo--,wo===0&&K&&Rn.value++}}function Au(){kt=[],Pt=[],jt=-1,cn.clear(),Ln.value=nt}function Er(){Au(),Qr(()=>hf()),je.clear()}function wf(L){!Number.isInteger(L)||L<0||L>=Ct.value.length||je.set(L,$u(L))}function Eu(L,K,le={}){const ae=fa[L];vf(L),gf(L,K,le);const we=fa[L];return Object.is(ae,we)?(cn.delete(L),!1):(we&&we>0?wf(L):ae&&je.delete(L),!0)}function yf(L,K){const le=Kt("getNodeLayoutHeight.slot.offsetHeight",()=>{var ae,we;return(we=(ae=es.get(L))==null?void 0:ae.offsetHeight)!=null?we:0});return le>0?le:Kt("getNodeLayoutHeight.content.offsetHeight",()=>K.offsetHeight)}function Tu(L,K={}){K.mode!=="merge"?Au():Mu(L.map(le=>le.index)),Qr(()=>z0(L,K)),N6()}const Se=B(()=>Is.value&&Cr.value),rt=B(()=>{var L;return!X.value&&C.batchRendering!==!1&&Oi.value>0&&((L=C.maxLiveNodes)!=null?L:0)<=0}),pt=B(()=>!X.value&&$t&&dt.value===!0&&!vn.value&&!Un.value&&!mn.value&&!Se.value&&!rt.value),un=B(()=>!!Ys&&Se.value),Co=B(()=>vn.value||ze.value),{focusIndex:Vo,liveRange:Wo,updateLiveRange:S1}=(function(L,K){const{parsedNodeCount:le,virtualizationEnabled:ae,maxLiveNodesResolved:we,liveNodeBufferResolved:Ne,clamp:Oe}=K,Ve=Ne??B(()=>{var Ye;return Math.max(0,(Ye=L.liveNodeBuffer)!=null?Ye:60)}),st=U(0),We=Rs({start:0,end:0});return{liveNodeBufferResolved:Ve,focusIndex:st,liveRange:We,updateLiveRange:function(){const Ye=le.value;if(!ae.value||Ye===0)return We.start=0,void(We.end=Ye);const ot=Math.min(we.value,Ye),Pe=Ve.value,Xe=Oe(st.value-Pe,0,Math.max(0,Ye-ot));We.start=Xe,We.end=Math.min(Ye,Xe+ot)}}})(C,{parsedNodeCount:Os,virtualizationEnabled:vn,maxLiveNodesResolved:io,liveNodeBufferResolved:uo,clamp:Ds}),Hi=new Map,Tr=new Map,Ir=new Map,kf=[],_l=new Map,ma=new Set,j9=U(0);let r6=!1;const O9=B(()=>(j9.value,ma.size)),Di=new Map,el=new Map,P9=U(0),l6=B(()=>{P9.value;let L=0;for(const K of Di.values())L+=Math.max(0,K);return L});let Vi=null;const bf=B(()=>{if(!vn.value)return Ct.value.length;const L=uo.value,K=Math.max(Wo.end+L,Pi.value),le=Math.min(Ct.value.length,K);return Math.max(De.value,le)});function _f(){r6||(r6=!0,queueMicrotask(()=>{r6=!1,j9.value+=1}))}function H9(L,K,le="node-resize"){if(!D||typeof window>"u")return null;const ae=window.setTimeout(()=>{ma.delete(ae)&&_f();try{K()}finally{Mo(le)}},Math.max(0,L));return ma.add(ae),_f(),ae}function xf(L){D&&L!=null&&(ma.delete(L)&&_f(),window.clearTimeout(L))}function D9(){if(D&&typeof window<"u")for(const L of ma)window.clearTimeout(L);ma.size&&(ma.clear(),_f()),kf.length=0,Ir.clear()}function qz(L){F.value=L}function Uz(L){j.value=L}function Zz(L){q.value=L}const{cancelScheduledFocusSync:a6,scheduleFocusSync:Lr}=(function(L){const{isClient:K,containerRef:le,virtualizationEnabled:ae,requestFrame:we,cancelFrame:Ne,syncFocusToScroll:Oe}=L;let Ve=null;function st(){var Ye,ot,Pe;return(Pe=(ot=(Ye=le.value)==null?void 0:Ye.ownerDocument)==null?void 0:ot.defaultView)!=null?Pe:typeof window<"u"?window:null}function We(){if(!Ve)return;const Ye=st();Ve.viaTimeout?Ye?Ye.clearTimeout(Ve.id):clearTimeout(Ve.id):Ne?.(Ve.id),Ve=null}return{cancelScheduledFocusSync:We,scheduleFocusSync:function(Ye={}){if(!ae.value)return;if(!K)return void Oe(!0);if(Ye.immediate)return We(),void Oe(!0);if(Ve)return;const ot=()=>{Ve=null,Oe()};if(we)return void(Ve={id:we(ot),viaTimeout:!1});const Pe=st();Ve={id:Pe?Pe.setTimeout(ot,16):setTimeout(ot,16),viaTimeout:!0}}}})({isClient:D,containerRef:A,virtualizationEnabled:vn,requestFrame:ro,cancelFrame:Io,syncFocusToScroll:function(L=!1){var K;if(!vn.value)return;const le=Nn.value||Ce();if(!le)return;const ae=le.ownerDocument||((K=A.value)==null?void 0:K.ownerDocument)||document,we=ae?.defaultView||(typeof window<"u"?window:null),Ne=le===ae?.documentElement||le===ae?.body,Oe=Ct.value.length;if(Oe<=0)return;if(!Ne&&Oe>0&&me(le)){const ut=Kt("syncFocusToScroll.clientHeight",()=>le.clientHeight||0),Tt=Kt("syncFocusToScroll.scrollTop",()=>le.scrollTop),yt=Tt<0?-Tt:Tt;return void Mf(Ds((Ve=Math.max(0,yt)+.5*Math.max(0,ut),he.estimateIndexForOffsetFromEnd(Ve)),0,Math.max(0,Oe-1)),L)}var Ve;const st=(function(ut,Tt,yt,Ot){const Ht=A.value;if(!Ht)return null;const Jt=Ot?0:Kt("syncFocusToScroll.model.root.getBoundingClientRect",()=>ut.getBoundingClientRect().top),Gt=Kt("syncFocusToScroll.model.container.getBoundingClientRect",()=>Ht.getBoundingClientRect().top),nn=Math.max(0,Jt-Gt),_n=Ot?Kt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Tn,fo,Vs,$s;return($s=(Vs=(fo=yt?.innerHeight)!=null?fo:(Tn=Tt.documentElement)==null?void 0:Tn.clientHeight)!=null?Vs:ut.clientHeight)!=null?$s:0}):Kt("syncFocusToScroll.model.root.clientHeight",()=>ut.clientHeight);return Ds(_u(nn+.5*Math.max(0,_n)),0,Math.max(0,Ct.value.length-1))})(le,ae,we,Ne);if(st!=null)return void Mf(st,L);const We=Ne?null:Kt("syncFocusToScroll.root.getBoundingClientRect",()=>le.getBoundingClientRect()),Ye=Ne?0:We.top,ot=Ne?Kt("syncFocusToScroll.viewport.clientHeight",()=>{var ut,Tt;return(Tt=(ut=we?.innerHeight)!=null?ut:le.clientHeight)!=null?Tt:0}):We.bottom,Pe=$n.value;let Xe=null,ft=null;for(const[ut,Tt]of Pe){if(!Tt)continue;const yt=Kt("syncFocusToScroll.slot.getBoundingClientRect",()=>Tt.getBoundingClientRect());yt.bottom<=Ye||yt.top>=ot||(Xe==null&&(Xe=ut),ft=ut)}if(Xe==null||ft==null){const ut=A.value;if(!ut)return;const Tt=Ne?{top:0}:Kt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>le.getBoundingClientRect()),yt=Kt("syncFocusToScroll.fallback.scrollTop",()=>be(le,ae,Ne)),Ot=Ne?(()=>{const Jt=Kt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>ut.getBoundingClientRect()),Gt=(Ne?0:Tt.top)-Jt.top;return Math.max(0,Gt)})():(()=>{const Jt=ie(ut,le);return Math.max(0,yt-Jt)})(),Ht=Ne?Kt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Jt,Gt,nn,_n;return(_n=(nn=(Gt=we?.innerHeight)!=null?Gt:(Jt=ae?.documentElement)==null?void 0:Jt.clientHeight)!=null?nn:le.clientHeight)!=null?_n:0}):Kt("syncFocusToScroll.fallback.root.clientHeight",()=>le.clientHeight);return void Mf(Ds(_u(Ot+.5*Math.max(0,Ht)),0,Math.max(0,Ct.value.length-1)),!0)}Mf(Math.round((Xe+ft)/2),L)}}),{visibleNodeIndices:c6,nodeVisibilityHandles:B0,nodeVisibilityWatchStops:Sf,nodeVisibilityFallbackTimers:V9,clearVisibilityFallback:Cf,markNodeVisible:ga,cleanupNodeVisibility:Kz,destroyNodeVisibilityState:u6}=hfe({isClient:D,shouldTrackVisibleNodeIndices:()=>Se.value,shouldCleanupNodeVisibility:()=>vn.value,onNodeMarkedVisible:L=>{vn.value?Lr():Vo.value=Ds(L,0,Math.max(0,Ct.value.length-1))},onNodeVisibilityCleaned:L=>{es.delete(L)&&vw()}}),{cleanupScrollListener:W9,setupScrollListener:Gz}=(function(L){const{isClient:K,virtualizationEnabled:le,listenerEnabled:ae,scrollRootElement:we,resolveScrollContainer:Ne,scheduleFocusSync:Oe,onScroll:Ve}=L;let st=null,We=null;function Ye(){st&&(st(),st=null),We=null,we.value=null}function ot(Pe){const Xe=L.getScrollTop?L.getScrollTop(Pe):Pe.scrollTop;return Math.max(0,Number.isFinite(Xe)?Math.abs(Xe):0)}return{cleanupScrollListener:Ye,setupScrollListener:function(){if(!K)return;if(!((Pe=ae?.value)!=null?Pe:le.value))return void Ye();var Pe;const Xe=Ne();if(!Xe)return void Ye();if(we.value===Xe&&st)return;Ye(),We=ot(Xe);const ft=()=>{if(Ve?.(),le.value){const ut=(function(Tt){const yt=ot(Tt),Ot=We;We=yt;const Ht=Math.max(480,.75*(Tt.clientHeight||0));return Ot==null?yt>Ht?{immediate:!0}:void 0:Math.abs(yt-Ot)>Ht?{immediate:!0}:void 0})(Xe);ut?Oe(ut):Oe()}};Xe.addEventListener("scroll",ft,{passive:!0}),we.value=Xe,st=()=>{Xe.removeEventListener("scroll",ft)}}}})({isClient:D,virtualizationEnabled:vn,listenerEnabled:Co,scrollRootElement:Nn,resolveScrollContainer:Ce,scheduleFocusSync:Lr,onScroll:function(){const L=qe.value;if(!L)return;const K=Lu();if(!K||(function(ae){if(Fu()>=bn)return ir=null,!1;const we=ir;if(we==null)return!0;const Ne=Math.abs(ae.scrollTop-we)<=2;return Ne||(ir=null),Ne})(K))return;const le=iw(K);le!=null?(le<-32||Math.abs(Math.max(0,le)-Math.max(0,L.distanceFromBottomPx))>32)&&H0("restore"):H0("restore")},getScrollTop:L=>{var K;const le=L.ownerDocument||((K=A.value)==null?void 0:K.ownerDocument)||document,ae=L===le.documentElement||L===le.body||L===le.scrollingElement;return Kt("scrollListener.getScrollTop",()=>be(L,le,ae))}});function Mf(L,K=!1){const le=Ds(L,0,Math.max(0,Ct.value.length-1));!K&&Math.abs(le-Vo.value)<=1||(Vo.value=le,S1())}function Ds(L,K,le){return Math.min(Math.max(L,K),le)}function d6(L=Ct.value.length){const K=so();return!Number.isInteger(K)||K<0?L:Ds(K,0,L)}function f6(L){return L?.firstElementChild}function q9(L,K){var le;return L?(le=L.matches)!=null&&le.call(L,K)?L:L.querySelector(K):null}function Yz(L,K){L<1||L>6||(P[L]=K)}function U9(){if(!Mt.value)return void(se.value=0);const L=Kt("updateExperimentContainerWidth.clientWidth",()=>{var K,le;return(le=(K=A.value)==null?void 0:K.clientWidth)!=null?le:0});se.value=L>0?L:0}let Iu=null;function p6(){Iu?.disconnect(),Iu=null}const Z9=I2("ViewportDeferredMarkdownCodeBlockNode",mr({loader:()=>Eo(null,null,function*(){return(yield ps(()=>import("./index5-CFutgKd9.js"),__vite__mapDeps([8,6,7]))).default}),loadingComponent:S5,delay:0,suspensible:!1}),S5);function K9(L){return L===Z9}const G9=B(()=>h.value==="pre"?Ei:h.value==="shiki"?Z9:em);function Y9(){var L;return((L=C.codeBlockProps)==null?void 0:L.showHeader)!==!1}function X9(L,K,le){const ae=fa[K],we=typeof ae=="number"&&ae>0;if(Xn.value&&!we&&!(function(Ne){return!!ao.value.paragraph&&(Ne.type==="paragraph"||Ne.type==="list_item"||Ne.type==="list")})(L)){const Ne=UL(L,le,oe.value);if(Ne)return Ne}if(Mr.value&&L.type==="code_block"){const Ne=(function(Oe){if(Oe.type!=="code_block")return null;const Ve=Tw(Oe,Rf(Oe));return K9(Ve)?"markdown":Ve===Ei?"pre":Ve===G9.value||Ve===em?"monaco":null})(L);if(Ne==="monaco"||Ne==="markdown"||Ne==="pre")return(function(Oe,Ve){var st,We,Ye;if(!Oe||Oe.type!=="code_block")return null;const ot=Ve.rendererKind,Pe=ot!=="pre"&&Ve.showHeader!==!1,Xe=!!Oe.diff;let ft=0,ut=500;if(ot==="monaco"){const yt=(st=Ve.monacoOptions)!=null?st:{},Ot=cm(Oe,yt,Ve.width),Ht=(function(Gt){const nn=typeof Gt?.fontSize=="number"&&Gt.fontSize>0?Gt.fontSize:12;return typeof Gt?.lineHeight=="number"&&Gt.lineHeight>0?Gt.lineHeight:Math.round(1.5*nn)})(yt),Jt=(function(Gt,nn){var _n,Tn;const fo=typeof((_n=Gt?.padding)==null?void 0:_n.top)=="number"?Gt.padding.top:nn?0:8,Vs=typeof((Tn=Gt?.padding)==null?void 0:Tn.bottom)=="number"?Gt.padding.bottom:nn?0:8;return Math.max(0,fo)+Math.max(0,Vs)})(yt,Xe);ut=typeof yt.MAX_HEIGHT=="number"&&yt.MAX_HEIGHT>0?yt.MAX_HEIGHT:500,ft=Math.round(Ot*Ht+Jt)}else if(ot==="markdown"){const yt=cm(Oe);ft=Math.round(21*yt+32)}else{const yt=cm(Oe);ft=Math.round(28*yt),ut=Number.POSITIVE_INFINITY}const Tt=Math.max(1,Math.min(ft,ut));return _t({kind:"code-block",height:Math.round(Tt+(Pe?40:0)),contentHeight:Tt,rendererKind:ot},Xe&&ot==="monaco"?{diffInline:gv((We=Ve.monacoOptions)!=null?We:{},(Ye=Ve.width)!=null?Ye:0)}:{})})(L,{rendererKind:Ne,monacoOptions:C.codeBlockMonacoOptions,showHeader:Y9(),width:le})}return null}PM(()=>{if(Rn.value,wo>0)return;const L=Ct.value,K=Bn();if(!L.length||!Qo.value)return kt=[],Pt=[],jt=-1,cn.clear(),void(Ln.value=nt);const le=se.value||Kt("estimatedNodeHeights.clientWidth",()=>{var We;return((We=A.value)==null?void 0:We.clientWidth)||0});if(!Number.isFinite(le)||le<=0)return kt=[],Pt=[],jt=-1,cn.clear(),void(Ln.value=nt);const ae=(function(We){return[Math.round(We),Xn.value,Mr.value,oe.value,C.codeBlockMonacoOptions,Y9(),h.value,ao.value,rm.value]})(le),we=kt.length<=L.length&&(Oe=ae,(Ne=Pt).length===Oe.length&&Ne.every((We,Ye)=>Object.is(We,Oe[Ye])));var Ne,Oe;const Ve=we&&jt===K?L.length:we?d6(L.length):0,st=we?Array.from(cn):[];kt.length=L.length;for(let We=Ve;We=0&&WeLn.value);he=(function(L){let K=!0,le=[0],ae="";function we(Ye){var ot;const Pe=L.nodeHeights[Ye];if(Number.isFinite(Pe)&&Pe>0)return Pe;const Xe=L.parsedNodes.value[Ye],ft=Xe?.type,ut=!!((ot=L.hasCustomParagraphComponent)!=null&&ot.call(L)),Tt=L.estimatedNodeHeights.value[Ye],yt=Tt?.height;if(!(function(Ht,Jt,Gt){return!!(Gt&&Jt?.kind==="simple-text"&&(Ht==="paragraph"||Ht==="list_item"||Ht==="list"))})(ft,Tt,ut)&&Number.isFinite(yt)&&yt>0)return yt;const Ot=nfe(Xe,L.getContainerWidth()||640);return ft==="heading"||ft==="paragraph"&&Ot<=28&&(function(Ht,Jt){if(Jt)return!1;const Gt=Ht.children;return!Array.isArray(Gt)||!Gt.length||Gt.every(KL)})(Xe,ut)?Ot:Math.max(L.averageNodeHeight.value,Ot)}function Ne(){var Ye;const ot=L.parsedNodes.value.length,Pe=L.getPrefixCacheKeyParts().join(":");if(!K&&ae===Pe)return le;const Xe=new Array(ot+1);Xe[0]=0;for(let ft=0;ft=((ot=ft[Xe])!=null?ot:0))return Xe-1;let ut=0,Tt=Xe-1,yt=Xe-1;for(;ut<=Tt;){const Ot=ut+Tt>>1;((Pe=ft[Ot+1])!=null?Pe:0)>=Ye?(yt=Ot,Tt=Ot-1):ut=Ot+1}return yt}function Ve(Ye,ot){var Pe,Xe;if(Ye>=ot)return 0;if(L.heightEstimationActive.value)return(function(Tt,yt){var Ot,Ht;const Jt=L.parsedNodes.value.length,Gt=Hx(Math.trunc(Tt),0,Jt),nn=Hx(Math.trunc(yt),Gt,Jt);if(Gt>=nn)return 0;const _n=Ne();return((Ot=_n[nn])!=null?Ot:0)-((Ht=_n[Gt])!=null?Ht:0)})(Ye,ot);if(L.heightTreeSize.value!==L.parsedNodes.value.length){let Tt=0;for(let yt=Ye;ytGt<=0?0:L.fenwickRangeSum(ut,0,Gt)+(Gt-L.fenwickRangeSum(Tt,0,Gt))*ft;let Ot=0,Ht=Pe.length-1,Jt=Pe.length-1;for(;Ot<=Ht;){const Gt=Ot+Ht>>1;yt(Gt+1)>=Ye?(Jt=Gt,Ht=Gt-1):Ot=Gt+1}return Jt}let Xe=Ye;for(let ft=0;ft0||Ye++}return Ye}return{markFallbackHeightPrefixDirty:function(){K=!0},getFallbackNodeHeight:we,estimateHeightRange:Ve,estimateIndexForOffset:st,estimateIndexForOffsetFromEnd:function(Ye){var ot,Pe;const Xe=L.parsedNodes.value;if(!Xe.length)return 0;if(Ye<=0)return Math.max(0,Xe.length-1);if(L.heightEstimationActive.value){const ut=(ot=Ne()[Xe.length])!=null?ot:0;return Oe(Math.max(0,ut-Ye))}if(L.heightTreeSize.value===Xe.length){const ut=Ve(0,Xe.length);return st(Math.max(0,ut-Ye))}let ft=Ye;for(let ut=Xe.length-1;ut>=0;ut--){const Tt=(Pe=L.nodeHeights[ut])!=null?Pe:L.averageNodeHeight.value;if(ft<=Tt)return ut;ft-=Tt}return 0},getEstimatedNodeHeightCount:We,buildVirtualHeightSummary:function(Ye){var ot;const Pe=L.parsedNodes.value.length;return{totalNodes:Pe,measuredCount:L.heightStats.count,estimatedCount:We(),averageNodeHeight:L.averageNodeHeight.value,topSpacerHeight:Ye.topSpacerHeight,bottomSpacerHeight:Ye.bottomSpacerHeight,estimatedTotalHeight:Ve(0,Pe),width:(ot=Ye.width)!=null?ot:L.getContainerWidth()}}}})({parsedNodes:Ct,nodeHeights:fa,heightStats:Xs,heightTreeSize:x1,heightSumTree:s6,heightKnownTree:pa,averageNodeHeight:Ar,heightEstimationActive:Mt,estimatedNodeHeights:R0,getContainerWidth:Jn,hasCustomParagraphComponent:()=>!!ao.value.paragraph,getPrefixCacheKeyParts:()=>{var L;const K=d2(se.value||Kt("getFallbackHeightPrefix.clientWidth",()=>{var ae;return((ae=A.value)==null?void 0:ae.clientWidth)||0})),le=((L=o.virtualScroll)==null?void 0:L.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[Ct.value.length,Xs.count,Math.round(Xs.total),Math.round(100*Ar.value),le,K,Mt.value?1:0,rm.value,ee.value,ao.value.paragraph?1:0]},fenwickRangeSum:Cu}),Ue(()=>Ct.value.length,L=>{var K;Ls(),L<=0?Er():(Lmf(K))),L!==x1.value&&bl(L))},{immediate:!0});const Xz=B(()=>{if(!vn.value)return Ct.value.map((ae,we)=>({node:ae,index:we}));const L=Ct.value.length,K=Ds(Wo.start,0,L),le=Ds(Wo.end,K,L);return Ct.value.slice(K,le).map((ae,we)=>({node:ae,index:K+we}))}),h6=B(()=>vn.value?ua(0,Math.min(Wo.start,Ct.value.length)):0),m6=B(()=>{if(!vn.value)return 0;const L=Ct.value.length;return ua(Math.min(Wo.end,L),L)});function J9(){return he.buildVirtualHeightSummary({topSpacerHeight:h6.value,bottomSpacerHeight:m6.value,width:C1()})}function Jz(){const L=Ct.value,K=J9();return gn(_t({},K),{probe:{paragraphReady:!!oe.value.paragraph,listItemReady:!!oe.value.listItem,listWrapperOverhead:oe.value.listWrapperOverhead,headingReadyLevels:Object.entries(oe.value.headings).filter(([,le])=>!!le).map(([le])=>Number(le))},nodes:L.map((le,ae)=>{var we,Ne,Oe,Ve,st,We,Ye,ot,Pe;return{index:ae,type:le.type,estimateKind:(Ne=(we=R0.value[ae])==null?void 0:we.kind)!=null?Ne:null,rendererKind:(Ve=(Oe=R0.value[ae])==null?void 0:Oe.rendererKind)!=null?Ve:null,estimatedHeight:(We=(st=R0.value[ae])==null?void 0:st.height)!=null?We:null,estimatedContentHeight:(ot=(Ye=R0.value[ae])==null?void 0:Ye.contentHeight)!=null?ot:null,measuredHeight:(Pe=fa[ae])!=null?Pe:null}})})}function g6(){return o.indexKey!=null?String(o.indexKey):Un.value?`virtual-${$o()}`:"markdown-renderer"}function Q9(L){const K=String(L),le=`${g6()}-`;if(!K.startsWith(le))return null;const ae=K.slice(le.length).match(/^(\d+)(?:$|-)/);if(!ae)return null;const we=Number(ae[1]);return!Number.isInteger(we)||we<0||we>=Ct.value.length?null:we}function $o(){var L,K,le;const ae=(L=o.virtualScroll)==null?void 0:L.sessionKey;return String(ae!=null&&ae!==""?ae:(le=(K=o.indexKey)!=null?K:C.customId)!=null?le:no)}function ls(){var L;const K=(L=o.virtualScroll)==null?void 0:L.threadKey;return K==null||K===""?void 0:String(K)}const Qz=B(()=>{var L,K,le;return(le=ls())!=null?le:String((K=(L=o.indexKey)!=null?L:C.customId)!=null?K:no)});function v6(L){var K;return(L??"")===((K=ls())!=null?K:"")}function xl(){var L,K,le;return K=(L=o.virtualScroll)==null?void 0:L.measurementKey,le=(function(){const ae=h.value;return(function(we){var Ne,Oe;const Ve=we.renderer,st=Ve==="monaco"?we.codeBlockMonacoOptions:void 0,We=we.codeBlockProps,Ye=Ve==="shiki";return[we.isDark?"dark":"light",Ve==="monaco"?"code-rich":Ve==="pre"?"code-pre":"code-shiki",we.codeBlockStream===!1?"code-static":"code-stream",Ns(we.codeBlockMinWidth),Ns(we.codeBlockMaxWidth),...Ye?[qce((Ne=We?.themes)!=null?Ne:we.themes,(Oe=We?.langs)!=null?Oe:we.langs)]:[],Ns(st?.fontSize),Ns(st?.lineHeight),Ns(st?.fontFamily),Ns(st?.tabSize),Ns(st?.MAX_HEIGHT),Ns(st?.wordWrap),Ns(st?.wrappingIndent),Ns(st?.padding),Ns(We?.showHeader),Ns(We?.showCopyButton),Ns(We?.showExpandButton),Ns(We?.showPreviewButton),Ns(We?.showCollapseButton),Ns(We?.showFontSizeButtons)].join("\0")})({renderer:ae,isDark:C.isDark,codeBlockStream:C.codeBlockStream,codeBlockMinWidth:C.codeBlockMinWidth,codeBlockMaxWidth:C.codeBlockMaxWidth,codeBlockMonacoOptions:ae==="monaco"?C.codeBlockMonacoOptions:void 0,codeBlockProps:C.codeBlockProps,themes:ae==="shiki"?C.themes:void 0,langs:ae==="shiki"?C.langs:void 0})})(),[K==null?"":String(K),le].join("\0")}function C1(){return Jn()}const Af=B(()=>d2(C1())),Wi=B(()=>[xl(),Af.value].join("\0")),eB=B(()=>{var L;return Un.value?["virtual",(L=ls())!=null?L:"",$o(),Wi.value].join("\0"):o.indexKey});function F0(){P9.value+=1}function w6(L){return!(!L||!Number.isInteger(L.index)||L.index<0||L.index>=Ct.value.length||L.sessionKey!==$o()||L.threadKey!==ls()||L.layoutEpochKey!==Wi.value)}function ew(L){const K=String(L),le=el.get(K);return le?w6(le)?le.index:null:Q9(K)}function tw(L="async-node"){(Di.size||el.size)&&(Di.clear(),el.clear(),F0(),Mo(L))}const j0=pn(Z8,null),y6={reportHeight(L,K){if(!ze.value)return;const le=ew(L);if(le==null)return;const ae=Hi.get(le);if(!ae)return;const we=Number(K),Ne=yf(le,ae);(function(Oe,Ve,st={}){Qr(()=>Eu(Oe,Ve,st))})(le,Number.isFinite(we)&&we>0?Math.max(we,Ne||0):Ne)},markPending(L){if(!ze.value)return;const K=Q9(L);K!=null&&(function(le,ae){var we;const Ne=el.get(le);if(Ne&&w6(Ne))return Di.set(le,Math.max(0,(we=Di.get(le))!=null?we:0)+1),F0(),void Mo("async-node");Di.set(le,1),el.set(le,(function(Oe){return{index:Oe,sessionKey:$o(),threadKey:ls(),layoutEpochKey:Wi.value}})(ae)),F0(),Mo("async-node")})(String(L),K)},markSettled(L){if(!ze.value)return;const K=String(L),le=ew(L);(le!=null||(function(ae){return Di.has(String(ae))})(K))&&(function(ae){var we;const Ne=(we=Di.get(ae))!=null?we:0;return!(Ne<=0||(Ne<=1?(Di.delete(ae),el.delete(ae)):Di.set(ae,Ne-1),F0(),Ne===1&&Mo("async-node"),0))})(K)&&le!=null&&Sl()}};function tB(){let L=0;for(const K of Hi.values())L+=Kt("getVisibleDomHeight.offsetHeight",()=>{var le;return(le=K?.offsetHeight)!=null?le:0});return Math.ceil(Math.max(0,L))}jn(Z8,{reportHeight(L,K){y6.reportHeight(L,K),j0?.reportHeight(L,K)},markPending(L){y6.markPending(L),j0?.markPending(L)},markSettled(L){y6.markSettled(L),j0?.markSettled(L)}});let k6,b6=null,O0=null;function Ef(L){return L!==!1&&L!=null&&L!==""}function nw(){return vn.value?(function(){if(!vn.value)return!0;const L=Ct.value.length,K=Ds(Wo.start,0,L),le=Ds(Wo.end,K,L);if(K>=le)return!0;for(let ae=K;ae=bf.value}function _6(){return dt.value===!0&&!Et.value&&l6.value===0&&ma.size===0&&_l.size===0&&Vi==null&&nw()}function ow(){var L,K;if(((L=o.virtualScroll)==null?void 0:L.settleMode)!=="manual"||b6===$o()&&k6===ls())return!0;const le=(K=o.virtualScroll)==null?void 0:K.settledToken;return!!Ef(le)&&O0===Wu(le)}function x6(){return _6()&&ow()}function nB(L,K){return K.totalNodes<=0?L==="final"?"final":"estimate":K.measuredCount>=K.totalNodes?L==="final"?"final":"measured":K.measuredCount>0||K.estimatedCount>0?"mixed":"estimate"}function M1(L="manual",K){const le=J9(),ae=(function(we){return we||(dt.value!==!0?Ct.value.length>0?"streaming":"estimating":!nw()||_l.size>0||Vi!=null?"measuring":x6()?"settled":"settling")})(K);return{sessionKey:$o(),threadKey:ls(),phase:ae,nodeCount:le.totalNodes,liveRange:{start:Wo.start,end:Wo.end},renderedCount:De.value,measuredCount:le.measuredCount,estimatedCount:le.estimatedCount,averageNodeHeight:le.averageNodeHeight,topSpacerHeight:le.topSpacerHeight,bottomSpacerHeight:le.bottomSpacerHeight,visibleDomHeight:tB(),totalHeight:sw(),width:le.width,final:dt.value===!0,stable:x6(),confidence:nB(ae,le),reason:L}}function Lu(){const L=Nn.value||Ce(),K=A.value;if(!L||!K)return null;const le=L.ownerDocument||K.ownerDocument||document,ae=L===le.documentElement||L===le.body||L===le.scrollingElement,we=Kt("getScrollBox.scrollTop",()=>be(L,le,ae)),Ne=Kt("getScrollBox.scrollHeight",()=>{var Ve,st,We,Ye,ot;return ae?Math.max((st=(Ve=le.documentElement)==null?void 0:Ve.scrollHeight)!=null?st:0,(Ye=(We=le.body)==null?void 0:We.scrollHeight)!=null?Ye:0,(ot=L.scrollHeight)!=null?ot:0):L.scrollHeight}),Oe=Kt("getScrollBox.clientHeight",()=>{var Ve;return ae?((Ve=le.documentElement)==null?void 0:Ve.clientHeight)||L.clientHeight||0:L.clientHeight});return{root:L,doc:le,isViewportRoot:ae,scrollTop:we,scrollHeight:Ne,clientHeight:Oe}}function sw(){const L=Ct.value.length,K=Math.max(0,ua(0,L)),le=Kt("getRendererLogicalHeight.offsetHeight",()=>{var we,Ne;return(Ne=(we=A.value)==null?void 0:we.offsetHeight)!=null?Ne:0}),ae=Math.max(0,le>0?le:Kt("getRendererLogicalHeight.scrollHeight",()=>{var we,Ne;return(Ne=(we=A.value)==null?void 0:we.scrollHeight)!=null?Ne:0}));return L<=0?Math.ceil(le):vn.value?K>0?Math.max(1,Math.ceil(K),(function(){let we=h6.value+m6.value;for(const Ne of es.values())Ne&&(we+=Math.max(0,Kt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ne.offsetHeight||0)));return Math.ceil(Math.max(0,we))})(),(function(we,Ne){return we<=0||Ne<=0?0:Ne<=we+Math.max(512,.05*we)?Math.ceil(Ne):0})(K,ae)):Math.max(1,Math.ceil(ae)):ze.value?K>0||Xs.count>0||he.getEstimatedNodeHeightCount()>0?(Ae.value&&De.value,Math.max(1,Math.ceil(ae),Math.ceil(K))):Math.ceil(ae):Math.max(1,Math.ceil(ae),Math.ceil(K))}function iw(L){const K=A.value;if(!K)return null;const le=Kt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>K.getBoundingClientRect());return(function(we){return we.isViewportRoot?we.clientHeight:Kt("getViewportBottomInRoot.getBoundingClientRect",()=>we.root.getBoundingClientRect().bottom)})(L)-le.bottom}function oB(L={}){const K=L.requireViewport!==!1,le=(function(Ne=64){const Oe=Lu(),Ve=A.value;if(!Oe||!Ve)return!1;const st=(function(Ye){if(Ye.isViewportRoot)return{top:0,bottom:Ye.clientHeight};const ot=Kt("getVirtualViewportRect.getBoundingClientRect",()=>Ye.root.getBoundingClientRect());return{top:ot.top,bottom:ot.bottom}})(Oe),We=Kt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Ve.getBoundingClientRect());return We.bottom>=st.top-Ne&&We.top<=st.bottom+Ne})();if(K&&!le)return null;const ae=(function(){const Ne=Lu(),Oe=A.value;if(!Ne||!Oe||Math.max(0,Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight)>64)return null;const Ve=iw(Ne);return Ve==null?null:Ve>=-8&&Ve<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Ve)}:null})();if(ae)return{anchor:ae,captured:!0};const we=ff();if(we)return{anchor:{type:"node",nodeIndex:we.nodeIndex,offsetWithinNodePx:we.offsetWithinNodePx},captured:le};if(L.allowFallback===!0){const Ne=(function(){const Oe=Ct.value.length;return Oe<=0?null:{type:"node",nodeIndex:Ds(Vo.value,0,Math.max(0,Oe-1)),offsetWithinNodePx:0}})();return Ne?{anchor:Ne,captured:!1}:null}return null}function S6(L){let K=2166136261;for(let le=0;le>>0).toString(36)}function sB(L,K){let le=L;for(let ae=0;ae8192?`${ae.slice(0,8192)}...${ae.length}`:ae;return`${ae.length}:${S6(we)}`})(L)}`;if(typeof L=="function")return"fn";if(typeof L!="object")return typeof L;if(K.has(L))return"cycle";if(le>=6)return"max-depth";K.add(L);try{if(Array.isArray(L)){if(L.length<=160){const We=[];for(let Ye=0;Ye=Ve&&Oe.push(Ye)}return[`a:${L.length}`,`h=${Ne.join(",")}`,`t=${Oe.join(",")}`,`all=${(st>>>0).toString(36)}`].join(":")}const ae=L,we=Object.keys(ae).filter(Ne=>{const Oe=ae[Ne];return Ne!=="parent"&&Ne!=="el"&&Ne!=="component"&&(Oe==null||typeof Oe=="string"||typeof Oe=="number"||typeof Oe=="boolean"||iB.has(Ne))}).sort();return`o:${we.length}:${we.map(Ne=>`${Ne}=${Tf(ae[Ne],K,le+1)}`).join(";")}`}finally{K.delete(L)}}let C6=-1,M6="",A1=[2166136261];function $u(L){const K=Ct.value[L];return K?S6(Tf(K)):""}function rB(L,K){let le=L;for(let ae=0;ae>>0}function A6(){var L,K;const le=ee.value;if(C6===le)return M6;const ae=Ct.value.length;let we=d6(ae);(C6!==le-1||we>ae||A1.length>>0).toString(36),C6=le,M6}function P0(L,K={}){var le;const ae=K.includeHeightCache===!0,we=(le=K.includeContentHash)!=null?le:ae,Ne=ae?(function(Ve){const st=(function(){var ut,Tt;const yt=Number((Tt=(ut=o.virtualScroll)==null?void 0:ut.heightCacheLimit)!=null?Tt:5e3);return!Number.isFinite(yt)||yt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(yt))})();if(!Number.isFinite(st)||Ve.length<=st)return Ve;const We=new Map,Ye=ut=>{!ut||We.size>=st||We.set(ut.index,ut)},ot=Ct.value.length,Pe=Ds(Wo.start-2*uo.value,0,ot),Xe=Ds(Wo.end+2*uo.value,Pe,ot);for(const ut of Ve)ut.index>=Pe&&ut.index=0&&We.sizeut.index-Tt.index).slice(0,st)})(ha().map(Ve=>{var st;const We=Ct.value[Ve.index];return We?gn(_t({},Ve),{nodeType:String((st=We.type)!=null?st:""),signature:$u(Ve.index)}):null}).filter(Ve=>!!Ve)):[],Oe=oB({allowFallback:K.allowAnchorFallback===!0,requireViewport:K.requireViewport});return Oe||Ne.length||K.includeEmptyState===!0?gn(_t({sessionKey:L.sessionKey,threadKey:L.threadKey},Oe?{anchor:Oe.anchor,anchorCaptured:Oe.captured}:{anchorCaptured:!1}),{metrics:L,width:L.width,contentHash:we?A6():void 0,measurementKey:xl()||void 0,heightCache:Ne.length?Ne:void 0}):null}function E6(L){var K,le;const ae=Lu();if(!ae)return;const we=(function(Ve){const st=A.value;if(!st)return null;const We=ie(st,Ve.root),Ye=Ct.value.length,ot=Kt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>st.offsetHeight||0),Pe=Math.max(0,ot>0?ot:Ye>0?Kt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>st.scrollHeight||0):0),Xe=sw();return We+Math.max(Pe,Xe)})(ae);if(we==null)return;const Ne=Math.max(0,L.distanceFromBottomPx),Oe=Math.max(0,we-ae.clientHeight-Ne);(function(Ve){bn=Fu()+120,ir=Ve})(Oe),ae.isViewportRoot?(le=(K=ae.doc.defaultView)==null?void 0:K.scrollTo)==null||le.call(K,0,Oe):jx(ae.root,ae.doc,Oe,{isReverseFlexScrollRoot:me,getNormalizedScrollTop:be})}const T6=[];function rw(){if(D)for($e!=null&&(Io?.($e),$e=null);T6.length;){const L=T6.pop();L!=null&&window.clearTimeout(L)}}function H0(L){const K=!!qe.value;qe.value=null,bn=0,ir=null,rw(),K&&L&&Mo(L)}function D0(){if(!qe.value||!D||$e!=null)return;const L=()=>{$e=null;const K=qe.value;K&&E6(K)};$e=ro?ro(L):null,$e==null&&L()}function lw(L,K={}){const le=Ct.value.length;return le<=0?[]:L.filter(ae=>!(!Number.isInteger(ae.index)||ae.index<0||ae.index>=le)&&!(!Number.isFinite(ae.height)||ae.height<=0)&&!(K.requireSignature&&!ae.signature)&&!(K.requireCompatibilityMetadata&&!ae.nodeType&&!ae.signature)&&(function(we){var Ne;const Oe=Ct.value[we.index];return!(!Oe||we.nodeType&&we.nodeType!==String((Ne=Oe.type)!=null?Ne:"")||we.signature&&we.signature!==$u(we.index))})(ae))}function aw(L){const K=d2(C1()),le=d2(L);return K!==-1&&le!==-1&&K===le}function I6(L){var K;const le=Number(L?.width);if(Number.isFinite(le)&&le>0)return le;const ae=Number((K=L?.metrics)==null?void 0:K.width);return Number.isFinite(ae)&&ae>0?ae:null}function cw(L){var K;return L.sessionKey===$o()&&!!v6(L.threadKey)&&((K=L.measurementKey)!=null?K:"")===xl()&&!!aw(I6(L))&&!!(function(le){const ae=le.heightCache;return!!ae?.length&&(uw(le)?ae.some(we=>!!(we.nodeType||we.signature)):ae.some(we=>!!we.signature))})(L)}function uw(L){return!!(L.contentHash&&L.contentHash===A6())}function lB(L){return!uw(L)}let E1=null,T1=null,If=null,Nu=null,zu=null;function L6(L){var K;const le=L.map(we=>{var Ne,Oe;return[we.index,Math.round(10*we.height),(Ne=we.nodeType)!=null?Ne:"",(Oe=we.signature)!=null?Oe:""].join("")}).join(""),ae=d2(C1());return[(K=ls())!=null?K:"",$o(),xl(),Ct.value.length,ae,L.length,S6(le)].join(":")}function dw(L=(K=>(K=o.virtualScroll)==null?void 0:K.heightCache)()){if(!ze.value||!L?.length||Ct.value.length<=0||!aw((K=o.virtualScroll)==null?void 0:K.heightCacheWidth))return!1;var K;const le=lw(L,{requireSignature:!0});if(!le.length)return!1;const ae=L6(le);return ae===E1?(T1="standalone",!0):(Tu(le,{mode:"merge"}),Ls(),E1=ae,T1="standalone",Ou(),Mo("restore"),!0)}function $6(L,K={}){var le,ae,we;if(!ze.value||!L||L.sessionKey!==$o()||!v6(L.threadKey)||Ct.value.length<=0)return!1;const Ne=!!((le=L.heightCache)!=null&&le.length)&&!Lf(),Oe=!L.anchor||L.anchorCaptured===!1&&K.allowUncapturedAnchor!==!0?null:L.anchor,Ve=K.restoreAnchor===!0&&!!Oe&&!Lf()&&Number(I6(L))>0;let st=!1;if((ae=L.heightCache)!=null&&ae.length&&cw(L)){const Ye=lw(L.heightCache,{requireCompatibilityMetadata:!L.contentHash,requireSignature:lB(L)});Ye.length&&(Tu(Ye,{mode:"merge"}),Ls(),E1=L6(Ye),T1="restore",Ou(),st=!0)}if(Ne||Ve)return!1;if(!K.restoreAnchor||!Oe)return st&&Mo("restore"),!0;const We=(function(Ye,ot){var Pe;const Xe=Ye.anchor,ft=Xe?Xe.type==="bottom"?`bottom:${Math.round(Xe.distanceFromBottomPx)}`:`node:${Xe.nodeIndex}:${Math.round(Xe.offsetWithinNodePx)}`:"none";return[(Pe=ls())!=null?Pe:"",$o(),xl(),Af.value,ot,ft].join(":")})(L,(we=K.restoreToken)!=null?we:"imperative");return If===We?(st&&Mo("restore"),!0):(If=We,(function(Ye){const ot=()=>{if(Ye.type==="node")return H0(),void pf({nodeIndex:Ye.nodeIndex,offsetWithinNodePx:Ye.offsetWithinNodePx});if(N0(),da.value=null,qe.value=Ye,rw(),E6(Ye),D)for(const Pe of[0,120,280,480])T6.push(window.setTimeout(()=>{const Xe=qe.value;Xe&&E6(Xe)},Pe))};(function(Pe){if(!vn.value)return!1;const Xe=Ct.value.length;return!(Xe<=0||(Vo.value=Pe.type==="node"?Ds(Pe.nodeIndex,0,Xe-1):Xe-1,S1(),0))})(Ye)?vt(ot):ot()})(Oe),Mo("restore"),!0)}function Lf(){const L=C1();return Number.isFinite(L)&&L>0}function fw(L){var K;return L.sessionKey===$o()&&!!v6(L.threadKey)&&(Ct.value.length<=0||!(!((K=L.heightCache)!=null&&K.length)||Lf())||!(!(L.anchor&&Number(I6(L))>0)||Lf()))}function N6(){je.clear();for(const L of Object.keys(fa)){const K=Number(L);Number.isInteger(K)&&K>=0&&K{let K=!1,le=null;const ae=()=>{K||(K=!0,le!=null&&window.clearTimeout(le),L())};if(ro)return ro(ae),void(le=window.setTimeout(ae,50));le=window.setTimeout(ae,0)})}function z6(L,K=ls(),le=Wi.value){return $o()===L&&ls()===K&&Wi.value===le}function B6(){return Eo(this,arguments,function*(L={}){var K,le,ae,we,Ne;const Oe=$o(),Ve=ls(),st=Wi.value,We=(K=L.frames)!=null?K:2,Ye=(le=L.timeoutMs)!=null?le:120,ot=(ae=L.reason)!=null?ae:"manual",Pe=L.expectedSettledTokenKey,Xe=L.flushPendingTimers===!0,ft=M1(ot),ut=()=>gn(_t({},ft),{phase:ft.final?"settling":ft.phase,stable:!1,confidence:ft.confidence==="final"?"mixed":ft.confidence,reason:ot}),Tt=()=>z6(Oe,Ve,st)&&(Pe==null||ju()===Pe);for(let Jt=0;Jtwindow.setTimeout(Gt,Jt))})(Ye),!Tt()||(Xe&&D9(),Sl(),Bu(),!Tt()))return ut();const yt=_6();yt&&(b6=Oe,k6=Ve,((we=o.virtualScroll)==null?void 0:we.settleMode)==="manual"&&Pe!=null&&Ef((Ne=o.virtualScroll)==null?void 0:Ne.settledToken)&&ju()===Pe&&(O0=Wu(o.virtualScroll.settledToken)));const Ot=Tt()&&yt&&ow(),Ht=M1(ot,Ot?"final":void 0);return P6(Ht,!0),Ht})}let R6="content",I1=null,L1=null,F6=0,Ru=null,V0=null,j6=null,O6=null;function Fu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hw(L){var K,le;const ae=Ru;if(!ae)return!0;const we=(le=(K=o.virtualScroll)==null?void 0:K.heightDiffThresholdPx)!=null?le:1;return Math.abs(L.totalHeight-ae.totalHeight)>we||L.sessionKey!==ae.sessionKey||L.phase!==ae.phase||L.stable!==ae.stable||L.final!==ae.final||L.threadKey!==ae.threadKey||L.nodeCount!==ae.nodeCount||L.measuredCount!==ae.measuredCount||L.width!==ae.width}function ju(L=(K=>(K=o.virtualScroll)==null?void 0:K.settledToken)()){return Ns(L)}function mw(L,K){var le,ae;return[L,K.sessionKey,(le=K.threadKey)!=null?le:"",xl(),A6(),Ns((ae=o.virtualScroll)==null?void 0:ae.settledToken),Math.round(K.totalHeight),Math.round(K.width)].join("\0")}function Ou(){j6=null,O6=null,V0=null}function aB(L){const K=L.heightCache;return K?.length?L6(K):""}function Pu(L){var K,le,ae;const we=L.metrics,Ne=L.anchor?(Oe=L.anchor).type==="bottom"?`bottom:${Math.round(Oe.distanceFromBottomPx)}`:`node:${Oe.nodeIndex}:${Math.round(Oe.offsetWithinNodePx)}`:"none";var Oe;return[L.sessionKey,(K=L.threadKey)!=null?K:"",(le=L.measurementKey)!=null?le:xl(),(ae=L.contentHash)!=null?ae:"",aB(L),Ne,L.anchorCaptured?1:0,we.liveRange.start,we.liveRange.end,we.renderedCount,we.nodeCount,Math.round(we.totalHeight),Math.round(we.width),we.phase,we.stable?1:0].join("\0")}function P6(L,K=!1){if(!ze.value||(function(Oe=!1){return!Oe&&Un.value&&!wt.value})(K))return;const le=K||hw(L),ae=(function(Oe,Ve=!1){return Ve||Oe.stable||Oe.phase==="final"?{state:P0(Oe,{includeHeightCache:!0})}:{state:P0(Oe)}})(L,K),we=ae.state,Ne=!!(we&&(le||(function(Oe,Ve=!1){return!!Ve||Pu(Oe)!==V0})(we,K)));if(le&&(O(L),Ru=L,F6=Fu()),we&&Ne&&(H(we),we.anchor&&V(we.anchor),V0=Pu(we)),L.stable){const Oe=mw("settled",L);if(Oe!==j6){j6=Oe;const Ve=P0(L,{includeHeightCache:!0});Ve&&(H(Ve),V0=Pu(Ve)),(function(st){s("render-settled",st)})(L)}}if(L.phase==="final"){const Oe=mw("final",L);if(Oe!==O6){O6=Oe;const Ve=P0(L,{includeHeightCache:!0});Ve&&(H(Ve),V0=Pu(Ve)),(function(st){s("render-final",st)})(L)}}}function H6(){I1!=null&&(Io?.(I1),I1=null),L1!=null&&D&&(window.clearTimeout(L1),L1=null)}function gw(){I1=null,L1=null,(function(L){if(_l.size>0||Vi!=null)return!0;switch(L){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(R6)&&(Sl(),Bu()),P6(M1(R6))}function Mo(L){var K,le;if(!ze.value||(R6=L,I1!=null||L1!=null))return;const ae=Math.max(0,(le=(K=o.virtualScroll)==null?void 0:K.emitIntervalMs)!=null?le:32),we=Math.max(0,ae-(Fu()-F6)),Ne=()=>{L1=null,I1=ro?ro(gw):null,I1==null&&gw()};D&&we>0?L1=window.setTimeout(Ne,we):Ne()}function vw(){qt.value+=1}function $f(L){if(Ae.value&&L>=De.value){const K=Ct.value[L],le=at.value===!0&&dt.value!==!0&&L>=Ct.value.length-2,ae=K?.type==="code_block"||K?.type==="image"||K?.type==="mermaid"||K?.type==="infographic";if(!le||ae)return!1}return!Se.value||L=et.value&&(W.value||(W.value=!0,u6()),!un.value||!Ys))return W0(L),void(K&&ga(L,!0));if(L{if(V9.delete(Ne),!Se.value||c6.value.has(Ne))return;const st=es.get(Ne);if(!st)return;const We=Ce(st),Ye=st.ownerDocument||document,ot=Ye.defaultView||window,Pe=!We||We===Ye.documentElement||We===Ye.body,Xe=!Pe&&We?Kt("nodeVisibilityFallback.root.getBoundingClientRect",()=>We.getBoundingClientRect()):null,ft=Pe?0:Xe.top,ut=Pe?Kt("nodeVisibilityFallback.clientHeight",()=>{var yt,Ot;return(Ot=(yt=ot.innerHeight)!=null?yt:We?.clientHeight)!=null?Ot:0}):Xe.bottom,Tt=Kt("nodeVisibilityFallback.node.getBoundingClientRect",()=>st.getBoundingClientRect());Tt.bottom>=ft-500&&Tt.top<=ut+500&&ga(Ne,!0)},1800+Oe);V9.set(Ne,Ve)})(L);let we=null;we=Ue(()=>ae.isVisible.value,Ne=>{if(Ne){Cf(L),ga(L,!0),we?.(),Sf.delete(L),B0.get(L)===ae&&B0.delete(L);try{ae.destroy()}catch{}}},{immediate:!0}),Sf.set(L,we),vn.value&&Lr()}function D6(){Vi=null,Qr(()=>{let L=!1;for(const[K,le]of _l)_l.delete(K),Hi.get(K)===le.el&&Tr.get(K)===le.version&&(L=Eu(K,le.height,{allowShrink:le.allowShrink})||L);return L})}function q0(){Vi!=null&&(Io?.(Vi),Vi=null),_l.clear()}function zf(L,K){(function(le,ae,we){var Ne;if(!Number.isFinite(we)||we<=0||Hi.get(le)!==ae)return;const Oe=Tr.get(le);if(Oe==null)return;const Ve=Ct.value[le],st=Et.value&&dt.value!==!0&&!((Ne=o.nodes)!=null&&Ne.length)&&le>=Ct.value.length-2,We=!(Ve?.loading===!0||st),Ye=_l.get(le),ot=Ye?Ye.allowShrink&&We:We,Pe=Ye&&!ot?Math.max(Ye.height,we):we;_l.set(le,{height:Pe,allowShrink:ot,version:Oe,el:ae}),Vi==null&&(Vi=ro?ro(D6):null,Vi==null&&D6())})(L,K,yf(L,K))}function Sl(){for(const[L,K]of Hi)K&&zf(L,K)}function ww(){_e?.disconnect(),_e=null,rs.clear()}function V6(){for(;kf.length;)xf(kf.pop())}Ue(wt,L=>{L&&Mo("content")},{flush:"post"}),t({getVirtualMetrics:M1,captureVirtualState:function(L={}){var K;return P0(M1("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:L.allowFallbackAnchor===!0,requireViewport:L.requireViewport===!0,includeEmptyState:(K=L.includeEmptyState)==null||K})},restoreVirtualState:function(L,K={}){const le=K.restoreAnchor===!0,ae=K.restoreToken==null?"imperative":String(K.restoreToken);Nu=L,zu={restoreAnchor:le,restoreToken:ae,allowUncapturedAnchor:K.allowUncapturedAnchor===!0},!$6(L,{restoreAnchor:le,restoreToken:ae,allowUncapturedAnchor:K.allowUncapturedAnchor===!0})&&fw(L)||(Nu=null,zu=null)},forceMeasure:function(L="manual"){return Eo(this,null,function*(){yield vt(),yield pw(),Sl(),Bu(),yield vt();const K=M1(L);return P6(K,!0),K})},settle:B6,scrollToNode:function(L,K="start"){H0(),N0();const le=Ct.value.length;if(le<=0)return;const ae=Ds(L,0,le-1),we=()=>{var Ne;const Oe=xu({nodeIndex:ae,offsetWithinNodePx:0}),Ve=$0(ae),st=Lu(),We=(Ne=st?.clientHeight)!=null?Ne:0,Ye=o6();let ot=Oe;if(K==="center")ot=Oe-We/2+Ve/2;else if(K==="end")ot=Oe-We+Ve;else if(K==="nearest"&&Ye!=null){if(Oe>=Ye&&Oe+Ve<=Ye+We)return;ot=OeHs.value,L=>{if(!L){ww();for(const K of Ir.values())for(const le of K)xf(le);Ir.clear(),Tr.clear(),V6(),q0()}},{immediate:!0}),Ue(dt,L=>{L&&(function(){if(D&&dt.value&&Hi.size){V6();for(const K of[80,240,640]){const le=H9(K,()=>{for(const[ae,we]of Hi)we&&zf(ae,we)},"final");le!=null&&kf.push(le)}}})(),Mo(L?"final":"content")});const cB=Ox(()=>Mo("content"),16),uB=Ox(()=>Mo("batch"),16);Ue([()=>Ct.value.length,()=>De.value],()=>{qe.value&&D0(),cB()},{flush:"post",immediate:!0}),Ue([()=>Wo.start,()=>Wo.end],()=>{uB()},{flush:"post"});const{cleanupBatchScheduler:dB}=(function(L){const{props:K,isClient:le,isTestEnv:ae,parsedNodesIdentity:we,parsedNodeCount:Ne,desiredRenderedCount:Oe,datasetKey:Ve,batchingEnabled:st,incrementalRenderingActive:We,resolvedBatchSize:Ye,resolvedInitialBatch:ot,renderedCount:Pe,adaptiveBatchSize:Xe,previousRenderContext:ft,previousBatchConfig:ut,requestFrame:Tt,cancelFrame:yt,hasIdleCallback:Ot,cleanupNodeVisibility:Ht,onDatasetKeyChanged:Jt,onDatasetChanged:Gt}=L;let nn=null,_n="raf",Tn=null,fo=0,Vs=!1,$s=!1;const $r=new Set,tl=new Set;function Gu(){if(le){nn!=null&&(_n==="raf"&&yt?yt(nn):_n==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(nn):_n==="timeout"&&window.clearTimeout(nn),nn=null),fo+=1;for(const Js of $r)yt&&yt(Js);for(const Js of tl)window.clearTimeout(Js);$r.clear(),tl.clear(),Tn=null,Vs=!1,$s=!1}}function Vf(){return typeof performance<"u"?performance.now():Date.now()}function Rw(Js){(function(Cl){var wa;if(!We.value)return;const Ml=Math.max(2,(wa=K.renderBatchBudgetMs)!=null?wa:6),Al=Math.max(1,Ye.value||1),Nr=Math.max(1,Math.floor(Al/4));Cl>1.5*Ml?Xe.value=Math.max(Nr,Math.floor(.8*Xe.value)):Cl<.6*Ml&&Xe.value=Ml)return;const Al=Math.max(1,Js),Nr=()=>{const K0=Vf();nn=null;const Yu=Tn??Al;Tn=null;const G0=Vf();Pe.value=Math.min(Ml,Pe.value+Yu),Ht(Pe.value),(function(Y6,Wf){if(!le)return void Rw(Wf);Vs=!0;const Pw=++fo;vt().then(()=>{var Hw;if(Pw!==fo)return;const $B=Vf(),NB=Math.max(Wf,$B-Y6),Dw=()=>{Pw===fo&&Rw(NB)};if(Tt){let N1=null,Y0=null,Ww=!1;const qw=()=>{Ww||(Ww=!0,N1!==null&&($r.delete(N1),N1=null),Y0!==null&&(tl.delete(Y0),window.clearTimeout(Y0),Y0=null),Dw())};return N1=Tt(()=>{qw()}),$r.add(N1),Y0=window.setTimeout(()=>{N1!==null&&yt&&yt(N1),qw()},Math.max(32,(Hw=K.renderBatchIdleTimeoutMs)!=null?Hw:120)),void tl.add(Y0)}const Vw=window.setTimeout(()=>{tl.delete(Vw),Dw()},0);tl.add(Vw)})})(K0,Vf()-G0)};if(!le||_i.immediate)return void Nr();const ya=Math.max(0,(Cl=K.renderBatchDelay)!=null?Cl:16);if(Tn=Tn!=null?Math.max(Tn,Al):Al,nn==null){if(!ae&&Ot&&window.requestIdleCallback){const K0=Math.max(0,(wa=K.renderBatchIdleTimeoutMs)!=null?wa:120);return _n="idle",void(nn=window.requestIdleCallback(()=>Nr(),{timeout:K0}))}if(Tt&&!ae)return _n="raf",void(nn=Tt(()=>{ya===0?Nr():(_n="timeout",nn=window.setTimeout(()=>Nr(),ya))}));_n="timeout",nn=window.setTimeout(()=>Nr(),ya)}}function jw(Js,_i={}){Vs?$s=!0:Js==null?Ow():Fw(Js,_i)}function Ow(){We.value&&Fw(st.value?Math.max(1,Math.round(Xe.value)):Math.max(1,Ye.value))}return Ue([we,Ne,Ve,We,Ye,ot,()=>K.renderBatchDelay],()=>{var Js;const _i=Ne.value,Cl=ft.value,wa=Ve.value,Ml=!Object.is(wa,Cl.key),Al=_i!==Cl.total,Nr=Ml||Al;ft.value={key:wa,total:_i};const ya=ut.value,K0=(Js=K.renderBatchDelay)!=null?Js:16,Yu=ya.batchSize!==Ye.value||ya.initial!==ot.value||ya.delay!==K0||ya.enabled!==We.value;ut.value={batchSize:Ye.value,initial:ot.value,delay:K0,enabled:We.value},Ml&&Jt(_i),(Nr||Yu||!We.value)&&Gu(),(Nr||Yu)&&(Xe.value=Math.max(1,Ye.value||1)),Nr&&Gt();const G0=Oe.value;if(!_i)return Pe.value=0,void Ht(0);if(!We.value)return Pe.value=G0,void Ht(Pe.value);const Y6=Ml||Cl.total===0;Pe.value=Y6||Yu?Math.min(G0,ot.value):Math.min(Pe.value,G0);const Wf=Math.max(1,ot.value||Ye.value||_i);Pe.value{We.value&&(typeof _i=="number"&&Js<=_i||Js>Pe.value&&jw())}),{cleanupBatchScheduler:Gu}})({props:C,isClient:D,isTestEnv:ki,parsedNodesIdentity:js,parsedNodeCount:Os,desiredRenderedCount:bf,datasetKey:eB,batchingEnabled:Te,incrementalRenderingActive:Ae,resolvedBatchSize:Oi,resolvedInitialBatch:Pi,renderedCount:De,adaptiveBatchSize:dn,previousRenderContext:Ut,previousBatchConfig:zn,requestFrame:ro,cancelFrame:Io,hasIdleCallback:yi,cleanupNodeVisibility:Kz,onDatasetKeyChanged:L=>{q0(),Er(),Ls(),Ou(),L>0&&bl(L)},onDatasetChanged:()=>{vn.value&&Lr({immediate:!0})}});Ue([Co,vn,()=>A.value,()=>Y()],([L,K])=>{if(!L)return W9(),void a6();Gz(),K?Lr({immediate:!0}):a6()},{flush:"post",immediate:!0}),Ue([()=>Ct.value.length,()=>vn.value],L=>Eo(null,[L],function*([K,le]){le&&K&&D&&(yield vt(),Lr({immediate:!0}))}),{flush:"post"}),Ue(Mt,L=>{L&&(function(){var K;if(Es.value&&ks.value&&Lo.value&&((K=Ro.value)!=null&&K[1]))return;const le=Nt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ae=Nt({type:"list_item",children:[le],raw:"- Probe paragraph text"}),we=Nt({type:"list",ordered:!1,items:[ae],raw:"- Probe paragraph text"});Es.value=le,ks.value=ae,Lo.value=we;const Ne={1:null,2:null,3:null,4:null,5:null,6:null};for(let Oe=1;Oe<=6;Oe++)Ne[Oe]=Nt({type:"heading",level:Oe,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Oe)} Probe heading`});Ro.value=Ne})()},{immediate:!0}),Ue([()=>A.value,Mt],()=>{if(!Mt.value)return p6(),void(se.value=0);U9(),p6(),Mt.value&&A.value&&typeof ResizeObserver<"u"&&(Iu=new ResizeObserver(()=>{U9(),da.value&&_1(),qe.value&&D0(),Mo("resize")}),Iu.observe(A.value))},{immediate:!0}),Ue([Mt,Ts,Wi],()=>Eo(null,null,function*(){if(!Mt.value)return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ls();yield vt(),(function(){if(!Mt.value||typeof window>"u")return oe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ls();const L={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},K=q9(f6(F.value),".paragraph-node");L.paragraph=um(F.value,K,"pre-wrap");const le=f6(j.value),ae=le?.querySelector(".paragraph-node");L.listItem=um(j.value,ae,"pre-wrap");const we=Kt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Oe,Ve;return(Ve=(Oe=q.value)==null?void 0:Oe.offsetHeight)!=null?Ve:0}),Ne=Kt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Oe,Ve;return(Ve=(Oe=j.value)==null?void 0:Oe.offsetHeight)!=null?Ve:0});L.listWrapperOverhead=Math.max(0,we-Ne);for(let Oe=1;Oe<=6;Oe++){const Ve=q9(f6(P[Oe]),`h${Oe}`);L.headings[Oe]=um(P[Oe],Ve,"pre-wrap")}oe.value=L,Ls()})()}),{flush:"post",immediate:!0}),Ue(()=>Ct.value.length,()=>{vn.value&&Lr({immediate:!0})}),Ue([Mt,se],()=>{Ls(),vn.value&&Lr({immediate:!0}),da.value&&_1(),qe.value&&D0(),Mo("resize")},{immediate:!1}),Ue(()=>Se.value,L=>{if(L)for(const[K,le]of es)Nf(K,le);else if(u6(),vn.value)Lr({immediate:!0});else for(const[K,le]of es)le&&ga(K,!0)},{immediate:!1}),Ue([Ke,et,()=>Y()],()=>{var L;(L=Ys.refresh)==null||L.call(Ys);for(const[K,le]of es)Nf(K,le)},{immediate:!1}),Ue([()=>C.viewportPriority,()=>Ct.value.length,et],([L,K,le])=>{if(L!==!1){if(W.value&&(K<=200||K<=le)){W.value=!1;for(const[ae,we]of es)Nf(ae,we)}}else W.value=!1}),Ue(()=>De.value,()=>{vn.value&&Lr({immediate:!0})}),Ue([Vo,io,uo,()=>Ct.value.length,vn],()=>{S1()},{immediate:!0});let Hu=null,Du=!1,U0=null;function Vu(){Hu=null,b6=null,k6=void 0,O0=null,Ou()}function W6(){q0(),Er(),Ls(),je.clear();const L=Ct.value.length;L>0&&bl(L),N6()}function q6(){H6(),D9(),Ru=null,E1=null,T1=null,If=null,Nu=null,zu=null,Du=!1,Vu(),tw("restore"),N0(),H0()}function Wu(L){var K;return[(K=ls())!=null?K:"",$o(),xl(),Af.value,ju(L),Ct.value.length,Math.round(ua(0,Ct.value.length)),Math.round(C1()),Xs.count,Math.round(Xs.total)].join(":")}function yw(){return Eo(this,null,function*(){var L,K,le,ae;const we=(L=o.virtualScroll)==null?void 0:L.settledToken,Ne=ju(we),Oe=$o(),Ve=ls(),st=Wi.value;if(ze.value&&((K=o.virtualScroll)==null?void 0:K.settleMode)==="manual"&&Ef(we))if(_6()){if(Wu(we)!==O0&&!Du){Du=!0;try{const We=yield B6({reason:"manual",expectedSettledTokenKey:Ne}),Ye=ju()===Ne;z6(Oe,Ve,st)&&We.sessionKey===Oe&&We.threadKey===Ve&&Ye&&We.stable&&We.phase==="final"&&(O0=Wu((le=o.virtualScroll)==null?void 0:le.settledToken))}finally{Du=!1,yield vt();const We=(ae=o.virtualScroll)==null?void 0:ae.settledToken,Ye=Ef(We)?Wu(We):"";z6(Oe,Ve,st)&&Ye&&O0!==Ye&&yw()}}}else Mo("manual")})}Ue(ze,(L,K)=>{if(L!==K){if(!L)return q6(),void H6();q6(),W6(),U0=Wi.value,Mo("content")}},{flush:"post"}),Ue([ze,Wi],([L,K])=>{L?U0!=null?U0!==K&&(U0=K,(function(le="resize"){q0(),Er(),Ls(),je.clear();const ae=Ct.value.length;ae>0&&bl(ae),N6(),E1=null,T1=null,If=null,Ru=null,Du=!1,Vu(),dw(),vt(()=>{Sl(),da.value&&_1(),qe.value&&D0(),Mo(le)})})("resize")):U0=K:U0=null},{flush:"post",immediate:!0}),Ue([ze,()=>$o(),()=>ls()],([L])=>{L&&(q6(),W6(),tw("content"),Mo("content"))}),Ue([ze,()=>$o(),()=>ls(),Wi,()=>Ct.value.length],([L])=>{L&&(function(K="async-node"){let le=!1;for(const[ae,we]of Array.from(el.entries()))w6(we)||(el.delete(ae),Di.delete(ae),le=!0);le&&(F0(),Mo(K))})("async-node")},{flush:"post"}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.sessionKey},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>o.indexKey,()=>ee.value],([L])=>{L&&(Ou(),(function(K="content"){if(!ze.value)return;const le=[],ae=Ct.value.length,we=d6(ae);for(const Ne of Array.from(je.keys())){if(Ne>=ae){le.push(Ne);continue}if(Ne=ae&&je.delete(Ne);le.length&&((function(Ne,Oe={}){const Ve=Array.from(Ne,Number);Mu(Ve);let st=0;if(Qr(()=>(st=i6(Ve,Oe),st>0)),st>0)(function(We){for(const Ye of We)je.delete(Ye)})(Ve);else for(const We of Ve)cn.delete(We)})(le,{notify:!1}),Ls(),Vu(),da.value&&_1(),qe.value&&D0(),Mo(K))})("content"))},{flush:"post",immediate:!0}),Ue([ze,()=>Ct.value.length,()=>$o(),()=>ls()],([L,K,le,ae],[we,Ne,Oe,Ve])=>{L&&we&&le===Oe&&ae===Ve&&K!==Ne&&Vu()},{flush:"post"}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCache},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.heightCacheWidth},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>Ct.value.length,()=>$o(),se],()=>{dw()},{flush:"post",immediate:!0}),Ue([ze,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreAnchor},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey},()=>Ct.value.length,()=>$o(),se],L=>Eo(null,[L],function*([K,le]){if(!K||!le)return;yield vt();const ae=(function(){var we;const Ne=(we=o.virtualScroll)==null?void 0:we.restoreAnchor;return Ne==null||Ne===!1?null:Ne===!0?"true":String(Ne)})();$6(le,{restoreAnchor:ae!=null,restoreToken:ae??void 0})}),{flush:"post",immediate:!0}),Ue([ze,se,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.restoreState},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.measurementKey}],([L])=>{var K;if(!L)return;const le=(K=o.virtualScroll)==null?void 0:K.restoreState;le&&E1&&T1==="restore"&&(cw(le)||(W6(),E1=null,T1=null,Mo("resize")))},{flush:"post"}),Ue([ze,()=>Ct.value.length,()=>$o(),se],L=>Eo(null,[L],function*([K]){var le;const ae=Nu,we=zu;K&&ae&&(yield vt(),!$6(ae,{restoreAnchor:we?.restoreAnchor===!0,restoreToken:(le=we?.restoreToken)!=null?le:"imperative",allowUncapturedAnchor:we?.allowUncapturedAnchor===!0})&&fw(ae)||(Nu=null,zu=null))}),{flush:"post",immediate:!0}),Ue([ze,dt,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>$o(),()=>ls(),Wi,l6,O9,()=>De.value,bf,()=>Xs.count,()=>Xs.total],([L,K,le])=>{if(!L||K!==!0||le==="manual"||!x6())return;const ae=(function(){var we;const Ne=Ct.value.length;return[(we=ls())!=null?we:"",$o(),xl(),Af.value,Ne,Math.round(ua(0,Ne)),Math.round(C1()),Xs.count,Math.round(Xs.total)].join(":")})();Hu!==ae&&(Hu=ae,B6({reason:"final"}).then(we=>{we.stable||Hu!==ae||(Hu=null)}))},{flush:"post",immediate:!0}),Ue([ze,dt,()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settleMode},()=>{var L;return(L=o.virtualScroll)==null?void 0:L.settledToken},()=>$o(),()=>ls(),Wi,l6,O9,()=>De.value,bf,()=>Ct.value.length,()=>Xs.count,()=>Xs.total],()=>{yw()},{flush:"post",immediate:!0}),Ue([()=>Ct.value.length,vn,io,uo,()=>Wo.start,()=>Wo.end],([L,K,le,ae,we,Ne])=>{ve.value&<("virtualization",{nodes:L,virtualization:K,maxLiveNodes:le,buffer:ae,focusIndex:Vo.value,scroll:K?(()=>{const Oe=Nn.value||Ce();return Oe?{reverse:me(Oe),scrollTop:Math.round(Oe.scrollTop),scrollTopAbs:Math.round(Math.abs(Oe.scrollTop)),scrollHeight:Math.round(Oe.scrollHeight),clientHeight:Math.round(Oe.clientHeight)}:null})():null,liveRange:{start:we,end:Ne},rendered:De.value})}),Ue([()=>C.customId],([L],K,le)=>{if(!L||Ze)return;const ae=(function(we,Ne){return we?(_s.controllers[we]=Ne,()=>{_s.controllers[we]===Ne&&delete _s.controllers[we]}):()=>{}})(L,{captureRestoreAnchor:ff,restoreAnchor:pf,getAnchorDrift:Su,getReport:Jz});le(()=>{ae()})},{immediate:!0}),vo(()=>{(function(){if(ze.value)try{Sl(),Bu();const L=M1("manual");hw(L)&&(O(L),Ru=L,F6=Fu());const K=P0(L,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});K&&(H(K),K.anchor&&V(K.anchor),V0=Pu(K))}catch{}})(),dB(),u6(),Mn(),ww();for(const L of Ir.values())for(const K of L)xf(K);Ir.clear(),Tr.clear(),je.clear(),V6(),q0(),p6(),N0(),H0(),H6(),W9(),a6()});const fB=I2("ViewportDeferredMermaidBlockNode",mr({loader:()=>Eo(null,null,function*(){try{return(yield ps(()=>import("./index11-HcP9dkU1.js"),__vite__mapDeps([9,7]))).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',L),Ei}}),loadingComponent:Qx,delay:0}),Qx),pB=I2("ViewportDeferredInfographicBlockNode",mr({loader:()=>Eo(null,null,function*(){try{return(yield ps(()=>import("./index10-DNWrJC2M.js"),[])).default}catch(L){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',L),Ei}}),loadingComponent:Jx,delay:0}),Jx),hB=I2("ViewportDeferredD2BlockNode",mr(()=>Eo(null,null,function*(){try{return(yield ps(()=>import("./index8-DNSwKVaQ.js"),[])).default}catch(L){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',L),Ei}})),Ei),kw={text:Ko,paragraph:h0,heading:Bp,code_block:em,list:qc,list_item:Wc,blockquote:f4,table:od,definition_list:p4,footnote:h4,footnote_reference:Gi,footnote_anchor:td,admonition:w4,vmr_container:g4,hardbreak:Ja,link:vi,image:Xa,thematic_break:m4,math_inline:Xr,math_block:DL,strong:mi,emphasis:wi,strikethrough:gi,highlight:Xi,insert:Ri,subscript:Bi,superscript:zi,emoji:Ni,checkbox:Ki,checkbox_input:Ki,inline_code:ii,html_inline:Yi,reference:hi,html_block:nd},mB=B(()=>g6()),bw=B(()=>Fx(C.codeBlockProps)),gB=B(()=>Fx(C.codeBlockProps,{omit:["langs"]})),_w=B(()=>_t(_t({stream:C.codeBlockStream,darkTheme:C.codeBlockDarkTheme,lightTheme:C.codeBlockLightTheme,monacoOptions:C.codeBlockMonacoOptions,themes:C.themes,langs:h.value==="shiki"?C.langs:void 0,minWidth:C.codeBlockMinWidth,maxWidth:C.codeBlockMaxWidth},typeof fe.value=="boolean"?{showTooltips:fe.value}:{}),gB.value)),xw=B(()=>_t(gn(_t({},_w.value),{langs:C.langs}),bw.value));function Sw(L){return typeof L=="boolean"?L:void 0}const vB=B(()=>{const L=C.codeBlockProps||{},K={},le=Sw(L.showLineNumbers);le!==void 0&&(K.showLineNumbers=le);const ae=Sw(L.diffInline);ae!==void 0&&(K.diffInline=ae);const we=(function(Ne){const Oe=Number(Ne);return Number.isFinite(Oe)&&Oe>0?Oe:void 0})(L.reservedHeightPx);return we!==void 0&&(K.reservedHeightPx=we),K}),wB=B(()=>_t(_t({stream:C.codeBlockStream,darkTheme:C.codeBlockDarkTheme,lightTheme:C.codeBlockLightTheme,themes:C.themes,langs:C.langs,minWidth:C.codeBlockMinWidth,maxWidth:C.codeBlockMaxWidth},typeof fe.value=="boolean"?{showTooltips:fe.value}:{}),bw.value)),yB=B(()=>_t({},C.mermaidProps||{})),Cw=B(()=>_t({},C.d2Props||{})),kB=B(()=>_t({},C.infographicProps||{})),qu=B(()=>({typewriter:f.value,fade:C.fade,customHtmlTags:oo.value.customHtmlTags})),bB=B(()=>_t(_t({},qu.value),typeof fe.value=="boolean"?{showTooltip:fe.value}:{})),_B=B(()=>_t(_t({},qu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{})),xB=B(()=>_t(_t({},qu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{})),SB=B(()=>_t(_t({},qu.value),typeof fe.value=="boolean"?{showTooltips:fe.value}:{}));function CB(L){return Array.isArray(L.children)&&L.children.length>0}const Bf=B(()=>Xz.value.map(L=>{var K,le,ae,we,Ne,Oe,Ve,st;let We=(function(yt){var Ot,Ht,Jt,Gt,nn,_n,Tn;if(yt.type!=="code_block")return yt;const fo=yt,Vs=[String((Ot=fo.language)!=null?Ot:""),String((Ht=fo.loading)!=null?Ht:""),String((Jt=fo.diff)!=null?Jt:""),String((Gt=fo.code)!=null?Gt:""),String((nn=fo.originalCode)!=null?nn:""),String((_n=fo.updatedCode)!=null?_n:""),String((Tn=fo.raw)!=null?Tn:"")].join("\0"),$s=Ie.get(fo);if($s&&$s.signature===Vs)return $s.node;const $r=_t({},fo);return Ie.set(fo,{signature:Vs,node:$r}),$r})(L.node);const Ye=Rf(We);let ot=Tw(We,Ye);if((We.type==="html_block"||We.type==="html_inline")&&ot===kw[We.type]){const yt=We,Ot=String((K=yt.tag)!=null?K:"").trim().toLowerCase()||mI(yt.content);if(Ot){const Ht=ao.value[Ot];if(co.value.has(Ot)&&Ht)ot=Ht,We=gn(_t({},yt),{type:Ot,tag:Ot,content:Are(yt.content,Ot)});else if(gI((le=yt.content)!=null?le:yt.raw,Ot)){const Jt=String((we=(ae=yt.content)!=null?ae:yt.raw)!=null?we:"");We.type==="html_inline"?(ot=Ko,We={type:"text",content:Jt,raw:Jt}):(ot=h0,We={type:"paragraph",children:[{type:"text",content:Jt,raw:Jt}],raw:Jt})}}}const Pe=We.type==="code_block"&&h.value==="pre"&&ot===Ei&&!U6(ao.value,Ye);let Xe=_t({},(function(yt,Ot,Ht){const Jt=Ot??Rf(yt);if(yt.type==="code_block"){const Gt=Jt?U6(ao.value,Jt):void 0;if(Ht&&h.value==="pre"&&!Gt&&Ht===Ei)return vB.value;if(Ht&&Jt&&Ht===Gt)return Jt==="mermaid"?Aw(yt):Jt==="infographic"?Ew(yt):Jt==="d2"||Jt==="d2lang"?Cw.value:xw.value;if(Ht&&Ht===ao.value.code_block)return xw.value;if(K9(Ht))return wB.value}return Jt==="mermaid"?Aw(yt):Jt==="infographic"?Ew(yt):Jt==="d2"||Jt==="d2lang"?Cw.value:yt.type==="link"?bB.value:yt.type==="list"?_B.value:yt.type==="blockquote"?xB.value:yt.type==="table"?SB.value:yt.type==="code_block"?_w.value:qu.value})(We,Ye,ot));const ft=Mt.value?R0.value[L.index]:null;We.type==="code_block"&&ft?.kind==="code-block"&&(Xe=gn(_t({},Xe),Pe?{reservedHeightPx:(Ne=ft.height)!=null?Ne:ft.contentHeight}:{estimatedHeightPx:ft.height,estimatedContentHeightPx:ft.contentHeight,estimatedDiffInline:ft.diffInline})),Pe||We.type!=="code_block"||Ye!=="mermaid"||Cc(Xe.estimatedPreviewHeightPx)!=null||(Xe=gn(_t({},Xe),{estimatedPreviewHeightPx:k5(w5(String((Oe=We.code)!=null?Oe:"")))})),Pe||We.type!=="code_block"||Ye!=="infographic"||Cc(Xe.estimatedPreviewHeightPx)!=null||(Xe=gn(_t({},Xe),{estimatedPreviewHeightPx:b5(y5(String((Ve=We.code)!=null?Ve:"")))})),We.type==="math_block"&&(Xe=gn(_t({},Xe),{cacheScope:ys}));const ut=(function(yt,Ot){const Ht=String(yt.type);return!sf(Ht)&&ao.value[Ht]===Ot})(We,ot),Tt=ut?fv(We,pe.value):void 0;return gn(_t({},L),{node:We,component:ot,bindings:Xe,customBindings:_t(_t({},Tt??{}),Xe),rendersCustomNode:ut,hasSlotChildren:CB(We),slotContent:String((st=We.content)!=null?st:""),isCodeBlock:We.type==="code_block",indexKey:`${mB.value}-${L.index}`,vnodeKey:`${Qz.value}\0${L.index}\0${We.type}`})}));function Rf(L){var K;return L?.type==="code_block"?String((K=L.language)!=null?K:"").trim().toLowerCase():""}function U6(L,K){const le=K.trim().toLowerCase();if(le)for(const ae of[le,$p(le),xL(le)]){const we=ae&&L[ae];if(we)return we}}function Mw(L,K,le,ae){var we,Ne;const Oe=_t({},L.value);return Cc(Oe.estimatedPreviewHeightPx)==null&&(Oe.estimatedPreviewHeightPx=ae(le(String((we=K?.code)!=null?we:"")),void 0,Oe.maxHeight==="none"?null:(Ne=Cc(Oe.maxHeight))!=null?Ne:void 0)),Oe}function Aw(L){return Mw(yB,L,w5,k5)}function Ew(L){return Mw(kB,L,y5,b5)}function Tw(L,K){if(!L)return i7;const le=ao.value,ae=le[String(L.type)];if(L.type==="code_block"){const we=K??Rf(L),Ne=we?U6(le,we):void 0;return Ne||(h.value==="pre"?le.code_block||Ei:we==="mermaid"?le.mermaid||fB:we==="infographic"?le.infographic||pB:we==="d2"||we==="d2lang"?le.d2||hB:ae||le.code_block||G9.value)}return ae||kw[String(L.type)]||i7}function Z6(L){s("click",L)}function MB(L){var K;(K=L.target)!=null&&K.closest("[data-node-index]")&&s("mouseover",L)}function AB(L){var K;(K=L.target)!=null&&K.closest("[data-node-index]")&&s("mouseout",L)}function Iw(L){s("mouseover",L)}function Lw(L){s("mouseout",L)}const $1=U(null),bi=U(!1),Uu=U(null),EB=B(()=>!(C.domMode!=="minimal"||X.value||C.fade!==!1||f.value||bi.value||So.value||vn.value||Ps.value||mn.value||Is.value||Object.keys(ao.value).length!==0));let Zu,Z0=null,K6=0,Ff=0,jf=0;const $w=["code_block","admonition","table","math_block","html_block","image","thematic_break"],TB=new Set($w),Nw=[".typewriter-cursor",".height-estimation-probes",...$w.map(L=>`[data-node-type="${L}"]`),"script","style"].join(",");function zw(L){if(!L||typeof L!="object")return!1;const K=L.type;return typeof K=="string"&&TB.has(K)}function Of(L){var K,le;if(!L||typeof L!="object")return 0;const ae=L,we=(le=(K=ae.raw)!=null?K:ae.content)!=null?le:ae.code;if(typeof we=="string")return we.length;const Ne=ae.children;if(Array.isArray(Ne))return Ne.reduce((Ve,st)=>Ve+Of(st),0);const Oe=ae.items;return Array.isArray(Oe)?Oe.reduce((Ve,st)=>Ve+Of(st),0):0}function Pf(){Zu&&(clearTimeout(Zu),Zu=void 0)}function G6(){K6+=1,Z0!=null&&(Io?.(Z0),Z0=null)}function Ku(){G6(),va(),$1.value&&($1.value.style.visibility="hidden")}function IB(L){var K;if(L.nodeType!==Node.TEXT_NODE||!((K=L.textContent)!=null?K:"").trim())return!1;const le=L.parentElement;return!!le&&!le.closest(Nw)}function LB(L){let K=L.lastChild;for(;K;){if(IB(K))return K;if(K.nodeType===Node.ELEMENT_NODE){const le=K;if(!le.matches(Nw)&&le.lastChild){K=le.lastChild;continue}}for(;K&&K!==L&&!K.previousSibling;)K=K.parentNode;if(!K||K===L)break;K=K.previousSibling}return null}function Bw(){const L=Bf.value;for(let K=L.length-1;K>=0;K--){const le=L[K];if(!le||zw(le.node)||!$f(le.index))continue;const ae=es.get(le.index);if(!ae)continue;const we=LB(ae);if(we)return we}return null}function va(){Uu.value&&(Uu.value.classList.remove(eS),Uu.value=null)}function Hf(){if(d.value!=="simple"||!D||!bi.value||!A.value)return void va();const L=Bw(),K=L?(function(le){var ae;const we=(ae=le.parentElement)==null?void 0:ae.closest(".text-node");return we instanceof HTMLElement?we:le.parentElement})(L):null;K!==Uu.value&&(va(),K&&(K.classList.add(eS),Uu.value=K))}function Df(){if(d.value!=="precise"||!D||!bi.value||Z0!=null)return;const L=K6,K=()=>{Z0=null,L===K6&&(function(){var le,ae;if(d.value!=="precise"||!(D&&bi.value&&A.value&&$1.value))return;const we=A.value,Ne=$1.value;Ne.style.visibility="hidden";const Oe=Bw();if(!Oe)return;let Ve=0,st=0,We=20,Ye=!1;if(Oe?.textContent){const ot=Oe.textContent.length,Pe=document.createRange();Pe.setStart(Oe,Math.max(0,ot-1)),Pe.setEnd(Oe,ot);const Xe=typeof Pe.getClientRects=="function"?Pe.getClientRects():void 0,ft=(ae=Xe?.[Xe.length-1])!=null?ae:(le=Oe.parentElement)==null?void 0:le.getBoundingClientRect();if(ft){const ut=Kt("typewriterCursor.root.getBoundingClientRect",()=>we.getBoundingClientRect());Ve=ft.right-ut.left+we.scrollLeft,st=ft.top-ut.top+we.scrollTop,We=ft.height||We,Ye=!0}Pe.detach()}Ye&&(Ne.style.transform=`translate(${Math.max(0,Ve)}px, ${Math.max(0,st)}px)`,Ne.style.height=`${We}px`,Ne.style.visibility="visible")})()};ro?Z0=ro(K):K()}return Ue([Fe,()=>o.content,()=>o.nodes,()=>C.typewriter,dt],()=>Eo(null,null,function*(){var L,K;if(!D||X.value||!de.value)return;if(dt.value)return bi.value=!1,Pf(),void Ku();if((L=o.nodes)!=null&&L.length)return bi.value=!1,Pf(),Ku(),Ff=((K=o.content)!=null?K:"").length,void(jf=Fe.value.length);const le=(function(){var Ve,st;return(Ve=o.nodes)!=null&&Ve.length?o.nodes.reduce((We,Ye)=>We+Of(Ye),0):((st=o.content)!=null?st:"").length})(),ae=(function(){var Ve;return(Ve=o.nodes)!=null&&Ve.length?o.nodes.reduce((st,We)=>st+Of(We),0):Fe.value.length})(),we=!zw(Ct.value[Ct.value.length-1]),Ne=le>Ff,Oe=ae>jf;if(!f.value||!we||!Ne&&!Oe)return f.value&&we||(bi.value=!1,Ku()),Ff=le,void(jf=ae);Ff=le,jf=ae,bi.value=!0,d.value==="precise"&&$1.value&&($1.value.style.visibility="hidden"),Pf(),yield vt(),d.value==="simple"?Hf():(va(),Df()),Zu=setTimeout(()=>{Zu=void 0,bi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ue(bi,L=>Eo(null,null,function*(){L?(yield vt(),d.value!=="simple"?(va(),d.value==="precise"&&Df()):Hf()):Ku()}),{flush:"post"}),Ue(d,()=>Eo(null,null,function*(){if(D&&!X.value&&de.value&&bi.value){if(yield vt(),d.value==="simple")return G6(),void Hf();va(),d.value!=="precise"?Ku():Df()}}),{flush:"post"}),Ue([()=>De.value,()=>Wo.start,()=>Wo.end],()=>Eo(null,null,function*(){D&&!X.value&&de.value&&bi.value&&(yield vt(),d.value!=="simple"?(va(),d.value==="precise"&&Df()):Hf())}),{flush:"post"}),vo(()=>{Pf(),G6(),va(),As.clear()}),(L,K)=>{const le=XM("NodeRenderer",!0);return y(X)?(g(!0),S(Me,{key:0},it(Bf.value,ae=>(g(),S(Me,{key:ae.vnodeKey},[ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onClick:Z6,onMouseover:Iw,onMouseout:Lw,onCopy:K[0]||(K[0]=we=>i(we)),onHandleArtifactClick:K[1]||(K[1]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onClick:Z6,onMouseover:Iw,onMouseout:Lw,onCopy:K[2]||(K[2]=we=>i(we)),onHandleArtifactClick:K[3]||(K[3]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(g(),S("div",{key:1,ref_key:"containerRef",ref:A,class:Be(["markstream-vue markdown-renderer",[{dark:C.isDark},{virtualized:vn.value},{"virtual-scroll-coordinated":wt.value},{"stable-layout":pt.value},{"typewriter-simple-cursor":bi.value&&d.value==="simple"}]]),"data-custom-id":C.customId,onClick:Z6,onMouseover:MB,onMouseout:AB},[tn.value||vn.value?(g(),S(Me,{key:0},[tn.value?(g(),ce(bfe,{key:0,width:Ts.value,"flow-root":vn.value||wt.value,"paragraph-node":Es.value,"list-item-node":ks.value,"list-node":Lo.value,"heading-nodes":Ro.value,"set-paragraph-wrapper":qz,"set-list-item-wrapper":Uz,"set-list-wrapper":Zz,"set-heading-wrapper":Yz},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):J("",!0),vn.value?(g(),S("div",{key:1,class:"node-spacer",style:Wt({height:`${h6.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],64)):J("",!0),EB.value?(g(!0),S(Me,{key:1},it(Bf.value,ae=>(g(),S(Me,{key:ae.vnodeKey},[$f(ae.index)?(g(),ce(ns(ae.component),Vn({key:0,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onMouseover:K[4]||(K[4]=we=>s("mouseover",we)),onMouseout:K[5]||(K[5]=we=>s("mouseout",we)),onCopy:K[6]||(K[6]=we=>i(we)),onHandleArtifactClick:K[7]||(K[7]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"])):J("",!0)],64))),128)):(g(!0),S(Me,{key:2},it(Bf.value,ae=>(g(),S("div",{key:ae.vnodeKey,ref_for:!0,ref:we=>Nf(ae.index,we),class:"node-slot","data-node-index":ae.index,"data-node-type":ae.node.type},[$f(ae.index)?(g(),S("div",{key:0,ref_for:!0,ref:we=>(function(Ne,Oe){var Ve;Oe||(function(ot){const Pe=`${g6()}-${ot}`;let Xe=!1;for(const ft of Array.from(Di.keys())){const ut=el.get(ft);(ut?.index===ot||ft===Pe||ft.startsWith(`${Pe}-`))&&(Di.delete(ft),el.delete(ft),Xe=!0)}Xe&&(F0(),Mo("async-node"))})(Ne),_l.delete(Ne),(function(ot){var Pe;const Xe=((Pe=Tr.get(ot))!=null?Pe:0)+1;Tr.set(ot,Xe)})(Ne);const st=Ir.get(Ne);if(st){for(const ot of st)xf(ot);Ir.delete(Ne)}if((function(ot){const Pe=rs.get(ot);Pe&&(_e?.unobserve(Pe),re.delete(Pe),rs.delete(ot))})(Ne),!Oe||!Hs.value)return Hi.delete(Ne),void Tr.delete(Ne);Hi.set(Ne,Oe);const We=()=>{zf(Ne,Oe)};queueMicrotask(We);const Ye=(_e||typeof ResizeObserver>"u"||(_e=new ResizeObserver(ot=>{if(ot.length)for(const Pe of ot){const Xe=re.get(Pe.target),ft=rs.get(Xe??-1);Xe!=null&&ft&&zf(Xe,ft)}else Sl()})),_e);if(Ye&&(rs.set(Ne,Oe),re.set(Oe,Ne),Ye.observe(Oe)),typeof window<"u"){const ot=((Ve=Ct.value[Ne])==null?void 0:Ve.type)==="code_block"?[16,80,240,800]:dt.value?[80]:[];if(ot.length){const Pe=ot.map(Xe=>H9(Xe,We,"node-resize")).filter(Xe=>Xe!=null);Pe.length&&Ir.set(Ne,Pe)}}})(ae.index,we),class:"node-content"},[ae.isCodeBlock?ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:1,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[12]||(K[12]=we=>i(we)),onHandleArtifactClick:K[13]||(K[13]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:2,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[14]||(K[14]=we=>i(we)),onHandleArtifactClick:K[15]||(K[15]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(gr,{key:0,name:"fade",css:C.fade!==!1,appear:C.fade!==!1},{default:ue(()=>[ae.rendersCustomNode?(g(),ce(ns(ae.component),Vn({key:0,ref_for:!0},ae.customBindings,{node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey,"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[8]||(K[8]=we=>i(we)),onHandleArtifactClick:K[9]||(K[9]=we=>s("handleArtifactClick",we))}),{default:ue(()=>[ae.hasSlotChildren?(g(),ce(le,Vn({key:0,ref_for:!0},Pn.value,{nodes:ae.node.children,"index-key":ae.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ae.slotContent?(g(),ce(le,Vn({key:1,ref_for:!0},Pn.value,{content:ae.slotContent,final:!ae.node.loading,"index-key":`${ae.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(g(),ce(ns(ae.component),Vn({key:1,node:ae.node,loading:ae.node.loading,"index-key":ae.indexKey},{ref_for:!0},ae.bindings,{"custom-id":C.customId,"is-dark":C.isDark,onCopy:K[10]||(K[10]=we=>i(we)),onHandleArtifactClick:K[11]||(K[11]=we=>s("handleArtifactClick",we))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(g(),S("div",{key:1,class:"node-placeholder",style:Wt({height:`${$0(ae.index)}px`})},null,4))],8,Sfe))),128)),bi.value&&d.value==="precise"?(g(),S("span",{key:3,ref_key:"typewriterCursorRef",ref:$1,class:"typewriter-cursor","aria-hidden":"true"},null,512)):J("",!0),vn.value?(g(),S("div",{key:4,class:"node-spacer",style:Wt({height:`${m6.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],42,xfe))}}})),[["__scopeId","data-v-a9489508"]]),Fi=n$;Fi.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Fi.__name,Fi.name].filter(n=>!!n));for(const n of t)e.component(n,n$)};const Mv=Object.freeze(Object.defineProperty({__proto__:null,default:Fi},Symbol.toStringTag,{value:"Module"})),Cfe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Mfe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Afe={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Efe={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Tfe={class:"admonition-title"},Ife=["aria-expanded","aria-controls"],Lfe=["id"],w4=to(Ge({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=B(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=U(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(g(),S("div",{class:Be(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(g(),S("svg",Cfe,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(g(),S("svg",Mfe,[...u[2]||(u[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(g(),S("svg",Afe,[...u[3]||(u[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(g(),S("svg",Efe,[...u[4]||(u[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):J("",!0),_("span",Tfe,I(i.value),1),o.node.collapsible?(g(),S("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(g(),S("svg",{style:Wt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Ife)):J("",!0)]),Zn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[Z(y(Fi),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Lfe),[[Ti,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);w4.install=e=>{e.component(w4.__name,w4)};const u7=()=>ps(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let T3=null,I3=u7,L3=null,tS=!1,nS=!1;function vqe(){return Eo(this,null,function*(){if(T3)return T3;const e=I3;return e?e===u7&&tS?null:L3||(L3=Eo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===u7)return e===I3&&(tS=!0,(function(o){nS||(nS=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===I3&&(L3=null)}return e!==I3?null:t?(T3=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),T3):null}),L3):null})}let $3=null,o$=null,N3=null;function wqe(){return typeof o$=="function"}function yqe(){return Eo(this,null,function*(){if($3)return $3;const e=o$;return e?N3||(N3=Eo(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?($3=n,$3):null}).finally(()=>{N3=null}),N3):null})}const kqe=Symbol("markstreamLanguageIconResolver"),s$=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],$fe=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),d7=[...s$].toSorted((e,t)=>t.length-e.length).join("|"),dm=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${d7}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${d7})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?])`].join(""),"gi"),i$=/[),.;!?]+$/;function Nfe(e){const t=e.toLowerCase();return s$.some(n=>t.endsWith(`.${n}`))}function zfe(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${d7}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Bfe(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(i$,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=$fe.has(i),a=Nfe(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Rfe(e,t={}){const n=[];dm.lastIndex=0;let o;for(;(o=dm.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(i$,""),u=a.length-c.length;a=c;const d=Bfe(a,t);if(!d)continue;const f=o.index+r,p=f+a.length;n.push({...d,start:f,end:p,text:a}),u>0&&(dm.lastIndex-=u)}return n}const Ffe=12e4,jfe=6e4,Ofe=32,Pfe=3e4,oS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Hfe(e){let t=0,n=0,o=0;oS.lastIndex=0;let s;for(;(s=oS.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Ffe||n>=jfe||t>=Ofe||o>=Pfe?"pre":"shiki",codeFenceCount:t,codeChars:n}}function z3(e,t){let n=0;for(let o=t-1;o>=0&&e[o]==="\\";o--)n++;return n%2===1}const Dfe=/\s/,Vfe=/\p{Nd}/u;function Qa(e,t){const n=e.codePointAt(t);return n===void 0?void 0:String.fromCodePoint(n)}function Wfe(e,t){if(t<=0)return;const n=e.codePointAt(t-1),o=n!==void 0&&n>=55296&&n<=56319&&t>1?t-2:t-1,s=e.codePointAt(o);return s===void 0?void 0:String.fromCodePoint(s)}function sS(e){return e!==void 0&&Dfe.test(e)}function ou(e){return e!==void 0&&Vfe.test(e)}function I5(e){return e!==void 0&&e>="A"&&e<="Z"}const r$=new RegExp(String.raw`^(?:AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SLL|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VED|VES|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMW|ZWL|HK|US|SG|AU|CA|NZ|NT|TW|RMB|MEX|TT|BZ|EU|UK)$`);function qfe(e,t){if(!I5(e[t-1]))return!1;let n=t-1;for(;n>0&&I5(e[n-1]);)n--;return r$.test(e.slice(n,t))||ou(Qa(e,t+1))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")&&!/\p{L}/u.test(Qa(e,t+1)??"")}function Ufe(e,t){if(!I5(e[t-1]))return!1;let n=t-1;for(;n>0&&I5(e[n-1]);)n--;return r$.test(e.slice(n,t))?!0:t-n<=2&&!/[\p{L}\p{Nd}]/u.test(e[n-1]??"")}function Zfe(e,t){const n=e[t+1];return ou(Qa(e,t+1))?!0:(n==="-"||n==="+"||n==="."||n==="−")&&ou(Qa(e,t+2))}const Kfe=/^[-–—,;:~([/]$/;function Gfe(e,t){const n=e[t+1];if(n!=="-"&&n!=="+"&&n!=="."||!ou(Qa(e,t+2)))return!1;const o=e[t-1];return o!==void 0&&Kfe.test(o)}const fm=String.raw`[,;:~\-–—/\s()=*×]|and|or`;function Yfe(e){let t=e.replace(new RegExp(String.raw`^(?:${fm})+`,"u"),"");for(;;){const o=t.replace(new RegExp(String.raw`^\p{L}+(?:${fm})+`,"u"),"").replace(/^[\p{L}][\p{L} ]*(?=\p{Nd})/u,"");if(o===t)break;t=o}if(!/\p{Nd}/u.test(t))return!1;const n=String.raw`[-+]?[\p{Nd}][\p{Nd},.'’]*`;return new RegExp(String.raw`^${n}(?:\p{L}+)?(?:(?:${fm})+${n}(?:\p{L}+)?)*$`,"u").test(t)}const iS=1,rS=2,lS=3,il=-1;function Xfe(e){const t=e.length,n=new Uint8Array(t),o=new Int32Array(t+1).fill(il),s=new Int32Array(t+1),i=new Int32Array(t+1),r=[],l=[];{const A=[];for(let P=0;P`*—–“”‘’'),c=[];for(const A of e.matchAll(/\b(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/gi))c.push(A.index);for(const A of e.matchAll(/\b(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,})(?=(?:\/|\?|:\d))/gi))c.push(A.index);for(const A of e.matchAll(/(?:\.{1,2})?\/[\p{L}\p{Nd}._-]+(?:\/[\p{L}\p{Nd}._-]*)*\?/gu))(A.index===0||!/[\w~/.-]/.test(e[A.index-1]??""))&&c.push(A.index);c.sort((A,F)=>A-F);let u=-1;for(const A of c){if(AA+7&&!/[\w/?#@~.+&=%-]/.test(e[F+1]??""))break}}r.push([A,F]),u=F}const d=[];for(let A=0;A]/.test(W))continue;let G=il,ee=il;for(;j"){ee=j;break}if(!q&&se==="/"&&e[j+1]===">"){ee=j+1;break}if(!/\s/.test(se)){G=j;break}for(;j"){ee=j;break}if(q){G=j;break}if(oe==="/"&&e[j+1]===">"){ee=j+1;break}const Q=/^[a-zA-Z_:][\w:.-]*/.exec(e.slice(j));if(!Q){G=j;break}j+=Q[0].length;let ge=j;for(;ge`]+/.exec(e.slice(ge));if(!Ke){G=ge;break}j=ge+Ke[0].length}}}if(ee!==il)d.push([A,ee+1]),A=ee;else if(G!==il){const se=e.indexOf("<",A+1);A=(se!==-1&&se",A+2);G===-1?f=!1:(d.push([A,G+2]),A=G+1,j=!0)}else if(F==="!"){if(e[A+2]==="-"&&e[A+3]==="-"){if(p){const G=e.indexOf("-->",A+4);G===-1?p=!1:(d.push([A,G+3]),A=G+2,j=!0)}}else if(e.startsWith("[CDATA[",A+2)){if(h){const G=e.indexOf("]]>",A+9);G===-1?h=!1:(d.push([A,G+3]),A=G+2,j=!0)}}else if(m&&/[A-Z]/.test(e[A+2]??"")){const G=e.indexOf(">",A+3);G===-1?m=!1:(d.push([A,G+1]),A=G,j=!0)}}if(j)continue;if(F!==void 0&&/[a-zA-Z]/.test(F)){const G=/^[a-zA-Z][a-zA-Z0-9+.-]{1,31}:/.exec(e.slice(A+1));if(G){let ee=A+1+G[0].length;for(;ee"&&e[ee]!=="<"&&!/\s/.test(e[ee]);)ee++;if(e[ee]===">"){d.push([A,ee+1]),A=ee;continue}}}if(F===void 0||!/[\w.!#$%&'*+/=?^`{|}~-]/.test(F))continue;let q=A+1;for(;q"&&(d.push([A,q+1]),A=q)}}d.sort((A,F)=>A[0]-F[0]);const k=[];for(const A of d){const F=k.at(-1);F&&A[0]<=F[1]?F[1]=Math.max(F[1],A[1]):k.push([A[0],A[1]])}r.push(...k);const x=A=>{let F=0;for(;F=(l[F]?.[1]??0);)F++;const j=l[F];return j!==void 0&&A>=j[0]},v=A=>{let F=0;for(;F=(k[F]?.[1]??0);)F++;const j=k[F];return j!==void 0&&A>=j[0]},w=[];let b=null,M=0,R=!1;for(let A=0;A"&&(R=!1);continue}if(!(x(A)||v(A))){if(b!==null){e[A]===b&&(b=null);continue}if(w.length>0&&(e[A]==='"'||e[A]==="'")&&A>0&&/\s/.test(e[A-1]??""))b=e[A];else if(e[A]==="[")M++;else if(e[A]==="]")M>0&&e[A+1]==="("&&(w.push(A),R=e[A+2]==="<",A++),M=Math.max(0,M-1);else if(e[A]==="("&&w.length>0)w.push(-1);else if(e[A]===")"&&w.length>0){const F=w.pop();if(F!==void 0&&F>=0){const j=e.slice(F+2,A);(/\s/.exec(j)===null||j.startsWith("<")&&/^<(?:\\[<>]|[^<>])*>$/.test(j)||/^[^\s]*\s+("([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\(([^()\\]|\\.)*\))$/.test(j))&&r.push([F,A+1])}}}}r.sort((A,F)=>A[0]-F[0]);const z=[];for(const A of r){const F=z.at(-1);F&&A[0]<=F[1]?F[1]=Math.max(F[1],A[1]):z.push([A[0],A[1]])}const $=A=>{let F=0,j=z.length-1;for(;F<=j;){const q=F+j>>1,P=z[q];if(P===void 0)return!1;if(A=P[1])F=q+1;else return!0}return!1},E=new Uint8Array(t);{let A=-1,F=!1,j=!1,q=0;for(let P=0;P<=t;P++){const W=P0&&(G==="{"?q++:G==="}"&&q--)}}for(let A=0;A=0;A--)n[A]===lS&&(T=A),o[A]=T;const N=/^[\p{L}\p{Nd}\\|{([+.¬°-±×÷′-″←-⇿∀-⋿^_<>=-]$/u,C=/[^\p{L}\p{Nd}\s]$/u,O=/[^\s\u0020-\u007E\u0370-\u03FF\u{1D400}-\u{1D7FF}\p{Nd}¬°-±×÷′-″←-⇿∀-⋿]/u,H=/(?:^|\s)[a-z]{2,}/,V=(A,F)=>{const j=Qa(e,A+1);if(j===void 0||!N.test(j))return!1;const q=o[A+1]??il;if(q!==il){const P=e.slice(A+1,q);return!(q-(A+1)===((e.codePointAt(A+1)??0)>65535?2:1))&&O.test(P)||/[,;:!?]$/.test(P)||/^[a-z]{2,}$/.test(P)?!1:(s[q]??0)-(s[A+1]??0)===0&&(i[q]??0)-(i[A+1]??0)===0}return C.test(F)||O.test(F)||H.test(F)};return(A,F=-1)=>{if(e[A]!=="$"||n[A]===iS||e[A+1]==="$"||e[A-1]==="$"&&F!==A||qfe(e,A)||A+1>=t||sS(Qa(e,A+1)))return null;const j=o[A+1]??il;if(j===il||(s[j]??0)-(s[A+1]??0)>0||(i[j]??0)-(i[A+1]??0)>0)return null;const q=e.slice(A+1,j);return/^\{[A-Z_][A-Z0-9_]*(?:\}$|[:-])/.test(q)||e[j+1]==="{"&&/^\{[A-Za-z_][A-Za-z0-9_]*(?:[:-][^{}]*)?\}$/.test(q)||ou(Wfe(e,A))&&Yfe(q)||Zfe(e,A)&&(V(j,q)||Ufe(e,j)||/\s/.test(q)&&/\p{Nd}$/u.test(q)&&!/[+\-*/^=_<>|\\¬°-±×÷′-″←-⇿∀-⋿]/.test(q)||!1)||e[j+1]==="$"&&!/\p{L}/u.test(q)&&C.test(q)?null:{content:q,end:j+1}}}const Jfe=/^---[ \t]*(?:\r\n|\n)/,Qfe=/^---[ \t]*$/;function e3e(e){const t=Jfe.exec(e);if(t===null)return{frontmatter:null,body:e};let n=t[0].length;const o=n;for(;n<=e.length;){let s=e.indexOf(` +`,n);s===-1&&(s=e.length);let i=e.slice(n,s);if(i.endsWith("\r")&&(i=i.slice(0,-1)),Qfe.test(i)){const r=e.slice(o,n);if(r==="")return{frontmatter:null,body:e};const l=s\n]*>|[^()\s]+)\)/g,t3e=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,n3e=/^[a-zA-Z]:(?:[\\/]|%5c)/i,o3e=/^[A-Za-z0-9._~-]$/,L5="pythinker-code://skill/";let cS;function uS(e){return e.replaceAll("%","%25").replaceAll("&","%26").replaceAll("<","%3C").replaceAll(">","%3E").replaceAll(/[[\]\\]/g,"\\$&").replaceAll(` +`,"%0A").replaceAll("\r","%0D")}function s3e(e){return e.replaceAll(/\\([\\[\]])/g,"$1").replaceAll("%26","&").replaceAll("%3C","<").replaceAll("%3E",">").replaceAll("%0A",` +`).replaceAll("%0D","\r").replaceAll("%25","%")}function l$(e){let t="";for(const n of e){const o=n.codePointAt(0);o>127||o3e.test(n)?t+=n:t+=`%${o.toString(16).toUpperCase().padStart(2,"0")}`}return t}function i3e(e){const t=e.split("/").map(l$).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function a$(e){return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1):e}function dS(e){const t=a$(e);try{return decodeURIComponent(t)}catch{return t}}function r3e(e){const t=a$(e);return!t||t.startsWith("#")||t.startsWith("?")||t.startsWith("//")?null:t.startsWith(L5)&&t.length>L5.length?"skill":t3e.test(t)&&!n3e.test(t)?null:/(?:[\\/]|%5c)$/i.test(t)?"folder":"file"}function pm(e,t){if(!t)return;const n=e.at(-1);n?.type==="text"?n.value+=t:e.push({type:"text",value:t})}function Av(e){if(e.kind==="skill")return`[${uS(e.name)}](${L5}${l$(e.name)})`;const t=e.kind==="folder"&&!/[\\/]$/.test(e.path)?`${e.path}/`:e.path;return`[${uS(e.name)}](${i3e(t)})`}function c$(e){const t=[];let n=0;aS.lastIndex=0;for(const o of e.matchAll(aS)){const s=o.index;pm(t,e.slice(n,s));const i=o[0],r=o[1],l=o[2],a=e[s-1]==="!"?null:r3e(l);if(a&&r){const c=a==="skill"?dS(l).slice(L5.length):void 0;t.push({type:"mention",attrs:{kind:a,name:c??s3e(r),path:a==="skill"?"":dS(l)}})}else pm(t,i);n=s+i.length}return pm(t,e.slice(n)),t}function u$(e){const t=c$(e.args??"").filter(o=>o.type==="mention"&&o.attrs.kind==="skill"),n=t[0];return t.length===1&&n?.type==="mention"&&n.attrs.name===e.name}function d$(e,t){if(u$(e))return t.revivePill?e.args??"":null;if(e.name.includes(" "))return null;const n=e.args??"";return`/skill:${e.name}${n.length>0?` ${n}`:""}`}function l3e(e,t){return d$(e,t)!==null}function a3e(e){if(u$(e))return e.args??"";const t=Av({kind:"skill",name:e.name,path:""});return e.args?`${t} ${e.args}`:t}function fS(e){return cS??=new Intl.Segmenter("und",{granularity:"grapheme"}),Array.from(cS.segment(e),({segment:t})=>t)}function f$(e){const t=fS(e);if(t.length<=32)return e;const n=e.lastIndexOf("."),s=(n>=0?fS(e.slice(n)).length:0)+4,i=31-s;return i<8?`${t.slice(0,31).join("")}…`:`${t.slice(0,i).join("")}…${t.slice(-s).join("")}`}function c3e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function u3e(e){return new Worker("/assets/mermaidParser.worker-DimdFOud.js",{type:"module",name:e?.name})}const d3e={key:0,class:"md-frontmatter"},f3e={key:1,class:"diff-wrap"},p3e={class:"diff-bar"},h3e=["aria-label","onClick"],m3e={class:"diff-pre"},g3e={key:0,class:"diff-sign"},v3e={class:"diff-text"},w3e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B3="pythinker-code://skill/",pS="md-table-wide",hS="md-table-toggle",mS="md-table-fade",gS="md-table-toggle--show",y3e="md-table-at-end",k3e=26,vS="github-light",wS="github-dark",b3e=Ge({__name:"Markdown",props:{text:{},openFile:{},skills:{},streaming:{type:Boolean,default:!1}},setup(e){rue(),yue(),aue(),_ue(),lue(new c3e),bue(new u3e);const t=new WeakMap;function n(Re,lt){if(Re.src[Re.pos]!=="$")return!1;let tt=t.get(Re);(!tt||tt.src!==Re.src)&&(tt={src:Re.src,match:Xfe(Re.src),lastEnd:-1},t.set(Re,tt));const ht=tt.match(Re.pos,tt.lastEnd);if(!ht||ht.end>Re.posMax)return!1;if(tt.lastEnd=ht.end,lt)return Re.pos=ht.end,!0;const bt=Re.push("math_inline","math",0);return bt.content=ht.content,bt.markup="$",bt.raw=Re.src.slice(Re.pos,ht.end),bt.loading=!1,Re.pos=ht.end,!0}function o(Re){return Re.set({typographer:!1}),Re.inline.ruler.disable("math"),Re.inline.ruler.before("escape","math",n),Re}const{t:s}=Lt(),i=pn("resolveImage"),r=U(null),l=e,a=B(()=>!l.streaming),c=B(()=>e3e(l.text??"")),u=B(()=>c.value.body),d=B(()=>zfe(u.value)),f=B(()=>l.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Hfe(u.value)),p=wp(),h=B(()=>!l.streaming),m=Rs(new Map),k=new Set,x=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,v=/(]*?\bsrc=")([^"]+)(")/gi;function w(Re){return!/^(https?:|data:|blob:)/i.test(Re)}function b(Re){if(!i)return;const lt=[];for(const tt of[x,v]){tt.lastIndex=0;let ht;for(;(ht=tt.exec(Re))!==null;)lt.push(ht[2]??"")}for(const tt of lt)!tt||!w(tt)||m.has(tt)||k.has(tt)||(k.add(tt),i(tt).then(ht=>{m.set(tt,ht!==tt?ht:"")}).catch(()=>{m.set(tt,"")}).finally(()=>{k.delete(tt)}))}function M(Re){if(!i)return Re;const lt=tt=>{if(!w(tt))return null;const ht=m.get(tt);return ht===void 0?w3e:ht===""?null:ht};return Re.replace(x,(tt,ht,bt,Rt)=>{const on=lt(bt);return on===null?tt:`${ht}${on}${Rt}`}).replace(v,(tt,ht,bt,Rt)=>{const on=lt(bt);return on===null?tt:`${ht}${on}${Rt}`})}Ue(()=>u.value,Re=>b(Re),{immediate:!0});function R(){if(!r.value||!l.openFile||l.streaming)return;const Re=document.createTreeWalker(r.value,NodeFilter.SHOW_TEXT),lt=[];let tt=Re.nextNode();for(;tt;){const ht=tt,bt=ht.parentElement;bt&&!bt.closest("a, pre, .md-file-link, svg")&&ht.data.trim().length>0&<.push(ht),tt=Re.nextNode()}for(const ht of lt){const bt=Rfe(ht.data,{aliases:d.value});if(bt.length===0||!ht.parentNode)continue;const Rt=document.createDocumentFragment();let on=0;for(const an of bt){an.start>on&&Rt.append(document.createTextNode(ht.data.slice(on,an.start)));const sn=document.createElement("button");sn.type="button",sn.className="md-file-link",sn.textContent=an.text,sn.title=an.line?`${an.path}:${an.line}`:an.path,sn.addEventListener("click",Yn=>{Yn.preventDefault(),Yn.stopPropagation(),l.openFile?.({path:an.path,line:an.line})}),Rt.append(sn),on=an.end}onB3.length?"skill":Re.startsWith("#")||Re.startsWith("?")||Re.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(Re)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(Re)?null:Re.endsWith("/")||Re.endsWith("\\")||/%5c$/i.test(Re)?"folder":"file":null}function T(Re){try{return decodeURIComponent(Re.slice(B3.length))}catch{return Re.slice(B3.length)}}function N(Re){return Re.replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function C(){if(!r.value||l.streaming)return;const Re=r.value.querySelectorAll("a[href]");for(const lt of Re){if(lt.dataset.mdLinkHandled==="true"||lt.closest("svg")||lt.querySelector("img"))continue;const tt=lt.getAttribute("href")??"",ht=E(tt);if(ht===null)continue;lt.dataset.mdLinkHandled="true",lt.removeAttribute("title");const bt=ht==="skill"?tt:z(tt),Rt=N(lt.textContent??"");lt.classList.add("mention-pill",`mention-${ht}`),lt.dataset.mentionKind=ht,lt.dataset.mentionName=ht==="skill"?T(tt):Rt,lt.dataset.mentionPath=bt,(ht==="skill"||l.openFile)&<.removeAttribute("href"),(ht==="skill"||ht==="file"&&l.openFile)&&(lt.tabIndex=0,lt.setAttribute("role","button"));const on=f$(Rt),an=document.createElement("span");if(an.className="mention-pill-name",an.textContent=on,lt.replaceChildren(an),!lt.querySelector(".mention-pill-icon")){const sn=document.createElement("span");sn.className="mention-pill-icon",sn.setAttribute("aria-hidden","true"),sn.innerHTML=ht==="skill"?jr("sparkles","sm"):ht==="folder"?jr("folder","sm"):gu(bt,Rt),lt.prepend(sn)}lt.addEventListener("click",sn=>{ht!=="skill"&&!l.openFile||(sn.preventDefault(),sn.stopPropagation(),ht==="file"&&l.openFile?.({path:$(z(tt))}))}),ht==="file"&&l.openFile&<.addEventListener("keydown",sn=>{sn.key!=="Enter"&&sn.key!==" "||(sn.preventDefault(),sn.stopPropagation(),l.openFile?.({path:$(z(tt))}))}),fe(lt)}}function O(Re){const lt=Re.dataset.mentionKind??(Re.classList.contains("mention-skill")?"skill":Re.classList.contains("mention-folder")?"folder":"file"),tt=Re.dataset.mentionName??Re.querySelector(".mention-pill-name")?.textContent??"";return{kind:lt,name:tt,path:Re.dataset.mentionPath??""}}function H(Re,lt){let tt;return()=>{if(tt===void 0){const ht=getComputedStyle(document.documentElement).getPropertyValue(Re).trim(),bt=parseFloat(ht);tt=Number.isFinite(bt)?ht.endsWith("s")?bt*1e3:bt:lt}return tt}}const V=H("--space-1-5",6),A=H("--p-mention-tip-vmargin",12),F=H("--duration-tooltip",150),j=H("--duration-fast",120),q=H("--duration-flash",1e3),P=U(null);let W=null,G=0,ee=0;function se(Re){return P.value?.contains(Re)??!1}function oe(){let Re=P.value;return Re||(Re=document.createElement("div"),Re.className="mention-tip",Re.id="mention-tip",Re.setAttribute("role","tooltip"),Re.addEventListener("mouseenter",()=>window.clearTimeout(ee)),Re.addEventListener("mouseleave",()=>D()),Re.addEventListener("focusin",()=>window.clearTimeout(ee)),Re.addEventListener("focusout",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&(Re.contains(tt)||W?.contains(tt))||Y()}),document.body.append(Re),P.value=Re),Re}function Q(){const Re=P.value,lt=W;if(!Re||!lt)return;const tt=lt.getBoundingClientRect(),ht=V(),bt=A();let Rt=tt.top-ht-Re.offsetHeight;Rtlt.name===Re)}function xe(Re){const lt=document.createElement("div");lt.className="mention-tip-path";const tt=document.createElement("div");tt.className="mention-tip-path-text";const ht=Re.split(/([/\\])/);let bt=ht.length-1;for(;bt>0&&(ht[bt]===""||ht[bt]==="/"||ht[bt]==="\\");)bt--;for(let an=0;an{an.preventDefault(),an.stopPropagation(),ss(Re).then(sn=>{sn&&(Rt.innerHTML=jr("check","sm"),window.setTimeout(()=>{Rt.innerHTML=on},q()))})}),lt.append(Rt),lt}function Ke(Re){const lt=document.createElement("div");lt.className="mention-tip-skill";const tt=document.createElement("div");tt.className="mention-tip-head";const ht=document.createElement("span");if(ht.className="mention-tip-name",ht.textContent=Re.name,tt.append(ht),Re.path&&l.openFile){const bt=document.createElement("button");bt.type="button",bt.className="mention-tip-open",bt.setAttribute("aria-label",s("mention.openSkill")),bt.innerHTML=jr("external-link","sm");const Rt=Re.path;bt.addEventListener("click",on=>{on.preventDefault(),on.stopPropagation(),Y(),l.openFile?.({path:Rt})}),tt.append(bt)}if(lt.append(tt),Re.description){const bt=document.createElement("div");bt.className="mention-tip-desc",bt.textContent=Re.description,lt.append(bt)}return lt}function et(Re){const lt=oe();W?.removeAttribute("aria-describedby"),W=Re,Re.setAttribute("aria-describedby",lt.id);const tt=O(Re);lt.replaceChildren(tt.kind==="skill"?Ke(ge(tt.name)??{name:tt.name,description:""}):xe(tt.path||tt.name)),lt.classList.remove("positioned"),Q(),lt.classList.add("positioned"),lt.removeAttribute("inert")}function Y(){window.clearTimeout(G),window.clearTimeout(ee),W?.removeAttribute("aria-describedby"),W=null;const Re=P.value;Re?.classList.remove("positioned"),Re?.setAttribute("inert","")}function ne(Re){window.clearTimeout(ee),window.clearTimeout(G);const lt=P.value?.classList.contains("positioned")&&W===Re;G=window.setTimeout(()=>{Re.isConnected&&et(Re)},lt?0:F())}function D(){window.clearTimeout(G),window.clearTimeout(ee),ee=window.setTimeout(Y,j())}function X(Re){const lt=P.value;if(!(!lt||!lt.classList.contains("positioned")||!W)){if(Re.key==="Escape"){Re.target instanceof Node&<.contains(Re.target)&&W.focus(),Y(),Re.preventDefault(),Re.stopImmediatePropagation();return}if(Re.key==="Tab"&&Re.target instanceof Node&<.contains(Re.target)){const tt=Array.from(lt.querySelectorAll("button")),ht=tt[0],bt=tt[tt.length-1];(!Re.shiftKey&&Re.target===bt||Re.shiftKey&&Re.target===ht)&&(Re.preventDefault(),W.focus(),Y())}}}function ve(Re){const lt=Re.target;lt instanceof Node&&(se(lt)||W?.contains(lt))||Y()}function fe(Re){Re.addEventListener("mouseenter",()=>ne(Re)),Re.addEventListener("mouseleave",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&se(tt)||D()}),Re.addEventListener("focus",()=>ne(Re)),Re.addEventListener("blur",lt=>{const tt=lt.relatedTarget;tt instanceof Node&&se(tt)||D()})}function pe(){Y()}function te(Re){return Re.querySelector(`button.${hS}`)}function de(Re){return Re.querySelector(`.${mS}`)}function ye(Re){const lt=te(Re);if(!lt)return;const tt=Re.querySelector("thead tr")??Re.querySelector("tr");if(!tt)return;const ht=tt.getBoundingClientRect(),bt=Re.getBoundingClientRect().top,Rt=Math.max(2,Math.round(ht.top-bt+(ht.height-k3e)/2));lt.style.top=`${Rt}px`,lt.style.right=`${Rt}px`}function Ce(Re){const lt=Re.querySelector("table");return lt!==null&<.scrollWidth>Re.clientWidth+1}function me(Re){const lt=`translateX(${Re.scrollLeft}px)`,tt=de(Re);tt&&(tt.style.transform=lt);const ht=te(Re);ht&&(ht.style.transform=lt);const bt=Re.scrollLeft+Re.clientWidth>=Re.scrollWidth-2;Re.classList.toggle(y3e,bt)}function be(Re){const lt=te(Re);if(!lt)return;const tt=Ce(Re),ht=Re.classList.contains(pS);lt.classList.toggle(gS,tt||ht),de(Re)?.classList.toggle(gS,tt),ye(Re),me(Re)}function ie(Re){const lt=te(Re);if(lt)return lt;if(!Re.closest(".a-msg .msg"))return null;const tt=document.createElement("div");tt.className=mS,tt.setAttribute("aria-hidden","true");const ht=document.createElement("button");return ht.type="button",ht.className=hS,ht.innerHTML=jr("expand","sm"),ht.setAttribute("aria-label",s("conversation.widenTable")),ht.title=s("conversation.widenTable"),ht.addEventListener("click",bt=>{bt.preventDefault(),bt.stopPropagation(),ke(Re)}),Re.append(tt,ht),Re.addEventListener("scroll",()=>me(Re),{passive:!0}),be(Re),ht}function ke(Re){const lt=Re.classList.toggle(pS),tt=te(Re);if(tt){tt.innerHTML=jr(lt?"collapse":"expand","sm");const ht=s(lt?"conversation.restoreTableWidth":"conversation.widenTable");tt.setAttribute("aria-label",ht),tt.title=ht}be(Re),Re.dispatchEvent(new CustomEvent("pythinker-table-layout",{bubbles:!0}))}function Fe(){if(!(!r.value||l.streaming))for(const Re of r.value.querySelectorAll(".table-node-wrapper"))ie(Re)}function at(){if(!(!r.value||l.streaming))for(const Re of r.value.querySelectorAll(".table-node-wrapper"))be(Re)}function dt(){Y(),vt().then(()=>{R(),C(),Fe()})}Ue(()=>l.text,dt),Ue(()=>l.streaming,dt);let $t=null,Et=null;xn(()=>{dt(),r.value&&($t=new MutationObserver(dt),$t.observe(r.value,{childList:!0,subtree:!0}),typeof ResizeObserver<"u"&&(Et=new ResizeObserver(at),Et.observe(r.value))),window.addEventListener("scroll",pe,{capture:!0}),window.addEventListener("resize",pe),document.addEventListener("pointerdown",ve,{capture:!0}),document.addEventListener("keydown",X,{capture:!0})}),An(()=>{$t?.disconnect(),Et?.disconnect(),window.removeEventListener("scroll",pe,{capture:!0}),window.removeEventListener("resize",pe),document.removeEventListener("pointerdown",ve,{capture:!0}),document.removeEventListener("keydown",X,{capture:!0}),Y(),P.value?.remove(),P.value=null});const Qt={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1,monacoOptions:{lineNumbers:!1,fontSize:13,fontFamily:"var(--font-mono)",padding:{top:12,bottom:12}}},Dt=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,en=B(()=>{const Re=M(u.value),lt=[];let tt=0;Dt.lastIndex=0;let ht;for(;(ht=Dt.exec(Re))!==null;){const Rt=ht[1]??"",on=Re.slice(tt,ht.index)+(Rt||"");on.trim()&<.push({kind:"md",text:on}),lt.push({kind:"diff",code:ht[2]??""}),tt=Dt.lastIndex}const bt=Re.slice(tt);return(bt.trim()||lt.length===0)&<.push({kind:"md",text:bt}),lt});function kn(Re){return Re.split(` +`).map(lt=>lt.startsWith("@@")?{type:"hunk",sign:"",text:lt}:/^\+(?!\+\+)/.test(lt)?{type:"add",sign:"+",text:lt.slice(1)}:/^-(?!--)/.test(lt)?{type:"del",sign:"-",text:lt.slice(1)}:lt.startsWith(" ")?{type:"ctx",sign:"",text:lt.slice(1)}:{type:"ctx",sign:"",text:lt})}const In=U(null);function Mn(Re,lt){ss(Re).then(tt=>{tt&&(In.value=lt,setTimeout(()=>{In.value=null},1400))})}return(Re,lt)=>(g(),S("div",{ref_key:"mdRef",ref:r,class:"md"},[c.value.frontmatter!==null?(g(),S("pre",d3e,I(c.value.frontmatter),1)):J("",!0),(g(!0),S(Me,null,it(en.value,(tt,ht)=>(g(),S(Me,{key:ht},[tt.kind==="md"?(g(),ce(y(Fi),{key:0,content:tt.text,"custom-markdown-it":o,mode:"chat","code-renderer":f.value.codeRenderer,"is-dark":y(p),"code-block-light-theme":vS,"code-block-dark-theme":wS,themes:[vS,wS],"code-block-props":Qt,final:a.value,"smooth-streaming":e.streaming,"batch-rendering":h.value,"defer-nodes-until-visible":!1,onCopy:y(DP)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(g(),S("div",f3e,[_("div",p3e,[lt[0]||(lt[0]=_("span",{class:"diff-lang"},"diff",-1)),Z(Cn,{text:y(s)("filePreview.copyCode")},{default:ue(()=>[_("button",{class:"diff-copy","aria-label":y(s)("filePreview.copyCode"),onClick:bt=>Mn(tt.code,ht)},[Z(Le,{name:In.value===ht?"check":"copy",size:"sm"},null,8,["name"])],8,h3e)]),_:2},1032,["text"])]),_("pre",m3e,[_("code",null,[(g(!0),S(Me,null,it(kn(tt.code),(bt,Rt)=>(g(),S("span",{key:Rt,class:Be(["diff-line",`diff-${bt.type}`])},[bt.type!=="hunk"?(g(),S("span",g3e,I(bt.sign),1)):J("",!0),_("span",v3e,I(bt.text),1)],2))),128))])])]))],64))),128))],512))}}),sa=mt(b3e,[["__scopeId","data-v-445dce9f"]]),_3e=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),x3e={class:"activity-notice",role:"status"},S3e={"aria-hidden":"true"},C3e={class:"an-label"},M3e=Ge({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(g(),S("div",x3e,[_("span",S3e,[Z(Go,{size:"sm"})]),_("span",C3e,I(e.label),1)]))}}),A3e=mt(M3e,[["__scopeId","data-v-5e7a6420"]]);function E3e(e,t="Yesterday"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const T3e=Ge({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Lt(),o=U(!1),s=B(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=B(()=>o.value?s.value:E3e(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(g(),S("button",{type:"button",class:"msg-time",onClick:xt(r,["stop"])},I(i.value),1))}}),Ev=mt(T3e,[["__scopeId","data-v-6761370d"]]);function I3e(e){return e.length===1?`0${e}`:e}function L3e(e,t){return`${String(Number(e))}:${I3e(t)}`}const yS=e=>/^\d+$/.test(e);function $3e(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(yS(o)&&yS(s)&&c){const f=L3e(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const N3e=["data-turn-id"],z3e={class:"cn-bubble"},B3e={class:"cn-title"},R3e={key:0,class:"cn-prompt"},F3e={class:"cn-meta"},j3e={key:0,class:"cn-meta-item"},O3e={key:1,class:"cn-meta-item"},P3e=["aria-label"],H3e=["title"],D3e=Ge({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Lt(),o=B(()=>t.cron),s=B(()=>o.value?.missedCount!==void 0),i=B(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=B(()=>{const u=o.value?.cron;return u?$3e(u,n):""}),l=B(()=>s.value?"error":"ok"),a=B(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=B(()=>t.text??"");return(u,d)=>(g(),S("div",{class:Be(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",z3e,[_("span",B3e,I(i.value),1),c.value?(g(),S("span",R3e,I(c.value),1)):J("",!0)]),_("div",F3e,[Z(Le,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(g(),S("span",j3e,I(r.value),1)):J("",!0),a.value?(g(),S("span",O3e,I(a.value),1)):J("",!0),_("span",{class:Be(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(g(),ce(Le,{key:0,name:"check",size:"sm"})):(g(),ce(Le,{key:1,name:"close",size:"sm"}))],10,P3e),o.value?.jobId?(g(),S("span",{key:2,class:"cn-meta-item cn-id",title:y(n)("conversation.cron.job",{id:o.value.jobId})},I(o.value.jobId),9,H3e)):J("",!0),e.createdAt?(g(),ce(Ev,{key:3,time:e.createdAt},null,8,["time"])):J("",!0)])],10,N3e))}}),V3e=mt(D3e,[["__scopeId","data-v-d3807b0f"]]),p$="pythinkerWeb.taskNotification",W3e=/]*)>([\s\S]*?)<\/notification>/g,q3e=/([\w-]+)="([^"]*)"/g,U3e=/]*)>[\s\S]*?<\/output-file>/,Z3e=/]*)>([\s\S]*?)<\/output-preview>/,K3e=/^Title: (.*)$/m,G3e=/^Severity: (.*)$/m;function y4(e){return e.replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function hm(e){const t={};for(const n of e.matchAll(q3e))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=y4(n[2]));return t}function mm(e){if(e===void 0)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function Y3e(e,t,n){const o=hm(e),s=K3e.exec(t)?.[1]?.trim()??"",i=G3e.exec(t)?.[1]?.trim()??"";let r=t.split(` `).filter(k=>!k.startsWith("Title: ")&&!k.startsWith("Severity: ")).join(` -`);const l=i.search(/^<\w/m);l!==-1&&(i=i.slice(0,l));const a=H3e.exec(t),c=a?pm(a[1]??""):void 0,u=c?.path?{path:c.path,bytes:hm(c.bytes)}:void 0,d=D3e.exec(t),f=d?pm(d[1]??""):void 0,p=(d?.[2]??"").replace(/^\n/,""),h=p.indexOf(` -`),m=d?{text:w4(h===-1?"":p.slice(h+1)).replace(/\n$/,""),bytes:hm(f?.bytes),totalBytes:hm(f?.total_bytes),truncated:f?.truncated==="true"?!0:f?.truncated==="false"?!1:void 0}:void 0;return{id:o.id??"",category:o.category??"",type:o.type??"",sourceKind:o.source_kind??"",sourceId:o.source_id??"",agentId:o.agent_id,title:w4(s),severity:r,body:w4(i.trim()),outputFile:u,outputPreview:m,raw:n}}function d$(e){if(!e.includes("{h=null,p.value=null},1200))}return An(()=>{h!==null&&clearTimeout(h)}),(k,x)=>(g(),S("div",K3e,[(g(!0),S(Me,null,rt(t.items,(w,v)=>(g(),S("div",{key:s(w,v),class:Be(["ntn",y(Z3e)(w)]),role:"status"},[_("div",G3e,[Z(Le,{name:r(w),size:"sm",class:"ntn-ico","aria-hidden":"true"},null,8,["name"]),_("span",Y3e,I(c(w)),1)]),_("div",X3e,[w.title?(g(),S("div",J3e,I(w.title),1)):J("",!0),w.body?(g(),S("div",Q3e,I(w.body),1)):J("",!0),w.outputFile?(g(),S("div",e4e,[Z(Le,{class:"ntn-out-ic",name:"file-text",size:"sm","aria-hidden":"true"}),_("span",{class:"ntn-out-path",title:w.outputFile.path},I(w.outputFile.path),9,t4e),w.outputFile.bytes!==void 0?(g(),S("span",n4e,I(u(w.outputFile.bytes)),1)):J("",!0),Z(It,{"data-testid":"notification-copy-path",variant:"secondary",size:"sm",type:"button",onClick:b=>m(w.outputFile.path,s(w,v))},{default:ue(()=>[Z(Le,{name:"copy",size:"sm","aria-hidden":"true"}),He(" "+I(p.value===s(w,v)?y(n)("conversation.notification.copied"):y(n)("conversation.notification.copyPath")),1)]),_:2},1032,["onClick"])])):J("",!0),f(w)?(g(),S("div",o4e,[d(w)?(g(),S("div",s4e,I(d(w)),1)):J("",!0),w.outputPreview?.text?(g(),S("pre",r4e,I(w.outputPreview.text),1)):J("",!0)])):J("",!0),_("details",i4e,[_("summary",null,[Z(Le,{class:"ntn-raw-car",name:"chevron-right",size:"sm","aria-hidden":"true"}),_("span",null,I(y(n)("conversation.notification.rawPayload")),1)]),_("div",l4e,[_("div",a4e,[_("span",c4e,I(y(n)("conversation.notification.fields.type")),1),_("span",u4e,I(w.type),1),_("span",d4e,I(y(n)("conversation.notification.fields.source")),1),_("span",f4e,I(w.sourceKind)+" · "+I(w.sourceId),1),_("span",p4e,I(y(n)("conversation.notification.fields.severity")),1),_("span",h4e,I(w.severity||"—"),1)]),_("pre",m4e,I(w.raw),1)])])]),_("div",g4e,[w.createdAt?(g(),ce(Av,{key:0,time:w.createdAt},null,8,["time"])):J("",!0)])],2))),128))]))}}),f$=mt(v4e,[["__scopeId","data-v-6e055dc6"]]),yS=ln.clientId,w4e="pythinker-code-web",y4e="web";function p$(){return{serverHttpUrl:b4e(),clientId:x4e(),clientName:w4e,clientVersion:S4e(),clientUiMode:y4e}}function k4e(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function b4e(e){const t=k4e(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function Mc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function _4e(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function x4e(){const e=Yo(yS);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return vs(yS,t),t}function S4e(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}function C4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function M4e(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const A4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function T4e(e,t){switch(t.op){case"reset":return E4e(e,t);case"turn.upsert":return L4e(e,t.turn);case"step.upsert":return N4e(e,t.turnId,t.step);case"frame.upsert":return B4e(e,t);case"append":return F4e(e,t);case"marker.upsert":return bS(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return bS(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return P4e(e,t.task);case"interaction.upsert":return H4e(e,t.interaction);case"attachment.upsert":return V4e(e,t.attachment);case"todo.upsert":return q4e(e,t.todo);case"prompt.upsert":return Z4e(e,t.prompt);case"meta.merge":return Y4e(e,t.meta);case"items.remove":return O4e(e,t.ids)}}function E4e(e,t){const n=new Set;for(const o of t.snapshot.interactions)o.state==="pending"&&n.add(o.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(o=>[o.taskId,o])),interactions:new Map(t.snapshot.interactions.map(o=>[o.interactionId,o])),attachments:new Map(t.snapshot.attachments.map(o=>[o.attachmentId,o])),todos:new Map(t.snapshot.todos.map(o=>[o.todoId,o])),prompts:new Map(t.snapshot.prompts.map(o=>[o.promptId,o])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function kS(e,t){return{...e,kind:"turn",steps:[...t]}}function h$(e){return{kind:"turn",turnId:e,ordinal:C4e(e),state:"running",origin:{kind:"other"},steps:[]}}function I4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function ou(e,t){const n=e.items.find(o=>o.kind==="turn"&&o.turnId===t);return n?.kind==="turn"?n:void 0}function Tv(e,t){const n=[...e];let o=n.length;for(let s=0;st.ordinal){o=s;break}}return n.splice(o,0,t),n}function Rp(e,t,n){return e.map(o=>o.kind==="turn"&&o.turnId===t?n(o):o)}function L4e(e,t){const n=ou(e,t.turnId);return n?$4e(n,t)?{state:e,changed:!1}:{state:{...e,items:Rp(e.items,t.turnId,o=>kS(t,o.steps))},changed:!0}:{state:{...e,items:Tv(e.items,kS(t,[]))},changed:!0}}function $4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&("taskId"in e.origin?e.origin.taskId:void 0)===("taskId"in t.origin?t.origin.taskId:void 0)&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function N4e(e,t,n){const o=ou(e,t)??h$(t),s=o.steps.findIndex(c=>c.stepId===n.stepId);let r,i=!0;if(s>=0){const c=o.steps[s];c&&z4e(c,n)?(i=!1,r=o.steps):r=o.steps.map(u=>u.stepId===n.stepId?{...n,kind:"step",frames:u.frames}:u)}else r=[...o.steps,{...n,kind:"step",frames:[]}].toSorted((c,u)=>c.ordinal-u.ordinal);if(!i)return{state:e,changed:!1};const l={...o,steps:[...r]},a=ou(e,t)?Rp(e.items,t,()=>l):Tv(e.items,l);return{state:{...e,items:a},changed:!0}}function z4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function B4e(e,t){const n=ou(e,t.turnId)??h$(t.turnId),o=n.steps.find(u=>u.stepId===t.stepId)??I4e(t.stepId,t.turnId),s=o.frames.findIndex(u=>u.frameId===t.frame.frameId);let r;if(s>=0){const u=o.frames[s];if(u!==void 0&&R4e(u,t.frame))return{state:e,changed:!1};r=o.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else r=[...o.frames,t.frame];const i={...o,frames:[...r]},l=n.steps.some(u=>u.stepId===t.stepId)?n.steps.map(u=>u.stepId===t.stepId?i:u):[...n.steps,i].toSorted((u,d)=>u.ordinal-d.ordinal),a={...n,steps:l},c=ou(e,t.turnId)?Rp(e.items,t.turnId,()=>a):Tv(e.items,a);return{state:{...e,items:c},changed:!0}}function R4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail&&e.source===t.source:!1}function F4e(e,t){if(t.target.type==="task")return j4e(e,t);const{turnId:n,stepId:o,frameId:s}=t.target,r=ou(e,n),i=r?.steps.find(f=>f.stepId===o),l=i?.frames.find(f=>f.frameId===s);if(!r||!i||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=m$(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const c={...l,text:a.text},u={...i,frames:i.frames.map(f=>f.frameId===s?c:f)},d={...r,steps:r.steps.map(f=>f.stepId===o?u:f)};return{state:{...e,items:Rp(e.items,n,()=>d)},changed:!0}}function j4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,o=e.tasks.get(n),s=o?.outputTail??"",r=m$(s,t.offset,t.text);if(r.gap)return{state:e,changed:!1,gap:r.gap};if(!r.changed)return{state:e,changed:!1};const i=o?{...o,outputTail:r.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:r.text},l=new Map(e.tasks);return l.set(n,i),{state:{...e,tasks:l},changed:!0}}function m$(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const o=e.length-t;return e.slice(t)!==n.slice(0,o)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(o>0?n.slice(o):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function bS(e,t,n,o){if(e.items.some(r=>f7(r)===n)){let r=!1;const i=e.items.map(l=>f7(l)!==n||l===t?l:(r=!0,t));return r?{state:{...e,items:i},changed:!0}:{state:e,changed:!1}}if(o!==void 0){const r=[...e.items];let i=r.length;for(let l=0;l=o){i=l;break}}return r.splice(i,0,t),{state:{...e,items:r},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function f7(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function O4e(e,t){const n=new Set(t),o=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),s=e.items.filter(l=>!n.has(f7(l)));if(s.length===e.items.length)return{state:e,changed:!1};let r=e.pendingInteractions,i=e.interactions;if(o.length>0){const l=new Set,a=new Set(r),c=new Set;for(const u of o)for(const d of u.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const u of i.values())u.toolCallId!==void 0&&l.has(u.toolCallId)&&(c.add(u.interactionId),a.delete(u.interactionId));if(c.size>0){const u=new Map(i);for(const d of c)u.delete(d);i=u}r=a}return{state:{...e,items:s,interactions:i,pendingInteractions:r},changed:!0}}function P4e(e,t){const n=e.tasks.get(t.taskId);if(n&&G4e(n,t))return{state:e,changed:!1};const o=new Map(e.tasks);return o.set(t.taskId,t),{state:{...e,tasks:o},changed:!0}}function H4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&D4e(n,t))return{state:e,changed:!1};const o=new Map(e.interactions);o.set(t.interactionId,t);let s=e.pendingInteractions;if(t.state==="pending"){if(!s.has(t.interactionId)){const r=new Set(s);r.add(t.interactionId),s=r}}else if(s.has(t.interactionId)){const r=new Set(s);r.delete(t.interactionId),s=r}return{state:{...e,interactions:o,pendingInteractions:s},changed:!0}}function D4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function V4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&W4e(n,t))return{state:e,changed:!1};const o=new Map(e.attachments);return o.set(t.attachmentId,t),{state:{...e,attachments:o},changed:!0}}function W4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function q4e(e,t){const n=e.todos.get(t.todoId);if(n&&U4e(n,t))return{state:e,changed:!1};const o=new Map(e.todos);return o.set(t.todoId,t),{state:{...e,todos:o},changed:!0}}function U4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function Z4e(e,t){const n=e.prompts.get(t.promptId);if(n&&K4e(n,t))return{state:e,changed:!1};const o=new Map(e.prompts);return o.set(t.promptId,t),{state:{...e,prompts:o},changed:!0}}function K4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function G4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function Y4e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,dynamic_workflow:t.modes.dynamic_workflow===null?void 0:t.modes.dynamic_workflow??e.meta.modes?.dynamic_workflow,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,o=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,s={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.dynamic_workflow===void 0&&n.tower===void 0?void 0:n,agent:o};return s.goal===e.meta.goal&&s.activity===e.meta.activity&&s.modes===e.meta.modes&&s.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:s},changed:!0}}class X4e{constructor(t){this.agentId=t}#e=A4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let o,s=this.#e;for(const r of t){const i=T4e(s,r);if(i.gap){o={target:r.target,...i.gap};continue}i.changed&&(s=i.state,n.push(r))}if(this.#e=s,n.length>0){const r={agentId:this.agentId,ops:n};for(const i of this.#t)i(r)}return{accepted:n,gap:o}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(o=>o.kind==="turn"&&o.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,o=this.#e.hasMoreOlder;if(t!==void 0){const s=n.reduce((r,i)=>i.kind==="turn"?r+1:r,0);if(s>t.tailTurns){const r=s-t.tailTurns,i=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=r)continue;i.push(a)}else l>r&&i.push(a);n=i,o=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:o}}}var _S;function gt(e,t,n){function o(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:i,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const c=i.prototype,u=Object.keys(c);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class qc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class g$ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(_S=globalThis).__zod_globalConfig??(_S.__zod_globalConfig={});const Ev=globalThis.__zod_globalConfig;function ra(e){return Ev}function v$(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>t.indexOf(+o)===-1).map(([o,s])=>s)}function p7(e,t){return typeof t=="bigint"?t.toString():t}function Fp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Iv(e){return e==null}function Lv(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function J4e(e,t){const n=e/t,o=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o){};function Rd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const e5e=Fp(()=>{if(Ev.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function su(e){if(Rd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Rd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function y$(e){return su(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const t5e=new Set(["string","number","symbol"]);function ru(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g1(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function rn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function n5e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const o5e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function s5e(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=m1(e._zod.def,{get shape(){const i={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(i[l]=n.shape[l])}return I0(this,"shape",i),i},checks:[]});return g1(e,r)}function r5e(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=m1(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete i[l]}return I0(this,"shape",i),i},checks:[]});return g1(e,r)}function i5e(e,t){if(!su(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const r=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(r,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=m1(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return I0(this,"shape",r),r}});return g1(e,s)}function l5e(e,t){if(!su(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=m1(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return I0(this,"shape",o),o}});return g1(e,n)}function a5e(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=m1(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return I0(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return g1(e,n)}function c5e(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=m1(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const c in n){if(!(c in l))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(a[c]=e?new e({type:"optional",innerType:l[c]}):l[c])}else for(const c in l)a[c]=e?new e({type:"optional",innerType:l[c]}):l[c];return I0(this,"shape",a),a},checks:[]});return g1(t,i)}function u5e(e,t,n){const o=m1(t._zod.def,{get shape(){const s=t._zod.def.shape,r={...s};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)r[i]=new e({type:"nonoptional",innerType:s[i]});return I0(this,"shape",r),r}});return g1(t,o)}function Ac(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function B3(e){return typeof e=="string"?e:e?.message}function ia(e,t,n){const o=e.message?e.message:B3(e.inst?._zod.def?.error?.(e))??B3(t?.error?.(e))??B3(n.customError?.(e))??B3(n.localeError?.(e))??"Invalid input",{inst:s,continue:r,input:i,...l}=e;return l.path??(l.path=[]),l.message=o,t?.reportInput&&(l.input=i),l}function $v(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fd(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const k$=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,p7,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},b$=gt("$ZodError",k$),_$=gt("$ZodError",k$,{Parent:Error});function f5e(e,t=n=>n.message){const n={},o=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):o.push(t(s));return{formErrors:o,fieldErrors:n}}function p5e(e,t=n=>n.message){const n={_errors:[]},o=(s,r=[])=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(l=>o({issues:l},[...r,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...r,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...r,...i.path]);else{const l=[...r,...i.path];if(l.length===0)n._errors.push(t(i));else{let a=n,c=0;for(;c(t,n,o,s)=>{const r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new qc;if(i.issues.length){const l=new(s?.Err??e)(i.issues.map(a=>ia(a,r,ra())));throw w$(l,s?.callee),l}return i.value},zv=e=>async(t,n,o,s)=>{const r=o?{...o,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise&&(i=await i),i.issues.length){const l=new(s?.Err??e)(i.issues.map(a=>ia(a,r,ra())));throw w$(l,s?.callee),l}return i.value},jp=e=>(t,n,o)=>{const s=o?{...o,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new qc;return r.issues.length?{success:!1,error:new(e??b$)(r.issues.map(i=>ia(i,s,ra())))}:{success:!0,data:r.value}},h5e=jp(_$),Op=e=>async(t,n,o)=>{const s=o?{...o,async:!0}:{async:!0};let r=t._zod.run({value:n,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(i=>ia(i,s,ra())))}:{success:!0,data:r.value}},m5e=Op(_$),g5e=e=>(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Nv(e)(t,n,s)},v5e=e=>(t,n,o)=>Nv(e)(t,n,o),w5e=e=>async(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return zv(e)(t,n,s)},y5e=e=>async(t,n,o)=>zv(e)(t,n,o),k5e=e=>(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return jp(e)(t,n,s)},b5e=e=>(t,n,o)=>jp(e)(t,n,o),_5e=e=>async(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Op(e)(t,n,s)},x5e=e=>async(t,n,o)=>Op(e)(t,n,o),S5e=/^[cC][0-9a-z]{6,}$/,C5e=/^[0-9a-z]+$/,M5e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,A5e=/^[0-9a-vA-V]{20}$/,T5e=/^[A-Za-z0-9]{27}$/,E5e=/^[a-zA-Z0-9_-]{21}$/,I5e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,L5e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,CS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$5e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,N5e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function z5e(){return new RegExp(N5e,"u")}const B5e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R5e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F5e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,j5e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O5e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,x$=/^[A-Za-z0-9_-]*$/,P5e=/^https?$/,H5e=/^\+[1-9]\d{6,14}$/,S$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",D5e=new RegExp(`^${S$}$`);function C$(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function V5e(e){return new RegExp(`^${C$(e)}$`)}function W5e(e){const t=C$({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${S$}T(?:${o})$`)}const q5e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},U5e=/^-?\d+$/,M$=/^-?\d+(?:\.\d+)?$/,Z5e=/^(?:true|false)$/i,K5e=/^[^A-Z]*$/,G5e=/^[^a-z]*$/,jr=gt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),A$={number:"number",bigint:"bigint",object:"date"},T$=gt("$ZodCheckLessThan",(e,t)=>{jr.init(e,t);const n=A$[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?o.value<=t.value:o.value{jr.init(e,t);const n=A$[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Y5e=gt("$ZodCheckMultipleOf",(e,t)=>{jr.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):J4e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),X5e=gt("$ZodCheckNumberFormat",(e,t)=>{jr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[s,r]=o5e[t.format];e._zod.onattach.push(i=>{const l=i._zod.bag;l.format=t.format,l.minimum=s,l.maximum=r,n&&(l.pattern=U5e)}),e._zod.check=i=>{const l=i.value;if(n){if(!Number.isInteger(l)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?i.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}lr&&i.issues.push({origin:"number",input:l,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),J5e=gt("$ZodCheckMaxLength",(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Iv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const s=o.value;if(s.length<=t.maximum)return;const i=$v(s);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Q5e=gt("$ZodCheckMinLength",(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Iv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=t.minimum)return;const i=$v(s);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),epe=gt("$ZodCheckLengthEquals",(e,t)=>{var n;jr.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Iv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=o=>{const s=o.value,r=s.length;if(r===t.length)return;const i=$v(s),l=r>t.length;o.issues.push({origin:i,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Pp=gt("$ZodCheckStringFormat",(e,t)=>{var n,o;jr.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tpe=gt("$ZodCheckRegex",(e,t)=>{Pp.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),npe=gt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=K5e),Pp.init(e,t)}),ope=gt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=G5e),Pp.init(e,t)}),spe=gt("$ZodCheckIncludes",(e,t)=>{jr.init(e,t);const n=ru(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),rpe=gt("$ZodCheckStartsWith",(e,t)=>{jr.init(e,t);const n=new RegExp(`^${ru(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ipe=gt("$ZodCheckEndsWith",(e,t)=>{jr.init(e,t);const n=new RegExp(`.*${ru(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),lpe=gt("$ZodCheckOverwrite",(e,t)=>{jr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ape{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(` -`).filter(i=>i),s=Math.min(...o.map(i=>i.length-i.trimStart().length)),r=o.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of r)this.content.push(i)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,s.join(` -`))}}const cpe={major:4,minor:4,patch:3},Po=gt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cpe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const r of s._zod.onattach)r(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,l,a)=>{let c=Ac(i),u;for(const d of l){if(d._zod.def.when){if(d5e(i)||!d._zod.def.when(i))continue}else if(c)continue;const f=i.issues.length,p=d._zod.check(i);if(p instanceof Promise&&a?.async===!1)throw new qc;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,i.issues.length!==f&&(c||(c=Ac(i,f)))});else{if(i.issues.length===f)continue;c||(c=Ac(i,f))}}return u?u.then(()=>i):i},r=(i,l,a)=>{if(Ac(i))return i.aborted=!0,i;const c=s(l,o,a);if(c instanceof Promise){if(a.async===!1)throw new qc;return c.then(u=>e._zod.parse(u,a))}return e._zod.parse(c,a)};e._zod.run=(i,l)=>{if(l.skipChecks)return e._zod.parse(i,l);if(l.direction==="backward"){const c=e._zod.parse({value:i.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(u=>r(u,i,l)):r(c,i,l)}const a=e._zod.parse(i,l);if(a instanceof Promise){if(l.async===!1)throw new qc;return a.then(c=>s(c,o,l))}return s(a,o,l)}}mo(e,"~standard",()=>({validate:s=>{try{const r=h5e(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return m5e(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Bv=gt("$ZodString",(e,t)=>{Po.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??q5e(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Bo=gt("$ZodStringFormat",(e,t)=>{Pp.init(e,t),Bv.init(e,t)}),upe=gt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=L5e),Bo.init(e,t)}),dpe=gt("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=CS(o))}else t.pattern??(t.pattern=CS());Bo.init(e,t)}),fpe=gt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=$5e),Bo.init(e,t)}),ppe=gt("$ZodURL",(e,t)=>{Bo.init(e,t),e._zod.check=n=>{try{const o=n.value.trim();if(!t.normalize&&t.protocol?.source===P5e.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),hpe=gt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=z5e()),Bo.init(e,t)}),mpe=gt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=E5e),Bo.init(e,t)}),gpe=gt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=S5e),Bo.init(e,t)}),vpe=gt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=C5e),Bo.init(e,t)}),wpe=gt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=M5e),Bo.init(e,t)}),ype=gt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=A5e),Bo.init(e,t)}),kpe=gt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=T5e),Bo.init(e,t)}),bpe=gt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=W5e(t)),Bo.init(e,t)}),_pe=gt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=D5e),Bo.init(e,t)}),xpe=gt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=V5e(t)),Bo.init(e,t)}),Spe=gt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=I5e),Bo.init(e,t)}),Cpe=gt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=B5e),Bo.init(e,t),e._zod.bag.format="ipv4"}),Mpe=gt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=R5e),Bo.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Ape=gt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=F5e),Bo.init(e,t)}),Tpe=gt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=j5e),Bo.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[s,r]=o;if(!r)throw new Error;const i=Number(r);if(`${i}`!==r)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function I$(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Epe=gt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=O5e),Bo.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{I$(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Ipe(e){if(!x$.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return I$(n)}const Lpe=gt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=x$),Bo.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Ipe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$pe=gt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=H5e),Bo.init(e,t)});function Npe(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const zpe=gt("$ZodJWT",(e,t)=>{Bo.init(e,t),e._zod.check=n=>{Npe(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),L$=gt("$ZodNumber",(e,t)=>{Po.init(e,t),e._zod.pattern=e._zod.bag.pattern??M$,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...r?{received:r}:{}}),n}}),Bpe=gt("$ZodNumberFormat",(e,t)=>{X5e.init(e,t),L$.init(e,t)}),Rpe=gt("$ZodBoolean",(e,t)=>{Po.init(e,t),e._zod.pattern=Z5e,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Fpe=gt("$ZodUnknown",(e,t)=>{Po.init(e,t),e._zod.parse=n=>n}),jpe=gt("$ZodNever",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function MS(e,t,n){e.issues.length&&t.issues.push(...Tc(n,e.issues)),t.value[n]=e.value}const Ope=gt("$ZodArray",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const r=[];for(let i=0;iMS(c,n,i))):MS(a,n,i)}return r.length?Promise.all(r).then(()=>n):n}});function L5(e,t,n,o,s,r){const i=n in o;if(e.issues.length){if(s&&r&&!i)return;t.issues.push(...Tc(n,e.issues))}if(!i&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function $$(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=n5e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function N$(e,t,n,o,s,r){const i=[],l=s.keySet,a=s.catchall._zod,c=a.def.type,u=a.optin==="optional",d=a.optout==="optional";for(const f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){i.push(f);continue}const p=a.run({value:t[f],issues:[]},o);p instanceof Promise?e.push(p.then(h=>L5(h,n,f,t,u,d))):L5(p,n,f,t,u,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Ppe=gt("$ZodObject",(e,t)=>{if(Po.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const o=Fp(()=>$$(t));mo(e._zod,"propValues",()=>{const l=t.shape,a={};for(const c in l){const u=l[c]._zod;if(u.values){a[c]??(a[c]=new Set);for(const d of u.values)a[c].add(d)}}return a});const s=Rd,r=t.catchall;let i;e._zod.parse=(l,a)=>{i??(i=o.value);const c=l.value;if(!s(c))return l.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),l;l.value={};const u=[],d=i.shape;for(const f of i.keys){const p=d[f],h=p._zod.optin==="optional",m=p._zod.optout==="optional",k=p._zod.run({value:c[f],issues:[]},a);k instanceof Promise?u.push(k.then(x=>L5(x,l,f,c,h,m))):L5(k,l,f,c,h,m)}return r?N$(u,c,l,a,o.value,e):u.length?Promise.all(u).then(()=>l):l}}),Hpe=gt("$ZodObjectJIT",(e,t)=>{Ppe.init(e,t);const n=e._zod.parse,o=Fp(()=>$$(t)),s=f=>{const p=new ape(["shape","payload","ctx"]),h=o.value,m=v=>{const b=SS(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");const k=Object.create(null);let x=0;for(const v of h.keys)k[v]=`key_${x++}`;p.write("const newResult = {};");for(const v of h.keys){const b=k[v],M=SS(v),R=f[v],z=R?._zod?.optin==="optional",$=R?._zod?.optout==="optional";p.write(`const ${b} = ${m(v)};`),z&&$?p.write(` +`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l));const a=U3e.exec(t),c=a?hm(a[1]??""):void 0,u=c?.path?{path:c.path,bytes:mm(c.bytes)}:void 0,d=Z3e.exec(t),f=d?hm(d[1]??""):void 0,p=(d?.[2]??"").replace(/^\n/,""),h=p.indexOf(` +`),m=d?{text:y4(h===-1?"":p.slice(h+1)).replace(/\n$/,""),bytes:mm(f?.bytes),totalBytes:mm(f?.total_bytes),truncated:f?.truncated==="true"?!0:f?.truncated==="false"?!1:void 0}:void 0;return{id:o.id??"",category:o.category??"",type:o.type??"",sourceKind:o.source_kind??"",sourceId:o.source_id??"",agentId:o.agent_id,title:y4(s),severity:i,body:y4(r.trim()),outputFile:u,outputPreview:m,raw:n}}function h$(e){if(!e.includes("{h=null,p.value=null},1200))}return An(()=>{h!==null&&clearTimeout(h)}),(k,x)=>(g(),S("div",Q3e,[(g(!0),S(Me,null,it(t.items,(v,w)=>(g(),S("div",{key:s(v,w),class:Be(["ntn",y(J3e)(v)]),role:"status"},[_("div",e4e,[Z(Le,{name:i(v),size:"sm",class:"ntn-ico","aria-hidden":"true"},null,8,["name"]),_("span",t4e,I(c(v)),1)]),_("div",n4e,[v.title?(g(),S("div",o4e,I(v.title),1)):J("",!0),v.body?(g(),S("div",s4e,I(v.body),1)):J("",!0),v.outputFile?(g(),S("div",i4e,[Z(Le,{class:"ntn-out-ic",name:"file-text",size:"sm","aria-hidden":"true"}),_("span",{class:"ntn-out-path",title:v.outputFile.path},I(v.outputFile.path),9,r4e),v.outputFile.bytes!==void 0?(g(),S("span",l4e,I(u(v.outputFile.bytes)),1)):J("",!0),Z(It,{"data-testid":"notification-copy-path",variant:"secondary",size:"sm",type:"button",onClick:b=>m(v.outputFile.path,s(v,w))},{default:ue(()=>[Z(Le,{name:"copy",size:"sm","aria-hidden":"true"}),He(" "+I(p.value===s(v,w)?y(n)("conversation.notification.copied"):y(n)("conversation.notification.copyPath")),1)]),_:2},1032,["onClick"])])):J("",!0),f(v)?(g(),S("div",a4e,[d(v)?(g(),S("div",c4e,I(d(v)),1)):J("",!0),v.outputPreview?.text?(g(),S("pre",u4e,I(v.outputPreview.text),1)):J("",!0)])):J("",!0),_("details",d4e,[_("summary",null,[Z(Le,{class:"ntn-raw-car",name:"chevron-right",size:"sm","aria-hidden":"true"}),_("span",null,I(y(n)("conversation.notification.rawPayload")),1)]),_("div",f4e,[_("div",p4e,[_("span",h4e,I(y(n)("conversation.notification.fields.type")),1),_("span",m4e,I(v.type),1),_("span",g4e,I(y(n)("conversation.notification.fields.source")),1),_("span",v4e,I(v.sourceKind)+" · "+I(v.sourceId),1),_("span",w4e,I(y(n)("conversation.notification.fields.severity")),1),_("span",y4e,I(v.severity||"—"),1)]),_("pre",k4e,I(v.raw),1)])])]),_("div",b4e,[v.createdAt?(g(),ce(Ev,{key:0,time:v.createdAt},null,8,["time"])):J("",!0)])],2))),128))]))}}),m$=mt(_4e,[["__scopeId","data-v-6e055dc6"]]),kS=ln.clientId,x4e="pythinker-code-web",S4e="web";function g$(){return{serverHttpUrl:M4e(),clientId:E4e(),clientName:x4e,clientVersion:T4e(),clientUiMode:S4e}}function C4e(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function M4e(e){const t=C4e(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function Ac(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function A4e(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function E4e(){const e=Yo(kS);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return vs(kS,t),t}function T4e(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}function I4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function L4e(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const $4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function N4e(e,t){switch(t.op){case"reset":return z4e(e,t);case"turn.upsert":return R4e(e,t.turn);case"step.upsert":return j4e(e,t.turnId,t.step);case"frame.upsert":return P4e(e,t);case"append":return D4e(e,t);case"marker.upsert":return _S(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return _S(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return q4e(e,t.task);case"interaction.upsert":return U4e(e,t.interaction);case"attachment.upsert":return K4e(e,t.attachment);case"todo.upsert":return Y4e(e,t.todo);case"prompt.upsert":return J4e(e,t.prompt);case"meta.merge":return t5e(e,t.meta);case"items.remove":return W4e(e,t.ids)}}function z4e(e,t){const n=new Set;for(const o of t.snapshot.interactions)o.state==="pending"&&n.add(o.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(o=>[o.taskId,o])),interactions:new Map(t.snapshot.interactions.map(o=>[o.interactionId,o])),attachments:new Map(t.snapshot.attachments.map(o=>[o.attachmentId,o])),todos:new Map(t.snapshot.todos.map(o=>[o.todoId,o])),prompts:new Map(t.snapshot.prompts.map(o=>[o.promptId,o])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function bS(e,t){return{...e,kind:"turn",steps:[...t]}}function v$(e){return{kind:"turn",turnId:e,ordinal:I4e(e),state:"running",origin:{kind:"other"},steps:[]}}function B4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function su(e,t){const n=e.items.find(o=>o.kind==="turn"&&o.turnId===t);return n?.kind==="turn"?n:void 0}function Tv(e,t){const n=[...e];let o=n.length;for(let s=0;st.ordinal){o=s;break}}return n.splice(o,0,t),n}function Fp(e,t,n){return e.map(o=>o.kind==="turn"&&o.turnId===t?n(o):o)}function R4e(e,t){const n=su(e,t.turnId);return n?F4e(n,t)?{state:e,changed:!1}:{state:{...e,items:Fp(e.items,t.turnId,o=>bS(t,o.steps))},changed:!0}:{state:{...e,items:Tv(e.items,bS(t,[]))},changed:!0}}function F4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&("taskId"in e.origin?e.origin.taskId:void 0)===("taskId"in t.origin?t.origin.taskId:void 0)&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function j4e(e,t,n){const o=su(e,t)??v$(t),s=o.steps.findIndex(c=>c.stepId===n.stepId);let i,r=!0;if(s>=0){const c=o.steps[s];c&&O4e(c,n)?(r=!1,i=o.steps):i=o.steps.map(u=>u.stepId===n.stepId?{...n,kind:"step",frames:u.frames}:u)}else i=[...o.steps,{...n,kind:"step",frames:[]}].toSorted((c,u)=>c.ordinal-u.ordinal);if(!r)return{state:e,changed:!1};const l={...o,steps:[...i]},a=su(e,t)?Fp(e.items,t,()=>l):Tv(e.items,l);return{state:{...e,items:a},changed:!0}}function O4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function P4e(e,t){const n=su(e,t.turnId)??v$(t.turnId),o=n.steps.find(u=>u.stepId===t.stepId)??B4e(t.stepId,t.turnId),s=o.frames.findIndex(u=>u.frameId===t.frame.frameId);let i;if(s>=0){const u=o.frames[s];if(u!==void 0&&H4e(u,t.frame))return{state:e,changed:!1};i=o.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else i=[...o.frames,t.frame];const r={...o,frames:[...i]},l=n.steps.some(u=>u.stepId===t.stepId)?n.steps.map(u=>u.stepId===t.stepId?r:u):[...n.steps,r].toSorted((u,d)=>u.ordinal-d.ordinal),a={...n,steps:l},c=su(e,t.turnId)?Fp(e.items,t.turnId,()=>a):Tv(e.items,a);return{state:{...e,items:c},changed:!0}}function H4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail&&e.source===t.source:!1}function D4e(e,t){if(t.target.type==="task")return V4e(e,t);const{turnId:n,stepId:o,frameId:s}=t.target,i=su(e,n),r=i?.steps.find(f=>f.stepId===o),l=r?.frames.find(f=>f.frameId===s);if(!i||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=w$(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const c={...l,text:a.text},u={...r,frames:r.frames.map(f=>f.frameId===s?c:f)},d={...i,steps:i.steps.map(f=>f.stepId===o?u:f)};return{state:{...e,items:Fp(e.items,n,()=>d)},changed:!0}}function V4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,o=e.tasks.get(n),s=o?.outputTail??"",i=w$(s,t.offset,t.text);if(i.gap)return{state:e,changed:!1,gap:i.gap};if(!i.changed)return{state:e,changed:!1};const r=o?{...o,outputTail:i.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:i.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function w$(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const o=e.length-t;return e.slice(t)!==n.slice(0,o)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(o>0?n.slice(o):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function _S(e,t,n,o){if(e.items.some(i=>p7(i)===n)){let i=!1;const r=e.items.map(l=>p7(l)!==n||l===t?l:(i=!0,t));return i?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(o!==void 0){const i=[...e.items];let r=i.length;for(let l=0;l=o){r=l;break}}return i.splice(r,0,t),{state:{...e,items:i},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function p7(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function W4e(e,t){const n=new Set(t),o=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),s=e.items.filter(l=>!n.has(p7(l)));if(s.length===e.items.length)return{state:e,changed:!1};let i=e.pendingInteractions,r=e.interactions;if(o.length>0){const l=new Set,a=new Set(i),c=new Set;for(const u of o)for(const d of u.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const u of r.values())u.toolCallId!==void 0&&l.has(u.toolCallId)&&(c.add(u.interactionId),a.delete(u.interactionId));if(c.size>0){const u=new Map(r);for(const d of c)u.delete(d);r=u}i=a}return{state:{...e,items:s,interactions:r,pendingInteractions:i},changed:!0}}function q4e(e,t){const n=e.tasks.get(t.taskId);if(n&&e5e(n,t))return{state:e,changed:!1};const o=new Map(e.tasks);return o.set(t.taskId,t),{state:{...e,tasks:o},changed:!0}}function U4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&Z4e(n,t))return{state:e,changed:!1};const o=new Map(e.interactions);o.set(t.interactionId,t);let s=e.pendingInteractions;if(t.state==="pending"){if(!s.has(t.interactionId)){const i=new Set(s);i.add(t.interactionId),s=i}}else if(s.has(t.interactionId)){const i=new Set(s);i.delete(t.interactionId),s=i}return{state:{...e,interactions:o,pendingInteractions:s},changed:!0}}function Z4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function K4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&G4e(n,t))return{state:e,changed:!1};const o=new Map(e.attachments);return o.set(t.attachmentId,t),{state:{...e,attachments:o},changed:!0}}function G4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function Y4e(e,t){const n=e.todos.get(t.todoId);if(n&&X4e(n,t))return{state:e,changed:!1};const o=new Map(e.todos);return o.set(t.todoId,t),{state:{...e,todos:o},changed:!0}}function X4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function J4e(e,t){const n=e.prompts.get(t.promptId);if(n&&Q4e(n,t))return{state:e,changed:!1};const o=new Map(e.prompts);return o.set(t.promptId,t),{state:{...e,prompts:o},changed:!0}}function Q4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function e5e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function t5e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,dynamic_workflow:t.modes.dynamic_workflow===null?void 0:t.modes.dynamic_workflow??e.meta.modes?.dynamic_workflow,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,o=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,s={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.dynamic_workflow===void 0&&n.tower===void 0?void 0:n,agent:o};return s.goal===e.meta.goal&&s.activity===e.meta.activity&&s.modes===e.meta.modes&&s.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:s},changed:!0}}class n5e{constructor(t){this.agentId=t}#e=$4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let o,s=this.#e;for(const i of t){const r=N4e(s,i);if(r.gap){o={target:i.target,...r.gap};continue}r.changed&&(s=r.state,n.push(i))}if(this.#e=s,n.length>0){const i={agentId:this.agentId,ops:n};for(const r of this.#t)r(i)}return{accepted:n,gap:o}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(o=>o.kind==="turn"&&o.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,o=this.#e.hasMoreOlder;if(t!==void 0){const s=n.reduce((i,r)=>r.kind==="turn"?i+1:i,0);if(s>t.tailTurns){const i=s-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=i)continue;r.push(a)}else l>i&&r.push(a);n=r,o=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:o}}}var xS;function gt(e,t,n){function o(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const c=r.prototype,u=Object.keys(c);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Uc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class y$ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(xS=globalThis).__zod_globalConfig??(xS.__zod_globalConfig={});const Iv=globalThis.__zod_globalConfig;function ia(e){return Iv}function k$(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>t.indexOf(+o)===-1).map(([o,s])=>s)}function h7(e,t){return typeof t=="bigint"?t.toString():t}function jp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Lv(e){return e==null}function $v(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function o5e(e,t){const n=e/t,o=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o){};function Fd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const i5e=jp(()=>{if(Iv.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function iu(e){if(Fd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Fd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _$(e){return iu(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const r5e=new Set(["string","number","symbol"]);function ru(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g1(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function rn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function l5e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const a5e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function c5e(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=m1(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return I0(this,"shape",r),r},checks:[]});return g1(e,i)}function u5e(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=m1(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return I0(this,"shape",r),r},checks:[]});return g1(e,i)}function d5e(e,t){if(!iu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(i,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=m1(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return I0(this,"shape",i),i}});return g1(e,s)}function f5e(e,t){if(!iu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=m1(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return I0(this,"shape",o),o}});return g1(e,n)}function p5e(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=m1(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return I0(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return g1(e,n)}function h5e(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=m1(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const c in n){if(!(c in l))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(a[c]=e?new e({type:"optional",innerType:l[c]}):l[c])}else for(const c in l)a[c]=e?new e({type:"optional",innerType:l[c]}):l[c];return I0(this,"shape",a),a},checks:[]});return g1(t,r)}function m5e(e,t,n){const o=m1(t._zod.def,{get shape(){const s=t._zod.def.shape,i={...s};if(n)for(const r in n){if(!(r in i))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(i[r]=new e({type:"nonoptional",innerType:s[r]}))}else for(const r in s)i[r]=new e({type:"nonoptional",innerType:s[r]});return I0(this,"shape",i),i}});return g1(t,o)}function Ec(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function R3(e){return typeof e=="string"?e:e?.message}function ra(e,t,n){const o=e.message?e.message:R3(e.inst?._zod.def?.error?.(e))??R3(t?.error?.(e))??R3(n.customError?.(e))??R3(n.localeError?.(e))??"Invalid input",{inst:s,continue:i,input:r,...l}=e;return l.path??(l.path=[]),l.message=o,t?.reportInput&&(l.input=r),l}function Nv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jd(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const x$=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,h7,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},S$=gt("$ZodError",x$),C$=gt("$ZodError",x$,{Parent:Error});function v5e(e,t=n=>n.message){const n={},o=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):o.push(t(s));return{formErrors:o,fieldErrors:n}}function w5e(e,t=n=>n.message){const n={_errors:[]},o=(s,i=[])=>{for(const r of s.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(l=>o({issues:l},[...i,...r.path]));else if(r.code==="invalid_key")o({issues:r.issues},[...i,...r.path]);else if(r.code==="invalid_element")o({issues:r.issues},[...i,...r.path]);else{const l=[...i,...r.path];if(l.length===0)n._errors.push(t(r));else{let a=n,c=0;for(;c(t,n,o,s)=>{const i=o?{...o,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise)throw new Uc;if(r.issues.length){const l=new(s?.Err??e)(r.issues.map(a=>ra(a,i,ia())));throw b$(l,s?.callee),l}return r.value},Bv=e=>async(t,n,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(s?.Err??e)(r.issues.map(a=>ra(a,i,ia())));throw b$(l,s?.callee),l}return r.value},Op=e=>(t,n,o)=>{const s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Uc;return i.issues.length?{success:!1,error:new(e??S$)(i.issues.map(r=>ra(r,s,ia())))}:{success:!0,data:i.value}},y5e=Op(C$),Pp=e=>async(t,n,o)=>{const s=o?{...o,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(r=>ra(r,s,ia())))}:{success:!0,data:i.value}},k5e=Pp(C$),b5e=e=>(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return zv(e)(t,n,s)},_5e=e=>(t,n,o)=>zv(e)(t,n,o),x5e=e=>async(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Bv(e)(t,n,s)},S5e=e=>async(t,n,o)=>Bv(e)(t,n,o),C5e=e=>(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Op(e)(t,n,s)},M5e=e=>(t,n,o)=>Op(e)(t,n,o),A5e=e=>async(t,n,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return Pp(e)(t,n,s)},E5e=e=>async(t,n,o)=>Pp(e)(t,n,o),T5e=/^[cC][0-9a-z]{6,}$/,I5e=/^[0-9a-z]+$/,L5e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$5e=/^[0-9a-vA-V]{20}$/,N5e=/^[A-Za-z0-9]{27}$/,z5e=/^[a-zA-Z0-9_-]{21}$/,B5e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,R5e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,MS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,F5e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,j5e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function O5e(){return new RegExp(j5e,"u")}const P5e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,H5e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,D5e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,V5e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W5e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,M$=/^[A-Za-z0-9_-]*$/,q5e=/^https?$/,U5e=/^\+[1-9]\d{6,14}$/,A$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Z5e=new RegExp(`^${A$}$`);function E$(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function K5e(e){return new RegExp(`^${E$(e)}$`)}function G5e(e){const t=E$({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${A$}T(?:${o})$`)}const Y5e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},X5e=/^-?\d+$/,T$=/^-?\d+(?:\.\d+)?$/,J5e=/^(?:true|false)$/i,Q5e=/^[^A-Z]*$/,epe=/^[^a-z]*$/,ji=gt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),I$={number:"number",bigint:"bigint",object:"date"},L$=gt("$ZodCheckLessThan",(e,t)=>{ji.init(e,t);const n=I$[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?o.value<=t.value:o.value{ji.init(e,t);const n=I$[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tpe=gt("$ZodCheckMultipleOf",(e,t)=>{ji.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):o5e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),npe=gt("$ZodCheckNumberFormat",(e,t)=>{ji.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[s,i]=a5e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=s,l.maximum=i,n&&(l.pattern=X5e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}li&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ope=gt("$ZodCheckMaxLength",(e,t)=>{var n;ji.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Lv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const s=o.value;if(s.length<=t.maximum)return;const r=Nv(s);o.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),spe=gt("$ZodCheckMinLength",(e,t)=>{var n;ji.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Lv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=t.minimum)return;const r=Nv(s);o.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ipe=gt("$ZodCheckLengthEquals",(e,t)=>{var n;ji.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!Lv(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=o=>{const s=o.value,i=s.length;if(i===t.length)return;const r=Nv(s),l=i>t.length;o.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Hp=gt("$ZodCheckStringFormat",(e,t)=>{var n,o;ji.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),rpe=gt("$ZodCheckRegex",(e,t)=>{Hp.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lpe=gt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Q5e),Hp.init(e,t)}),ape=gt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=epe),Hp.init(e,t)}),cpe=gt("$ZodCheckIncludes",(e,t)=>{ji.init(e,t);const n=ru(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),upe=gt("$ZodCheckStartsWith",(e,t)=>{ji.init(e,t);const n=new RegExp(`^${ru(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),dpe=gt("$ZodCheckEndsWith",(e,t)=>{ji.init(e,t);const n=new RegExp(`.*${ru(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),fpe=gt("$ZodCheckOverwrite",(e,t)=>{ji.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ppe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(` +`).filter(r=>r),s=Math.min(...o.map(r=>r.length-r.trimStart().length)),i=o.map(r=>r.slice(s)).map(r=>" ".repeat(this.indent*2)+r);for(const r of i)this.content.push(r)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,s.join(` +`))}}const hpe={major:4,minor:4,patch:3},Po=gt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hpe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const i of s._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(r,l,a)=>{let c=Ec(r),u;for(const d of l){if(d._zod.def.when){if(g5e(r)||!d._zod.def.when(r))continue}else if(c)continue;const f=r.issues.length,p=d._zod.check(r);if(p instanceof Promise&&a?.async===!1)throw new Uc;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,r.issues.length!==f&&(c||(c=Ec(r,f)))});else{if(r.issues.length===f)continue;c||(c=Ec(r,f))}}return u?u.then(()=>r):r},i=(r,l,a)=>{if(Ec(r))return r.aborted=!0,r;const c=s(l,o,a);if(c instanceof Promise){if(a.async===!1)throw new Uc;return c.then(u=>e._zod.parse(u,a))}return e._zod.parse(c,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const c=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,r,l)):i(c,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new Uc;return a.then(c=>s(c,o,l))}return s(a,o,l)}}mo(e,"~standard",()=>({validate:s=>{try{const i=y5e(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return k5e(e,s).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),Rv=gt("$ZodString",(e,t)=>{Po.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Y5e(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Bo=gt("$ZodStringFormat",(e,t)=>{Hp.init(e,t),Rv.init(e,t)}),mpe=gt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=R5e),Bo.init(e,t)}),gpe=gt("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=MS(o))}else t.pattern??(t.pattern=MS());Bo.init(e,t)}),vpe=gt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=F5e),Bo.init(e,t)}),wpe=gt("$ZodURL",(e,t)=>{Bo.init(e,t),e._zod.check=n=>{try{const o=n.value.trim();if(!t.normalize&&t.protocol?.source===q5e.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ype=gt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=O5e()),Bo.init(e,t)}),kpe=gt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=z5e),Bo.init(e,t)}),bpe=gt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=T5e),Bo.init(e,t)}),_pe=gt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=I5e),Bo.init(e,t)}),xpe=gt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=L5e),Bo.init(e,t)}),Spe=gt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$5e),Bo.init(e,t)}),Cpe=gt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=N5e),Bo.init(e,t)}),Mpe=gt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=G5e(t)),Bo.init(e,t)}),Ape=gt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Z5e),Bo.init(e,t)}),Epe=gt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=K5e(t)),Bo.init(e,t)}),Tpe=gt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=B5e),Bo.init(e,t)}),Ipe=gt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=P5e),Bo.init(e,t),e._zod.bag.format="ipv4"}),Lpe=gt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=H5e),Bo.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$pe=gt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=D5e),Bo.init(e,t)}),Npe=gt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=V5e),Bo.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[s,i]=o;if(!i)throw new Error;const r=Number(i);if(`${r}`!==i)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function N$(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const zpe=gt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=W5e),Bo.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{N$(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Bpe(e){if(!M$.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return N$(n)}const Rpe=gt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=M$),Bo.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Bpe(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Fpe=gt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=U5e),Bo.init(e,t)});function jpe(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Ope=gt("$ZodJWT",(e,t)=>{Bo.init(e,t),e._zod.check=n=>{jpe(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),z$=gt("$ZodNumber",(e,t)=>{Po.init(e,t),e._zod.pattern=e._zod.bag.pattern??T$,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Ppe=gt("$ZodNumberFormat",(e,t)=>{npe.init(e,t),z$.init(e,t)}),Hpe=gt("$ZodBoolean",(e,t)=>{Po.init(e,t),e._zod.pattern=J5e,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Dpe=gt("$ZodUnknown",(e,t)=>{Po.init(e,t),e._zod.parse=n=>n}),Vpe=gt("$ZodNever",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function AS(e,t,n){e.issues.length&&t.issues.push(...Tc(n,e.issues)),t.value[n]=e.value}const Wpe=gt("$ZodArray",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let r=0;rAS(c,n,r))):AS(a,n,r)}return i.length?Promise.all(i).then(()=>n):n}});function $5(e,t,n,o,s,i){const r=n in o;if(e.issues.length){if(s&&i&&!r)return;t.issues.push(...Tc(n,e.issues))}if(!r&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?r&&(t.value[n]=void 0):t.value[n]=e.value}function B$(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=l5e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function R$(e,t,n,o,s,i){const r=[],l=s.keySet,a=s.catchall._zod,c=a.def.type,u=a.optin==="optional",d=a.optout==="optional";for(const f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){r.push(f);continue}const p=a.run({value:t[f],issues:[]},o);p instanceof Promise?e.push(p.then(h=>$5(h,n,f,t,u,d))):$5(p,n,f,t,u,d)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const qpe=gt("$ZodObject",(e,t)=>{if(Po.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const o=jp(()=>B$(t));mo(e._zod,"propValues",()=>{const l=t.shape,a={};for(const c in l){const u=l[c]._zod;if(u.values){a[c]??(a[c]=new Set);for(const d of u.values)a[c].add(d)}}return a});const s=Fd,i=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=o.value);const c=l.value;if(!s(c))return l.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),l;l.value={};const u=[],d=r.shape;for(const f of r.keys){const p=d[f],h=p._zod.optin==="optional",m=p._zod.optout==="optional",k=p._zod.run({value:c[f],issues:[]},a);k instanceof Promise?u.push(k.then(x=>$5(x,l,f,c,h,m))):$5(k,l,f,c,h,m)}return i?R$(u,c,l,a,o.value,e):u.length?Promise.all(u).then(()=>l):l}}),Upe=gt("$ZodObjectJIT",(e,t)=>{qpe.init(e,t);const n=e._zod.parse,o=jp(()=>B$(t)),s=f=>{const p=new ppe(["shape","payload","ctx"]),h=o.value,m=w=>{const b=CS(w);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");const k=Object.create(null);let x=0;for(const w of h.keys)k[w]=`key_${x++}`;p.write("const newResult = {};");for(const w of h.keys){const b=k[w],M=CS(w),R=f[w],z=R?._zod?.optin==="optional",$=R?._zod?.optout==="optional";p.write(`const ${b} = ${m(w)};`),z&&$?p.write(` if (${b}.issues.length) { if (${M} in input) { payload.issues = payload.issues.concat(${b}.issues.map(iss => ({ @@ -918,68 +918,68 @@ ${v}`);u+=z}else u+=R;u+=x,d=p?f+1:e.length}return u}function rce(e,t){if(!e||!t } } - `)}p.write("payload.value = newResult;"),p.write("return payload;");const w=p.compile();return(v,b)=>w(f,v,b)};let r;const i=Rd,l=!Ev.jitless,c=l&&e5e.value,u=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=o.value);const h=f.value;return i(h)?l&&c&&p?.async===!1&&p.jitless!==!0?(r||(r=s(t.shape)),f=r(f,p),u?N$([],h,f,p,d,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f)}});function AS(e,t,n,o){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const s=e.filter(r=>!Ac(r));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(i=>ia(i,o,ra())))}),t)}const z$=gt("$ZodUnion",(e,t)=>{Po.init(e,t),mo(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),mo(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),mo(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),mo(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Lv(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(n)return n(o,s);let r=!1;const i=[];for(const l of t.options){const a=l._zod.run({value:o.value,issues:[]},s);if(a instanceof Promise)i.push(a),r=!0;else{if(a.issues.length===0)return a;i.push(a)}}return r?Promise.all(i).then(l=>AS(l,o,e,s)):AS(i,o,e,s)}}),Dpe=gt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,z$.init(e,t);const n=e._zod.parse;mo(e._zod,"propValues",()=>{const s={};for(const r of t.options){const i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const[l,a]of Object.entries(i)){s[l]||(s[l]=new Set);for(const c of a)s[l].add(c)}}return s});const o=Fp(()=>{const s=t.options,r=new Map;for(const i of s){const l=i._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const a of l){if(r.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);r.set(a,i)}}return r});e._zod.parse=(s,r)=>{const i=s.value;if(!Rd(i))return s.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),s;const l=o.value.get(i?.[t.discriminator]);return l?l._zod.run(s,r):t.unionFallback||r.direction==="backward"?n(s,r):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:i,path:[t.discriminator],inst:e}),s)}}),Vpe=gt("$ZodIntersection",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value,r=t.left._zod.run({value:s,issues:[]},o),i=t.right._zod.run({value:s,issues:[]},o);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then(([a,c])=>TS(n,a,c)):TS(n,r,i)}});function h7(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(su(e)&&su(t)){const n=Object.keys(t),o=Object.keys(e).filter(r=>n.indexOf(r)!==-1),s={...e,...t};for(const r of o){const i=h7(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};s[r]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;ol.l&&l.r).map(([l])=>l);if(r.length&&s&&e.issues.push({...s,keys:r}),Ac(e))return e;const i=h7(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Wpe=gt("$ZodRecord",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!su(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const r=[],i=t.keyType._zod.values;if(i){n.value={};const l=new Set;for(const c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);const u=t.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>ia(p,o,ra())),input:c,path:[c],inst:e});continue}const d=u.value,f=t.valueType._zod.run({value:s[c],issues:[]},o);f instanceof Promise?r.push(f.then(p=>{p.issues.length&&n.issues.push(...Tc(c,p.issues)),n.value[d]=p.value})):(f.issues.length&&n.issues.push(...Tc(c,f.issues)),n.value[d]=f.value)}let a;for(const c in s)l.has(c)||(a=a??[],a.push(c));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(s)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,l))continue;let a=t.keyType._zod.run({value:l,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&M$.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=s[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>ia(d,o,ra())),input:l,path:[l],inst:e});continue}const u=t.valueType._zod.run({value:s[l],issues:[]},o);u instanceof Promise?r.push(u.then(d=>{d.issues.length&&n.issues.push(...Tc(l,d.issues)),n.value[a.value]=d.value})):(u.issues.length&&n.issues.push(...Tc(l,u.issues)),n.value[a.value]=u.value)}}return r.length?Promise.all(r).then(()=>n):n}}),qpe=gt("$ZodEnum",(e,t)=>{Po.init(e,t);const n=v$(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(s=>t5e.has(typeof s)).map(s=>typeof s=="string"?ru(s):s.toString()).join("|")})$`),e._zod.parse=(s,r)=>{const i=s.value;return o.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),Upe=gt("$ZodLiteral",(e,t)=>{if(Po.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ru(o):o?ru(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return n.has(r)||o.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),o}}),Zpe=gt("$ZodTransform",(e,t)=>{Po.init(e,t),e._zod.optin="optional",e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new g$(e.constructor.name);const s=t.transform(n.value,n);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n.fallback=!0,n));if(s instanceof Promise)throw new qc;return n.value=s,n.fallback=!0,n}});function ES(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const B$=gt("$ZodOptional",(e,t)=>{Po.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mo(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lv(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>ES(i,s)):ES(r,s)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Kpe=gt("$ZodExactOptional",(e,t)=>{B$.init(e,t),mo(e._zod,"values",()=>t.innerType._zod.values),mo(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),Gpe=gt("$ZodNullable",(e,t)=>{Po.init(e,t),mo(e._zod,"optin",()=>t.innerType._zod.optin),mo(e._zod,"optout",()=>t.innerType._zod.optout),mo(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lv(n.source)}|null)$`):void 0}),mo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Ype=gt("$ZodDefault",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(r=>IS(r,t)):IS(s,t)}});function IS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Xpe=gt("$ZodPrefault",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),Jpe=gt("$ZodNonOptional",(e,t)=>{Po.init(e,t),mo(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(r=>LS(r,e)):LS(s,e)}});function LS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Qpe=gt("$ZodCatch",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"optout",()=>t.innerType._zod.optout),mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>ia(i,o,ra()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>ia(r,o,ra()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),e6e=gt("$ZodPipe",(e,t)=>{Po.init(e,t),mo(e._zod,"values",()=>t.in._zod.values),mo(e._zod,"optin",()=>t.in._zod.optin),mo(e._zod,"optout",()=>t.out._zod.optout),mo(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const r=t.out._zod.run(n,o);return r instanceof Promise?r.then(i=>R3(i,t.in,o)):R3(r,t.in,o)}const s=t.in._zod.run(n,o);return s instanceof Promise?s.then(r=>R3(r,t.out,o)):R3(s,t.out,o)}});function R3(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const t6e=gt("$ZodReadonly",(e,t)=>{Po.init(e,t),mo(e._zod,"propValues",()=>t.innerType._zod.propValues),mo(e._zod,"values",()=>t.innerType._zod.values),mo(e._zod,"optin",()=>t.innerType?._zod?.optin),mo(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then($S):$S(s)}});function $S(e){return e.value=Object.freeze(e.value),e}const n6e=gt("$ZodCustom",(e,t)=>{jr.init(e,t),Po.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,s=t.fn(o);if(s instanceof Promise)return s.then(r=>NS(r,n,o,e));NS(s,n,o,e)}});function NS(e,t,n,o){if(!e){const s={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),t.issues.push(Fd(s))}}var zS;class o6e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const s={...o,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function s6e(){return new o6e}(zS=globalThis).__zod_globalRegistry??(zS.__zod_globalRegistry=s6e());const I2=globalThis.__zod_globalRegistry;function r6e(e,t){return new e({type:"string",...rn(t)})}function i6e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...rn(t)})}function BS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...rn(t)})}function l6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...rn(t)})}function a6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rn(t)})}function c6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rn(t)})}function u6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rn(t)})}function d6e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...rn(t)})}function f6e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...rn(t)})}function p6e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...rn(t)})}function h6e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...rn(t)})}function m6e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...rn(t)})}function g6e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...rn(t)})}function v6e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...rn(t)})}function w6e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...rn(t)})}function y6e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...rn(t)})}function k6e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...rn(t)})}function b6e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rn(t)})}function _6e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rn(t)})}function x6e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...rn(t)})}function S6e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...rn(t)})}function C6e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...rn(t)})}function M6e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...rn(t)})}function A6e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rn(t)})}function T6e(e,t){return new e({type:"string",format:"date",check:"string_format",...rn(t)})}function E6e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...rn(t)})}function I6e(e,t){return new e({type:"string",format:"duration",check:"string_format",...rn(t)})}function L6e(e,t){return new e({type:"number",checks:[],...rn(t)})}function $6e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...rn(t)})}function N6e(e,t){return new e({type:"boolean",...rn(t)})}function z6e(e){return new e({type:"unknown"})}function B6e(e,t){return new e({type:"never",...rn(t)})}function RS(e,t){return new T$({check:"less_than",...rn(t),value:e,inclusive:!1})}function mm(e,t){return new T$({check:"less_than",...rn(t),value:e,inclusive:!0})}function FS(e,t){return new E$({check:"greater_than",...rn(t),value:e,inclusive:!1})}function gm(e,t){return new E$({check:"greater_than",...rn(t),value:e,inclusive:!0})}function jS(e,t){return new Y5e({check:"multiple_of",...rn(t),value:e})}function R$(e,t){return new J5e({check:"max_length",...rn(t),maximum:e})}function $5(e,t){return new Q5e({check:"min_length",...rn(t),minimum:e})}function F$(e,t){return new epe({check:"length_equals",...rn(t),length:e})}function R6e(e,t){return new tpe({check:"string_format",format:"regex",...rn(t),pattern:e})}function F6e(e){return new npe({check:"string_format",format:"lowercase",...rn(e)})}function j6e(e){return new ope({check:"string_format",format:"uppercase",...rn(e)})}function O6e(e,t){return new spe({check:"string_format",format:"includes",...rn(t),includes:e})}function P6e(e,t){return new rpe({check:"string_format",format:"starts_with",...rn(t),prefix:e})}function H6e(e,t){return new ipe({check:"string_format",format:"ends_with",...rn(t),suffix:e})}function yu(e){return new lpe({check:"overwrite",tx:e})}function D6e(e){return yu(t=>t.normalize(e))}function V6e(){return yu(e=>e.trim())}function W6e(){return yu(e=>e.toLowerCase())}function q6e(){return yu(e=>e.toUpperCase())}function U6e(){return yu(e=>Q4e(e))}function Z6e(e,t,n){return new e({type:"array",element:t,...rn(n)})}function K6e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...rn(n)})}function G6e(e,t){const n=Y6e(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(Fd(s,o.value,n._zod.def));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),o.issues.push(Fd(r))}},e(o.value,o)),t);return n}function Y6e(e,t){const n=new jr({check:"custom",...rn(t)});return n._zod.check=e,n}function j$(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??I2,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ms(e,t,n={path:[],schemaPath:[]}){var o;const s=e._zod.def,r=t.seen.get(e);if(r)return r.count++,n.schemaPath.includes(e)&&(r.cycle=n.path),r.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const l=e._zod.toJSONSchema?.();if(l)i.schema=l;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const f=i.schema,p=t.processors[s.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);p(e,t,f,u)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),ms(d,t,u),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(i.schema,a),t.io==="input"&&ar(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function O$(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const i of e.seen.entries()){const l=e.metadataRegistry.get(i[0])?.id;if(l){const a=o.get(l);if(a&&a!==i[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(l,i[0])}}const s=i=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,f=e.external.uri??(h=>h);if(d)return{ref:f(d)};const p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${f("__shared")}#/${l}/${p}`}}if(i[1]===n)return{ref:"#"};const c=`#/${l}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},r=i=>{if(i[1].schema.$ref)return;const l=i[1],{ref:a,defId:c}=s(i);l.def={...l.schema},c&&(l.defId=c);const u=l.schema;for(const d in u)delete u[d];u.$ref=a};if(e.cycles==="throw")for(const i of e.seen.entries()){const l=i[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + `)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(w,b)=>v(f,w,b)};let i;const r=Fd,l=!Iv.jitless,c=l&&i5e.value,u=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=o.value);const h=f.value;return r(h)?l&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),f=i(f,p),u?R$([],h,f,p,d,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f)}});function ES(e,t,n,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Ec(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(r=>ra(r,o,ia())))}),t)}const F$=gt("$ZodUnion",(e,t)=>{Po.init(e,t),mo(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),mo(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),mo(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),mo(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$v(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(n)return n(o,s);let i=!1;const r=[];for(const l of t.options){const a=l._zod.run({value:o.value,issues:[]},s);if(a instanceof Promise)r.push(a),i=!0;else{if(a.issues.length===0)return a;r.push(a)}}return i?Promise.all(r).then(l=>ES(l,o,e,s)):ES(r,o,e,s)}}),Zpe=gt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,F$.init(e,t);const n=e._zod.parse;mo(e._zod,"propValues",()=>{const s={};for(const i of t.options){const r=i._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[l,a]of Object.entries(r)){s[l]||(s[l]=new Set);for(const c of a)s[l].add(c)}}return s});const o=jp(()=>{const s=t.options,i=new Map;for(const r of s){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(i.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);i.set(a,r)}}return i});e._zod.parse=(s,i)=>{const r=s.value;if(!Fd(r))return s.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),s;const l=o.value.get(r?.[t.discriminator]);return l?l._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:r,path:[t.discriminator],inst:e}),s)}}),Kpe=gt("$ZodIntersection",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},o),r=t.right._zod.run({value:s,issues:[]},o);return i instanceof Promise||r instanceof Promise?Promise.all([i,r]).then(([a,c])=>TS(n,a,c)):TS(n,i,r)}});function m7(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(iu(e)&&iu(t)){const n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of o){const r=m7(e[i],t[i]);if(!r.valid)return{valid:!1,mergeErrorPath:[i,...r.mergeErrorPath]};s[i]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;ol.l&&l.r).map(([l])=>l);if(i.length&&s&&e.issues.push({...s,keys:i}),Ec(e))return e;const r=m7(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Gpe=gt("$ZodRecord",(e,t)=>{Po.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!iu(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const c of r)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);const u=t.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>ra(p,o,ia())),input:c,path:[c],inst:e});continue}const d=u.value,f=t.valueType._zod.run({value:s[c],issues:[]},o);f instanceof Promise?i.push(f.then(p=>{p.issues.length&&n.issues.push(...Tc(c,p.issues)),n.value[d]=p.value})):(f.issues.length&&n.issues.push(...Tc(c,f.issues)),n.value[d]=f.value)}let a;for(const c in s)l.has(c)||(a=a??[],a.push(c));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(s)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,l))continue;let a=t.keyType._zod.run({value:l,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&T$.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=s[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>ra(d,o,ia())),input:l,path:[l],inst:e});continue}const u=t.valueType._zod.run({value:s[l],issues:[]},o);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...Tc(l,d.issues)),n.value[a.value]=d.value})):(u.issues.length&&n.issues.push(...Tc(l,u.issues)),n.value[a.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Ype=gt("$ZodEnum",(e,t)=>{Po.init(e,t);const n=k$(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(s=>r5e.has(typeof s)).map(s=>typeof s=="string"?ru(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const r=s.value;return o.has(r)||s.issues.push({code:"invalid_value",values:n,input:r,inst:e}),s}}),Xpe=gt("$ZodLiteral",(e,t)=>{if(Po.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ru(o):o?ru(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Jpe=gt("$ZodTransform",(e,t)=>{Po.init(e,t),e._zod.optin="optional",e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new y$(e.constructor.name);const s=t.transform(n.value,n);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(r=>(n.value=r,n.fallback=!0,n));if(s instanceof Promise)throw new Uc;return n.value=s,n.fallback=!0,n}});function IS(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const j$=gt("$ZodOptional",(e,t)=>{Po.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mo(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$v(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>IS(r,s)):IS(i,s)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Qpe=gt("$ZodExactOptional",(e,t)=>{j$.init(e,t),mo(e._zod,"values",()=>t.innerType._zod.values),mo(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),e6e=gt("$ZodNullable",(e,t)=>{Po.init(e,t),mo(e._zod,"optin",()=>t.innerType._zod.optin),mo(e._zod,"optout",()=>t.innerType._zod.optout),mo(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$v(n.source)}|null)$`):void 0}),mo(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),t6e=gt("$ZodDefault",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>LS(i,t)):LS(s,t)}});function LS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const n6e=gt("$ZodPrefault",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),o6e=gt("$ZodNonOptional",(e,t)=>{Po.init(e,t),mo(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>$S(i,e)):$S(s,e)}});function $S(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const s6e=gt("$ZodCatch",(e,t)=>{Po.init(e,t),e._zod.optin="optional",mo(e._zod,"optout",()=>t.innerType._zod.optout),mo(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>ra(r,o,ia()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>ra(i,o,ia()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),i6e=gt("$ZodPipe",(e,t)=>{Po.init(e,t),mo(e._zod,"values",()=>t.in._zod.values),mo(e._zod,"optin",()=>t.in._zod.optin),mo(e._zod,"optout",()=>t.out._zod.optout),mo(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(n,o);return i instanceof Promise?i.then(r=>F3(r,t.in,o)):F3(i,t.in,o)}const s=t.in._zod.run(n,o);return s instanceof Promise?s.then(i=>F3(i,t.out,o)):F3(s,t.out,o)}});function F3(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const r6e=gt("$ZodReadonly",(e,t)=>{Po.init(e,t),mo(e._zod,"propValues",()=>t.innerType._zod.propValues),mo(e._zod,"values",()=>t.innerType._zod.values),mo(e._zod,"optin",()=>t.innerType?._zod?.optin),mo(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(NS):NS(s)}});function NS(e){return e.value=Object.freeze(e.value),e}const l6e=gt("$ZodCustom",(e,t)=>{ji.init(e,t),Po.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,s=t.fn(o);if(s instanceof Promise)return s.then(i=>zS(i,n,o,e));zS(s,n,o,e)}});function zS(e,t,n,o){if(!e){const s={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),t.issues.push(jd(s))}}var BS;class a6e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const s={...o,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function c6e(){return new a6e}(BS=globalThis).__zod_globalRegistry??(BS.__zod_globalRegistry=c6e());const L2=globalThis.__zod_globalRegistry;function u6e(e,t){return new e({type:"string",...rn(t)})}function d6e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...rn(t)})}function RS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...rn(t)})}function f6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...rn(t)})}function p6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rn(t)})}function h6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rn(t)})}function m6e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rn(t)})}function g6e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...rn(t)})}function v6e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...rn(t)})}function w6e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...rn(t)})}function y6e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...rn(t)})}function k6e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...rn(t)})}function b6e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...rn(t)})}function _6e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...rn(t)})}function x6e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...rn(t)})}function S6e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...rn(t)})}function C6e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...rn(t)})}function M6e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rn(t)})}function A6e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rn(t)})}function E6e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...rn(t)})}function T6e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...rn(t)})}function I6e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...rn(t)})}function L6e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...rn(t)})}function $6e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rn(t)})}function N6e(e,t){return new e({type:"string",format:"date",check:"string_format",...rn(t)})}function z6e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...rn(t)})}function B6e(e,t){return new e({type:"string",format:"duration",check:"string_format",...rn(t)})}function R6e(e,t){return new e({type:"number",checks:[],...rn(t)})}function F6e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...rn(t)})}function j6e(e,t){return new e({type:"boolean",...rn(t)})}function O6e(e){return new e({type:"unknown"})}function P6e(e,t){return new e({type:"never",...rn(t)})}function FS(e,t){return new L$({check:"less_than",...rn(t),value:e,inclusive:!1})}function gm(e,t){return new L$({check:"less_than",...rn(t),value:e,inclusive:!0})}function jS(e,t){return new $$({check:"greater_than",...rn(t),value:e,inclusive:!1})}function vm(e,t){return new $$({check:"greater_than",...rn(t),value:e,inclusive:!0})}function OS(e,t){return new tpe({check:"multiple_of",...rn(t),value:e})}function O$(e,t){return new ope({check:"max_length",...rn(t),maximum:e})}function N5(e,t){return new spe({check:"min_length",...rn(t),minimum:e})}function P$(e,t){return new ipe({check:"length_equals",...rn(t),length:e})}function H6e(e,t){return new rpe({check:"string_format",format:"regex",...rn(t),pattern:e})}function D6e(e){return new lpe({check:"string_format",format:"lowercase",...rn(e)})}function V6e(e){return new ape({check:"string_format",format:"uppercase",...rn(e)})}function W6e(e,t){return new cpe({check:"string_format",format:"includes",...rn(t),includes:e})}function q6e(e,t){return new upe({check:"string_format",format:"starts_with",...rn(t),prefix:e})}function U6e(e,t){return new dpe({check:"string_format",format:"ends_with",...rn(t),suffix:e})}function ku(e){return new fpe({check:"overwrite",tx:e})}function Z6e(e){return ku(t=>t.normalize(e))}function K6e(){return ku(e=>e.trim())}function G6e(){return ku(e=>e.toLowerCase())}function Y6e(){return ku(e=>e.toUpperCase())}function X6e(){return ku(e=>s5e(e))}function J6e(e,t,n){return new e({type:"array",element:t,...rn(n)})}function Q6e(e,t,n){return new e({type:"custom",check:"custom",fn:t,...rn(n)})}function ehe(e,t){const n=the(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(jd(s,o.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),o.issues.push(jd(i))}},e(o.value,o)),t);return n}function the(e,t){const n=new ji({check:"custom",...rn(t)});return n._zod.check=e,n}function H$(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??L2,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ms(e,t,n={path:[],schemaPath:[]}){var o;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,u);else{const f=r.schema,p=t.processors[s.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);p(e,t,f,u)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),ms(d,t,u),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&ai(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&"_prefault"in r.schema&&((o=r.schema).default??(o.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function D$(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=o.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(l,r[0])}}const s=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(h=>h);if(d)return{ref:f(d)};const p=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=p,{defId:p,ref:`${f("__shared")}#/${l}/${p}`}}if(r[1]===n)return{ref:"#"};const c=`#/${l}/`,u=r[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:c}=s(r);l.def={...l.schema},c&&(l.defId=c);const u=l.schema;for(const d in u)delete u[d];u.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const l=i[1];if(t===i[0]){r(i);continue}if(e.external){const c=e.external.registry.get(i[0])?.id;if(t!==i[0]&&c){r(i);continue}}if(e.metadataRegistry.get(i[0])?.id){r(i);continue}if(l.cycle){r(i);continue}if(l.count>1&&e.reused==="ref"){r(i);continue}}}function P$(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=l=>{const a=e.seen.get(l);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){o(d);const p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),l._zod.parent===d)for(const k in c)k==="$ref"||k==="allOf"||k in u||delete c[k];if(h.$ref&&p.def)for(const k in c)k==="$ref"||k==="allOf"||k in p.def&&JSON.stringify(c[k])===JSON.stringify(p.def[k])&&delete c[k]}const f=l._zod.parent;if(f&&f!==d){o(f);const p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const h in c)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(c[h])===JSON.stringify(p.def[h])&&delete c[h]}e.override({zodSchema:l,jsonSchema:c,path:a.path??[]})};for(const l of[...e.seen.entries()].reverse())o(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const r=e.metadataRegistry.get(t)?.id;r!==void 0&&s.id===r&&delete s.id;const i=e.external?.defs??{};for(const l of e.seen.entries()){const a=l[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:N5(t,"input",e.processors),output:N5(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ar(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ar(o.element,n);if(o.type==="set")return ar(o.valueType,n);if(o.type==="lazy")return ar(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ar(o.innerType,n);if(o.type==="intersection")return ar(o.left,n)||ar(o.right,n);if(o.type==="record"||o.type==="map")return ar(o.keyType,n)||ar(o.valueType,n);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ar(o.in,n)||ar(o.out,n);if(o.type==="object"){for(const s in o.shape)if(ar(o.shape[s],n))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(ar(s,n))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(ar(s,n))return!0;return!!(o.rest&&ar(o.rest,n))}return!1}const X6e=(e,t={})=>n=>{const o=j$({...n,processors:t});return ms(e,o),O$(o,e),P$(o,e)},N5=(e,t,n={})=>o=>{const{libraryOptions:s,target:r}=o??{},i=j$({...s??{},target:r,io:t,processors:n});return ms(e,i),O$(i,e),P$(i,e)},J6e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Q6e=(e,t,n,o)=>{const s=n;s.type="string";const{minimum:r,maximum:i,format:l,patterns:a,contentEncoding:c}=e._zod.bag;if(typeof r=="number"&&(s.minLength=r),typeof i=="number"&&(s.maxLength=i),l&&(s.format=J6e[l]??l,s.format===""&&delete s.format,l==="time"&&delete s.format),c&&(s.contentEncoding=c),a&&a.size>0){const u=[...a];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ehe=(e,t,n,o)=>{const s=n,{minimum:r,maximum:i,format:l,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof l=="string"&&l.includes("int")?s.type="integer":s.type="number";const d=typeof u=="number"&&u>=(r??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";d?p?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof r=="number"&&(s.minimum=r),f?p?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof i=="number"&&(s.maximum=i),typeof a=="number"&&(s.multipleOf=a)},the=(e,t,n,o)=>{n.type="boolean"},nhe=(e,t,n,o)=>{n.not={}},ohe=(e,t,n,o)=>{},she=(e,t,n,o)=>{const s=e._zod.def,r=v$(s.entries);r.every(i=>typeof i=="number")&&(n.type="number"),r.every(i=>typeof i=="string")&&(n.type="string"),n.enum=r},rhe=(e,t,n,o)=>{const s=e._zod.def,r=[];for(const i of s.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(i))}else r.push(i);if(r.length!==0)if(r.length===1){const i=r[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else r.every(i=>typeof i=="number")&&(n.type="number"),r.every(i=>typeof i=="string")&&(n.type="string"),r.every(i=>typeof i=="boolean")&&(n.type="boolean"),r.every(i=>i===null)&&(n.type="null"),n.enum=r},ihe=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},lhe=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ahe=(e,t,n,o)=>{const s=n,r=e._zod.def,{minimum:i,maximum:l}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=ms(r.element,t,{...o,path:[...o.path,"items"]})},che=(e,t,n,o)=>{const s=n,r=e._zod.def;s.type="object",s.properties={};const i=r.shape;for(const c in i)s.properties[c]=ms(i[c],t,{...o,path:[...o.path,"properties",c]});const l=new Set(Object.keys(i)),a=new Set([...l].filter(c=>{const u=r.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));a.size>0&&(s.required=Array.from(a)),r.catchall?._zod.def.type==="never"?s.additionalProperties=!1:r.catchall?r.catchall&&(s.additionalProperties=ms(r.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},uhe=(e,t,n,o)=>{const s=e._zod.def,r=s.inclusive===!1,i=s.options.map((l,a)=>ms(l,t,{...o,path:[...o.path,r?"oneOf":"anyOf",a]}));r?n.oneOf=i:n.anyOf=i},dhe=(e,t,n,o)=>{const s=e._zod.def,r=ms(s.left,t,{...o,path:[...o.path,"allOf",0]}),i=ms(s.right,t,{...o,path:[...o.path,"allOf",1]}),l=c=>"allOf"in c&&Object.keys(c).length===1,a=[...l(r)?r.allOf:[r],...l(i)?i.allOf:[i]];n.allOf=a},fhe=(e,t,n,o)=>{const s=n,r=e._zod.def;s.type="object";const i=r.keyType,a=i._zod.bag?.patterns;if(r.mode==="loose"&&a&&a.size>0){const u=ms(r.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});s.patternProperties={};for(const d of a)s.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=ms(r.keyType,t,{...o,path:[...o.path,"propertyNames"]})),s.additionalProperties=ms(r.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const c=i._zod.values;if(c){const u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(s.required=u)}},phe=(e,t,n,o)=>{const s=e._zod.def,r=ms(s.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[r,{type:"null"}]},hhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType},mhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},ghe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},vhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},whe=(e,t,n,o)=>{const s=e._zod.def,r=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?r?s.out:s.in:s.out;ms(i,t,o);const l=t.seen.get(e);l.ref=i},yhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType,n.readOnly=!0},H$=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const r=t.seen.get(e);r.ref=s.innerType},khe=gt("ZodISODateTime",(e,t)=>{bpe.init(e,t),Do.init(e,t)});function bhe(e){return A6e(khe,e)}const _he=gt("ZodISODate",(e,t)=>{_pe.init(e,t),Do.init(e,t)});function xhe(e){return T6e(_he,e)}const She=gt("ZodISOTime",(e,t)=>{xpe.init(e,t),Do.init(e,t)});function Che(e){return E6e(She,e)}const Mhe=gt("ZodISODuration",(e,t)=>{Spe.init(e,t),Do.init(e,t)});function Ahe(e){return I6e(Mhe,e)}const The=(e,t)=>{b$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>p5e(e,n)},flatten:{value:n=>f5e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,p7,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,p7,2)}},isEmpty:{get(){return e.issues.length===0}}})},Si=gt("ZodError",The,{Parent:Error}),Ehe=Nv(Si),Ihe=zv(Si),Lhe=jp(Si),$he=Op(Si),Nhe=g5e(Si),zhe=v5e(Si),Bhe=w5e(Si),Rhe=y5e(Si),Fhe=k5e(Si),jhe=b5e(Si),Ohe=_5e(Si),Phe=x5e(Si),OS=new WeakMap;function sf(e,t,n){const o=Object.getPrototypeOf(e);let s=OS.get(o);if(s||(s=new Set,OS.set(o,s)),!s.has(t)){s.add(t);for(const r in n){const i=n[r];Object.defineProperty(o,r,{configurable:!0,enumerable:!1,get(){const l=i.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const Ho=gt("ZodType",(e,t)=>(Po.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:N5(e,"input"),output:N5(e,"output")}}),e.toJSONSchema=X6e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,o)=>Ehe(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>Lhe(e,n,o),e.parseAsync=async(n,o)=>Ihe(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>$he(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Nhe(e,n,o),e.decode=(n,o)=>zhe(e,n,o),e.encodeAsync=async(n,o)=>Bhe(e,n,o),e.decodeAsync=async(n,o)=>Rhe(e,n,o),e.safeEncode=(n,o)=>Fhe(e,n,o),e.safeDecode=(n,o)=>jhe(e,n,o),e.safeEncodeAsync=async(n,o)=>Ohe(e,n,o),e.safeDecodeAsync=async(n,o)=>Phe(e,n,o),sf(e,"ZodType",{check(...n){const o=this.def;return this.clone(m1(o,{checks:[...o.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return g1(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(Nme(n,o))},superRefine(n,o){return this.check(zme(n,o))},overwrite(n){return this.check(yu(n))},optional(){return VS(this)},exactOptional(){return kme(this)},nullable(){return WS(this)},nullish(){return VS(WS(this))},nonoptional(n){return Mme(this,n)},array(){return qn(this)},or(n){return fme([this,n])},and(n){return mme(this,n)},transform(n){return qS(this,wme(n))},default(n){return xme(this,n)},prefault(n){return Cme(this,n)},catch(n){return Tme(this,n)},pipe(n){return qS(this,n)},readonly(){return Lme(this)},describe(n){const o=this.clone();return I2.add(o,{description:n}),o},meta(...n){if(n.length===0)return I2.get(this);const o=this.clone();return I2.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return I2.get(e)?.description},configurable:!0}),e)),D$=gt("_ZodString",(e,t)=>{Bv.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,r)=>Q6e(e,o,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,sf(e,"_ZodString",{regex(...o){return this.check(R6e(...o))},includes(...o){return this.check(O6e(...o))},startsWith(...o){return this.check(P6e(...o))},endsWith(...o){return this.check(H6e(...o))},min(...o){return this.check($5(...o))},max(...o){return this.check(R$(...o))},length(...o){return this.check(F$(...o))},nonempty(...o){return this.check($5(1,...o))},lowercase(o){return this.check(F6e(o))},uppercase(o){return this.check(j6e(o))},trim(){return this.check(V6e())},normalize(...o){return this.check(D6e(...o))},toLowerCase(){return this.check(W6e())},toUpperCase(){return this.check(q6e())},slugify(){return this.check(U6e())}})}),Hhe=gt("ZodString",(e,t)=>{Bv.init(e,t),D$.init(e,t),e.email=n=>e.check(i6e(Dhe,n)),e.url=n=>e.check(d6e(Vhe,n)),e.jwt=n=>e.check(M6e(sme,n)),e.emoji=n=>e.check(f6e(Whe,n)),e.guid=n=>e.check(BS(PS,n)),e.uuid=n=>e.check(l6e(F3,n)),e.uuidv4=n=>e.check(a6e(F3,n)),e.uuidv6=n=>e.check(c6e(F3,n)),e.uuidv7=n=>e.check(u6e(F3,n)),e.nanoid=n=>e.check(p6e(qhe,n)),e.guid=n=>e.check(BS(PS,n)),e.cuid=n=>e.check(h6e(Uhe,n)),e.cuid2=n=>e.check(m6e(Zhe,n)),e.ulid=n=>e.check(g6e(Khe,n)),e.base64=n=>e.check(x6e(tme,n)),e.base64url=n=>e.check(S6e(nme,n)),e.xid=n=>e.check(v6e(Ghe,n)),e.ksuid=n=>e.check(w6e(Yhe,n)),e.ipv4=n=>e.check(y6e(Xhe,n)),e.ipv6=n=>e.check(k6e(Jhe,n)),e.cidrv4=n=>e.check(b6e(Qhe,n)),e.cidrv6=n=>e.check(_6e(eme,n)),e.e164=n=>e.check(C6e(ome,n)),e.datetime=n=>e.check(bhe(n)),e.date=n=>e.check(xhe(n)),e.time=n=>e.check(Che(n)),e.duration=n=>e.check(Ahe(n))});function St(e){return r6e(Hhe,e)}const Do=gt("ZodStringFormat",(e,t)=>{Bo.init(e,t),D$.init(e,t)}),Dhe=gt("ZodEmail",(e,t)=>{fpe.init(e,t),Do.init(e,t)}),PS=gt("ZodGUID",(e,t)=>{upe.init(e,t),Do.init(e,t)}),F3=gt("ZodUUID",(e,t)=>{dpe.init(e,t),Do.init(e,t)}),Vhe=gt("ZodURL",(e,t)=>{ppe.init(e,t),Do.init(e,t)}),Whe=gt("ZodEmoji",(e,t)=>{hpe.init(e,t),Do.init(e,t)}),qhe=gt("ZodNanoID",(e,t)=>{mpe.init(e,t),Do.init(e,t)}),Uhe=gt("ZodCUID",(e,t)=>{gpe.init(e,t),Do.init(e,t)}),Zhe=gt("ZodCUID2",(e,t)=>{vpe.init(e,t),Do.init(e,t)}),Khe=gt("ZodULID",(e,t)=>{wpe.init(e,t),Do.init(e,t)}),Ghe=gt("ZodXID",(e,t)=>{ype.init(e,t),Do.init(e,t)}),Yhe=gt("ZodKSUID",(e,t)=>{kpe.init(e,t),Do.init(e,t)}),Xhe=gt("ZodIPv4",(e,t)=>{Cpe.init(e,t),Do.init(e,t)}),Jhe=gt("ZodIPv6",(e,t)=>{Mpe.init(e,t),Do.init(e,t)}),Qhe=gt("ZodCIDRv4",(e,t)=>{Ape.init(e,t),Do.init(e,t)}),eme=gt("ZodCIDRv6",(e,t)=>{Tpe.init(e,t),Do.init(e,t)}),tme=gt("ZodBase64",(e,t)=>{Epe.init(e,t),Do.init(e,t)}),nme=gt("ZodBase64URL",(e,t)=>{Lpe.init(e,t),Do.init(e,t)}),ome=gt("ZodE164",(e,t)=>{$pe.init(e,t),Do.init(e,t)}),sme=gt("ZodJWT",(e,t)=>{zpe.init(e,t),Do.init(e,t)}),V$=gt("ZodNumber",(e,t)=>{L$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,r)=>ehe(e,o,s),sf(e,"ZodNumber",{gt(o,s){return this.check(FS(o,s))},gte(o,s){return this.check(gm(o,s))},min(o,s){return this.check(gm(o,s))},lt(o,s){return this.check(RS(o,s))},lte(o,s){return this.check(mm(o,s))},max(o,s){return this.check(mm(o,s))},int(o){return this.check(HS(o))},safe(o){return this.check(HS(o))},positive(o){return this.check(FS(0,o))},nonnegative(o){return this.check(gm(0,o))},negative(o){return this.check(RS(0,o))},nonpositive(o){return this.check(mm(0,o))},multipleOf(o,s){return this.check(jS(o,s))},step(o,s){return this.check(jS(o,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Yt(e){return L6e(V$,e)}const rme=gt("ZodNumberFormat",(e,t)=>{Bpe.init(e,t),V$.init(e,t)});function HS(e){return $6e(rme,e)}const ime=gt("ZodBoolean",(e,t)=>{Rpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>the(e,n,o)});function rf(e){return N6e(ime,e)}const lme=gt("ZodUnknown",(e,t)=>{Fpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ohe()});function Ss(){return z6e(lme)}const ame=gt("ZodNever",(e,t)=>{jpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>nhe(e,n,o)});function cme(e){return B6e(ame,e)}const ume=gt("ZodArray",(e,t)=>{Ope.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ahe(e,n,o,s),e.element=t.element,sf(e,"ZodArray",{min(n,o){return this.check($5(n,o))},nonempty(n){return this.check($5(1,n))},max(n,o){return this.check(R$(n,o))},length(n,o){return this.check(F$(n,o))},unwrap(){return this.element}})});function qn(e,t){return Z6e(ume,e,t)}const dme=gt("ZodObject",(e,t)=>{Hpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>che(e,n,o,s),mo(e,"shape",()=>t.shape),sf(e,"ZodObject",{keyof(){return zo(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Ss()})},loose(){return this.clone({...this._zod.def,catchall:Ss()})},strict(){return this.clone({...this._zod.def,catchall:cme()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return i5e(this,n)},safeExtend(n){return l5e(this,n)},merge(n){return a5e(this,n)},pick(n){return s5e(this,n)},omit(n){return r5e(this,n)},partial(...n){return c5e(q$,this,n[0])},required(...n){return u5e(U$,this,n[0])}})});function Bt(e,t){const n={type:"object",shape:e??{},...rn(t)};return new dme(n)}const W$=gt("ZodUnion",(e,t)=>{z$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>uhe(e,n,o,s),e.options=t.options});function fme(e,t){return new W$({type:"union",options:e,...rn(t)})}const pme=gt("ZodDiscriminatedUnion",(e,t)=>{W$.init(e,t),Dpe.init(e,t)});function v1(e,t,n){return new pme({type:"union",options:t,discriminator:e,...rn(n)})}const hme=gt("ZodIntersection",(e,t)=>{Vpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>dhe(e,n,o,s)});function mme(e,t){return new hme({type:"intersection",left:e,right:t})}const DS=gt("ZodRecord",(e,t)=>{Wpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>fhe(e,n,o,s),e.keyType=t.keyType,e.valueType=t.valueType});function Rv(e,t,n){return!t||!t._zod?new DS({type:"record",keyType:St(),valueType:e,...rn(t)}):new DS({type:"record",keyType:e,valueType:t,...rn(n)})}const m7=gt("ZodEnum",(e,t)=>{qpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,r)=>she(e,o,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,s)=>{const r={};for(const i of o)if(n.has(i))r[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new m7({...t,checks:[],...rn(s),entries:r})},e.exclude=(o,s)=>{const r={...t.entries};for(const i of o)if(n.has(i))delete r[i];else throw new Error(`Key ${i} not found in enum`);return new m7({...t,checks:[],...rn(s),entries:r})}});function zo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new m7({type:"enum",entries:n,...rn(t)})}const gme=gt("ZodLiteral",(e,t)=>{Upe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>rhe(e,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Sn(e,t){return new gme({type:"literal",values:Array.isArray(e)?e:[e],...rn(t)})}const vme=gt("ZodTransform",(e,t)=>{Zpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>lhe(e,n),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new g$(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(Fd(r,n.value,t));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Fd(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(r=>(n.value=r,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function wme(e){return new vme({type:"transform",transform:e})}const q$=gt("ZodOptional",(e,t)=>{B$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>H$(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function VS(e){return new q$({type:"optional",innerType:e})}const yme=gt("ZodExactOptional",(e,t)=>{Kpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>H$(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function kme(e){return new yme({type:"optional",innerType:e})}const bme=gt("ZodNullable",(e,t)=>{Gpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>phe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function WS(e){return new bme({type:"nullable",innerType:e})}const _me=gt("ZodDefault",(e,t)=>{Ype.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>mhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xme(e,t){return new _me({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():y$(t)}})}const Sme=gt("ZodPrefault",(e,t)=>{Xpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ghe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Cme(e,t){return new Sme({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():y$(t)}})}const U$=gt("ZodNonOptional",(e,t)=>{Jpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>hhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Mme(e,t){return new U$({type:"nonoptional",innerType:e,...rn(t)})}const Ame=gt("ZodCatch",(e,t)=>{Qpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>vhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tme(e,t){return new Ame({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Eme=gt("ZodPipe",(e,t)=>{e6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>whe(e,n,o,s),e.in=t.in,e.out=t.out});function qS(e,t){return new Eme({type:"pipe",in:e,out:t})}const Ime=gt("ZodReadonly",(e,t)=>{t6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>yhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Lme(e){return new Ime({type:"readonly",innerType:e})}const $me=gt("ZodCustom",(e,t)=>{n6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ihe(e,n)});function Nme(e,t={}){return K6e($me,e,t)}function zme(e,t){return G6e(e,t)}const _0=St().min(1),Fv=St().min(1),lf=St().min(1),x0=St().min(1),ti=St().min(1),Bme=/^[A-Za-z0-9._-]{1,128}$/;function Rme(e){return Bme.test(e)&&e!=="."&&e!==".."}const Z$=v1("kind",[Bt({kind:Sn("user"),payload:Ss().optional()}),Bt({kind:Sn("cron"),taskId:x0.optional(),payload:Ss().optional()}),Bt({kind:Sn("task"),taskId:x0,payload:Ss().optional()}),Bt({kind:Sn("hook"),payload:Ss().optional()}),Bt({kind:Sn("compaction"),payload:Ss().optional()}),Bt({kind:Sn("side"),payload:Ss().optional()}),Bt({kind:Sn("other"),payload:Ss().optional()})]),Fme=Bt({inputTokens:Yt().optional(),outputTokens:Yt().optional(),cachedTokens:Yt().optional(),cost:Yt().optional()}),sd=Bt({inputOther:Yt(),output:Yt(),inputCacheRead:Yt(),inputCacheCreation:Yt()}),jme=Bt({llmFirstTokenLatencyMs:Yt().optional(),llmStreamDurationMs:Yt().optional(),llmRequestBuildMs:Yt().optional(),llmServerFirstTokenMs:Yt().optional(),llmServerDecodeMs:Yt().optional(),llmClientConsumeMs:Yt().optional()}),Ome=Bt({failedAttempt:Yt(),nextAttempt:Yt(),maxAttempts:Yt(),delayMs:Yt(),errorName:St(),errorMessage:St(),statusCode:Yt().optional()}),K$=zo(["queued","running","completed","failed","cancelled"]),Pme=zo(["running","completed","interrupted","failed"]),Hme=Bt({kind:Sn("text"),frameId:lf,role:zo(["assistant","user"]),text:St(),attachmentIds:qn(St()).optional(),taskId:x0.optional(),promptIds:qn(St()).optional()}),Dme=Bt({kind:Sn("thinking"),frameId:lf,text:St()}),Vme=Bt({agentId:ti,role:zo(["child","member"]).optional()}),Wme=Bt({kind:zo(["stdout","stderr","progress","status","custom"]),text:St().optional(),percent:Yt().optional(),customKind:St().optional(),customData:Ss().optional()}),qme=Bt({kind:Sn("tool"),frameId:lf,toolCallId:St(),name:St(),view:St().optional(),state:zo(["running","done","error"]),input:Ss().optional(),output:Ss().optional(),display:Ss().optional(),error:St().optional(),inputText:St().optional(),progress:Wme.optional(),taskId:x0.optional(),approvalId:St().optional(),todoId:St().optional(),agentRefs:qn(Vme).optional()}),jv=Bt({interactionId:St(),interactionKind:zo(["approval","question"]),toolCallId:St().optional(),state:zo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ss().optional(),response:Ss().optional()}),Ume=Bt({kind:Sn("notice"),frameId:lf,level:zo(["error","warning","info"]),source:St().optional(),message:St(),detail:Ss().optional()}),G$=v1("kind",[Hme,Dme,qme,Ume]),Y$=Bt({kind:Sn("step"),stepId:Fv,turnId:_0,ordinal:Yt().int(),state:Pme,frames:qn(G$),startedAt:St().optional(),endedAt:St().optional(),usage:sd.optional(),finishReason:St().optional(),timing:jme.optional(),retry:Ome.optional(),endReason:St().optional(),endMessage:St().optional()}),X$=Bt({kind:Sn("turn"),turnId:_0,ordinal:Yt().int(),state:K$,origin:Z$,prompt:St().optional(),attachmentIds:qn(St()).optional(),steps:qn(Y$),startedAt:St().optional(),endedAt:St().optional(),usage:Fme.optional(),durationMs:Yt().optional(),error:St().optional()}),J$=Bt({kind:Sn("marker"),markerId:St(),marker:St(),payload:Ss().optional(),at:St().optional()}),Q$=Bt({kind:Sn("taskref"),refId:St(),taskId:x0,at:St().optional()}),eN=v1("kind",[X$,J$,Q$]),Ov=Bt({taskId:x0,kind:zo(["shell","subagent","tool","other"]),state:zo(["running","completed","failed","timed_out","killed","lost"]),detached:rf(),description:St().optional(),agentId:ti.optional(),outputTail:St(),startedAt:St().optional(),endedAt:St().optional(),resultSummary:St().optional(),error:St().optional(),stateReason:St().optional(),usage:sd.optional(),model:St().optional(),thinkingEffort:St().optional()}),tN=Bt({objective:St(),status:zo(["active","paused","blocked","complete"]),completionCriterion:St().optional(),budgetUsed:Yt().optional(),budgetLimit:Yt().optional()}),Zme=Bt({plan:Bt({reviewPath:St().optional(),version:Yt().optional()}).optional(),dynamic_workflow:Bt({trigger:St().optional()}).optional(),tower:Bt({}).optional()}),Kme=Bt({plan:Bt({reviewPath:St().optional(),version:Yt().optional()}).nullable().optional(),dynamic_workflow:Bt({trigger:St().optional()}).nullable().optional(),tower:Bt({}).nullable().optional()}),Gme=v1("kind",[Bt({kind:Sn("idle")}),Bt({kind:Sn("running"),turnId:Yt(),step:Yt(),stepId:St(),since:Yt()}),Bt({kind:Sn("streaming"),turnId:Yt(),step:Yt(),stepId:St(),stream:zo(["assistant","thinking","tool_call"]),toolCallId:St().optional(),toolName:St().optional(),since:Yt()}),Bt({kind:Sn("tool_call"),turnId:Yt(),step:Yt(),toolCallId:St(),name:St(),since:Yt()}),Bt({kind:Sn("retrying"),turnId:Yt(),step:Yt(),stepId:St(),failedAttempt:Yt(),nextAttempt:Yt(),maxAttempts:Yt(),delayMs:Yt(),errorName:St().optional(),statusCode:Yt().optional(),since:Yt()}),Bt({kind:Sn("awaiting_approval"),turnId:Yt(),step:Yt().optional(),approval:Ss().optional(),since:Yt()}),Bt({kind:Sn("interrupted"),turnId:Yt(),step:Yt().optional(),reason:zo(["aborted","max_steps","error"]),message:St().optional(),at:Yt()}),Bt({kind:Sn("ended"),turnId:Yt(),reason:zo(["completed","cancelled","failed","blocked"]),durationMs:Yt().optional(),at:Yt()})]),Yme=Bt({byModel:Rv(St(),sd).optional(),currentTurn:sd.optional(),total:sd.optional()}),Xme=Bt({model:St().optional(),thinkingEffort:St().optional(),usage:Yme.optional(),contextTokens:Yt().optional(),maxContextTokens:Yt().optional(),contextUsage:Yt().optional(),permission:zo(["manual","yolo","auto"]).optional(),phase:Gme.optional()}),Pv=Bt({goal:tN.optional(),modes:Zme.optional(),activity:zo(["idle","turn","disposing","unknown"]).optional(),agent:Xme.optional()}),Jme=Pv.extend({goal:tN.nullable().optional(),modes:Kme.optional()}),Hp=Bt({attachmentId:St(),mediaType:St(),name:St().optional(),size:Yt().optional(),source:v1("kind",[Bt({kind:Sn("url"),url:St()}),Bt({kind:Sn("file"),fileId:St()}),Bt({kind:Sn("session_media"),fileId:St()})]).optional(),placeholder:St().optional()}),Qme=Bt({title:St(),status:zo(["pending","in_progress","done"])}),Hv=Bt({todoId:St(),items:qn(Qme),updatedAt:St().optional()}),Dv=Bt({promptId:St(),status:zo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:St().optional(),content:Ss().optional(),createdAt:St(),finishedAt:St().optional(),steeredAt:St().optional()}),nN=Bt({items:qn(eN),tasks:qn(Ov),interactions:qn(jv).default([]),attachments:qn(Hp).default([]),todos:qn(Hv).default([]),prompts:qn(Dv).default([]),meta:Pv,hasMoreOlder:rf().optional()}),e8e=X$.omit({steps:!0}),t8e=Y$.omit({frames:!0}),n8e=v1("type",[Bt({type:Sn("frame"),turnId:_0,stepId:Fv,frameId:lf}),Bt({type:Sn("task"),taskId:x0})]),Vv=v1("op",[Bt({op:Sn("reset"),agentId:ti,snapshot:nN}),Bt({op:Sn("turn.upsert"),turn:e8e}),Bt({op:Sn("step.upsert"),turnId:_0,step:t8e}),Bt({op:Sn("frame.upsert"),turnId:_0,stepId:Fv,frame:G$}),Bt({op:Sn("append"),target:n8e,offset:Yt().int().nonnegative(),text:St()}),Bt({op:Sn("marker.upsert"),item:J$,beforeTurn:Yt().int().optional()}),Bt({op:Sn("taskref.upsert"),item:Q$,beforeTurn:Yt().int().optional()}),Bt({op:Sn("task.upsert"),task:Ov}),Bt({op:Sn("interaction.upsert"),interaction:jv}),Bt({op:Sn("attachment.upsert"),attachment:Hp}),Bt({op:Sn("todo.upsert"),todo:Hv}),Bt({op:Sn("prompt.upsert"),prompt:Dv}),Bt({op:Sn("meta.merge"),meta:Jme}),Bt({op:Sn("items.remove"),ids:qn(St())})]);Bt({agentId:ti,ops:qn(Vv)});const o8e=zo(["off","turn","block","delta"]),iu=Yt().int().nonnegative(),s8e=Rv(St(),o8e);Bt({session_id:St().min(1),transcript:s8e,transcript_since:Rv(St(),iu).optional()});Bt({agent_id:ti,before_turn:St().min(1).optional(),after_turn:St().min(1).optional(),page_size:Yt().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),Rme(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const r8e=Bt({agentId:ti,type:zo(["main","sub","independent"]).optional(),parentAgentId:ti.optional(),label:St().optional(),createdAt:St().optional(),disposedAt:St().optional()}),i8e=Bt({agent_id:ti,items:qn(eN),has_more:rf(),tasks:qn(Ov),interactions:qn(jv).default([]),attachments:qn(Hp).default([]),todos:qn(Hv).default([]),prompts:qn(Dv).default([]),meta:Pv,agents:qn(r8e),pending_interactions:qn(St()),seq:iu.optional()});Bt({agent_id:ti,batches:qn(Bt({seq:iu,ops:qn(Vv)})),latest_seq:iu,complete:rf()});const l8e=Bt({turn_id:_0,ordinal:Yt().int(),state:K$,origin:Z$,prompt:St(),attachment_ids:qn(St()).optional(),started_at:St().optional()});Bt({agents:qn(Bt({agent_id:ti,messages:qn(l8e),attachments:qn(Hp).default([])}))});const a8e=Bt({state:zo(["pending","approved","rejected","cancelled"]),selected_option:St().optional(),feedback:St().optional()}),c8e=Bt({tool_call_id:St(),turn_id:_0,source:zo(["interaction","display","output"]),plan:St(),path:St().optional(),options:qn(Bt({label:St(),description:St().optional()})).optional(),review:a8e.optional()});Bt({agent_id:ti,plans:qn(c8e)});const u8e=Bt({agent_id:ti,snapshot:nN,has_more_older:rf(),seq:iu.optional()}),d8e=Bt({agent_id:ti,ops:qn(Vv),seq:iu.optional()}),oN=u8e.extend({type:Sn("transcript.reset")}),sN=d8e.extend({type:Sn("transcript.ops")});v1("type",[oN,sN]);const f8e=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],rN=500,z5=256*1024,US=200,vm=16384,wm=500,ym=50,km=50,p8e=6,h8e=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,m8e=/^[A-Za-z0-9+/=_-]{200,}$/;let bm=null;function Ji(){if(bm!==null)return bm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=Yo(ln.debug)==="1"),bm=e,e}const e1=[],Ec=[];let L2=0;const J1=[];let $2=0,g8e=1;const B5=new TextEncoder,v8e=new Set(f8e),Wv=U(0),N2=jo(!1);function w8e(){return e1}function y8e(){e1.length=0,Ec.length=0,L2=0,J1.length=0,$2=0,Wv.value++}function ca(e){if(!N2.value){try{const t={id:g8e++,ts:Date.now(),source:e.source,kind:String(Uc(e.kind)),label:String(Uc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Uc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:w1(e.detail)},n=JSON.stringify(t),o=B5.encode(n).byteLength;if(o>z5)return;for(e1.push(t),Ec.push(n),L2+=o+(Ec.length>1?1:0);e1.length>rN||L2>z5;){const s=Ec.shift();e1.shift(),s!==void 0&&(L2-=B5.encode(s).byteLength,Ec.length>0&&(L2-=1))}}catch{return}Wv.value++}}function D1(e){if(typeof e=="string")return e.length<=US?e:e.slice(0,US)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function k8e(e,t){if(v8e.has(e))try{const n={ts:Date.now(),event:e,sessionId:D1(t?.sessionId),status:D1(t?.status),operation:D1(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:D1(t?.promptId),zipBytes:li(t?.zipBytes),errorName:D1(t?.errorName),errorCode:li(t?.errorCode),requestId:D1(t?.requestId),phase:D1(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=B5.encode(o).byteLength;if(s>z5)return;for(J1.push(o),$2+=s+(J1.length>1?1:0);J1.length>rN||$2>z5;){const r=J1.shift();r!==void 0&&($2-=B5.encode(r).byteLength,J1.length>0&&($2-=1))}}catch{return}}function Uc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const r=e;return m8e.test(r)?`[base64-like, ${r.length} chars omitted]`:r.length>wm?`${r.slice(0,wm)}… [+${r.length-wm} chars]`:r}if(n!=="object")return String(e);if(t>=p8e)return"[max depth]";if(Array.isArray(e)){const r=e.slice(0,ym).map(i=>Uc(i,t+1));return e.length>ym&&r.push(`[+${e.length-ym} more items]`),r}const o={},s=Object.entries(e);for(const[r,i]of s.slice(0,km))o[r]=h8e.test(r)?"[redacted]":Uc(i,t+1);return s.length>km&&(o._truncatedKeys=s.length-km),o}function w1(e){if(e===void 0)return;const t=Uc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>vm)return{_truncated:`detail JSON was ${n.length} chars; first ${vm} kept`,preview:n.slice(0,vm)}}catch{return"[unserializable detail]"}return t}function j3(e){Ji()&&ca({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:w1(e.body)}})}function sc(e){if(!Ji())return;const t=e.code!==0;ca({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:w1(e.data)}})}function Ta(e){Ji()&&ca({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function rc(e,t){Ji()&&ca({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:w1(t)})}function b8e(e){if(!Ji())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;ca({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:w1(e)})}function _8e(e){if(!Ji())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,r=typeof t.offset=="number"?t.offset:void 0,i=[o,s!==void 0?`seq=${s}`:void 0,r!==void 0?`offset=${r}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ca({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:r,label:`← ${n}${i.length>0?` (${i.join(" ")})`:""}`,detail:w1(t.payload)})}const x8e={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function S8e(e,t,n){Ji()&&ca({source:"client",kind:`client:${e}`,label:`${x8e[e]} ${t}`,detail:w1(n)})}function Ol(e,t){Ji()&&ca({source:"client",kind:"client:event",label:`· ${e}`,detail:w1(t)})}function us(e,t){k8e(e,t),ca({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let _m=!1,O3=null;function C8e(){if(_m)return()=>O3?.();_m=!0;const e=[];try{if(typeof window<"u"){const n=s=>{us("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const r=s.reason;us("window:unhandled-rejection",{status:"failed",errorName:r instanceof Error?r.name:typeof r})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Ji())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...r)=>{try{S8e(n,r.map(M8e).join(" "),r.length>1?r:r[0])}catch{}o.apply(console,r)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(O3===t){for(const n of e.toReversed())n();O3=null,_m=!1}};return O3=t,t}function M8e(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function iN(e=e1){if(typeof document>"u")return;const t=new Blob([A8e(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`pythinker-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function A8e(e=e1){return e===e1?Ec.join(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){i(r);continue}if(e.external){const c=e.external.registry.get(r[0])?.id;if(t!==r[0]&&c){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id){i(r);continue}if(l.cycle){i(r);continue}if(l.count>1&&e.reused==="ref"){i(r);continue}}}function V$(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=l=>{const a=e.seen.get(l);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){o(d);const p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),l._zod.parent===d)for(const k in c)k==="$ref"||k==="allOf"||k in u||delete c[k];if(h.$ref&&p.def)for(const k in c)k==="$ref"||k==="allOf"||k in p.def&&JSON.stringify(c[k])===JSON.stringify(p.def[k])&&delete c[k]}const f=l._zod.parent;if(f&&f!==d){o(f);const p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const h in c)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(c[h])===JSON.stringify(p.def[h])&&delete c[h]}e.override({zodSchema:l,jsonSchema:c,path:a.path??[]})};for(const l of[...e.seen.entries()].reverse())o(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&s.id===i&&delete s.id;const r=e.external?.defs??{};for(const l of e.seen.entries()){const a=l[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,r[a.defId]=a.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:z5(t,"input",e.processors),output:z5(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ai(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ai(o.element,n);if(o.type==="set")return ai(o.valueType,n);if(o.type==="lazy")return ai(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ai(o.innerType,n);if(o.type==="intersection")return ai(o.left,n)||ai(o.right,n);if(o.type==="record"||o.type==="map")return ai(o.keyType,n)||ai(o.valueType,n);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ai(o.in,n)||ai(o.out,n);if(o.type==="object"){for(const s in o.shape)if(ai(o.shape[s],n))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(ai(s,n))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(ai(s,n))return!0;return!!(o.rest&&ai(o.rest,n))}return!1}const nhe=(e,t={})=>n=>{const o=H$({...n,processors:t});return ms(e,o),D$(o,e),V$(o,e)},z5=(e,t,n={})=>o=>{const{libraryOptions:s,target:i}=o??{},r=H$({...s??{},target:i,io:t,processors:n});return ms(e,r),D$(r,e),V$(r,e)},ohe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},she=(e,t,n,o)=>{const s=n;s.type="string";const{minimum:i,maximum:r,format:l,patterns:a,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof r=="number"&&(s.maxLength=r),l&&(s.format=ohe[l]??l,s.format===""&&delete s.format,l==="time"&&delete s.format),c&&(s.contentEncoding=c),a&&a.size>0){const u=[...a];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ihe=(e,t,n,o)=>{const s=n,{minimum:i,maximum:r,format:l,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof l=="string"&&l.includes("int")?s.type="integer":s.type="number";const d=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(r??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";d?p?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof i=="number"&&(s.minimum=i),f?p?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof r=="number"&&(s.maximum=r),typeof a=="number"&&(s.multipleOf=a)},rhe=(e,t,n,o)=>{n.type="boolean"},lhe=(e,t,n,o)=>{n.not={}},ahe=(e,t,n,o)=>{},che=(e,t,n,o)=>{const s=e._zod.def,i=k$(s.entries);i.every(r=>typeof r=="number")&&(n.type="number"),i.every(r=>typeof r=="string")&&(n.type="string"),n.enum=i},uhe=(e,t,n,o)=>{const s=e._zod.def,i=[];for(const r of s.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(r))}else i.push(r);if(i.length!==0)if(i.length===1){const r=i[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else i.every(r=>typeof r=="number")&&(n.type="number"),i.every(r=>typeof r=="string")&&(n.type="string"),i.every(r=>typeof r=="boolean")&&(n.type="boolean"),i.every(r=>r===null)&&(n.type="null"),n.enum=i},dhe=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fhe=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},phe=(e,t,n,o)=>{const s=n,i=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(s.minItems=r),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=ms(i.element,t,{...o,path:[...o.path,"items"]})},hhe=(e,t,n,o)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const r=i.shape;for(const c in r)s.properties[c]=ms(r[c],t,{...o,path:[...o.path,"properties",c]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));a.size>0&&(s.required=Array.from(a)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=ms(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},mhe=(e,t,n,o)=>{const s=e._zod.def,i=s.inclusive===!1,r=s.options.map((l,a)=>ms(l,t,{...o,path:[...o.path,i?"oneOf":"anyOf",a]}));i?n.oneOf=r:n.anyOf=r},ghe=(e,t,n,o)=>{const s=e._zod.def,i=ms(s.left,t,{...o,path:[...o.path,"allOf",0]}),r=ms(s.right,t,{...o,path:[...o.path,"allOf",1]}),l=c=>"allOf"in c&&Object.keys(c).length===1,a=[...l(i)?i.allOf:[i],...l(r)?r.allOf:[r]];n.allOf=a},vhe=(e,t,n,o)=>{const s=n,i=e._zod.def;s.type="object";const r=i.keyType,a=r._zod.bag?.patterns;if(i.mode==="loose"&&a&&a.size>0){const u=ms(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});s.patternProperties={};for(const d of a)s.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=ms(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),s.additionalProperties=ms(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const c=r._zod.values;if(c){const u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(s.required=u)}},whe=(e,t,n,o)=>{const s=e._zod.def,i=ms(s.innerType,t,o),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},yhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType},khe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},bhe=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},_he=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType;let r;try{r=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},xhe=(e,t,n,o)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),r=t.io==="input"?i?s.out:s.in:s.out;ms(r,t,o);const l=t.seen.get(e);l.ref=r},She=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},W$=(e,t,n,o)=>{const s=e._zod.def;ms(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType},Che=gt("ZodISODateTime",(e,t)=>{Mpe.init(e,t),Do.init(e,t)});function Mhe(e){return $6e(Che,e)}const Ahe=gt("ZodISODate",(e,t)=>{Ape.init(e,t),Do.init(e,t)});function Ehe(e){return N6e(Ahe,e)}const The=gt("ZodISOTime",(e,t)=>{Epe.init(e,t),Do.init(e,t)});function Ihe(e){return z6e(The,e)}const Lhe=gt("ZodISODuration",(e,t)=>{Tpe.init(e,t),Do.init(e,t)});function $he(e){return B6e(Lhe,e)}const Nhe=(e,t)=>{S$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>w5e(e,n)},flatten:{value:n=>v5e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,h7,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,h7,2)}},isEmpty:{get(){return e.issues.length===0}}})},Sr=gt("ZodError",Nhe,{Parent:Error}),zhe=zv(Sr),Bhe=Bv(Sr),Rhe=Op(Sr),Fhe=Pp(Sr),jhe=b5e(Sr),Ohe=_5e(Sr),Phe=x5e(Sr),Hhe=S5e(Sr),Dhe=C5e(Sr),Vhe=M5e(Sr),Whe=A5e(Sr),qhe=E5e(Sr),PS=new WeakMap;function rf(e,t,n){const o=Object.getPrototypeOf(e);let s=PS.get(o);if(s||(s=new Set,PS.set(o,s)),!s.has(t)){s.add(t);for(const i in n){const r=n[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){const l=r.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const Ho=gt("ZodType",(e,t)=>(Po.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:z5(e,"input"),output:z5(e,"output")}}),e.toJSONSchema=nhe(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,o)=>zhe(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>Rhe(e,n,o),e.parseAsync=async(n,o)=>Bhe(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Fhe(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>jhe(e,n,o),e.decode=(n,o)=>Ohe(e,n,o),e.encodeAsync=async(n,o)=>Phe(e,n,o),e.decodeAsync=async(n,o)=>Hhe(e,n,o),e.safeEncode=(n,o)=>Dhe(e,n,o),e.safeDecode=(n,o)=>Vhe(e,n,o),e.safeEncodeAsync=async(n,o)=>Whe(e,n,o),e.safeDecodeAsync=async(n,o)=>qhe(e,n,o),rf(e,"ZodType",{check(...n){const o=this.def;return this.clone(m1(o,{checks:[...o.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return g1(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(jme(n,o))},superRefine(n,o){return this.check(Ome(n,o))},overwrite(n){return this.check(ku(n))},optional(){return WS(this)},exactOptional(){return Cme(this)},nullable(){return qS(this)},nullish(){return WS(qS(this))},nonoptional(n){return Lme(this,n)},array(){return qn(this)},or(n){return vme([this,n])},and(n){return kme(this,n)},transform(n){return US(this,xme(n))},default(n){return Eme(this,n)},prefault(n){return Ime(this,n)},catch(n){return Nme(this,n)},pipe(n){return US(this,n)},readonly(){return Rme(this)},describe(n){const o=this.clone();return L2.add(o,{description:n}),o},meta(...n){if(n.length===0)return L2.get(this);const o=this.clone();return L2.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return L2.get(e)?.description},configurable:!0}),e)),q$=gt("_ZodString",(e,t)=>{Rv.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,i)=>she(e,o,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,rf(e,"_ZodString",{regex(...o){return this.check(H6e(...o))},includes(...o){return this.check(W6e(...o))},startsWith(...o){return this.check(q6e(...o))},endsWith(...o){return this.check(U6e(...o))},min(...o){return this.check(N5(...o))},max(...o){return this.check(O$(...o))},length(...o){return this.check(P$(...o))},nonempty(...o){return this.check(N5(1,...o))},lowercase(o){return this.check(D6e(o))},uppercase(o){return this.check(V6e(o))},trim(){return this.check(K6e())},normalize(...o){return this.check(Z6e(...o))},toLowerCase(){return this.check(G6e())},toUpperCase(){return this.check(Y6e())},slugify(){return this.check(X6e())}})}),Uhe=gt("ZodString",(e,t)=>{Rv.init(e,t),q$.init(e,t),e.email=n=>e.check(d6e(Zhe,n)),e.url=n=>e.check(g6e(Khe,n)),e.jwt=n=>e.check(L6e(cme,n)),e.emoji=n=>e.check(v6e(Ghe,n)),e.guid=n=>e.check(RS(HS,n)),e.uuid=n=>e.check(f6e(j3,n)),e.uuidv4=n=>e.check(p6e(j3,n)),e.uuidv6=n=>e.check(h6e(j3,n)),e.uuidv7=n=>e.check(m6e(j3,n)),e.nanoid=n=>e.check(w6e(Yhe,n)),e.guid=n=>e.check(RS(HS,n)),e.cuid=n=>e.check(y6e(Xhe,n)),e.cuid2=n=>e.check(k6e(Jhe,n)),e.ulid=n=>e.check(b6e(Qhe,n)),e.base64=n=>e.check(E6e(rme,n)),e.base64url=n=>e.check(T6e(lme,n)),e.xid=n=>e.check(_6e(eme,n)),e.ksuid=n=>e.check(x6e(tme,n)),e.ipv4=n=>e.check(S6e(nme,n)),e.ipv6=n=>e.check(C6e(ome,n)),e.cidrv4=n=>e.check(M6e(sme,n)),e.cidrv6=n=>e.check(A6e(ime,n)),e.e164=n=>e.check(I6e(ame,n)),e.datetime=n=>e.check(Mhe(n)),e.date=n=>e.check(Ehe(n)),e.time=n=>e.check(Ihe(n)),e.duration=n=>e.check($he(n))});function St(e){return u6e(Uhe,e)}const Do=gt("ZodStringFormat",(e,t)=>{Bo.init(e,t),q$.init(e,t)}),Zhe=gt("ZodEmail",(e,t)=>{vpe.init(e,t),Do.init(e,t)}),HS=gt("ZodGUID",(e,t)=>{mpe.init(e,t),Do.init(e,t)}),j3=gt("ZodUUID",(e,t)=>{gpe.init(e,t),Do.init(e,t)}),Khe=gt("ZodURL",(e,t)=>{wpe.init(e,t),Do.init(e,t)}),Ghe=gt("ZodEmoji",(e,t)=>{ype.init(e,t),Do.init(e,t)}),Yhe=gt("ZodNanoID",(e,t)=>{kpe.init(e,t),Do.init(e,t)}),Xhe=gt("ZodCUID",(e,t)=>{bpe.init(e,t),Do.init(e,t)}),Jhe=gt("ZodCUID2",(e,t)=>{_pe.init(e,t),Do.init(e,t)}),Qhe=gt("ZodULID",(e,t)=>{xpe.init(e,t),Do.init(e,t)}),eme=gt("ZodXID",(e,t)=>{Spe.init(e,t),Do.init(e,t)}),tme=gt("ZodKSUID",(e,t)=>{Cpe.init(e,t),Do.init(e,t)}),nme=gt("ZodIPv4",(e,t)=>{Ipe.init(e,t),Do.init(e,t)}),ome=gt("ZodIPv6",(e,t)=>{Lpe.init(e,t),Do.init(e,t)}),sme=gt("ZodCIDRv4",(e,t)=>{$pe.init(e,t),Do.init(e,t)}),ime=gt("ZodCIDRv6",(e,t)=>{Npe.init(e,t),Do.init(e,t)}),rme=gt("ZodBase64",(e,t)=>{zpe.init(e,t),Do.init(e,t)}),lme=gt("ZodBase64URL",(e,t)=>{Rpe.init(e,t),Do.init(e,t)}),ame=gt("ZodE164",(e,t)=>{Fpe.init(e,t),Do.init(e,t)}),cme=gt("ZodJWT",(e,t)=>{Ope.init(e,t),Do.init(e,t)}),U$=gt("ZodNumber",(e,t)=>{z$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,i)=>ihe(e,o,s),rf(e,"ZodNumber",{gt(o,s){return this.check(jS(o,s))},gte(o,s){return this.check(vm(o,s))},min(o,s){return this.check(vm(o,s))},lt(o,s){return this.check(FS(o,s))},lte(o,s){return this.check(gm(o,s))},max(o,s){return this.check(gm(o,s))},int(o){return this.check(DS(o))},safe(o){return this.check(DS(o))},positive(o){return this.check(jS(0,o))},nonnegative(o){return this.check(vm(0,o))},negative(o){return this.check(FS(0,o))},nonpositive(o){return this.check(gm(0,o))},multipleOf(o,s){return this.check(OS(o,s))},step(o,s){return this.check(OS(o,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Yt(e){return R6e(U$,e)}const ume=gt("ZodNumberFormat",(e,t)=>{Ppe.init(e,t),U$.init(e,t)});function DS(e){return F6e(ume,e)}const dme=gt("ZodBoolean",(e,t)=>{Hpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>rhe(e,n,o)});function lf(e){return j6e(dme,e)}const fme=gt("ZodUnknown",(e,t)=>{Dpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ahe()});function Ss(){return O6e(fme)}const pme=gt("ZodNever",(e,t)=>{Vpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>lhe(e,n,o)});function hme(e){return P6e(pme,e)}const mme=gt("ZodArray",(e,t)=>{Wpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>phe(e,n,o,s),e.element=t.element,rf(e,"ZodArray",{min(n,o){return this.check(N5(n,o))},nonempty(n){return this.check(N5(1,n))},max(n,o){return this.check(O$(n,o))},length(n,o){return this.check(P$(n,o))},unwrap(){return this.element}})});function qn(e,t){return J6e(mme,e,t)}const gme=gt("ZodObject",(e,t)=>{Upe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>hhe(e,n,o,s),mo(e,"shape",()=>t.shape),rf(e,"ZodObject",{keyof(){return zo(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Ss()})},loose(){return this.clone({...this._zod.def,catchall:Ss()})},strict(){return this.clone({...this._zod.def,catchall:hme()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return d5e(this,n)},safeExtend(n){return f5e(this,n)},merge(n){return p5e(this,n)},pick(n){return c5e(this,n)},omit(n){return u5e(this,n)},partial(...n){return h5e(K$,this,n[0])},required(...n){return m5e(G$,this,n[0])}})});function Bt(e,t){const n={type:"object",shape:e??{},...rn(t)};return new gme(n)}const Z$=gt("ZodUnion",(e,t)=>{F$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>mhe(e,n,o,s),e.options=t.options});function vme(e,t){return new Z$({type:"union",options:e,...rn(t)})}const wme=gt("ZodDiscriminatedUnion",(e,t)=>{Z$.init(e,t),Zpe.init(e,t)});function v1(e,t,n){return new wme({type:"union",options:t,discriminator:e,...rn(n)})}const yme=gt("ZodIntersection",(e,t)=>{Kpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ghe(e,n,o,s)});function kme(e,t){return new yme({type:"intersection",left:e,right:t})}const VS=gt("ZodRecord",(e,t)=>{Gpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>vhe(e,n,o,s),e.keyType=t.keyType,e.valueType=t.valueType});function Fv(e,t,n){return!t||!t._zod?new VS({type:"record",keyType:St(),valueType:e,...rn(t)}):new VS({type:"record",keyType:e,valueType:t,...rn(n)})}const g7=gt("ZodEnum",(e,t)=>{Ype.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(o,s,i)=>che(e,o,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,s)=>{const i={};for(const r of o)if(n.has(r))i[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new g7({...t,checks:[],...rn(s),entries:i})},e.exclude=(o,s)=>{const i={...t.entries};for(const r of o)if(n.has(r))delete i[r];else throw new Error(`Key ${r} not found in enum`);return new g7({...t,checks:[],...rn(s),entries:i})}});function zo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new g7({type:"enum",entries:n,...rn(t)})}const bme=gt("ZodLiteral",(e,t)=>{Xpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>uhe(e,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Sn(e,t){return new bme({type:"literal",values:Array.isArray(e)?e:[e],...rn(t)})}const _me=gt("ZodTransform",(e,t)=>{Jpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>fhe(e,n),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new y$(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(jd(i,n.value,t));else{const r=i;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(jd(r))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function xme(e){return new _me({type:"transform",transform:e})}const K$=gt("ZodOptional",(e,t)=>{j$.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>W$(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function WS(e){return new K$({type:"optional",innerType:e})}const Sme=gt("ZodExactOptional",(e,t)=>{Qpe.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>W$(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Cme(e){return new Sme({type:"optional",innerType:e})}const Mme=gt("ZodNullable",(e,t)=>{e6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>whe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function qS(e){return new Mme({type:"nullable",innerType:e})}const Ame=gt("ZodDefault",(e,t)=>{t6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>khe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Eme(e,t){return new Ame({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_$(t)}})}const Tme=gt("ZodPrefault",(e,t)=>{n6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>bhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Ime(e,t){return new Tme({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_$(t)}})}const G$=gt("ZodNonOptional",(e,t)=>{o6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>yhe(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Lme(e,t){return new G$({type:"nonoptional",innerType:e,...rn(t)})}const $me=gt("ZodCatch",(e,t)=>{s6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>_he(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nme(e,t){return new $me({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zme=gt("ZodPipe",(e,t)=>{i6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>xhe(e,n,o,s),e.in=t.in,e.out=t.out});function US(e,t){return new zme({type:"pipe",in:e,out:t})}const Bme=gt("ZodReadonly",(e,t)=>{r6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>She(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Rme(e){return new Bme({type:"readonly",innerType:e})}const Fme=gt("ZodCustom",(e,t)=>{l6e.init(e,t),Ho.init(e,t),e._zod.processJSONSchema=(n,o,s)=>dhe(e,n)});function jme(e,t={}){return Q6e(Fme,e,t)}function Ome(e,t){return ehe(e,t)}const _0=St().min(1),jv=St().min(1),af=St().min(1),x0=St().min(1),tr=St().min(1),Pme=/^[A-Za-z0-9._-]{1,128}$/;function Hme(e){return Pme.test(e)&&e!=="."&&e!==".."}const Y$=v1("kind",[Bt({kind:Sn("user"),payload:Ss().optional()}),Bt({kind:Sn("cron"),taskId:x0.optional(),payload:Ss().optional()}),Bt({kind:Sn("task"),taskId:x0,payload:Ss().optional()}),Bt({kind:Sn("hook"),payload:Ss().optional()}),Bt({kind:Sn("compaction"),payload:Ss().optional()}),Bt({kind:Sn("side"),payload:Ss().optional()}),Bt({kind:Sn("other"),payload:Ss().optional()})]),Dme=Bt({inputTokens:Yt().optional(),outputTokens:Yt().optional(),cachedTokens:Yt().optional(),cost:Yt().optional()}),id=Bt({inputOther:Yt(),output:Yt(),inputCacheRead:Yt(),inputCacheCreation:Yt()}),Vme=Bt({llmFirstTokenLatencyMs:Yt().optional(),llmStreamDurationMs:Yt().optional(),llmRequestBuildMs:Yt().optional(),llmServerFirstTokenMs:Yt().optional(),llmServerDecodeMs:Yt().optional(),llmClientConsumeMs:Yt().optional()}),Wme=Bt({failedAttempt:Yt(),nextAttempt:Yt(),maxAttempts:Yt(),delayMs:Yt(),errorName:St(),errorMessage:St(),statusCode:Yt().optional()}),X$=zo(["queued","running","completed","failed","cancelled"]),qme=zo(["running","completed","interrupted","failed"]),Ume=Bt({kind:Sn("text"),frameId:af,role:zo(["assistant","user"]),text:St(),attachmentIds:qn(St()).optional(),taskId:x0.optional(),promptIds:qn(St()).optional()}),Zme=Bt({kind:Sn("thinking"),frameId:af,text:St()}),Kme=Bt({agentId:tr,role:zo(["child","member"]).optional()}),Gme=Bt({kind:zo(["stdout","stderr","progress","status","custom"]),text:St().optional(),percent:Yt().optional(),customKind:St().optional(),customData:Ss().optional()}),Yme=Bt({kind:Sn("tool"),frameId:af,toolCallId:St(),name:St(),view:St().optional(),state:zo(["running","done","error"]),input:Ss().optional(),output:Ss().optional(),display:Ss().optional(),error:St().optional(),inputText:St().optional(),progress:Gme.optional(),taskId:x0.optional(),approvalId:St().optional(),todoId:St().optional(),agentRefs:qn(Kme).optional()}),Ov=Bt({interactionId:St(),interactionKind:zo(["approval","question"]),toolCallId:St().optional(),state:zo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ss().optional(),response:Ss().optional()}),Xme=Bt({kind:Sn("notice"),frameId:af,level:zo(["error","warning","info"]),source:St().optional(),message:St(),detail:Ss().optional()}),J$=v1("kind",[Ume,Zme,Yme,Xme]),Q$=Bt({kind:Sn("step"),stepId:jv,turnId:_0,ordinal:Yt().int(),state:qme,frames:qn(J$),startedAt:St().optional(),endedAt:St().optional(),usage:id.optional(),finishReason:St().optional(),timing:Vme.optional(),retry:Wme.optional(),endReason:St().optional(),endMessage:St().optional()}),eN=Bt({kind:Sn("turn"),turnId:_0,ordinal:Yt().int(),state:X$,origin:Y$,prompt:St().optional(),attachmentIds:qn(St()).optional(),steps:qn(Q$),startedAt:St().optional(),endedAt:St().optional(),usage:Dme.optional(),durationMs:Yt().optional(),error:St().optional()}),tN=Bt({kind:Sn("marker"),markerId:St(),marker:St(),payload:Ss().optional(),at:St().optional()}),nN=Bt({kind:Sn("taskref"),refId:St(),taskId:x0,at:St().optional()}),oN=v1("kind",[eN,tN,nN]),Pv=Bt({taskId:x0,kind:zo(["shell","subagent","tool","other"]),state:zo(["running","completed","failed","timed_out","killed","lost"]),detached:lf(),description:St().optional(),agentId:tr.optional(),outputTail:St(),startedAt:St().optional(),endedAt:St().optional(),resultSummary:St().optional(),error:St().optional(),stateReason:St().optional(),usage:id.optional(),model:St().optional(),thinkingEffort:St().optional()}),sN=Bt({objective:St(),status:zo(["active","paused","blocked","complete"]),completionCriterion:St().optional(),budgetUsed:Yt().optional(),budgetLimit:Yt().optional()}),Jme=Bt({plan:Bt({reviewPath:St().optional(),version:Yt().optional()}).optional(),dynamic_workflow:Bt({trigger:St().optional()}).optional(),tower:Bt({}).optional()}),Qme=Bt({plan:Bt({reviewPath:St().optional(),version:Yt().optional()}).nullable().optional(),dynamic_workflow:Bt({trigger:St().optional()}).nullable().optional(),tower:Bt({}).nullable().optional()}),e8e=v1("kind",[Bt({kind:Sn("idle")}),Bt({kind:Sn("running"),turnId:Yt(),step:Yt(),stepId:St(),since:Yt()}),Bt({kind:Sn("streaming"),turnId:Yt(),step:Yt(),stepId:St(),stream:zo(["assistant","thinking","tool_call"]),toolCallId:St().optional(),toolName:St().optional(),since:Yt()}),Bt({kind:Sn("tool_call"),turnId:Yt(),step:Yt(),toolCallId:St(),name:St(),since:Yt()}),Bt({kind:Sn("retrying"),turnId:Yt(),step:Yt(),stepId:St(),failedAttempt:Yt(),nextAttempt:Yt(),maxAttempts:Yt(),delayMs:Yt(),errorName:St().optional(),statusCode:Yt().optional(),since:Yt()}),Bt({kind:Sn("awaiting_approval"),turnId:Yt(),step:Yt().optional(),approval:Ss().optional(),since:Yt()}),Bt({kind:Sn("interrupted"),turnId:Yt(),step:Yt().optional(),reason:zo(["aborted","max_steps","error"]),message:St().optional(),at:Yt()}),Bt({kind:Sn("ended"),turnId:Yt(),reason:zo(["completed","cancelled","failed","blocked"]),durationMs:Yt().optional(),at:Yt()})]),t8e=Bt({byModel:Fv(St(),id).optional(),currentTurn:id.optional(),total:id.optional()}),n8e=Bt({model:St().optional(),thinkingEffort:St().optional(),usage:t8e.optional(),contextTokens:Yt().optional(),maxContextTokens:Yt().optional(),contextUsage:Yt().optional(),permission:zo(["manual","yolo","auto"]).optional(),phase:e8e.optional()}),Hv=Bt({goal:sN.optional(),modes:Jme.optional(),activity:zo(["idle","turn","disposing","unknown"]).optional(),agent:n8e.optional()}),o8e=Hv.extend({goal:sN.nullable().optional(),modes:Qme.optional()}),Dp=Bt({attachmentId:St(),mediaType:St(),name:St().optional(),size:Yt().optional(),source:v1("kind",[Bt({kind:Sn("url"),url:St()}),Bt({kind:Sn("file"),fileId:St()}),Bt({kind:Sn("session_media"),fileId:St()})]).optional(),placeholder:St().optional()}),s8e=Bt({title:St(),status:zo(["pending","in_progress","done"])}),Dv=Bt({todoId:St(),items:qn(s8e),updatedAt:St().optional()}),Vv=Bt({promptId:St(),status:zo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:St().optional(),content:Ss().optional(),createdAt:St(),finishedAt:St().optional(),steeredAt:St().optional()}),iN=Bt({items:qn(oN),tasks:qn(Pv),interactions:qn(Ov).default([]),attachments:qn(Dp).default([]),todos:qn(Dv).default([]),prompts:qn(Vv).default([]),meta:Hv,hasMoreOlder:lf().optional()}),i8e=eN.omit({steps:!0}),r8e=Q$.omit({frames:!0}),l8e=v1("type",[Bt({type:Sn("frame"),turnId:_0,stepId:jv,frameId:af}),Bt({type:Sn("task"),taskId:x0})]),Wv=v1("op",[Bt({op:Sn("reset"),agentId:tr,snapshot:iN}),Bt({op:Sn("turn.upsert"),turn:i8e}),Bt({op:Sn("step.upsert"),turnId:_0,step:r8e}),Bt({op:Sn("frame.upsert"),turnId:_0,stepId:jv,frame:J$}),Bt({op:Sn("append"),target:l8e,offset:Yt().int().nonnegative(),text:St()}),Bt({op:Sn("marker.upsert"),item:tN,beforeTurn:Yt().int().optional()}),Bt({op:Sn("taskref.upsert"),item:nN,beforeTurn:Yt().int().optional()}),Bt({op:Sn("task.upsert"),task:Pv}),Bt({op:Sn("interaction.upsert"),interaction:Ov}),Bt({op:Sn("attachment.upsert"),attachment:Dp}),Bt({op:Sn("todo.upsert"),todo:Dv}),Bt({op:Sn("prompt.upsert"),prompt:Vv}),Bt({op:Sn("meta.merge"),meta:o8e}),Bt({op:Sn("items.remove"),ids:qn(St())})]);Bt({agentId:tr,ops:qn(Wv)});const a8e=zo(["off","turn","block","delta"]),lu=Yt().int().nonnegative(),c8e=Fv(St(),a8e);Bt({session_id:St().min(1),transcript:c8e,transcript_since:Fv(St(),lu).optional()});Bt({agent_id:tr,before_turn:St().min(1).optional(),after_turn:St().min(1).optional(),page_size:Yt().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),Hme(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const u8e=Bt({agentId:tr,type:zo(["main","sub","independent"]).optional(),parentAgentId:tr.optional(),label:St().optional(),createdAt:St().optional(),disposedAt:St().optional()}),d8e=Bt({agent_id:tr,items:qn(oN),has_more:lf(),tasks:qn(Pv),interactions:qn(Ov).default([]),attachments:qn(Dp).default([]),todos:qn(Dv).default([]),prompts:qn(Vv).default([]),meta:Hv,agents:qn(u8e),pending_interactions:qn(St()),seq:lu.optional()});Bt({agent_id:tr,batches:qn(Bt({seq:lu,ops:qn(Wv)})),latest_seq:lu,complete:lf()});const f8e=Bt({turn_id:_0,ordinal:Yt().int(),state:X$,origin:Y$,prompt:St(),attachment_ids:qn(St()).optional(),started_at:St().optional()});Bt({agents:qn(Bt({agent_id:tr,messages:qn(f8e),attachments:qn(Dp).default([])}))});const p8e=Bt({state:zo(["pending","approved","rejected","cancelled"]),selected_option:St().optional(),feedback:St().optional()}),h8e=Bt({tool_call_id:St(),turn_id:_0,source:zo(["interaction","display","output"]),plan:St(),path:St().optional(),options:qn(Bt({label:St(),description:St().optional()})).optional(),review:p8e.optional()});Bt({agent_id:tr,plans:qn(h8e)});const m8e=Bt({agent_id:tr,snapshot:iN,has_more_older:lf(),seq:lu.optional()}),g8e=Bt({agent_id:tr,ops:qn(Wv),seq:lu.optional()}),rN=m8e.extend({type:Sn("transcript.reset")}),lN=g8e.extend({type:Sn("transcript.ops")});v1("type",[rN,lN]);const v8e=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],aN=500,B5=256*1024,ZS=200,wm=16384,ym=500,km=50,bm=50,w8e=6,y8e=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,k8e=/^[A-Za-z0-9+/=_-]{200,}$/;let _m=null;function Jr(){if(_m!==null)return _m;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=Yo(ln.debug)==="1"),_m=e,e}const e1=[],Ic=[];let $2=0;const J1=[];let N2=0,b8e=1;const R5=new TextEncoder,_8e=new Set(v8e),qv=U(0),z2=jo(!1);function x8e(){return e1}function S8e(){e1.length=0,Ic.length=0,$2=0,J1.length=0,N2=0,qv.value++}function ca(e){if(!z2.value){try{const t={id:b8e++,ts:Date.now(),source:e.source,kind:String(Zc(e.kind)),label:String(Zc(e.label)),sessionId:e.sessionId===void 0?void 0:String(Zc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:w1(e.detail)},n=JSON.stringify(t),o=R5.encode(n).byteLength;if(o>B5)return;for(e1.push(t),Ic.push(n),$2+=o+(Ic.length>1?1:0);e1.length>aN||$2>B5;){const s=Ic.shift();e1.shift(),s!==void 0&&($2-=R5.encode(s).byteLength,Ic.length>0&&($2-=1))}}catch{return}qv.value++}}function D1(e){if(typeof e=="string")return e.length<=ZS?e:e.slice(0,ZS)}function lr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function C8e(e,t){if(_8e.has(e))try{const n={ts:Date.now(),event:e,sessionId:D1(t?.sessionId),status:D1(t?.status),operation:D1(t?.operation),seq:lr(t?.seq),durationMs:lr(t?.durationMs),messageCount:lr(t?.messageCount),contentCount:lr(t?.contentCount),mediaCount:lr(t?.mediaCount),sessionCount:lr(t?.sessionCount),workspaceCount:lr(t?.workspaceCount),promptId:D1(t?.promptId),zipBytes:lr(t?.zipBytes),errorName:D1(t?.errorName),errorCode:lr(t?.errorCode),requestId:D1(t?.requestId),phase:D1(t?.phase),httpStatus:lr(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:lr(t?.line),col:lr(t?.col)},o=JSON.stringify(n),s=R5.encode(o).byteLength;if(s>B5)return;for(J1.push(o),N2+=s+(J1.length>1?1:0);J1.length>aN||N2>B5;){const i=J1.shift();i!==void 0&&(N2-=R5.encode(i).byteLength,J1.length>0&&(N2-=1))}}catch{return}}function Zc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return k8e.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>ym?`${i.slice(0,ym)}… [+${i.length-ym} chars]`:i}if(n!=="object")return String(e);if(t>=w8e)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,km).map(r=>Zc(r,t+1));return e.length>km&&i.push(`[+${e.length-km} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,bm))o[i]=y8e.test(i)?"[redacted]":Zc(r,t+1);return s.length>bm&&(o._truncatedKeys=s.length-bm),o}function w1(e){if(e===void 0)return;const t=Zc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>wm)return{_truncated:`detail JSON was ${n.length} chars; first ${wm} kept`,preview:n.slice(0,wm)}}catch{return"[unserializable detail]"}return t}function O3(e){Jr()&&ca({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:w1(e.body)}})}function sc(e){if(!Jr())return;const t=e.code!==0;ca({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:w1(e.data)}})}function Ea(e){Jr()&&ca({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function ic(e,t){Jr()&&ca({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:w1(t)})}function M8e(e){if(!Jr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;ca({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:w1(e)})}function A8e(e){if(!Jr())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ca({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:w1(t.payload)})}const E8e={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function T8e(e,t,n){Jr()&&ca({source:"client",kind:`client:${e}`,label:`${E8e[e]} ${t}`,detail:w1(n)})}function Ol(e,t){Jr()&&ca({source:"client",kind:"client:event",label:`· ${e}`,detail:w1(t)})}function us(e,t){C8e(e,t),ca({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let xm=!1,P3=null;function I8e(){if(xm)return()=>P3?.();xm=!0;const e=[];try{if(typeof window<"u"){const n=s=>{us("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;us("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Jr())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{T8e(n,i.map(L8e).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(P3===t){for(const n of e.toReversed())n();P3=null,xm=!1}};return P3=t,t}function L8e(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function cN(e=e1){if(typeof document>"u")return;const t=new Blob([$8e(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`pythinker-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function $8e(e=e1){return e===e1?Ic.join(` `):e.map(t=>JSON.stringify(t)).join(` -`)}function T8e(){return J1.join(` -`)}function lN(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function g7(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ri(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:lN(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function rd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function ZS(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url,id:e.id}}function qv(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:ZS(e.source)};case"video":return{type:"video",source:ZS(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function v7(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(qv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function E8e(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url,id:t.id},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function I8e(e){return{content:e.content.map(E8e),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,dynamic_workflow_mode:e.dynamicWorkflowMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function L8e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function aN(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function $8e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function N8e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map($8e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function cN(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(N8e),createdAt:e.created_at}}function z8e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function B8e(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=z8e(o);return{answers:t,method:e.method,note:e.note}}function y4(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,agentId:e.agent_id,model:e.model,thinkingEffort:e.thinking_effort,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,dynamicWorkflowIndex:e.dynamic_workflow_index,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function KS(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Ea(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ic(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function uN(e){if(!e||typeof e!="object")return null;const t=e,n=Ea(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:Ea(t,"goalId")??Ea(t,"goal_id")??"goal",objective:Ea(t,"objective")??"",completionCriterion:Ea(t,"completionCriterion")??Ea(t,"completion_criterion"),status:n,turnsUsed:ic(t,"turnsUsed")??ic(t,"turns_used")??0,tokensUsed:ic(t,"tokensUsed")??ic(t,"tokens_used")??0,wallClockMs:ic(t,"wallClockMs")??ic(t,"wall_clock_ms")??0,terminalReason:Ea(t,"terminalReason")??Ea(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function R8e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ri(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ri(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":return{type:"sessionArchived",sessionId:t.session_id,workspaceId:t.payload.workspace_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:rd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:rd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:lN(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=uN(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:v7(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(qv),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:aN(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:cN(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:y4(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:w7(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function F8e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort,adaptiveThinking:e.adaptive_thinking}}function xm(e){return{loginId:e.login_id,state:e.state,defaultModel:e.default_model,message:e.message}}function d2(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function dN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function j8e(e){return{provider:dN(e.provider),modelsImported:e.models_imported}}function O8e(e){return Array.isArray(e)?e.map(t=>({id:t.id,enabled:t.enabled===!0,source:t.source,configValue:typeof t.config_value=="boolean"?t.config_value:void 0,defaultEnabled:t.default_enabled===!0,externallyControlled:t.externally_controlled===!0,overridden:t.overridden===!0})):[]}function w7(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,disabledSkills:e.disabled_skills,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function P8e(e){return e.session_id}function H8e(e){return e.seq}const D8e="main",V8e=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function Bl(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function W8e(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}const y7=new Map;function q8e(e){return y7.get(e)}function GS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map,retryReuseMsgId:void 0}}function ts(e,t){const n=e[t];return typeof n=="string"?n:void 0}function V1(e){return e.replaceAll("&","&").replaceAll('"',""").replaceAll("'","'").replaceAll("<","<").replaceAll(">",">")}function U1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function U8e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ts(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const r=ts(t,"goalId")??ts(t,"goal_id")??"goal",i=ts(t,"objective")??"";return{goalId:r,objective:i,completionCriterion:ts(t,"completionCriterion")??ts(t,"completion_criterion"),status:s,turnsUsed:U1(t,"turnsUsed")??U1(t,"turns_used")??0,tokensUsed:U1(t,"tokensUsed")??U1(t,"tokens_used")??0,wallClockMs:U1(t,"wallClockMs")??U1(t,"wall_clock_ms")??0,terminalReason:ts(t,"terminalReason")??ts(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Q1(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const s=e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},i=(s.status==="completed"||s.status==="failed"||s.status==="cancelled")&&o.status==="running"?{...o,status:s.status,subagentPhase:s.subagentPhase,startedAt:s.startedAt,completedAt:s.completedAt,outputPreview:s.outputPreview,outputBytes:s.outputBytes,suspendedReason:s.suspendedReason}:o,l={...s,...i,id:n,agentId:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,l),l}function Z8e(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ts(t,"name")??ts(t,"toolName")??"tool",o=Gs(K8e(n)),s=G8e(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=ts(n,"text");if(s)return Sm(s);const r=ts(n,"message");if(r)return Sm(r)}const o=ts(t,"message");if(o)return Sm(o)}return null}function K8e(e){return e.replace(/_\d+$/,"")}const YS=2e3;function Sm(e){return e.length>YS?`${e.slice(0,YS)}…`:e}function G8e(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return ta(e,n)}function Y8e(e,t,n,o,s,r){if(r.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ts(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Q1(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const i=Z8e(o,s);if(i===null||i.length===0)return[];const l=e.subagentMeta.get(n),a=Q1(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:i,stream:"stdout"}),c}function lc(e){return{...e,content:e.content.map(t=>({...t}))}}function XS(e,t,n){const o={id:Bl("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function X8e(e,t,n,o,s,r){const i={id:o,sessionId:t,role:"user",content:s,createdAt:r,promptId:n};return e.messages.push(i),i}function J8e(e){return Array.isArray(e)?e.map(t=>qv(t)):[]}function JS(e,t,n,o){const s=e.messages.find(i=>i.id===t);if(!s)return-1;const r=s.content.at(-1);return r&&r.type===n?(n==="text"?r.text+=o:r.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function Q8e(e,t,n,o,s,r){const i=e.messages.find(l=>l.id===t);i&&i.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:r})}function e7e(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",r=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return r.length>0?{outputChunk:r,stream:s}:null}function QS(e,t){e.messages.find(n=>n.id===t)}function t7e(e,t,n,o,s,r){const i={id:Bl("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:r};return e.messages.push(i),i}function f2(e,t){return e.messages.find(n=>n.id===t)}function eC(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function n7e(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=GS(),e.set(u,d)),d}function o(u){e.set(u,GS())}function s(u){t.add(u)}function r(u,d){const f=n(u);f.currentPromptId=d}function i(u,d){o(u);const f=n(u),p=d.promptId??Bl("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=XS(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const k=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:k}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:lc(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":du?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,k=[],x=m?.agentId;if(typeof x=="string"&&x!==D8e){const w=t.has(x);if(w&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:x,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(w&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:x,reason:m?.reason}];if(V8e.has(u))return Y8e(h,f,x,u,m??{},t)}switch(u){case"session.meta.updated":{const w=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,b={};typeof w=="string"&&w.length>0&&(b.title=w),typeof v=="string"&&(b.lastPrompt=v),(b.title!==void 0||b.lastPrompt!==void 0)&&k.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const w=m?.promptId,v=m?.userMessageId;if(!w||!v)break;const b=J8e(m?.content);if(b.length===0)break;h.currentPromptId=w;const M=X8e(h,f,w,v,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());k.push({type:"messageCreated",message:lc(M)});break}case"turn.started":{const w=m?.turnId,v=h.currentPromptId??Bl("pr_");h.currentPromptId=v,w!==void 0&&h.turnPromptId.set(w,v),h.turnTextLen=0,h.turnThinkLen=0,y7.delete(f),k.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const w=m?.turnId;let v=h.turnPromptId.get(w)??h.currentPromptId;if(v||(v=Bl("pr_"),h.currentPromptId=v,w!==void 0&&h.turnPromptId.set(w,v)),h.turnTextLen=0,h.turnThinkLen=0,h.retryReuseMsgId!==void 0){const M=h.retryReuseMsgId;if(h.retryReuseMsgId=void 0,f2(h,M)!==void 0){h.currentAssistantMsgId=M;break}}const b=XS(h,f,v);h.currentAssistantMsgId=b.id,k.push({type:"messageCreated",message:lc(b)});break}case"thinking.delta":{const w=h.currentAssistantMsgId;if(!w)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const b=a(h.turnThinkLen,p?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=JS(h,w,"thinking",v);if(M<0)break;h.turnThinkLen+=v.length,k.push({type:"assistantDelta",sessionId:f,messageId:w,contentIndex:M,delta:{thinking:v}});break}case"assistant.delta":{const w=h.currentAssistantMsgId;if(!w)break;const v=m?.delta??"";if(!v)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const b=a(h.turnTextLen,p?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=JS(h,w,"text",v);if(M<0)break;h.turnTextLen+=v.length,k.push({type:"assistantDelta",sessionId:f,messageId:w,contentIndex:M,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const w=h.currentAssistantMsgId,v=m?.turnId,b=h.turnPromptId.get(v)??h.currentPromptId;if(!w||!b)break;const M=m?.toolCallId,R=m?.name??m?.toolName??"",z=m?.args??m?.input??{};Q8e(h,w,M,R,z);const $=f2(h,w);$&&$.content.length-1,h.toolStartTimes.set(M,Date.now()),$&&k.push({type:"messageUpdated",sessionId:f,messageId:w,content:$.content.map(T=>({...T})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const w=m?.toolCallId,v=e7e(m??{});w&&v&&k.push({type:"toolOutput",sessionId:f,toolCallId:w,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const w=m?.turnId;let v=h.turnPromptId.get(w)??h.currentPromptId;v||(v=Bl("pr_"),h.currentPromptId=v,w!==void 0&&h.turnPromptId.set(w,v));const b=m?.toolCallId,M=m?.output,R=m?.isError??!1;h.toolStartTimes.get(b)??Date.now(),h.toolStartTimes.delete(b);const z=t7e(h,f,b,M,R,v);k.push({type:"messageCreated",message:lc(z)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const w=h.currentAssistantMsgId,v=W8e(m?.usage);if(h.totalInput+=v.input,h.totalOutput+=v.output,h.totalCacheRead+=v.cacheRead,h.totalCacheCreate+=v.cacheCreate,w){QS(h,w);const b=f2(h,w);b&&k.push({type:"messageUpdated",sessionId:f,messageId:w,content:b.content.map(M=>({...M})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),k.push({type:"sessionUsageUpdated",sessionId:f,usage:eC(h),model:h.model||void 0,dynamicWorkflowMode:m?.dynamicWorkflowMode===!0?!0:m?.dynamicWorkflowMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const w=h.currentAssistantMsgId,v=m?.reason??"completed",b=U1(m??{},"durationMs");if(k.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),w){QS(h,w);const R=f2(h,w);R&&k.push({type:"messageUpdated",sessionId:f,messageId:w,content:R.content.map(z=>({...z})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:b})}h.turnCount++;const M=eC(h);k.push({type:"sessionUsageUpdated",sessionId:f,usage:M}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0,h.retryReuseMsgId=void 0;break}case"prompt.completed":{const w=m?.promptId;typeof w=="string"&&w.length>0&&k.push({type:"promptCompleted",sessionId:f,promptId:w,reason:m?.reason??"completed"});break}case"prompt.aborted":{const w=m?.promptId;typeof w=="string"&&w.length>0&&k.push({type:"promptAborted",sessionId:f,promptId:w});break}case"turn.step.retrying":{const w=h.currentAssistantMsgId;if(w!==void 0){const v=f2(h,w);v!==void 0&&(v.content=v.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),k.push({type:"messageUpdated",sessionId:f,messageId:w,content:v.content.map(b=>({...b})),status:"pending"}),h.retryReuseMsgId=w)}h.turnTextLen=0,h.turnThinkLen=0,h.toolStartTimes.clear();break}case"turn.step.interrupted":{h.currentAssistantMsgId=void 0,h.retryReuseMsgId=void 0;const w=typeof m?.reason=="string"&&m.reason.length>0?m.reason:"error",v=typeof m?.message=="string"&&m.message.length>0?m.message:void 0;y7.set(f,{reason:w,message:v,turnId:typeof m?.turnId=="number"?m.turnId:void 0,at:Date.now()});break}case"subagent.spawned":{const w=typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Bl("task_"),v={id:w,agentId:w,sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,model:typeof m?.model=="string"?m.model:void 0,thinkingEffort:typeof m?.thinkingEffort=="string"?m.thinkingEffort:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,dynamicWorkflowIndex:typeof m?.dynamicWorkflowIndex=="number"?m.dynamicWorkflowIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(v.id,v),k.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const w=Q1(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});w&&k.push({type:"taskCreated",sessionId:f,task:w});break}case"subagent.suspended":{const w=Q1(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});w&&k.push({type:"taskCreated",sessionId:f,task:w});break}case"subagent.completed":{const w=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Q1(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});v&&k.push({type:"taskCreated",sessionId:f,task:v}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:w});break}case"subagent.failed":{const w=typeof m?.error=="string"?m.error:void 0,v=Q1(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});v&&k.push({type:"taskCreated",sessionId:f,task:v}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:w});break}case"task.notified":{const w=ts(m??{},"notificationType"),v=ts(m??{},"sourceKind"),b=ts(m??{},"sourceId");if(!w||!v||!b)break;const M=w.startsWith("task.")?w.slice(5):w,R=`task:${b}:${M}`,z=ts(m??{},"title")??"",$=ts(m??{},"severity")??"",T=ts(m??{},"body")??"",E=` +`)}function N8e(){return J1.join(` +`)}function uN(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function v7(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Rr(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:uN(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function rd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function KS(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url,id:e.id}}function Uv(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:KS(e.source)};case"video":return{type:"video",source:KS(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function w7(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Uv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function z8e(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url,id:t.id},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function B8e(e){return{content:e.content.map(z8e),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,dynamic_workflow_mode:e.dynamicWorkflowMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function R8e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function dN(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function F8e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function j8e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(F8e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function fN(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(j8e),createdAt:e.created_at}}function O8e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function P8e(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=O8e(o);return{answers:t,method:e.method,note:e.note}}const H8e=["spawn","fork","resume"],D8e=["requested","default","fork-inherit","resume-existing"],V8e=["caller","policy-default","policy-pool","policy-force","fork-inherit","resume-existing"],W8e=["inherit","default","pool","force"],q8e=["config","default"],U8e=["master-env","env","config","default"];function rc(e,t){return typeof t=="string"&&e.includes(t)?t:void 0}function GS(e){return typeof e=="string"&&e.length>0?e:void 0}function pN(e,t){const n=rc(H8e,e[t.operation]),o=rc(D8e,e[t.profileSource]),s=rc(V8e,e[t.modelSource]),i=rc(W8e,e[t.policyMode]),r=rc(q8e,e[t.policySource]),l=rc(U8e,e[t.featureSource]),a=GS(e[t.routingEnvRevision]),c=GS(e[t.routeDecision]);if(!(n===void 0||o===void 0||s===void 0||i===void 0||r===void 0||l===void 0||a===void 0||c===void 0))return{operation:n,profileSource:o,modelSource:s,policyMode:i,policySource:r,featureSource:l,routingEnvRevision:a,routeDecision:c}}const Z8e={operation:"operation",profileSource:"profile_source",modelSource:"model_source",policyMode:"policy_mode",policySource:"policy_source",featureSource:"feature_source",routingEnvRevision:"routing_env_revision",routeDecision:"route_decision"},K8e={operation:"operation",profileSource:"profileSource",modelSource:"modelSource",policyMode:"policyMode",policySource:"policySource",featureSource:"featureSource",routingEnvRevision:"resolvedFromRoutingEnvironmentRevision",routeDecision:"routeDecisionFingerprint"};function G8e(e){if(!(typeof e!="object"||e===null))return pN(e,Z8e)}function YS(e){if(!(typeof e!="object"||e===null))return pN(e,K8e)}function k4(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,agentId:e.agent_id,model:e.model,thinkingEffort:e.thinking_effort,routing:G8e(e.routing),currentRoutingEnvRevision:e.current_routing_env_revision,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,dynamicWorkflowIndex:e.dynamic_workflow_index,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function XS(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Ta(e,t){const n=e[t];return typeof n=="string"?n:void 0}function lc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ar(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function hN(e){if(!e||typeof e!="object")return null;const t=e,n=Ta(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:Ta(t,"goalId")??Ta(t,"goal_id")??"goal",objective:Ta(t,"objective")??"",completionCriterion:Ta(t,"completionCriterion")??Ta(t,"completion_criterion"),status:n,turnsUsed:lc(t,"turnsUsed")??lc(t,"turns_used")??0,tokensUsed:lc(t,"tokensUsed")??lc(t,"tokens_used")??0,wallClockMs:lc(t,"wallClockMs")??lc(t,"wall_clock_ms")??0,terminalReason:Ta(t,"terminalReason")??Ta(t,"terminal_reason"),budget:{tokenBudget:ar(s,"tokenBudget")??ar(s,"token_budget"),remainingTokens:ar(s,"remainingTokens")??ar(s,"remaining_tokens"),turnBudget:ar(s,"turnBudget")??ar(s,"turn_budget"),remainingTurns:ar(s,"remainingTurns")??ar(s,"remaining_turns"),wallClockBudgetMs:ar(s,"wallClockBudgetMs")??ar(s,"wall_clock_budget_ms"),remainingWallClockMs:ar(s,"remainingWallClockMs")??ar(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Y8e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Rr(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Rr(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":return{type:"sessionArchived",sessionId:t.session_id,workspaceId:t.payload.workspace_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:rd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:rd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:uN(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=hN(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:w7(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Uv),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:dN(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:fN(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:k4(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:y7(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function X8e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort,adaptiveThinking:e.adaptive_thinking}}function Sm(e){return{loginId:e.login_id,state:e.state,defaultModel:e.default_model,message:e.message}}function f2(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function mN(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function J8e(e){return{provider:mN(e.provider),modelsImported:e.models_imported}}function Q8e(e){return Array.isArray(e)?e.map(t=>({id:t.id,enabled:t.enabled===!0,source:t.source,configValue:typeof t.config_value=="boolean"?t.config_value:void 0,defaultEnabled:t.default_enabled===!0,externallyControlled:t.externally_controlled===!0,overridden:t.overridden===!0})):[]}function y7(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,disabledSkills:e.disabled_skills,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function e7e(e){return e.session_id}function t7e(e){return e.seq}const n7e="main",o7e=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function Bl(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function s7e(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}const k7=new Map;function i7e(e){return k7.get(e)}function JS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map,retryReuseMsgId:void 0}}function ts(e,t){const n=e[t];return typeof n=="string"?n:void 0}function V1(e){return e.replaceAll("&","&").replaceAll('"',""").replaceAll("'","'").replaceAll("<","<").replaceAll(">",">")}function U1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function cr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function r7e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ts(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ts(t,"goalId")??ts(t,"goal_id")??"goal",r=ts(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ts(t,"completionCriterion")??ts(t,"completion_criterion"),status:s,turnsUsed:U1(t,"turnsUsed")??U1(t,"turns_used")??0,tokensUsed:U1(t,"tokensUsed")??U1(t,"tokens_used")??0,wallClockMs:U1(t,"wallClockMs")??U1(t,"wall_clock_ms")??0,terminalReason:ts(t,"terminalReason")??ts(t,"terminal_reason"),budget:{tokenBudget:cr(o,"tokenBudget")??cr(o,"token_budget"),remainingTokens:cr(o,"remainingTokens")??cr(o,"remaining_tokens"),turnBudget:cr(o,"turnBudget")??cr(o,"turn_budget"),remainingTurns:cr(o,"remainingTurns")??cr(o,"remaining_turns"),wallClockBudgetMs:cr(o,"wallClockBudgetMs")??cr(o,"wall_clock_budget_ms"),remainingWallClockMs:cr(o,"remainingWallClockMs")??cr(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Q1(e,t,n,o,s=[]){if(typeof n!="string"||n.length===0)return null;const i=e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},l=(i.status==="completed"||i.status==="failed"||i.status==="cancelled")&&o.status==="running"?{...o,status:i.status,subagentPhase:i.subagentPhase,startedAt:i.startedAt,completedAt:i.completedAt,outputPreview:i.outputPreview,outputBytes:i.outputBytes,suspendedReason:i.suspendedReason}:o,a=Object.fromEntries(Object.entries(l).filter(([,u])=>u!==void 0)),c={...i,...a,id:n,agentId:n,sessionId:t,kind:"subagent"};for(const u of s)u in a||delete c[u];return e.subagentMeta.set(n,c),c}function l7e(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ts(t,"name")??ts(t,"toolName")??"tool",o=Gs(a7e(n)),s=c7e(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=ts(n,"text");if(s)return Cm(s);const i=ts(n,"message");if(i)return Cm(i)}const o=ts(t,"message");if(o)return Cm(o)}return null}function a7e(e){return e.replace(/_\d+$/,"")}const QS=2e3;function Cm(e){return e.length>QS?`${e.slice(0,QS)}…`:e}function c7e(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return ta(e,n)}function u7e(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ts(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Q1(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),p=[];return f&&p.push({type:"taskCreated",sessionId:t,task:f}),p.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),p}const r=l7e(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Q1(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function ac(e){return{...e,content:e.content.map(t=>({...t}))}}function eC(e,t,n){const o={id:Bl("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function d7e(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function f7e(e){return Array.isArray(e)?e.map(t=>Uv(t)):[]}function tC(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function p7e(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function h7e(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function nC(e,t){e.messages.find(n=>n.id===t)}function m7e(e,t,n,o,s,i){const r={id:Bl("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function p2(e,t){return e.messages.find(n=>n.id===t)}function oC(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function g7e(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=JS(),e.set(u,d)),d}function o(u){e.set(u,JS())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),p=d.promptId??Bl("pr_");f.currentPromptId=p,f.turnPromptId.set(d.turnId,p);const h=eC(f,u,p);d.thinkingText.length>0&&h.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&h.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const k=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;h.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:k}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=h.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:ac(h)}]}function l(u,d,f,p){try{return c(u,d,f,p)}catch(h){return console.error("[agentProjector] Error projecting event:",u,h instanceof Error?h.message:h),[]}}function a(u,d){return d===void 0?"append":du?"gap":"append"}function c(u,d,f,p){const h=n(f),m=d,k=[],x=m?.agentId;if(typeof x=="string"&&x!==n7e){const v=t.has(x);if(v&&(u==="thinking.delta"||u==="assistant.delta")){const w=m?.delta??"";return w?[{type:"agentDelta",sessionId:f,agentId:x,delta:{[u==="thinking.delta"?"thinking":"text"]:w}}]:[]}if(v&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:x,reason:m?.reason}];if(o7e.has(u))return u7e(h,f,x,u,m??{},t)}switch(u){case"session.meta.updated":{const v=m?.patch?.title??m?.title,w=m?.patch?.lastPrompt,b={};typeof v=="string"&&v.length>0&&(b.title=v),typeof w=="string"&&(b.lastPrompt=w),(b.title!==void 0||b.lastPrompt!==void 0)&&k.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const v=m?.promptId,w=m?.userMessageId;if(!v||!w)break;const b=f7e(m?.content);if(b.length===0)break;h.currentPromptId=v;const M=d7e(h,f,v,w,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());k.push({type:"messageCreated",message:ac(M)});break}case"turn.started":{const v=m?.turnId,w=h.currentPromptId??Bl("pr_");h.currentPromptId=w,v!==void 0&&h.turnPromptId.set(v,w),h.turnTextLen=0,h.turnThinkLen=0,k7.delete(f),k.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const v=m?.turnId;let w=h.turnPromptId.get(v)??h.currentPromptId;if(w||(w=Bl("pr_"),h.currentPromptId=w,v!==void 0&&h.turnPromptId.set(v,w)),h.turnTextLen=0,h.turnThinkLen=0,h.retryReuseMsgId!==void 0){const M=h.retryReuseMsgId;if(h.retryReuseMsgId=void 0,p2(h,M)!==void 0){h.currentAssistantMsgId=M;break}}const b=eC(h,f,w);h.currentAssistantMsgId=b.id,k.push({type:"messageCreated",message:ac(b)});break}case"thinking.delta":{const v=h.currentAssistantMsgId;if(!v)break;const w=m?.delta??"";if(!w)break;p?.offset===0&&h.turnThinkLen>0&&(h.turnThinkLen=0);const b=a(h.turnThinkLen,p?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=tC(h,v,"thinking",w);if(M<0)break;h.turnThinkLen+=w.length,k.push({type:"assistantDelta",sessionId:f,messageId:v,contentIndex:M,delta:{thinking:w}});break}case"assistant.delta":{const v=h.currentAssistantMsgId;if(!v)break;const w=m?.delta??"";if(!w)break;p?.offset===0&&h.turnTextLen>0&&(h.turnTextLen=0);const b=a(h.turnTextLen,p?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const M=tC(h,v,"text",w);if(M<0)break;h.turnTextLen+=w.length,k.push({type:"assistantDelta",sessionId:f,messageId:v,contentIndex:M,delta:{text:w}});break}case"tool.use":case"tool.call.started":{const v=h.currentAssistantMsgId,w=m?.turnId,b=h.turnPromptId.get(w)??h.currentPromptId;if(!v||!b)break;const M=m?.toolCallId,R=m?.name??m?.toolName??"",z=m?.args??m?.input??{};p7e(h,v,M,R,z);const $=p2(h,v);$&&$.content.length-1,h.toolStartTimes.set(M,Date.now()),$&&k.push({type:"messageUpdated",sessionId:f,messageId:v,content:$.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const v=m?.toolCallId,w=h7e(m??{});v&&w&&k.push({type:"toolOutput",sessionId:f,toolCallId:v,outputChunk:w.outputChunk,stream:w.stream});break}case"tool.result":{const v=m?.turnId;let w=h.turnPromptId.get(v)??h.currentPromptId;w||(w=Bl("pr_"),h.currentPromptId=w,v!==void 0&&h.turnPromptId.set(v,w));const b=m?.toolCallId,M=m?.output,R=m?.isError??!1;h.toolStartTimes.get(b)??Date.now(),h.toolStartTimes.delete(b);const z=m7e(h,f,b,M,R,w);k.push({type:"messageCreated",message:ac(z)}),h.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const v=h.currentAssistantMsgId,w=s7e(m?.usage);if(h.totalInput+=w.input,h.totalOutput+=w.output,h.totalCacheRead+=w.cacheRead,h.totalCacheCreate+=w.cacheCreate,v){nC(h,v);const b=p2(h,v);b&&k.push({type:"messageUpdated",sessionId:f,messageId:v,content:b.content.map(M=>({...M})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(h.model=m.model),m?.contextTokens!==void 0&&(h.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(h.contextLimit=m.maxContextTokens),k.push({type:"sessionUsageUpdated",sessionId:f,usage:oC(h),model:h.model||void 0,dynamicWorkflowMode:m?.dynamicWorkflowMode===!0?!0:m?.dynamicWorkflowMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const v=h.currentAssistantMsgId,w=m?.reason??"completed",b=U1(m??{},"durationMs");if(k.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),v){nC(h,v);const R=p2(h,v);R&&k.push({type:"messageUpdated",sessionId:f,messageId:v,content:R.content.map(z=>({...z})),status:w==="failed"||w==="blocked"?"error":"completed",durationMs:b})}h.turnCount++;const M=oC(h);k.push({type:"sessionUsageUpdated",sessionId:f,usage:M}),h.currentAssistantMsgId=void 0,h.currentPromptId=void 0,h.turnTextLen=0,h.turnThinkLen=0,h.retryReuseMsgId=void 0;break}case"prompt.completed":{const v=m?.promptId;typeof v=="string"&&v.length>0&&k.push({type:"promptCompleted",sessionId:f,promptId:v,reason:m?.reason??"completed"});break}case"prompt.aborted":{const v=m?.promptId;typeof v=="string"&&v.length>0&&k.push({type:"promptAborted",sessionId:f,promptId:v});break}case"turn.step.retrying":{const v=h.currentAssistantMsgId;if(v!==void 0){const w=p2(h,v);w!==void 0&&(w.content=w.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),k.push({type:"messageUpdated",sessionId:f,messageId:v,content:w.content.map(b=>({...b})),status:"pending"}),h.retryReuseMsgId=v)}h.turnTextLen=0,h.turnThinkLen=0,h.toolStartTimes.clear();break}case"turn.step.interrupted":{h.currentAssistantMsgId=void 0,h.retryReuseMsgId=void 0;const v=typeof m?.reason=="string"&&m.reason.length>0?m.reason:"error",w=typeof m?.message=="string"&&m.message.length>0?m.message:void 0;k7.set(f,{reason:v,message:w,turnId:typeof m?.turnId=="number"?m.turnId:void 0,at:Date.now()});break}case"subagent.spawned":{const v=typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Bl("task_"),w={id:v,agentId:v,sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,model:typeof m?.model=="string"?m.model:void 0,thinkingEffort:typeof m?.thinkingEffort=="string"?m.thinkingEffort:void 0,routing:YS(m?.routing),currentRoutingEnvRevision:typeof m?.currentRoutingEnvironmentRevision=="string"?m.currentRoutingEnvironmentRevision:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,dynamicWorkflowIndex:typeof m?.dynamicWorkflowIndex=="number"?m.dynamicWorkflowIndex:void 0,runInBackground:m?.runInBackground===!0};h.subagentMeta.set(w.id,w),k.push({type:"taskCreated",sessionId:f,task:w});break}case"subagent.started":{const v=Q1(h,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});v&&k.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.suspended":{const v=Q1(h,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0},["suspendedReason"]);v&&k.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.completed":{const v=typeof m?.resultSummary=="string"?m.resultSummary:void 0,w=Q1(h,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:v});w&&k.push({type:"taskCreated",sessionId:f,task:w}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:v});break}case"subagent.failed":{const v=typeof m?.error=="string"?m.error:void 0,w=Q1(h,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:v});w&&k.push({type:"taskCreated",sessionId:f,task:w}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:v});break}case"task.notified":{const v=ts(m??{},"notificationType"),w=ts(m??{},"sourceKind"),b=ts(m??{},"sourceId");if(!v||!w||!b)break;const M=v.startsWith("task.")?v.slice(5):v,R=`task:${b}:${M}`,z=ts(m??{},"title")??"",$=ts(m??{},"severity")??"",E=ts(m??{},"body")??"",T=` `+(z!==""?`Title: ${V1(z)} `:"")+($!==""?`Severity: ${V1($)} -`:"")+(T!==""?`${V1(T)} -`:"")+"",N={id:`task_ntf_${R}`,sessionId:f,role:"user",content:[{type:"text",text:E}],createdAt:new Date().toISOString(),metadata:{origin:{kind:"task",taskId:b,status:M,notificationId:R}}};h.messages.push(N),k.push({type:"messageCreated",message:lc(N)});break}case"error":{k.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{k.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const w=m?.info??{},v=typeof w.startedAt=="number"?new Date(w.startedAt).toISOString():void 0,b=typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):Bl("task_"),M=typeof w.description=="string"?w.description:typeof w.command=="string"?w.command:yo.global.t("tasks.defaultDescription");if(w.kind==="agent"){const z=typeof w.agentId=="string"&&w.agentId.length>0?w.agentId:void 0;if(z!==void 0){const $=Q1(h,f,z,{description:M,backgroundTaskId:b,model:typeof w.model=="string"?w.model:void 0,thinkingEffort:typeof w.thinkingEffort=="string"?w.thinkingEffort:void 0,runInBackground:!0});$&&k.push({type:"taskCreated",sessionId:f,task:$})}else k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:M,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,subagentPhase:"queued",runInBackground:!0}});break}const R=typeof w.command=="string"?w.command:void 0;k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:M,command:R,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:R!==void 0?`$ ${R}`:void 0}});break}case"task.terminated":{const w=m?.info??{},v=w.status==="failed"||typeof w.exitCode=="number"&&w.exitCode!==0;k.push({type:"taskCompleted",sessionId:f,taskId:typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const w=m?.result??{};k.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof w.tokensBefore=="number"?w.tokensBefore:void 0,tokensAfter:typeof w.tokensAfter=="number"?w.tokensAfter:void 0,summary:typeof w.summary=="string"?w.summary:void 0}),k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{k.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{k.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const w=U8e(m?.snapshot??null);k.push({type:"goalUpdated",sessionId:f,goal:w?.status==="complete"?null:w});break}case"cron.fired":{const w=m?.origin,v=ts(m??{},"prompt");if(w&&typeof w=="object"&&w.kind==="cron_job"&&v){const b={id:Bl("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:w}};h.messages.push(b),k.push({type:"messageCreated",message:lc(b)})}break}}return k}return{project:l,bindNextPromptId:r,seedInFlight:i,reset:o,markSideChannelAgent:s}}const o7e=new Set(["server_hello","ack","ping","resync_required","error","pong"]),tC=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","task.notified","background.task.started","background.task.terminated","cron.fired"]),s7e=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),r7e=new Set(["assistant.delta","thinking.delta"]);function i7e(e,t){if(o7e.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return r7e.has(o)?l7e(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?s7e.has(o)?{route:"protocol"}:tC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:tC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function l7e(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class z2 extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class $l extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function Ur(e){return e instanceof z2||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Uv(e){return e instanceof $l||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Ws="pythinker-web.server-credential",a7e="token",c7e=10080*60*1e3;let gl;const k7=new Set;function u7e(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(a7e);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function b7(e){return{version:1,credential:e,expiresAt:Date.now()+c7e}}function d7e(e){return JSON.stringify(e)}function Zv(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function _7(e){globalThis.localStorage?.setItem(Ws,d7e(e))}function f7e(){try{const e=globalThis.localStorage?.getItem(Ws);if(e){const n=Zv(e);if(n===void 0){const o=b7(e);let s=!1;try{_7(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Ws)===e&&globalThis.localStorage?.removeItem(Ws),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Ws)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Ws),globalThis.localStorage?.getItem(Ws)===e&&globalThis.localStorage?.removeItem(Ws);return}const t=globalThis.sessionStorage?.getItem(Ws);if(t){const n=b7(t);let o=!1;try{_7(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Ws),o=!0}catch{}return o?n:void 0}return}catch{return}}function p7e(){const e=u7e();return e?(pN(e),!0):(gl=f7e(),gl!==void 0)}function fN(){if(gl!==void 0){if(gl.expiresAt<=Date.now()){h7e(gl);return}return gl.credential}}function h7e(e){gl=void 0;try{globalThis.sessionStorage?.removeItem(Ws);const t=globalThis.localStorage?.getItem(Ws),n=t==null?void 0:Zv(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Ws)}catch{}}function pN(e){const t=b7(e);gl=t;try{_7(t)}catch{}try{globalThis.sessionStorage?.removeItem(Ws)}catch{}}function m7e(){const e=gl;gl=void 0;try{const t=globalThis.localStorage?.getItem(Ws),o=(t==null?void 0:Zv(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Ws),globalThis.sessionStorage?.removeItem(Ws)}catch{}}function g7e(e){return k7.add(e),()=>{k7.delete(e)}}function v7e(){m7e();for(const e of k7)try{e()}catch{}}const gc=3e4,P3=5*6e4,hN="0123456789ABCDEFGHJKMNPQRSTVWXYZ",nC=500,mN=40101;function H3(e=gc){try{return AbortSignal.timeout(e)}catch{return}}function w7e(e,t){let n="",o=e;for(let s=0;shN[n%32]).join("")}function D3(){return`${w7e(Date.now(),10)}${y7e(16)}`}function k7e(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Cm(e){try{const t=await e.text();return t?t.length>nC?`${t.slice(0,nC)}...`:t:void 0}catch{return}}class gN{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=Mc(this.origin,t),o=D3(),s={"X-Request-Id":o};this.addClientHeaders(s);const r=Date.now();j3({method:"GET",path:t,url:n,requestId:o});let i;try{i=await fetch(n,{method:"GET",headers:s,signal:H3()})}catch(a){throw Ta({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:a}),new $l({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:gc,timestamp:Date.now(),durationMs:Date.now()-r})}if(i.ok)return sc({method:"GET",path:t,requestId:o,status:i.status,durationMs:Date.now()-r,code:0,msg:""}),i.blob();let l;try{l=await i.clone().json()}catch{}throw this.checkAuthRequired(i,l?.code??0),sc({method:"GET",path:t,requestId:o,status:i.status,durationMs:Date.now()-r,code:l?.code??i.status,msg:l?.msg??i.statusText,envelopeRequestId:l?.request_id}),new z2({code:l?.code??i.status,msg:l?.msg??i.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-r})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",r=Mc(this.origin,t),i=D3(),l={"X-Request-Id":i,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();j3({method:s,path:t,url:r,requestId:i,body:o});let c;try{c=await fetch(r,{method:s,headers:l,body:JSON.stringify(n),signal:H3(P3)})}catch(p){throw Ta({method:s,path:t,requestId:i,phase:"fetch",durationMs:Date.now()-a,error:p}),new $l({message:`Network error calling ${s} ${t}`,cause:p,method:s,path:t,url:r,requestId:i,phase:"fetch",timeoutMs:P3,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let p;try{p=await c.clone().json()}catch{}if(this.checkAuthRequired(c,p?.code??0),!c.ok||p!==void 0&&p.code!==0){const k=p?.code??c.status,x=p?.msg??c.statusText;throw sc({method:s,path:t,requestId:i,status:c.status,durationMs:Date.now()-a,code:k,msg:x,envelopeRequestId:p?.request_id}),new z2({code:k,msg:x,requestId:p?.request_id??i,details:p?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const h=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw Ta({method:s,path:t,requestId:i,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new $l({message:`Invalid ZIP response from ${s} ${t}`,cause:m,method:s,path:t,url:r,requestId:i,phase:"parse",timeoutMs:P3,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await Cm(h),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(p){throw Ta({method:s,path:t,requestId:i,phase:"parse",durationMs:Date.now()-a,status:c.status,error:p}),new $l({message:`Failed to read ZIP response from ${s} ${t}`,cause:p,method:s,path:t,url:r,requestId:i,phase:"parse",timeoutMs:P3,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return sc({method:s,path:t,requestId:i,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=Mc(this.origin,t),s=D3(),r={"X-Request-Id":s};this.addClientHeaders(r);const i=Date.now();j3({method:"POST",path:t,url:o,requestId:s,body:k7e(n)});let l;try{l=await fetch(o,{method:"POST",headers:r,body:n,signal:H3()})}catch(u){throw Ta({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:u}),new $l({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:gc,timestamp:Date.now(),durationMs:Date.now()-i})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Ta({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-i,status:l.status,error:u}),new $l({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:gc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Cm(c),timestamp:Date.now(),durationMs:Date.now()-i})}if(sc({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-i,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new z2({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-i});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,r=[]){let i=Mc(this.origin,n);if(s){const p=new URLSearchParams;for(const[m,k]of Object.entries(s))k!==void 0&&p.set(m,String(k));const h=p.toString();h&&(i=`${i}?${h}`)}const l=D3(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();j3({method:t,path:n,url:i,requestId:l,body:o});let u;try{u=await fetch(i,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:H3()})}catch(p){throw Ta({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new $l({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:i,requestId:l,phase:"fetch",timeoutMs:gc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw Ta({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new $l({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:i,requestId:l,phase:"parse",timeoutMs:gc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Cm(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(sc({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!r.includes(d.code))throw new z2({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=fN();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Pythinker-Client-Id"]=this.identity.clientId,t["X-Pythinker-Client-Name"]=this.identity.clientName,t["X-Pythinker-Client-Version"]=this.identity.clientVersion,t["X-Pythinker-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===mN)&&v7e()}}const b7e="pythinker-code.bearer.",_7e=3e4;class x7e{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];transcriptSubscriptions=new Map;terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),rc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=fN(),n=t!==void 0?[`${b7e}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{rc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const r=JSON.parse(String(s.data));_8e(r),this.handleFrame(r)}catch(r){rc("parse-error",{error:String(r)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(r)}`,!1)}},o.onerror=()=>{rc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{rc("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,rc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,o){this.transcriptSubscriptions.set(t,{agentId:n,sinceSeq:o}),this.connected&&this.sendTranscriptSubscribe(t,n,o)}unsubscribeTranscript(t,n){const o=this.transcriptSubscriptions.get(t);(n===void 0||o===void 0||n.includes(o.agentId))&&this.transcriptSubscriptions.delete(t),!(!this.connected||!this.ws)&&this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=V3(t,n),r=this.terminalAttachments.get(s),i=o??r?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:i}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,i)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(V3(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(V3(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,_7e),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,o=t.type;if(o==="transcript.reset"){const s=oN.safeParse({type:o,...n.payload}),r=n.session_id;if(!s.success||typeof r!="string"){this.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const i=s.data;this.handlers.onTranscriptReset?.(r,i.agent_id,{...i.snapshot,hasMoreOlder:i.has_more_older},i.seq);const l=this.transcriptSubscriptions.get(r);l?.agentId===i.agent_id&&i.seq!==void 0&&(l.sinceSeq=i.seq);return}if(o==="transcript.ops"){const s=sN.safeParse({type:o,...n.payload}),r=n.session_id;if(!s.success||typeof r!="string"){this.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const i=s.data,l=this.handlers.onTranscriptOps?.(r,i.agent_id,i.ops,i.seq),a=this.transcriptSubscriptions.get(r);l!==!1&&a?.agentId===i.agent_id&&i.seq!==void 0&&(a.sinceSeq=i.seq);return}switch(o){case"server_hello":{const s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,r=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:r}),this.handlers.onResync(s,n.payload.current_seq,r);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,r=n.terminal_id,i=n.seq,l=V3(s,r),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,i)});const c=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,r,c,i);break}case"terminal_exit":{const s=n.session_id,r=n.terminal_id,i=n.payload?.exit_code,l=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,r,l);break}default:{this.trackCursor(n);const s=n.type,r=i7e(s,n.payload);if(r.route==="protocol"){this.handlers.onWireEvent(n);break}if(r.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,l=n;this.handlers.onRawAgentEvent({type:r.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const[o,s]of this.transcriptSubscriptions)this.sendTranscriptSubscribe(o,s.agentId,s.sinceSeq);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTranscriptSubscribe(t,n,o){this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:{[n]:"delta"},...o!==void 0?{transcript_since:{[n]:o}}:{}}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const r=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:r})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),b8e(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function V3(e,t){return`${e}\0${t}`}function S7e(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function oC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function C7e(e){return{transport:e.transport,command:e.command,args:e.args,env:e.env,url:e.url,headers:e.headers}}function sC(e){return{transport:e.transport,command:e.command,args:e.args,env:e.env,url:e.url,headers:e.headers}}function rC(e){const t={type:e.type,models:e.models.map(n=>({model:n.model,max_context_size:n.maxContextSize,display_name:n.displayName,capabilities:n.capabilities,max_output_size:n.maxOutputSize,support_efforts:n.supportEfforts,adaptive_thinking:n.adaptiveThinking}))};return"id"in e&&(t.id=e.id),"newId"in e&&e.newId!==void 0&&(t.new_id=e.newId),e.apiKey!==void 0&&(t.api_key=e.apiKey),e.baseUrl!==void 0&&(t.base_url=e.baseUrl),e.defaultModel!==void 0&&(t.default_model=e.defaultModel),t}function Mm(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function iC(e){return e==="auto_compact"||e==="manual_compact"}class M7e{http;config;constructor(t){this.config=t,this.http=new gN(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1",experimentalFlagStates:O8e(t.experimental_flag_states)}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ri),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Ri(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ri(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.dynamicWorkflowMode!==void 0&&(s.dynamic_workflow_mode=n.dynamicWorkflowMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),n.tools!==void 0&&(s.tools=n.tools),n.mcpServers!==void 0&&(s.mcp_servers=n.mcpServers),Object.keys(s).length>0&&(o.agent_config=s);const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ri(r)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,dynamicWorkflowMode:n.dynamic_workflow_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return uN(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ri(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(v7),hasMore:s.has_more}}async getSessionTranscript(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),s=i8e.parse(o);return{agentId:s.agent_id,snapshot:{items:s.items,tasks:s.tasks,interactions:s.interactions,attachments:s.attachments,todos:s.todos,prompts:s.prompts,meta:s.meta,hasMoreOlder:s.has_more},agents:s.agents,pendingInteractions:s.pending_interactions,seq:s.seq}}async getSessionSnapshot(t){const n=Date.now();us("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ri(o.session),messages:o.messages.items.map(v7),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(r=>({toolCallId:r.tool_call_id,name:r.name,args:r.args,description:r.description,lastProgress:r.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(aN),pendingQuestions:o.pending_questions.map(cN),subagents:(o.subagents??[]).map(y4)};return us("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw us("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...oC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),i=`${t}.zip`;return{blob:r.blob,fileName:S7e(r.contentDisposition,i)}}async submitPrompt(t,n){const o=Date.now();us("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,I8e(n));return us("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw us("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...oC(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ri(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ri(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ri)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,L8e(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,B8e(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(y4)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},r=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return y4(r)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Mm)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Mm(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Mm(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source,path:o.path,disableModelInvocation:o.disable_model_invocation}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source,path:o.path,disableModelInvocation:o.disable_model_invocation}))}async listTools(t){return((await this.http.get("/tools",{session_id:t})).tools??[]).map(o=>({name:o.name,description:o.description,inputSchema:o.input_schema,source:o.source,mcpServerId:o.mcp_server_id}))}async listConnectors(){return((await this.http.get("/mcp/servers")).servers??[]).map(n=>({id:n.id,name:n.name,transport:n.transport,status:n.status,toolCount:n.tool_count,lastError:n.last_error,editable:n.editable,definition:n.definition===void 0?void 0:C7e(n.definition)}))}async createConnector(t){return this.http.post("/mcp/servers",{mcp_server_id:t.name,config:sC(t)})}async updateConnector(t,n){return this.http.put(`/mcp/servers/${encodeURIComponent(t)}`,{config:sC(n)})}async removeConnector(t){return this.http.delete(`/mcp/servers/${encodeURIComponent(t)}`)}async restartConnector(t){return this.http.post(`/mcp/servers/${encodeURIComponent(t)}:restart`,{})}async listPlugins(){return((await this.http.get("/plugins")).plugins??[]).map(n=>({id:n.id,displayName:n.display_name,version:n.version,enabled:n.enabled,state:n.state,skillCount:n.skill_count,mcpServerCount:n.mcp_server_count,hasErrors:n.has_errors,source:n.source}))}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:set-enabled`,{enabled:n})}async listSubagents(t){return((await this.http.get("/agent-profiles",{work_dir:t})).profiles??[]).map(o=>({name:o.name,description:o.description,source:o.source,tools:o.tools,model:o.model,effort:o.effort,whenToUse:o.when_to_use}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),r=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([i,l])=>[i,l.map(KS)])):void 0;return{items:s.items.map(KS),childrenByPath:r,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length),n.encoding!==void 0&&(o.encoding=n.encoding);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async writeFile(t,n){const o={path:n.path,content:n.content};n.encoding!==void 0&&(o.encoding=n.encoding),n.baseEtag!==void 0&&(o.base_etag=n.baseEtag);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:write`,o);return{path:s.path,size:s.size,etag:s.etag,created:s.created}}async searchFiles(t,n){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o);return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Mc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async revealSavedPlan(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/transcript/plan:reveal`,{agent_id:n.agentId,tool_call_id:n.toolCallId})}async openInApp(t,n,o,s){const r={app_id:n,path:o};s!==void 0&&(r.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,r)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(rd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return rd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return rd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async generateSessionTitle(t,n){const o={};return n?.force===!0&&(o.force=!0),n?.source!==void 0&&(o.source=n.source),this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,o)}async listModels(){return(await this.http.get("/models")).items.map(F8e)}async listProviders(){return(await this.http.get("/providers")).items.map(d2)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),o=d2(n);return n.api_key===void 0?o:{...o,apiKey:n.api_key}}async addProvider(t){const n=await this.http.post("/providers",rC(t));return d2(n)}async updateProvider(t,n){const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,rC(n));return{provider:d2(o.provider)}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const o=await this.http.post("/providers:import_registry",n);return{providers:o.providers.map(d2),modelsImported:o.models_imported}}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return lC(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return lC(t)}async startCodexLogin(){const t=await this.http.post("/auth/codex:start");return{loginId:t.login_id,authorizeUrl:t.authorize_url,loopback:t.loopback,expiresAt:t.expires_at}}async getCodexLoginStatus(t){const n=await this.http.get(`/auth/codex/${encodeURIComponent(t)}`);return xm(n)}async submitCodexLoginRedirect(t,n){const o=await this.http.post(`/auth/codex/${encodeURIComponent(t)}:submit_code`,{redirect_url:n});return xm(o)}async cancelCodexLogin(t){const n=await this.http.post(`/auth/codex/${encodeURIComponent(t)}:cancel`);return xm(n)}async getConfig(){const t=await this.http.get("/config");return w7(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",disabledSkills:"disabled_skills",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[r,i]of Object.entries(t)){const l=o[r];l!==void 0&&(n[l]=i)}const s=await this.http.post("/config",n);return w7(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Mc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=_4e(this.config.serverHttpUrl,this.config.clientId),o=n7e(),s=new x7e(n,this.config.clientId,{onWireEvent:r=>{const i=P8e(r),l=H8e(r),a=R8e(r);a.type==="historyCompacted"&&!iC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:i,seq:l})},onRawAgentEvent:r=>{const{type:i,seq:l,session_id:a,payload:c,offset:u}=r,d=o.project(i,c,a,{offset:u});for(const f of d){const p=c?.turnId,h=f.type==="assistantDelta"&&typeof p=="number"&&typeof u=="number"&&(i==="assistant.delta"||i==="thinking.delta")?{turnId:p,offset:u,kind:i==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!iC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:h})}},onResync:(r,i,l)=>{o.reset(r),t.onResync(r,i,l)},onConnectionState:r=>{t.onConnectionChange(r)},onError:(r,i,l)=>{t.onError(r,i,l)},onTranscriptReset:(r,i,l,a)=>{t.onTranscriptReset?.(r,i,l,a)},onTranscriptOps:(r,i,l,a)=>t.onTranscriptOps?.(r,i,l,a),onTerminalOutput:(r,i,l,a)=>{t.onTerminalOutput?.(r,i,l,a)},onTerminalExit:(r,i,l)=>{t.onTerminalExit?.(r,i,l)}});return s.connect(),{subscribe(r,i){s.subscribe(r,i??{seq:0})},unsubscribe(r){s.unsubscribe(r)},subscribeTranscript(r,i,l){s.subscribeTranscript(r,i,l)},unsubscribeTranscript(r,i){s.unsubscribeTranscript(r,i)},seedSnapshot(r,i){if(i.inFlightTurn===null){o.reset(r);return}const l=o.seedInFlight(r,i.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:r,seq:i.asOfSeq})},bindNextPromptId(r,i){o.bindNextPromptId(r,i)},abort(r,i){s.abort(r,i)},terminalAttach(r,i,l){s.terminalAttach(r,i,l)},terminalInput(r,i,l){s.terminalInput(r,i,l)},terminalResize(r,i,l,a){s.terminalResize(r,i,l,a)},terminalDetach(r,i){s.terminalDetach(r,i)},terminalClose(r,i){s.terminalClose(r,i)},markSideChannelAgent(r){o.markSideChannelAgent(r)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function lC(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function A7e(e){const t=new gN(e.serverHttpUrl,{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode});return{async listCatalogProviders(){return(await t.get("/catalog/providers")).items.map(dN)},async importCatalogProvider(n){const o={catalog_id:n.catalogId};n.apiKey!==void 0&&(o.api_key=n.apiKey),n.baseUrl!==void 0&&(o.base_url=n.baseUrl),n.id!==void 0&&(o.id=n.id);const s=await t.post("/providers:import_catalog",o);return j8e(s)}}}let Am;function At(){if(Am===void 0){const e=p$();Am=Object.assign(new M7e(e),A7e(e))}return Am}const T7e=["src","controls","muted"],E7e=["aria-label"],I7e=["src","alt"],L7e=["aria-label"],Kv=Ge({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=U(t.fileId?"":t.url),o=U(null),s=U(!t.fileId);let r=null,i=0,l=!1,a=null;function c(){r!==null&&(URL.revokeObjectURL(r),r=null)}async function u(){const d=++i;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await At().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==i){URL.revokeObjectURL(p);return}r=p,n.value=r}catch{if(l||d!==i)return;n.value=t.url}}return Ue(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),xn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),vo(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(g(),S(Me,{key:0},[n.value?(g(),S("video",{key:0,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),src:n.value,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,T7e)):(g(),S("span",{key:1,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),role:"status","aria-label":e.alt||""},null,10,E7e))],64)):n.value?(g(),S("img",{key:1,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),src:n.value,alt:e.alt||"",loading:"lazy"},null,10,I7e)):(g(),S("span",{key:2,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),role:"img","aria-label":e.alt||""},null,10,L7e))}}),$7e=["title","aria-label"],N7e={key:1,class:"media-thumb-media media-thumb-tile","aria-hidden":"true"},z7e={key:2,class:"media-thumb-badge"},B7e={key:3,class:"media-thumb-badge is-error"},R7e={key:4,class:"media-thumb-badge"},F7e=["aria-label"],j7e=Ge({__name:"MediaThumb",props:{kind:{},name:{},url:{},fileId:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=B(()=>n.name?n.name:n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentImage"));function i(l){const a=l.currentTarget;o("activate",a?.querySelector("img")??null)}return(l,a)=>(g(),S("span",{class:Be(["media-thumb",{"is-error":n.error,uploading:n.uploading}])},[_("button",{type:"button",class:"media-thumb-btn",title:r.value,"aria-label":r.value,onClick:i},[n.url?(g(),ce(Kv,{key:0,url:n.url,kind:n.kind,alt:n.name,"file-id":n.fileId,"media-class":"media-thumb-media",controls:!1,muted:""},null,8,["url","kind","alt","file-id"])):(g(),S("span",N7e)),n.uploading?(g(),S("span",z7e,[Z(Go,{size:"sm",label:y(s)("composer.uploading")},null,8,["label"])])):n.error?(g(),S("span",B7e,[Z(Le,{name:"info",size:"sm"})])):n.kind==="video"?(g(),S("span",R7e,[Z(Le,{name:"play",size:"sm"})])):J("",!0)],8,$7e),n.removable?(g(),ce(Cn,{key:0,text:n.removeLabel??y(s)("composer.remove")},{default:ue(()=>[_("button",{type:"button",class:"media-thumb-rm","aria-label":n.removeLabel??y(s)("composer.remove"),onClick:a[0]||(a[0]=c=>o("remove"))},[Z(Le,{name:"close",size:"sm"})],8,F7e)]),_:1},8,["text"])):J("",!0)],2))}}),O7e=mt(j7e,[["__scopeId","data-v-f1799a86"]]),P7e=["title","data-kind"],H7e=["aria-label"],D7e={class:"att-tile"},V7e={class:"att-name"},W7e={key:1,class:"att-err"},q7e=["aria-label"],U7e=Ge({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=B(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),i=B(()=>{const u=r.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=B(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=B(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>e.kind!=="file"&&e.removable?(g(),ce(O7e,{key:0,kind:e.kind,name:e.name,url:e.url,"file-id":e.fileId,uploading:e.uploading,error:e.error,removable:"","remove-label":e.removeLabel,onActivate:d[0]||(d[0]=f=>o("activate")),onRemove:d[1]||(d[1]=f=>o("remove"))},null,8,["kind","name","url","file-id","uploading","error","remove-label"])):(g(),S("span",{key:1,class:Be(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[2]||(d[2]=f=>o("activate"))},[_("span",D7e,[e.kind==="image"&&e.url?(g(),ce(Kv,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(g(),ce(Le,{key:1,name:"play",size:"sm"})):e.kind==="image"?(g(),ce(Le,{key:2,name:"image",size:"sm"})):(g(),ce(Le,{key:3,name:i.value,size:"sm"},null,8,["name"]))]),_("span",V7e,I(l.value),1),e.uploading?(g(),ce(Go,{key:0,size:"sm",label:y(s)("composer.uploading")},null,8,["label"])):e.error?(g(),S("span",W7e,[Z(Le,{name:"info",size:"sm"})])):J("",!0)],8,H7e),e.removable?(g(),ce(Cn,{key:0,text:e.removeLabel??y(s)("composer.remove")},{default:ue(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??y(s)("composer.remove"),onClick:d[3]||(d[3]=f=>o("remove"))},[Z(Le,{name:"close",size:"sm"})],8,q7e)]),_:1},8,["text"])):J("",!0)],10,P7e))}}),x7=mt(U7e,[["__scopeId","data-v-fe5172dd"]]),Z7e=["data-mention-kind","data-mention-name","data-mention-path","tabindex","role","onClick","onKeydown"],K7e=["innerHTML"],G7e={class:"mention-pill-name"},aC=Ge({__name:"ComposerText",props:{text:{},interactive:{type:Boolean,default:!0},openFile:{}},setup(e){const t=e,n=U(null),o=B(()=>i$(t.text));function s(i,l){l.kind!=="file"||!t.interactive||!t.openFile||(i.preventDefault(),i.stopPropagation(),t.openFile({path:l.path}))}function r(i){const l=window.getSelection(),a=n.value;if(!l||l.rangeCount===0||!a||!i.clipboardData)return;const c=l.getRangeAt(0);if(!c.intersectsNode(a))return;const u=c.cloneContents();for(const d of u.querySelectorAll(".mention-pill")){const{mentionKind:f,mentionName:p,mentionPath:h}=d.dataset;f!=="file"&&f!=="folder"&&f!=="skill"||p===void 0||h===void 0||d.replaceWith(document.createTextNode(Mv({kind:f,name:p,path:h})))}i.clipboardData.setData("text/plain",u.textContent??""),i.preventDefault()}return(i,l)=>(g(),S("span",{ref_key:"root",ref:n,class:"composer-text",onCopy:r},[(g(!0),S(Me,null,rt(o.value,(a,c)=>(g(),S(Me,{key:c},[a.type==="text"?(g(),S(Me,{key:0},[He(I(a.value),1)],64)):(g(),S("span",{key:1,class:Be(["mention-pill",`mention-${a.attrs.kind}`]),"data-mention-kind":a.attrs.kind,"data-mention-name":a.attrs.name,"data-mention-path":a.attrs.path,tabindex:a.attrs.kind==="file"&&e.interactive&&e.openFile?0:void 0,role:a.attrs.kind==="file"&&e.interactive&&e.openFile?"button":void 0,onClick:u=>s(u,a.attrs),onKeydown:[Eo(u=>s(u,a.attrs),["enter"]),Eo(u=>s(u,a.attrs),["space"])]},[_("span",{class:"mention-pill-icon","aria-hidden":"true",innerHTML:a.attrs.kind==="skill"?y(ji)("sparkles","sm"):y(mu)(a.attrs.path,a.attrs.name)},null,8,K7e),_("span",G7e,I(y(c$)(a.attrs.name)),1)],42,Z7e))],64))),128))],544))}}),Y7e=["aria-expanded","title"],X7e={class:"tf-sum"},J7e=["inert"],Q7e={class:"tf-body-inner"},ege={key:1,class:"msg"},tge=Ge({__name:"TurnFold",props:{items:{},live:{type:Boolean,default:!1},parked:{type:Boolean,default:!1},seedMs:{default:void 0},createdMs:{default:void 0},endedMs:{default:void 0},streamingTailIndex:{default:null},durationMs:{default:void 0},toolDiffPanel:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=B(()=>n.streamingTailIndex!==null),i=B(()=>n.live?n.parked?"parked":"live":"settled"),l=U(!1),a=B(()=>r.value||l.value),c=U(a.value),u=U(a.value);let d=null;Ue(a,z=>{if(z){if(d!==null&&(clearTimeout(d),d=null),c.value){u.value=!0;return}c.value=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{u.value=!0})});return}u.value=!1,d=setTimeout(()=>{d=null,c.value=!1},200)});const f=pn("pinScroll",()=>{}),p=U(null);function h(){l.value=!l.value,vt(()=>{const z=p.value;z&&f(z)})}const m=U(Date.now());let k=null;function x(){k!==null&&(clearInterval(k),k=null)}Ue(i,(z,$)=>{z!=="settled"?(m.value=Date.now(),k===null&&(k=setInterval(()=>{m.value=Date.now()},1e3))):x(),$==="live"&&z!=="live"&&(l.value=!1)},{immediate:!0}),An(()=>{x(),d!==null&&clearTimeout(d)});const w=B(()=>n.seedMs===void 0?n.createdMs:n.createdMs===void 0?n.seedMs:Math.min(n.seedMs,n.createdMs)),v=B(()=>{if(i.value==="settled")return n.durationMs!==void 0?Math.max(0,n.durationMs):w.value===void 0||n.endedMs===void 0?void 0:Math.max(0,n.endedMs-w.value);if(w.value!==void 0)return Math.max(0,m.value-w.value)}),b=B(()=>{const z=v.value;if(z===void 0)return s("conversation.fold.workedUnknown");const $=_d(z);return $?s("conversation.fold.worked",{duration:$}):s("conversation.fold.workedUnknown")});function M(z){return Ga(z)?!1:n.streamingTailIndex!==null&&"sourceIndex"in z&&z.sourceIndex===n.streamingTailIndex}function R(z){if(n.streamingTailIndex===null)return!1;const $=z.items.at(-1);return $!==void 0&&Ga($)?!1:$!==void 0&&$.sourceIndex===n.streamingTailIndex}return(z,$)=>e.items.length>0?(g(),S("div",{key:0,class:Be(["turn-fold",{open:a.value,streaming:r.value}])},[r.value?J("",!0):(g(),S("button",{key:0,ref_key:"headEl",ref:p,type:"button",class:"tf-head","aria-expanded":l.value,title:b.value,onClick:h},[_("span",X7e,I(b.value),1),Z(Le,{class:"tf-car",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,Y7e)),c.value?(g(),S("div",{key:1,class:Be(["tf-body",{open:u.value}]),inert:!a.value},[_("div",Q7e,[(g(!0),S(Me,null,rt(e.items,(T,E)=>(g(),S(Me,{key:y(DT)(T,E)},[T.kind==="thinking"?(g(),ce(Tg,{key:0,text:T.thinking,mobile:e.mobile,streaming:M(T),"started-at-ms":y(xd)(T.startedAt),"duration-ms":T.durationMs},null,8,["text","mobile","streaming","started-at-ms","duration-ms"])):T.kind==="text"&&T.text?(g(),S("div",ege,[Z(sa,{text:T.text,streaming:M(T),"open-file":N=>o("openFile",N)},null,8,["text","streaming","open-file"])])):T.kind==="activity-run"?(g(),ce(WT,{key:2,items:T.items,mobile:e.mobile,streaming:R(T),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:$[0]||($[0]=N=>o("openMedia",N)),onOpenFile:$[1]||($[1]=N=>o("openFile",N)),onOpenToolDiff:$[2]||($[2]=N=>o("openToolDiff",N)),onOpenAgent:$[3]||($[3]=N=>o("openAgent",N))},null,8,["items","mobile","streaming","tool-diff-panel"])):T.kind==="tool"?(g(),ce(Ag,{key:3,tool:T.tool,mobile:e.mobile,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:$[4]||($[4]=N=>o("openMedia",N)),onOpenFile:$[5]||($[5]=N=>o("openFile",N)),onOpenToolDiff:$[6]||($[6]=N=>o("openToolDiff",N)),onOpenAgent:$[7]||($[7]=N=>o("openAgent",N))},null,8,["tool","mobile","tool-diff-panel"])):T.kind==="notification"?(g(),ce(f$,{key:4,items:T.items},null,8,["items"])):J("",!0)],64))),128))])],10,J7e)):J("",!0)],2)):J("",!0)}}),nge=mt(tge,[["__scopeId","data-v-09401ef9"]]),oge={key:0,class:"ui-card__head"},sge={class:"ui-card__body"},rge={key:1,class:"ui-card__foot"},ige=Ge({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(g(),S("div",oge,[Tn(t.$slots,"head",{},void 0,!0)])):J("",!0),_("div",sge,[Tn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(g(),S("div",rge,[Tn(t.$slots,"foot",{},void 0,!0)])):J("",!0)],2))}}),Gv=mt(ige,[["__scopeId","data-v-d2cab471"]]),lge={class:"tf-ic"},age={class:"tf-title"},cge={key:0,class:"tf-stats"},uge={key:0,class:"tf-add"},dge={key:1,class:"tf-del"},fge={class:"diffbar","aria-hidden":"true"},pge={class:"tf-list"},hge=["innerHTML"],mge={class:"tf-dir"},gge={class:"tf-base"},vge={key:0,class:"tf-stats"},wge={key:0,class:"tf-add"},yge={key:1,class:"tf-del"},kge=Ge({__name:"TurnFilesSummary",props:{changes:{},cwd:{},interactive:{type:Boolean,default:!0}},emits:["openDiff","openFile"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=jo(!1),r=B(()=>s.value?e.changes:e.changes.slice(0,3)),i=B(()=>Math.max(0,e.changes.length-3)),l=B(()=>e.changes.reduce((k,x)=>k+x.added,0)),a=B(()=>e.changes.reduce((k,x)=>k+x.removed,0)),c=B(()=>e.changes.every(k=>!k.statsIncomplete)),u=B(()=>l.value+a.value),d=B(()=>u.value===0?1:l.value),f=B(()=>u.value===0?1:a.value);function p(k){if(!e.cwd)return k;const x=e.cwd.replaceAll("\\","/").replace(/\/$/,""),w=k.replaceAll("\\","/");return w.startsWith(`${x}/`)?w.slice(x.length+1):k}function h(k){const x=p(k).replaceAll("\\","/"),w=x.lastIndexOf("/");return w<0?{dir:"",base:x}:{dir:x.slice(0,w+1),base:x.slice(w+1)}}function m(k){e.interactive&&(k.hasWrite?n("openFile",{path:k.path}):n("openDiff",k))}return(k,x)=>(g(),ce(Gv,{class:"turn-files"},dd({head:ue(()=>[_("span",lge,[Z(Le,{name:"pencil",size:"sm"})]),_("span",age,I(y(o)(e.changes.length===1?"conversation.turnFiles.titleOne":"conversation.turnFiles.titleOther",{number:e.changes.length})),1),c.value&&u.value>0?(g(),S("span",cge,[l.value>0?(g(),S("span",uge,"+"+I(l.value),1)):J("",!0),a.value>0?(g(),S("span",dge,"−"+I(a.value),1)):J("",!0),_("span",fge,[_("span",{class:"seg-add",style:Wt({flexGrow:d.value})},null,4),_("span",{class:"seg-del",style:Wt({flexGrow:f.value})},null,4)])])):J("",!0)]),default:ue(()=>[_("ul",pge,[(g(!0),S(Me,null,rt(r.value,w=>(g(),S("li",{key:w.path,class:"tf-row"},[(g(),ce(ns(e.interactive?"button":"span"),{type:e.interactive?"button":void 0,class:"tf-file",onClick:v=>m(w)},{default:ue(()=>[_("span",{class:"tf-ficon","aria-hidden":"true",innerHTML:y(mu)(w.path)},null,8,hge),_("span",mge,I(h(w.path).dir),1),_("span",gge,I(h(w.path).base),1)]),_:2},1032,["type","onClick"])),!w.statsIncomplete&&(w.added>0||w.removed>0)?(g(),S("span",vge,[w.added>0?(g(),S("span",wge,"+"+I(w.added),1)):J("",!0),w.removed>0?(g(),S("span",yge,"−"+I(w.removed),1)):J("",!0)])):J("",!0)]))),128))])]),_:2},[i.value>0?{name:"foot",fn:ue(()=>[Z(It,{class:"tf-more",variant:"ghost",size:"sm",onClick:x[0]||(x[0]=w=>s.value=!s.value)},{default:ue(()=>[Z(Le,{class:Be(["tf-more-car",{open:s.value}]),name:"chevron-down",size:"sm"},null,8,["class"]),He(" "+I(s.value?y(o)("conversation.turnFiles.showLess"):y(o)(i.value===1?"conversation.turnFiles.moreOne":"conversation.turnFiles.more",{number:i.value})),1)]),_:1})]),key:"0"}:void 0]),1024))}}),bge=mt(kge,[["__scopeId","data-v-11486090"]]),_ge=["src"],xge=6,Sge=300,Cge=6,Mge=250,Age=Ge({__name:"MascotSprite",props:{state:{},size:{default:48}},setup(e){const t=xge*Sge,n=Cge*Mge,o=e,s=U("laptop");let r;const i=B(()=>{const d=o.size;return{width:`${d}px`,height:`${d*208/192}px`}}),l=B(()=>o.state==="failed"?"/brand/mascot-failed.png":`/brand/mascot-${s.value}.png`);function a(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function c(){r!==void 0&&(clearTimeout(r),r=void 0)}function u(){if(c(),o.state==="failed"||a())return;const d=s.value==="laptop"?t:n;r=setTimeout(()=>{r=void 0,s.value=s.value==="laptop"?"review":"laptop",u()},d)}return xn(u),An(c),Ue(()=>o.state==="failed",d=>{if(d){c();return}s.value="laptop",u()}),(d,f)=>(g(),S("img",{"aria-hidden":"true",class:"mascot-apng",src:l.value,style:Wt(i.value)},null,12,_ge))}}),Tge=mt(Age,[["__scopeId","data-v-c03cab60"]]),Ege={class:"working-indicator",role:"status"},Ige={class:"wi-mascot","aria-hidden":"true"},Lge={class:"wi-label ui-shimmer"},$ge=Ge({__name:"WorkingIndicator",props:{label:{}},setup(e){return(t,n)=>(g(),S("div",Ege,[_("span",Ige,[Z(Tge,{state:"running",size:40})]),_("span",Lge,I(e.label),1)]))}}),Nge=mt($ge,[["__scopeId","data-v-934cc635"]]),fl=U(null),Zc=U(!1);function Yv(e){const t=fl.value;!t||Zc.value||(fl.value=null,t.resolve(e))}async function zge(){const e=fl.value;if(!(!e||Zc.value)){if(!e.action){Yv(!0);return}Zc.value=!0;try{await e.action(),fl.value===e&&(fl.value=null),e.resolve(!0)}catch(t){fl.value===e&&(fl.value=null),e.reject(t)}finally{Zc.value=!1}}}function Bge(e){return Zc.value?Promise.resolve(!1):(fl.value&&Yv(!1),new Promise((t,n)=>{fl.value={...e,resolve:t,reject:n}}))}function y1(){return{current:fl,busy:Zc,confirm:Bge,settle:Yv,runAction:zge}}const Rge=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,Fge=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,jge=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,cC="text/plain;charset=utf-8";function Oge(e,t){const n=(t??"").toLowerCase();if(Rge.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:cC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:Fge.test(o)?cC:jge.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function vN(e,t,n){const o=Oge(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const r=await At().getFileBlob(e).catch(()=>null);if(r===null)return s?.close(),"failed";const i=URL.createObjectURL(new Blob([r],{type:o}));if(s!==null)s.location.href=i;else{const l=document.createElement("a");l.href=i,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(i)},6e4),"previewed"}function Pge(e){const t=e.replaceAll("\\","/");let n="",o=t,s=!1;const r=/^\/\/([^/]+\/[^/]+)(\/|$)/.exec(t);r?(n=`//${r[1].toLowerCase()}/`,o=t.slice(r[0].length-(r[0].endsWith("/")?1:0)),s=!0):/^[a-zA-Z]:\//.test(t)?(n=`${t[0].toLowerCase()}:/`,o=t.slice(3),s=!0):t.startsWith("/")&&(n="/",o=t.slice(1));const i=n!=="",l=[];for(const c of o.split("/"))!c||c==="."||(c===".."?l.length>0&&l.at(-1)!==".."?l.pop():i||l.push(c):l.push(c));const a=n+l.join("/");return s?a.toLowerCase():a}function Hge(e,t){let n=0,o=0;for(const s of e)s.oldNo!==void 0&&(n=Math.max(n,s.oldNo)),s.newNo!==void 0&&(o=Math.max(o,s.newNo));return t.map(s=>({...s,oldNo:s.oldNo===void 0?void 0:s.oldNo+n,newNo:s.newNo===void 0?void 0:s.newNo+o}))}function Dge(e){const t=new Map;for(const n of Ka(e)){if(n.kind!=="tool"||n.tool.status==="error")continue;const o=sr(n.tool.name);if(o!=="edit"&&o!=="multi_edit"&&o!=="write")continue;const s=Mg(n.tool.arg);if(!s)continue;const r=o==="write",i=r?null:Cg(n.tool),l=i?FT(i):{added:0,removed:0},a=r||i===null,c=Pge(s),u=t.get(c);if(!u){t.set(c,{path:s,...l,hasWrite:r,statsIncomplete:a,diff:i});continue}u.added+=l.added,u.removed+=l.removed,u.hasWrite||=r,u.statsIncomplete||=a,u.diff!==null&&i!==null?u.diff=[...u.diff,{type:"hunk",text:"···"},...Hge(u.diff,i)]:u.diff=null}return[...t.values()]}const Vge={class:"chat"},Wge={key:0,class:"chat-loading"},qge={class:"chat-loading-text"},Uge={key:1,class:"chat-empty"},Zge={key:1,class:"top-sentinel-text"},Kge={key:0,class:"u-turn"},Gge=["data-turn-id"],Yge={key:0,class:"u-atts"},Xge={key:1,class:"skill-act"},Jge={class:"skill-act-head"},Qge=["aria-expanded","onClick"],eve={key:0,class:"u-meta"},tve=["aria-label","onClick"],nve=["aria-label","onClick"],ove=["data-turn-id"],sve=["onClick"],rve={class:"cd-view"},ive={key:1,class:"cd-label"},lve=["data-turn-id"],ave={key:1,class:"msg"},cve={key:1,class:"a-msg-ft"},uve={key:0,class:"a-duration"},dve=["aria-label","onClick"],fve={key:3,class:"turn-failed",role:"alert"},pve={class:"tf-chip","aria-hidden":"true"},hve={class:"tf-main"},mve={class:"tf-title"},gve=["title"],vve={key:5,class:"sending-placeholder"},wve={key:6,class:"q-stack"},yve={class:"q-head"},kve={class:"q-title"},bve=["onDragover","onDrop"],_ve=["aria-label","onClick"],xve={class:"u-bub q-bub"},Sve=["title","onDragstart"],Cve=["title","onClick"],Mve={key:0,class:"u-text q-text"},Ave={key:1,class:"q-text q-text-placeholder"},Tve={key:0,class:"q-imgs"},Eve={key:0,class:"q-file"},Ive=["aria-label","onClick"],Lve={key:0,class:"open-unsupported",role:"status"},$ve=2500,Nve=Ge({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},questions:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},inspector:{type:Boolean,default:!1},lastTurnReason:{},turnErrorKind:{},turnErrorMessage:{},cwd:{},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openCompaction","openAgent","openToolDiff","openTurnDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue","steerQueued","continueTurn"],setup(e,{expose:t,emit:n}){const{t:o}=Lt(),{confirm:s}=y1();An(()=>{for(const me of x.values())me.disconnect();x.clear(),k.clear(),et!==null&&(clearTimeout(et),et=null),ee!==null&&(clearTimeout(ee),ee=null),q!==null&&(clearTimeout(q),q=null),ve!==null&&(clearTimeout(ve),ve=null)});const r=e,i=U(null);let l=null;function a(){!i.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(me=>{me[0]?.isIntersecting&&r.hasMoreMessages&&!r.loadingMore&&!r.loadingMoreError&&!r.sessionLoading&&!r.isFollowing&&p("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(i.value))}xn(a),An(()=>{l?.disconnect(),l=null}),Ue(()=>[r.hasMoreMessages,r.loadingMore,r.loadingMoreError],()=>{vt().then(a)});const c=B(()=>{if(!r.turnActive||r.turns.length===0)return null;const me=r.turns.at(-1);return me.role==="assistant"?me.id:null}),u=B(()=>r.working),d=B(()=>{const me=new Map;for(const be of r.turns){if(be.role!=="assistant")continue;const re=Jee(be),{folded:ke,visible:Fe}=Qee(re);me.set(be.id,{all:re,folded:ke,visible:Fe,changes:Dge(be)})}return me}),f=B(()=>{const me=r.turns.at(-1);if(me?.role!=="assistant")return o("conversation.requesting");const be=d.value.get(me.id)?.all.some(re=>re.kind==="text"?re.text.trim().length>0:!0);return o(be?"conversation.working":"conversation.requesting")}),p=n,h=U({}),m=U({}),k=new Map,x=new Map;function w(me){const re=k.get(me)?.querySelector(".u-text");if(!re)return;const ke=Number.parseFloat(getComputedStyle(re).lineHeight)||24;m.value[me]=re.scrollHeight>ke*10+1}function v(me,be){const re=be instanceof HTMLElement?be:null;if(!re){x.get(me)?.disconnect(),x.delete(me),k.delete(me);return}if(k.get(me)!==re){if(x.get(me)?.disconnect(),k.set(me,re),typeof ResizeObserver<"u"){const ke=new ResizeObserver(()=>w(me));ke.observe(re.querySelector(".u-text")??re),x.set(me,ke)}vt(()=>w(me))}}function b(me){h.value[me]=!h.value[me]}const M=U(null),R=U(null);function z(me){return(me.attachments?.length??0)>0}function $(me){p("editQueued",me)}function T(me,be){if(M.value=me,!be.dataTransfer)return;be.dataTransfer.effectAllowed="move",be.dataTransfer.setData("text/plain",String(me));const re=be.currentTarget?.closest(".q-turn");re&&be.dataTransfer.setDragImage(re,24,24)}function E(me,be){if(M.value===null)return;be.preventDefault(),be.dataTransfer&&(be.dataTransfer.dropEffect="move");const re=be.currentTarget.getBoundingClientRect(),ke=be.clientY{for(let me=r.turns.length-1;me>=0;me--)if(r.turns[me].role==="user")return r.turns[me].id;return null});function H(me){return!r.readOnly&&me.role==="user"&&me.id===O.value&&!r.working&&!me.pluginCommand&&!(me.skillActivation&&!n3e(me.skillActivation,{revivePill:!1}))}function V(me){return me.skillActivation?o3e(me.skillActivation):me.pluginCommand?me.pluginCommand.args||null:me.text||null}function A(me){const be=me.compaction,re=be?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof be?.tokensBefore=="number"&&typeof be?.tokensAfter=="number"?re+o("conversation.compactedTokens",{before:na(be.tokensBefore),after:na(be.tokensAfter)}):re}const F=U(null),j=U(null);let q=null;async function P(me){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&W(me)}function W(me){if(j.value!==null)return;j.value=me.id;const be=me.skillActivation?a$(me.skillActivation,{revivePill:!1})??me.text:me.text;p("editMessage",{text:be,attachments:me.attachments}),q=setTimeout(()=>{q=null,j.value=null},$ve)}Ue(()=>r.turns,me=>{j.value!==null&&(me.some(be=>be.id===j.value)||(j.value=null,q!==null&&(clearTimeout(q),q=null)))},{flush:"post"});const G=U(!1);let ee=null;function se(){if(r.turns.length===0)return;const me=[];for(const re of r.turns){if(re.role==="compaction"||re.role==="cron")continue;const ke=re.role==="user"?"User":"Assistant",Fe=tte(re);Fe.trim()&&me.push(`**${ke}** +`:"")+(E!==""?`${V1(E)} +`:"")+"",N={id:`task_ntf_${R}`,sessionId:f,role:"user",content:[{type:"text",text:T}],createdAt:new Date().toISOString(),metadata:{origin:{kind:"task",taskId:b,status:M,notificationId:R}}};h.messages.push(N),k.push({type:"messageCreated",message:ac(N)});break}case"error":{k.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{k.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const v=m?.info??{},w=typeof v.startedAt=="number"?new Date(v.startedAt).toISOString():void 0,b=typeof v.taskId=="string"?v.taskId:typeof v.taskId=="number"?String(v.taskId):Bl("task_"),M=typeof v.description=="string"?v.description:typeof v.command=="string"?v.command:yo.global.t("tasks.defaultDescription");if(v.kind==="agent"){const z=typeof v.agentId=="string"&&v.agentId.length>0?v.agentId:void 0;if(z!==void 0){const $=Q1(h,f,z,{description:M,backgroundTaskId:b,model:typeof v.model=="string"?v.model:void 0,thinkingEffort:typeof v.thinkingEffort=="string"?v.thinkingEffort:void 0,routing:YS(v.routing),currentRoutingEnvRevision:typeof v.currentRoutingEnvironmentRevision=="string"?v.currentRoutingEnvironmentRevision:void 0,runInBackground:!0});$&&k.push({type:"taskCreated",sessionId:f,task:$})}else k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:M,status:"running",createdAt:w??new Date().toISOString(),startedAt:w,subagentPhase:"queued",runInBackground:!0}});break}const R=typeof v.command=="string"?v.command:void 0;k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:M,command:R,status:"running",createdAt:w??new Date().toISOString(),startedAt:w,outputPreview:R!==void 0?`$ ${R}`:void 0}});break}case"task.terminated":{const v=m?.info??{},w=v.status==="failed"||typeof v.exitCode=="number"&&v.exitCode!==0;k.push({type:"taskCompleted",sessionId:f,taskId:typeof v.taskId=="string"?v.taskId:typeof v.taskId=="number"?String(v.taskId):"",status:w?"failed":"completed"});break}case"compaction.completed":{const v=m?.result??{};k.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof v.tokensBefore=="number"?v.tokensBefore:void 0,tokensAfter:typeof v.tokensAfter=="number"?v.tokensAfter:void 0,summary:typeof v.summary=="string"?v.summary:void 0}),k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{k.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{k.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const v=r7e(m?.snapshot??null);k.push({type:"goalUpdated",sessionId:f,goal:v?.status==="complete"?null:v});break}case"cron.fired":{const v=m?.origin,w=ts(m??{},"prompt");if(v&&typeof v=="object"&&v.kind==="cron_job"&&w){const b={id:Bl("cron_"),sessionId:f,role:"user",content:[{type:"text",text:w}],createdAt:new Date().toISOString(),metadata:{origin:v}};h.messages.push(b),k.push({type:"messageCreated",message:ac(b)})}break}}return k}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const v7e=new Set(["server_hello","ack","ping","resync_required","error","pong"]),sC=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","task.notified","background.task.started","background.task.terminated","cron.fired"]),w7e=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),y7e=new Set(["assistant.delta","thinking.delta"]);function k7e(e,t){if(v7e.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return y7e.has(o)?b7e(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?w7e.has(o)?{route:"protocol"}:sC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:sC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function b7e(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class B2 extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class $l extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function Ui(e){return e instanceof B2||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Zv(e){return e instanceof $l||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Ws="pythinker-web.server-credential",_7e="token",x7e=10080*60*1e3;let gl;const b7=new Set;function S7e(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(_7e);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function _7(e){return{version:1,credential:e,expiresAt:Date.now()+x7e}}function C7e(e){return JSON.stringify(e)}function Kv(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function x7(e){globalThis.localStorage?.setItem(Ws,C7e(e))}function M7e(){try{const e=globalThis.localStorage?.getItem(Ws);if(e){const n=Kv(e);if(n===void 0){const o=_7(e);let s=!1;try{x7(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Ws)===e&&globalThis.localStorage?.removeItem(Ws),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Ws)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Ws),globalThis.localStorage?.getItem(Ws)===e&&globalThis.localStorage?.removeItem(Ws);return}const t=globalThis.sessionStorage?.getItem(Ws);if(t){const n=_7(t);let o=!1;try{x7(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Ws),o=!0}catch{}return o?n:void 0}return}catch{return}}function A7e(){const e=S7e();return e?(vN(e),!0):(gl=M7e(),gl!==void 0)}function gN(){if(gl!==void 0){if(gl.expiresAt<=Date.now()){E7e(gl);return}return gl.credential}}function E7e(e){gl=void 0;try{globalThis.sessionStorage?.removeItem(Ws);const t=globalThis.localStorage?.getItem(Ws),n=t==null?void 0:Kv(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Ws)}catch{}}function vN(e){const t=_7(e);gl=t;try{x7(t)}catch{}try{globalThis.sessionStorage?.removeItem(Ws)}catch{}}function T7e(){const e=gl;gl=void 0;try{const t=globalThis.localStorage?.getItem(Ws),o=(t==null?void 0:Kv(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Ws),globalThis.sessionStorage?.removeItem(Ws)}catch{}}function I7e(e){return b7.add(e),()=>{b7.delete(e)}}function L7e(){T7e();for(const e of b7)try{e()}catch{}}const vc=3e4,H3=5*6e4,wN="0123456789ABCDEFGHJKMNPQRSTVWXYZ",iC=500,yN=40101;function D3(e=vc){try{return AbortSignal.timeout(e)}catch{return}}function $7e(e,t){let n="",o=e;for(let s=0;swN[n%32]).join("")}function V3(){return`${$7e(Date.now(),10)}${N7e(16)}`}function z7e(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Mm(e){try{const t=await e.text();return t?t.length>iC?`${t.slice(0,iC)}...`:t:void 0}catch{return}}class kN{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=Ac(this.origin,t),o=V3(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();O3({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:D3()})}catch(a){throw Ea({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new $l({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:vc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return sc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),sc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new B2({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=Ac(this.origin,t),r=V3(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();O3({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:D3(H3)})}catch(p){throw Ea({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:p}),new $l({message:`Network error calling ${s} ${t}`,cause:p,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:H3,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let p;try{p=await c.clone().json()}catch{}if(this.checkAuthRequired(c,p?.code??0),!c.ok||p!==void 0&&p.code!==0){const k=p?.code??c.status,x=p?.msg??c.statusText;throw sc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:k,msg:x,envelopeRequestId:p?.request_id}),new B2({code:k,msg:x,requestId:p?.request_id??r,details:p?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const h=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw Ea({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new $l({message:`Invalid ZIP response from ${s} ${t}`,cause:m,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:H3,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await Mm(h),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(p){throw Ea({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:p}),new $l({message:`Failed to read ZIP response from ${s} ${t}`,cause:p,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:H3,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return sc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=Ac(this.origin,t),s=V3(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();O3({method:"POST",path:t,url:o,requestId:s,body:z7e(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:D3()})}catch(u){throw Ea({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new $l({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:vc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Ea({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new $l({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:vc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Mm(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(sc({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new B2({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=Ac(this.origin,n);if(s){const p=new URLSearchParams;for(const[m,k]of Object.entries(s))k!==void 0&&p.set(m,String(k));const h=p.toString();h&&(r=`${r}?${h}`)}const l=V3(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();O3({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:D3()})}catch(p){throw Ea({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:p}),new $l({message:`Network error calling ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:vc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(p){throw Ea({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:p}),new $l({message:`Failed to parse JSON response from ${t} ${n}`,cause:p,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:vc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Mm(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(sc({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new B2({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=gN();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Pythinker-Client-Id"]=this.identity.clientId,t["X-Pythinker-Client-Name"]=this.identity.clientName,t["X-Pythinker-Client-Version"]=this.identity.clientVersion,t["X-Pythinker-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===yN)&&L7e()}}const B7e="pythinker-code.bearer.",R7e=3e4;class F7e{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];transcriptSubscriptions=new Map;terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),ic("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=gN(),n=t!==void 0?[`${B7e}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{ic("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));A8e(i),this.handleFrame(i)}catch(i){ic("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{ic("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{ic("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,ic("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,o){this.transcriptSubscriptions.set(t,{agentId:n,sinceSeq:o}),this.connected&&this.sendTranscriptSubscribe(t,n,o)}unsubscribeTranscript(t,n){const o=this.transcriptSubscriptions.get(t);(n===void 0||o===void 0||n.includes(o.agentId))&&this.transcriptSubscriptions.delete(t),!(!this.connected||!this.ws)&&this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=W3(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(W3(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(W3(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,R7e),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,o=t.type;if(o==="transcript.reset"){const s=rN.safeParse({type:o,...n.payload}),i=n.session_id;if(!s.success||typeof i!="string"){this.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=s.data;this.handlers.onTranscriptReset?.(i,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(i);l?.agentId===r.agent_id&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(o==="transcript.ops"){const s=lN.safeParse({type:o,...n.payload}),i=n.session_id;if(!s.success||typeof i!="string"){this.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=s.data,l=this.handlers.onTranscriptOps?.(i,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(i);l!==!1&&a?.agentId===r.agent_id&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(o){case"server_hello":{const s=n.payload?.heartbeat_ms;typeof s=="number"&&s>0&&(this.heartbeatMs=s),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,i=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:i}),this.handlers.onResync(s,n.payload.current_seq,i);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,i=n.terminal_id,r=n.seq,l=W3(s,i),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const c=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,i,c,r);break}case"terminal_exit":{const s=n.session_id,i=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.handlers.onTerminalExit?.(s,i,l);break}default:{this.trackCursor(n);const s=n.type,i=k7e(s,n.payload);if(i.route==="protocol"){this.handlers.onWireEvent(n);break}if(i.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.handlers.onRawAgentEvent({type:i.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const[o,s]of this.transcriptSubscriptions)this.sendTranscriptSubscribe(o,s.agentId,s.sinceSeq);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTranscriptSubscribe(t,n,o){this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:{[n]:"delta"},...o!==void 0?{transcript_since:{[n]:o}}:{}}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),M8e(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function W3(e,t){return`${e}\0${t}`}function j7e(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function rC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function O7e(e){return{transport:e.transport,command:e.command,args:e.args,env:e.env,url:e.url,headers:e.headers}}function lC(e){return{transport:e.transport,command:e.command,args:e.args,env:e.env,url:e.url,headers:e.headers}}function aC(e){const t={type:e.type,models:e.models.map(n=>({model:n.model,max_context_size:n.maxContextSize,display_name:n.displayName,capabilities:n.capabilities,max_output_size:n.maxOutputSize,support_efforts:n.supportEfforts,adaptive_thinking:n.adaptiveThinking}))};return"id"in e&&(t.id=e.id),"newId"in e&&e.newId!==void 0&&(t.new_id=e.newId),e.apiKey!==void 0&&(t.api_key=e.apiKey),e.baseUrl!==void 0&&(t.base_url=e.baseUrl),e.defaultModel!==void 0&&(t.default_model=e.defaultModel),t}function Am(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function cC(e){return e==="auto_compact"||e==="manual_compact"}class P7e{http;config;constructor(t){this.config=t,this.http=new kN(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1",experimentalFlagStates:Q8e(t.experimental_flag_states)}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Rr),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Rr(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Rr(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.dynamicWorkflowMode!==void 0&&(s.dynamic_workflow_mode=n.dynamicWorkflowMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),n.tools!==void 0&&(s.tools=n.tools),n.mcpServers!==void 0&&(s.mcp_servers=n.mcpServers),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Rr(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,dynamicWorkflowMode:n.dynamic_workflow_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return hN(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Rr(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(w7),hasMore:s.has_more}}async getSessionTranscript(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),s=d8e.parse(o);return{agentId:s.agent_id,snapshot:{items:s.items,tasks:s.tasks,interactions:s.interactions,attachments:s.attachments,todos:s.todos,prompts:s.prompts,meta:s.meta,hasMoreOlder:s.has_more},agents:s.agents,pendingInteractions:s.pending_interactions,seq:s.seq}}async getSessionSnapshot(t){const n=Date.now();us("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Rr(o.session),messages:o.messages.items.map(w7),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(dN),pendingQuestions:o.pending_questions.map(fN),subagents:(o.subagents??[]).map(k4)};return us("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw us("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...rC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:j7e(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();us("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,B8e(n));return us("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw us("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...rC(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Rr(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Rr(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Rr)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,R8e(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,P8e(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(k4)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return k4(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Am)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Am(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Am(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source,path:o.path,disableModelInvocation:o.disable_model_invocation}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source,path:o.path,disableModelInvocation:o.disable_model_invocation}))}async listTools(t){return((await this.http.get("/tools",{session_id:t})).tools??[]).map(o=>({name:o.name,description:o.description,inputSchema:o.input_schema,source:o.source,mcpServerId:o.mcp_server_id}))}async listConnectors(){return((await this.http.get("/mcp/servers")).servers??[]).map(n=>({id:n.id,name:n.name,transport:n.transport,status:n.status,toolCount:n.tool_count,lastError:n.last_error,editable:n.editable,definition:n.definition===void 0?void 0:O7e(n.definition)}))}async createConnector(t){return this.http.post("/mcp/servers",{mcp_server_id:t.name,config:lC(t)})}async updateConnector(t,n){return this.http.put(`/mcp/servers/${encodeURIComponent(t)}`,{config:lC(n)})}async removeConnector(t){return this.http.delete(`/mcp/servers/${encodeURIComponent(t)}`)}async restartConnector(t){return this.http.post(`/mcp/servers/${encodeURIComponent(t)}:restart`,{})}async listPlugins(){return((await this.http.get("/plugins")).plugins??[]).map(n=>({id:n.id,displayName:n.display_name,version:n.version,enabled:n.enabled,state:n.state,skillCount:n.skill_count,mcpServerCount:n.mcp_server_count,hasErrors:n.has_errors,source:n.source}))}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:set-enabled`,{enabled:n})}async listSubagents(t){return((await this.http.get("/agent-profiles",{work_dir:t})).profiles??[]).map(o=>({name:o.name,description:o.description,source:o.source,tools:o.tools,model:o.model,effort:o.effort,whenToUse:o.when_to_use}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(XS)])):void 0;return{items:s.items.map(XS),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length),n.encoding!==void 0&&(o.encoding=n.encoding);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async writeFile(t,n){const o={path:n.path,content:n.content};n.encoding!==void 0&&(o.encoding=n.encoding),n.baseEtag!==void 0&&(o.base_etag=n.baseEtag);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:write`,o);return{path:s.path,size:s.size,etag:s.etag,created:s.created}}async searchFiles(t,n){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Ac(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async revealSavedPlan(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/transcript/plan:reveal`,{agent_id:n.agentId,tool_call_id:n.toolCallId})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(rd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return rd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return rd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async generateSessionTitle(t,n){const o={};return n?.force===!0&&(o.force=!0),n?.source!==void 0&&(o.source=n.source),this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,o)}async listModels(){return(await this.http.get("/models")).items.map(X8e)}async listProviders(){return(await this.http.get("/providers")).items.map(f2)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),o=f2(n);return n.api_key===void 0?o:{...o,apiKey:n.api_key}}async addProvider(t){const n=await this.http.post("/providers",aC(t));return f2(n)}async updateProvider(t,n){const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,aC(n));return{provider:f2(o.provider)}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const o=await this.http.post("/providers:import_registry",n);return{providers:o.providers.map(f2),modelsImported:o.models_imported}}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return uC(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return uC(t)}async startCodexLogin(){const t=await this.http.post("/auth/codex:start");return{loginId:t.login_id,authorizeUrl:t.authorize_url,loopback:t.loopback,expiresAt:t.expires_at}}async getCodexLoginStatus(t){const n=await this.http.get(`/auth/codex/${encodeURIComponent(t)}`);return Sm(n)}async submitCodexLoginRedirect(t,n){const o=await this.http.post(`/auth/codex/${encodeURIComponent(t)}:submit_code`,{redirect_url:n});return Sm(o)}async cancelCodexLogin(t){const n=await this.http.post(`/auth/codex/${encodeURIComponent(t)}:cancel`);return Sm(n)}async getConfig(){const t=await this.http.get("/config");return y7(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",disabledSkills:"disabled_skills",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return y7(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Ac(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=A4e(this.config.serverHttpUrl,this.config.clientId),o=g7e(),s=new F7e(n,this.config.clientId,{onWireEvent:i=>{const r=e7e(i),l=t7e(i),a=Y8e(i);a.type==="historyCompacted"&&!cC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d){const p=c?.turnId,h=f.type==="assistantDelta"&&typeof p=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:p,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!cC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:h})}},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTranscriptReset:(i,r,l,a)=>{t.onTranscriptReset?.(i,r,l,a)},onTranscriptOps:(i,r,l,a)=>t.onTranscriptOps?.(i,r,l,a),onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},subscribeTranscript(i,r,l){s.subscribeTranscript(i,r,l)},unsubscribeTranscript(i,r){s.unsubscribeTranscript(i,r)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function uC(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function H7e(e){const t=new kN(e.serverHttpUrl,{clientId:e.clientId,clientName:e.clientName,clientVersion:e.clientVersion,clientUiMode:e.clientUiMode});return{async listCatalogProviders(){return(await t.get("/catalog/providers")).items.map(mN)},async importCatalogProvider(n){const o={catalog_id:n.catalogId};n.apiKey!==void 0&&(o.api_key=n.apiKey),n.baseUrl!==void 0&&(o.base_url=n.baseUrl),n.id!==void 0&&(o.id=n.id);const s=await t.post("/providers:import_catalog",o);return J8e(s)}}}let Em;function At(){if(Em===void 0){const e=g$();Em=Object.assign(new P7e(e),H7e(e))}return Em}const D7e=["src","controls","muted"],V7e=["aria-label"],W7e=["src","alt"],q7e=["aria-label"],Gv=Ge({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=U(t.fileId?"":t.url),o=U(null),s=U(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await At().getFileBlob(t.fileId),p=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(p);return}i=p,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ue(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),xn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),vo(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(g(),S(Me,{key:0},[n.value?(g(),S("video",{key:0,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),src:n.value,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,D7e)):(g(),S("span",{key:1,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),role:"status","aria-label":e.alt||""},null,10,V7e))],64)):n.value?(g(),S("img",{key:1,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),src:n.value,alt:e.alt||"",loading:"lazy"},null,10,W7e)):(g(),S("span",{key:2,ref_key:"mediaEl",ref:o,class:Be(e.mediaClass),role:"img","aria-label":e.alt||""},null,10,q7e))}}),U7e=["title","aria-label"],Z7e={key:1,class:"media-thumb-media media-thumb-tile","aria-hidden":"true"},K7e={key:2,class:"media-thumb-badge"},G7e={key:3,class:"media-thumb-badge is-error"},Y7e={key:4,class:"media-thumb-badge"},X7e=["aria-label"],J7e=Ge({__name:"MediaThumb",props:{kind:{},name:{},url:{},fileId:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=B(()=>n.name?n.name:n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentImage"));function r(l){const a=l.currentTarget;o("activate",a?.querySelector("img")??null)}return(l,a)=>(g(),S("span",{class:Be(["media-thumb",{"is-error":n.error,uploading:n.uploading}])},[_("button",{type:"button",class:"media-thumb-btn",title:i.value,"aria-label":i.value,onClick:r},[n.url?(g(),ce(Gv,{key:0,url:n.url,kind:n.kind,alt:n.name,"file-id":n.fileId,"media-class":"media-thumb-media",controls:!1,muted:""},null,8,["url","kind","alt","file-id"])):(g(),S("span",Z7e)),n.uploading?(g(),S("span",K7e,[Z(Go,{size:"sm",label:y(s)("composer.uploading")},null,8,["label"])])):n.error?(g(),S("span",G7e,[Z(Le,{name:"info",size:"sm"})])):n.kind==="video"?(g(),S("span",Y7e,[Z(Le,{name:"play",size:"sm"})])):J("",!0)],8,U7e),n.removable?(g(),ce(Cn,{key:0,text:n.removeLabel??y(s)("composer.remove")},{default:ue(()=>[_("button",{type:"button",class:"media-thumb-rm","aria-label":n.removeLabel??y(s)("composer.remove"),onClick:a[0]||(a[0]=c=>o("remove"))},[Z(Le,{name:"close",size:"sm"})],8,X7e)]),_:1},8,["text"])):J("",!0)],2))}}),Q7e=mt(J7e,[["__scopeId","data-v-f1799a86"]]),ege=["title","data-kind"],tge=["aria-label"],nge={class:"att-tile"},oge={class:"att-name"},sge={key:1,class:"att-err"},ige=["aria-label"],rge=Ge({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=B(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=B(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=B(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=B(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>e.kind!=="file"&&e.removable?(g(),ce(Q7e,{key:0,kind:e.kind,name:e.name,url:e.url,"file-id":e.fileId,uploading:e.uploading,error:e.error,removable:"","remove-label":e.removeLabel,onActivate:d[0]||(d[0]=f=>o("activate")),onRemove:d[1]||(d[1]=f=>o("remove"))},null,8,["kind","name","url","file-id","uploading","error","remove-label"])):(g(),S("span",{key:1,class:Be(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[2]||(d[2]=f=>o("activate"))},[_("span",nge,[e.kind==="image"&&e.url?(g(),ce(Gv,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(g(),ce(Le,{key:1,name:"play",size:"sm"})):e.kind==="image"?(g(),ce(Le,{key:2,name:"image",size:"sm"})):(g(),ce(Le,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",oge,I(l.value),1),e.uploading?(g(),ce(Go,{key:0,size:"sm",label:y(s)("composer.uploading")},null,8,["label"])):e.error?(g(),S("span",sge,[Z(Le,{name:"info",size:"sm"})])):J("",!0)],8,tge),e.removable?(g(),ce(Cn,{key:0,text:e.removeLabel??y(s)("composer.remove")},{default:ue(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??y(s)("composer.remove"),onClick:d[3]||(d[3]=f=>o("remove"))},[Z(Le,{name:"close",size:"sm"})],8,ige)]),_:1},8,["text"])):J("",!0)],10,ege))}}),S7=mt(rge,[["__scopeId","data-v-fe5172dd"]]),lge=["data-mention-kind","data-mention-name","data-mention-path","tabindex","role","onClick","onKeydown"],age=["innerHTML"],cge={class:"mention-pill-name"},dC=Ge({__name:"ComposerText",props:{text:{},interactive:{type:Boolean,default:!0},openFile:{}},setup(e){const t=e,n=U(null),o=B(()=>c$(t.text));function s(r,l){l.kind!=="file"||!t.interactive||!t.openFile||(r.preventDefault(),r.stopPropagation(),t.openFile({path:l.path}))}function i(r){const l=window.getSelection(),a=n.value;if(!l||l.rangeCount===0||!a||!r.clipboardData)return;const c=l.getRangeAt(0);if(!c.intersectsNode(a))return;const u=c.cloneContents();for(const d of u.querySelectorAll(".mention-pill")){const{mentionKind:f,mentionName:p,mentionPath:h}=d.dataset;f!=="file"&&f!=="folder"&&f!=="skill"||p===void 0||h===void 0||d.replaceWith(document.createTextNode(Av({kind:f,name:p,path:h})))}r.clipboardData.setData("text/plain",u.textContent??""),r.preventDefault()}return(r,l)=>(g(),S("span",{ref_key:"root",ref:n,class:"composer-text",onCopy:i},[(g(!0),S(Me,null,it(o.value,(a,c)=>(g(),S(Me,{key:c},[a.type==="text"?(g(),S(Me,{key:0},[He(I(a.value),1)],64)):(g(),S("span",{key:1,class:Be(["mention-pill",`mention-${a.attrs.kind}`]),"data-mention-kind":a.attrs.kind,"data-mention-name":a.attrs.name,"data-mention-path":a.attrs.path,tabindex:a.attrs.kind==="file"&&e.interactive&&e.openFile?0:void 0,role:a.attrs.kind==="file"&&e.interactive&&e.openFile?"button":void 0,onClick:u=>s(u,a.attrs),onKeydown:[To(u=>s(u,a.attrs),["enter"]),To(u=>s(u,a.attrs),["space"])]},[_("span",{class:"mention-pill-icon","aria-hidden":"true",innerHTML:a.attrs.kind==="skill"?y(jr)("sparkles","sm"):y(gu)(a.attrs.path,a.attrs.name)},null,8,age),_("span",cge,I(y(f$)(a.attrs.name)),1)],42,lge))],64))),128))],544))}}),uge=["aria-expanded","title"],dge={class:"tf-sum"},fge=["inert"],pge={class:"tf-body-inner"},hge={key:1,class:"msg"},mge=Ge({__name:"TurnFold",props:{items:{},live:{type:Boolean,default:!1},parked:{type:Boolean,default:!1},seedMs:{default:void 0},createdMs:{default:void 0},endedMs:{default:void 0},streamingTailIndex:{default:null},durationMs:{default:void 0},toolDiffPanel:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=B(()=>n.streamingTailIndex!==null),r=B(()=>n.live?n.parked?"parked":"live":"settled"),l=U(!1),a=B(()=>i.value||l.value),c=U(a.value),u=U(a.value);let d=null;Ue(a,z=>{if(z){if(d!==null&&(clearTimeout(d),d=null),c.value){u.value=!0;return}c.value=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{u.value=!0})});return}u.value=!1,d=setTimeout(()=>{d=null,c.value=!1},200)});const f=pn("pinScroll",()=>{}),p=U(null);function h(){l.value=!l.value,vt(()=>{const z=p.value;z&&f(z)})}const m=U(Date.now());let k=null;function x(){k!==null&&(clearInterval(k),k=null)}Ue(r,(z,$)=>{z!=="settled"?(m.value=Date.now(),k===null&&(k=setInterval(()=>{m.value=Date.now()},1e3))):x(),$==="live"&&z!=="live"&&(l.value=!1)},{immediate:!0}),An(()=>{x(),d!==null&&clearTimeout(d)});const v=B(()=>n.seedMs===void 0?n.createdMs:n.createdMs===void 0?n.seedMs:Math.min(n.seedMs,n.createdMs)),w=B(()=>{if(r.value==="settled")return n.durationMs!==void 0?Math.max(0,n.durationMs):v.value===void 0||n.endedMs===void 0?void 0:Math.max(0,n.endedMs-v.value);if(v.value!==void 0)return Math.max(0,m.value-v.value)}),b=B(()=>{const z=w.value;if(z===void 0)return s("conversation.fold.workedUnknown");const $=xd(z);return $?s("conversation.fold.worked",{duration:$}):s("conversation.fold.workedUnknown")});function M(z){return Ga(z)?!1:n.streamingTailIndex!==null&&"sourceIndex"in z&&z.sourceIndex===n.streamingTailIndex}function R(z){if(n.streamingTailIndex===null)return!1;const $=z.items.at(-1);return $!==void 0&&Ga($)?!1:$!==void 0&&$.sourceIndex===n.streamingTailIndex}return(z,$)=>e.items.length>0?(g(),S("div",{key:0,class:Be(["turn-fold",{open:a.value,streaming:i.value}])},[i.value?J("",!0):(g(),S("button",{key:0,ref_key:"headEl",ref:p,type:"button",class:"tf-head","aria-expanded":l.value,title:b.value,onClick:h},[_("span",dge,I(b.value),1),Z(Le,{class:"tf-car",name:"chevron-right",size:"sm","aria-hidden":"true"})],8,uge)),c.value?(g(),S("div",{key:1,class:Be(["tf-body",{open:u.value}]),inert:!a.value},[_("div",pge,[(g(!0),S(Me,null,it(e.items,(E,T)=>(g(),S(Me,{key:y(qE)(E,T)},[E.kind==="thinking"?(g(),ce(Tg,{key:0,text:E.thinking,mobile:e.mobile,streaming:M(E),"started-at-ms":y(Sd)(E.startedAt),"duration-ms":E.durationMs},null,8,["text","mobile","streaming","started-at-ms","duration-ms"])):E.kind==="text"&&E.text?(g(),S("div",hge,[Z(sa,{text:E.text,streaming:M(E),"open-file":N=>o("openFile",N)},null,8,["text","streaming","open-file"])])):E.kind==="activity-run"?(g(),ce(ZE,{key:2,items:E.items,mobile:e.mobile,streaming:R(E),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:$[0]||($[0]=N=>o("openMedia",N)),onOpenFile:$[1]||($[1]=N=>o("openFile",N)),onOpenToolDiff:$[2]||($[2]=N=>o("openToolDiff",N)),onOpenAgent:$[3]||($[3]=N=>o("openAgent",N))},null,8,["items","mobile","streaming","tool-diff-panel"])):E.kind==="tool"?(g(),ce(Eg,{key:3,tool:E.tool,mobile:e.mobile,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:$[4]||($[4]=N=>o("openMedia",N)),onOpenFile:$[5]||($[5]=N=>o("openFile",N)),onOpenToolDiff:$[6]||($[6]=N=>o("openToolDiff",N)),onOpenAgent:$[7]||($[7]=N=>o("openAgent",N))},null,8,["tool","mobile","tool-diff-panel"])):E.kind==="notification"?(g(),ce(m$,{key:4,items:E.items},null,8,["items"])):J("",!0)],64))),128))])],10,fge)):J("",!0)],2)):J("",!0)}}),gge=mt(mge,[["__scopeId","data-v-09401ef9"]]),vge={key:0,class:"ui-card__head"},wge={class:"ui-card__body"},yge={key:1,class:"ui-card__foot"},kge=Ge({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(g(),S("div",vge,[En(t.$slots,"head",{},void 0,!0)])):J("",!0),_("div",wge,[En(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(g(),S("div",yge,[En(t.$slots,"foot",{},void 0,!0)])):J("",!0)],2))}}),Yv=mt(kge,[["__scopeId","data-v-d2cab471"]]),bge={class:"tf-ic"},_ge={class:"tf-title"},xge={key:0,class:"tf-stats"},Sge={key:0,class:"tf-add"},Cge={key:1,class:"tf-del"},Mge={class:"diffbar","aria-hidden":"true"},Age={class:"tf-list"},Ege=["innerHTML"],Tge={class:"tf-dir"},Ige={class:"tf-base"},Lge={key:0,class:"tf-stats"},$ge={key:0,class:"tf-add"},Nge={key:1,class:"tf-del"},zge=Ge({__name:"TurnFilesSummary",props:{changes:{},cwd:{},interactive:{type:Boolean,default:!0}},emits:["openDiff","openFile"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=jo(!1),i=B(()=>s.value?e.changes:e.changes.slice(0,3)),r=B(()=>Math.max(0,e.changes.length-3)),l=B(()=>e.changes.reduce((k,x)=>k+x.added,0)),a=B(()=>e.changes.reduce((k,x)=>k+x.removed,0)),c=B(()=>e.changes.every(k=>!k.statsIncomplete)),u=B(()=>l.value+a.value),d=B(()=>u.value===0?1:l.value),f=B(()=>u.value===0?1:a.value);function p(k){if(!e.cwd)return k;const x=e.cwd.replaceAll("\\","/").replace(/\/$/,""),v=k.replaceAll("\\","/");return v.startsWith(`${x}/`)?v.slice(x.length+1):k}function h(k){const x=p(k).replaceAll("\\","/"),v=x.lastIndexOf("/");return v<0?{dir:"",base:x}:{dir:x.slice(0,v+1),base:x.slice(v+1)}}function m(k){e.interactive&&(k.hasWrite?n("openFile",{path:k.path}):n("openDiff",k))}return(k,x)=>(g(),ce(Yv,{class:"turn-files"},fd({head:ue(()=>[_("span",bge,[Z(Le,{name:"pencil",size:"sm"})]),_("span",_ge,I(y(o)(e.changes.length===1?"conversation.turnFiles.titleOne":"conversation.turnFiles.titleOther",{number:e.changes.length})),1),c.value&&u.value>0?(g(),S("span",xge,[l.value>0?(g(),S("span",Sge,"+"+I(l.value),1)):J("",!0),a.value>0?(g(),S("span",Cge,"−"+I(a.value),1)):J("",!0),_("span",Mge,[_("span",{class:"seg-add",style:Wt({flexGrow:d.value})},null,4),_("span",{class:"seg-del",style:Wt({flexGrow:f.value})},null,4)])])):J("",!0)]),default:ue(()=>[_("ul",Age,[(g(!0),S(Me,null,it(i.value,v=>(g(),S("li",{key:v.path,class:"tf-row"},[(g(),ce(ns(e.interactive?"button":"span"),{type:e.interactive?"button":void 0,class:"tf-file",onClick:w=>m(v)},{default:ue(()=>[_("span",{class:"tf-ficon","aria-hidden":"true",innerHTML:y(gu)(v.path)},null,8,Ege),_("span",Tge,I(h(v.path).dir),1),_("span",Ige,I(h(v.path).base),1)]),_:2},1032,["type","onClick"])),!v.statsIncomplete&&(v.added>0||v.removed>0)?(g(),S("span",Lge,[v.added>0?(g(),S("span",$ge,"+"+I(v.added),1)):J("",!0),v.removed>0?(g(),S("span",Nge,"−"+I(v.removed),1)):J("",!0)])):J("",!0)]))),128))])]),_:2},[r.value>0?{name:"foot",fn:ue(()=>[Z(It,{class:"tf-more",variant:"ghost",size:"sm",onClick:x[0]||(x[0]=v=>s.value=!s.value)},{default:ue(()=>[Z(Le,{class:Be(["tf-more-car",{open:s.value}]),name:"chevron-down",size:"sm"},null,8,["class"]),He(" "+I(s.value?y(o)("conversation.turnFiles.showLess"):y(o)(r.value===1?"conversation.turnFiles.moreOne":"conversation.turnFiles.more",{number:r.value})),1)]),_:1})]),key:"0"}:void 0]),1024))}}),Bge=mt(zge,[["__scopeId","data-v-11486090"]]),Rge=["src"],Fge=6,jge=300,Oge=6,Pge=250,Hge=Ge({__name:"MascotSprite",props:{state:{},size:{default:48}},setup(e){const t=Fge*jge,n=Oge*Pge,o=e,s=U("laptop");let i;const r=B(()=>{const d=o.size;return{width:`${d}px`,height:`${d*208/192}px`}}),l=B(()=>o.state==="failed"?"/brand/mascot-failed.png":`/brand/mascot-${s.value}.png`);function a(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function c(){i!==void 0&&(clearTimeout(i),i=void 0)}function u(){if(c(),o.state==="failed"||a())return;const d=s.value==="laptop"?t:n;i=setTimeout(()=>{i=void 0,s.value=s.value==="laptop"?"review":"laptop",u()},d)}return xn(u),An(c),Ue(()=>o.state==="failed",d=>{if(d){c();return}s.value="laptop",u()}),(d,f)=>(g(),S("img",{"aria-hidden":"true",class:"mascot-apng",src:l.value,style:Wt(r.value)},null,12,Rge))}}),Dge=mt(Hge,[["__scopeId","data-v-c03cab60"]]),Vge={class:"working-indicator",role:"status"},Wge={class:"wi-mascot","aria-hidden":"true"},qge={class:"wi-label ui-shimmer"},Uge=Ge({__name:"WorkingIndicator",props:{label:{}},setup(e){return(t,n)=>(g(),S("div",Vge,[_("span",Wge,[Z(Dge,{state:"running",size:40})]),_("span",qge,I(e.label),1)]))}}),Zge=mt(Uge,[["__scopeId","data-v-934cc635"]]),fl=U(null),Kc=U(!1);function Xv(e){const t=fl.value;!t||Kc.value||(fl.value=null,t.resolve(e))}async function Kge(){const e=fl.value;if(!(!e||Kc.value)){if(!e.action){Xv(!0);return}Kc.value=!0;try{await e.action(),fl.value===e&&(fl.value=null),e.resolve(!0)}catch(t){fl.value===e&&(fl.value=null),e.reject(t)}finally{Kc.value=!1}}}function Gge(e){return Kc.value?Promise.resolve(!1):(fl.value&&Xv(!1),new Promise((t,n)=>{fl.value={...e,resolve:t,reject:n}}))}function y1(){return{current:fl,busy:Kc,confirm:Gge,settle:Xv,runAction:Kge}}const Yge=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,Xge=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,Jge=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,fC="text/plain;charset=utf-8";function Qge(e,t){const n=(t??"").toLowerCase();if(Yge.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:fC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:Xge.test(o)?fC:Jge.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function bN(e,t,n){const o=Qge(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await At().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}function eve(e){const t=e.replaceAll("\\","/");let n="",o=t,s=!1;const i=/^\/\/([^/]+\/[^/]+)(\/|$)/.exec(t);i?(n=`//${i[1].toLowerCase()}/`,o=t.slice(i[0].length-(i[0].endsWith("/")?1:0)),s=!0):/^[a-zA-Z]:\//.test(t)?(n=`${t[0].toLowerCase()}:/`,o=t.slice(3),s=!0):t.startsWith("/")&&(n="/",o=t.slice(1));const r=n!=="",l=[];for(const c of o.split("/"))!c||c==="."||(c===".."?l.length>0&&l.at(-1)!==".."?l.pop():r||l.push(c):l.push(c));const a=n+l.join("/");return s?a.toLowerCase():a}function tve(e,t){let n=0,o=0;for(const s of e)s.oldNo!==void 0&&(n=Math.max(n,s.oldNo)),s.newNo!==void 0&&(o=Math.max(o,s.newNo));return t.map(s=>({...s,oldNo:s.oldNo===void 0?void 0:s.oldNo+n,newNo:s.newNo===void 0?void 0:s.newNo+o}))}function nve(e){const t=new Map;for(const n of Ka(e)){if(n.kind!=="tool"||n.tool.status==="error")continue;const o=si(n.tool.name);if(o!=="edit"&&o!=="multi_edit"&&o!=="write")continue;const s=Ag(n.tool.arg);if(!s)continue;const i=o==="write",r=i?null:Mg(n.tool),l=r?PE(r):{added:0,removed:0},a=i||r===null,c=eve(s),u=t.get(c);if(!u){t.set(c,{path:s,...l,hasWrite:i,statsIncomplete:a,diff:r});continue}u.added+=l.added,u.removed+=l.removed,u.hasWrite||=i,u.statsIncomplete||=a,u.diff!==null&&r!==null?u.diff=[...u.diff,{type:"hunk",text:"···"},...tve(u.diff,r)]:u.diff=null}return[...t.values()]}const ove={class:"chat"},sve={key:0,class:"chat-loading"},ive={class:"chat-loading-text"},rve={key:1,class:"chat-empty"},lve={key:1,class:"top-sentinel-text"},ave={key:0,class:"u-turn"},cve=["data-turn-id"],uve={key:0,class:"u-atts"},dve={key:1,class:"skill-act"},fve={class:"skill-act-head"},pve=["aria-expanded","onClick"],hve={key:0,class:"u-meta"},mve=["aria-label","onClick"],gve=["aria-label","onClick"],vve=["data-turn-id"],wve=["onClick"],yve={class:"cd-view"},kve={key:1,class:"cd-label"},bve=["data-turn-id"],_ve={key:1,class:"msg"},xve={key:1,class:"a-msg-ft"},Sve={key:0,class:"a-duration"},Cve=["aria-label","onClick"],Mve={key:3,class:"turn-failed",role:"alert"},Ave={class:"tf-chip","aria-hidden":"true"},Eve={class:"tf-main"},Tve={class:"tf-title"},Ive=["title"],Lve={key:5,class:"sending-placeholder"},$ve={key:6,class:"q-stack"},Nve={class:"q-head"},zve={class:"q-title"},Bve=["onDragover","onDrop"],Rve=["aria-label","onClick"],Fve={class:"u-bub q-bub"},jve=["title","onDragstart"],Ove=["title","onClick"],Pve={key:0,class:"u-text q-text"},Hve={key:1,class:"q-text q-text-placeholder"},Dve={key:0,class:"q-imgs"},Vve={key:0,class:"q-file"},Wve=["aria-label","onClick"],qve={key:0,class:"open-unsupported",role:"status"},Uve=2500,Zve=Ge({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},questions:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},inspector:{type:Boolean,default:!1},lastTurnReason:{},turnErrorKind:{},turnErrorMessage:{},cwd:{},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openCompaction","openAgent","openToolDiff","openTurnDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue","steerQueued","continueTurn"],setup(e,{expose:t,emit:n}){const{t:o}=Lt(),{confirm:s}=y1();An(()=>{for(const me of x.values())me.disconnect();x.clear(),k.clear(),et!==null&&(clearTimeout(et),et=null),ee!==null&&(clearTimeout(ee),ee=null),q!==null&&(clearTimeout(q),q=null),ve!==null&&(clearTimeout(ve),ve=null)});const i=e,r=U(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(me=>{me[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&p("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}xn(a),An(()=>{l?.disconnect(),l=null}),Ue(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{vt().then(a)});const c=B(()=>{if(!i.turnActive||i.turns.length===0)return null;const me=i.turns.at(-1);return me.role==="assistant"?me.id:null}),u=B(()=>i.working),d=B(()=>{const me=new Map;for(const be of i.turns){if(be.role!=="assistant")continue;const ie=ote(be),{folded:ke,visible:Fe}=ste(ie);me.set(be.id,{all:ie,folded:ke,visible:Fe,changes:nve(be)})}return me}),f=B(()=>{const me=i.turns.at(-1);if(me?.role!=="assistant")return o("conversation.requesting");const be=d.value.get(me.id)?.all.some(ie=>ie.kind==="text"?ie.text.trim().length>0:!0);return o(be?"conversation.working":"conversation.requesting")}),p=n,h=U({}),m=U({}),k=new Map,x=new Map;function v(me){const ie=k.get(me)?.querySelector(".u-text");if(!ie)return;const ke=Number.parseFloat(getComputedStyle(ie).lineHeight)||24;m.value[me]=ie.scrollHeight>ke*10+1}function w(me,be){const ie=be instanceof HTMLElement?be:null;if(!ie){x.get(me)?.disconnect(),x.delete(me),k.delete(me);return}if(k.get(me)!==ie){if(x.get(me)?.disconnect(),k.set(me,ie),typeof ResizeObserver<"u"){const ke=new ResizeObserver(()=>v(me));ke.observe(ie.querySelector(".u-text")??ie),x.set(me,ke)}vt(()=>v(me))}}function b(me){h.value[me]=!h.value[me]}const M=U(null),R=U(null);function z(me){return(me.attachments?.length??0)>0}function $(me){p("editQueued",me)}function E(me,be){if(M.value=me,!be.dataTransfer)return;be.dataTransfer.effectAllowed="move",be.dataTransfer.setData("text/plain",String(me));const ie=be.currentTarget?.closest(".q-turn");ie&&be.dataTransfer.setDragImage(ie,24,24)}function T(me,be){if(M.value===null)return;be.preventDefault(),be.dataTransfer&&(be.dataTransfer.dropEffect="move");const ie=be.currentTarget.getBoundingClientRect(),ke=be.clientY{for(let me=i.turns.length-1;me>=0;me--)if(i.turns[me].role==="user")return i.turns[me].id;return null});function H(me){return!i.readOnly&&me.role==="user"&&me.id===O.value&&!i.working&&!me.pluginCommand&&!(me.skillActivation&&!l3e(me.skillActivation,{revivePill:!1}))}function V(me){return me.skillActivation?a3e(me.skillActivation):me.pluginCommand?me.pluginCommand.args||null:me.text||null}function A(me){const be=me.compaction,ie=be?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof be?.tokensBefore=="number"&&typeof be?.tokensAfter=="number"?ie+o("conversation.compactedTokens",{before:na(be.tokensBefore),after:na(be.tokensAfter)}):ie}const F=U(null),j=U(null);let q=null;async function P(me){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&W(me)}function W(me){if(j.value!==null)return;j.value=me.id;const be=me.skillActivation?d$(me.skillActivation,{revivePill:!1})??me.text:me.text;p("editMessage",{text:be,attachments:me.attachments}),q=setTimeout(()=>{q=null,j.value=null},Uve)}Ue(()=>i.turns,me=>{j.value!==null&&(me.some(be=>be.id===j.value)||(j.value=null,q!==null&&(clearTimeout(q),q=null)))},{flush:"post"});const G=U(!1);let ee=null;function se(){if(i.turns.length===0)return;const me=[];for(const ie of i.turns){if(ie.role==="compaction"||ie.role==="cron")continue;const ke=ie.role==="user"?"User":"Assistant",Fe=rte(ie);Fe.trim()&&me.push(`**${ke}** ${Fe}`)}const be=me.join(` --- -`);ss(be).then(re=>{re&&(G.value=!0,p("copyConversationCopied"),ee!==null&&clearTimeout(ee),ee=setTimeout(()=>{ee=null,G.value=!1},2e3))}).catch(()=>{})}function oe(me){const be=[];for(let re=me;re>=0;re--){const ke=r.turns[re];if(!ke||ke.role!=="assistant")break;be.unshift(ke)}return be}function Q(me){return oe(me).map(be=>ete(be)).filter(Boolean).join(` +`);ss(be).then(ie=>{ie&&(G.value=!0,p("copyConversationCopied"),ee!==null&&clearTimeout(ee),ee=setTimeout(()=>{ee=null,G.value=!1},2e3))}).catch(()=>{})}function oe(me){const be=[];for(let ie=me;ie>=0;ie--){const ke=i.turns[ie];if(!ke||ke.role!=="assistant")break;be.unshift(ke)}return be}function Q(me){return oe(me).map(be=>ite(be)).filter(Boolean).join(` -`)}function ge(){for(let me=r.turns.length-1;me>=0;me-=1)if(r.turns[me]?.role==="assistant")return Q(me);return""}function xe(){const me=ge();me.trim()&&ss(me).then(be=>{be&&(G.value=!0,p("copyConversationCopied"),ee!==null&&clearTimeout(ee),ee=setTimeout(()=>{ee=null,G.value=!1},2e3))}).catch(()=>{})}t({copyConversation:se,copyFinalSummary:xe});function Ke(me){const be=r.turns[me];if(!be||be.role!=="assistant")return!1;const re=r.turns[me+1];return!re||re.role!=="assistant"}let et=null;function Y(me){const be=r.turns[me];if(!be)return;const re=Q(me);re.trim()&&ss(re).then(ke=>{ke&&(F.value=be.id,et!==null&&clearTimeout(et),et=setTimeout(()=>{et=null,F.value=null},1400))}).catch(()=>{})}function ne(me){const be=me.text;be.trim()&&ss(be).then(re=>{re&&(F.value=me.id,et!==null&&clearTimeout(et),et=setTimeout(()=>{et=null,F.value=null},1400))}).catch(()=>{})}function D(me){return{kind:me.kind==="video"?"video":"image",url:me.url,path:me.name,fileId:me.fileId}}const X=U(null);let ve=null;function fe(me){if(me.kind==="image"||me.kind==="video"){p("openMedia",D(me));return}me.fileId!==void 0&&vN(me.fileId,me.name,me.mediaType).then(be=>{be==="unsupported"&&(X.value=me.name??me.fileId??"",ve!==null&&clearTimeout(ve),ve=setTimeout(()=>{ve=null,X.value=null},2400))})}function pe(me,be){return me.id!==c.value||Ga(be)?!1:be.sourceIndex===Ka(me).length-1}function te(me){if(me.id!==c.value)return null;const be=Ka(me),re=be.at(-1);if(re!==void 0&&Ga(re))return null;if(re?.kind==="tool"&&re.tool.status==="running"){const ke=re.tool.id;if(r.approvals.some(at=>at.toolCallId===ke)||(r.questions??[]).some(at=>at.toolCallId===ke))return null}return be.length-1}function de(me){if(!me.createdAt)return;const be=Date.parse(me.createdAt);return Number.isFinite(be)?be:void 0}function ye(me,be){if(me.id!==c.value)return!1;const re=be.items.at(-1);return re!==void 0&&Ga(re)?!1:re!==void 0&&re.sourceIndex===Ka(me).length-1}function Ce(){p("continueTurn",o("conversation.turnFailedResumeText"))}return(me,be)=>(g(),S(Me,null,[_("div",Vge,[e.sessionLoading?(g(),S("div",Wge,[Z(Go,{size:"sm"}),_("span",qge,I(y(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(g(),S("div",Uge)):J("",!0),e.hasMoreMessages||e.loadingMore?(g(),S("div",{key:2,ref_key:"topSentinelRef",ref:i,class:Be(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(g(),S("span",Zge,[Z(Go,{size:"sm"}),He(" "+I(y(o)("conversation.loadingOlder")),1)])):(g(),S("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:be[0]||(be[0]=re=>p("loadOlderMessages"))},I(y(o)("conversation.loadOlder")),1))],2)):J("",!0),(g(!0),S(Me,null,rt(e.turns,(re,ke)=>(g(),S(Me,{key:re.id},[re.role==="user"?(g(),S("div",Kge,[_("div",{class:Be(["u-bub turn-anchor",{undoing:j.value===re.id}]),"data-turn-id":re.id},[re.attachments&&re.attachments.length>0?(g(),S("div",Yge,[(g(!0),S(Me,null,rt(re.attachments,(Fe,at)=>(g(),ce(x7,{key:at,kind:Fe.kind,name:Fe.name,url:Fe.url,"file-id":Fe.fileId,"media-type":Fe.mediaType,size:Fe.size,onActivate:dt=>fe(Fe)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):J("",!0),re.pluginCommand?(g(),S("div",Xge,[_("div",Jge,[be[14]||(be[14]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+I(re.pluginCommand.pluginId)+":"+I(re.pluginCommand.commandName),1)])])):J("",!0),V(re)!==null?(g(),S("div",{key:2,ref_for:!0,ref:Fe=>v(re.id,Fe),class:Be(["u-text-wrap",{"u-text-wrap-args":!!re.pluginCommand,"is-clamped":m.value[re.id]&&!h.value[re.id]}])},[_("div",{class:Be(re.pluginCommand?"skill-act-args":"u-text")},[Z(aC,{text:V(re)??"","open-file":Fe=>p("openFile",Fe)},null,8,["text","open-file"])],2),m.value[re.id]?(g(),S("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!!h.value[re.id],onClick:Fe=>b(re.id)},[He(I(y(o)(h.value[re.id]?"conversation.userMessage.collapse":"conversation.userMessage.expand"))+" ",1),Z(Le,{class:"u-text-toggle-car",name:"chevron-down",size:"sm"})],8,Qge)):J("",!0)],2)):J("",!0)],10,Gge),re.createdAt||H(re)?(g(),S("div",eve,[H(re)?(g(),S("div",{key:0,class:Be(["u-edit-wrap",{undoing:j.value===re.id}])},[_("button",{type:"button",class:"u-edit","aria-label":y(o)("conversation.undoTooltip"),onClick:Fe=>P(re)},[Z(Le,{name:"undo",size:"sm"})],8,tve)],2)):J("",!0),re.text.trim().length>0?(g(),S("button",{key:1,type:"button",class:"u-copy","aria-label":y(o)("filePreview.copy"),onClick:xt(Fe=>ne(re),["stop"])},[F.value!==re.id?(g(),ce(Le,{key:0,name:"copy",size:"sm"})):(g(),ce(Le,{key:1,name:"check",size:"sm"}))],8,nve)):J("",!0),re.createdAt?(g(),ce(Av,{key:2,time:re.createdAt},null,8,["time"])):J("",!0)])):J("",!0)])):re.role==="compaction"?(g(),S("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":re.id,role:"separator"},[be[15]||(be[15]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),re.text?(g(),S("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Fe=>p("openCompaction",{turnId:re.id})},[_("span",null,I(A(re)),1),_("span",rve,I(y(o)("conversation.viewSummary")),1)],8,sve)):(g(),S("span",ive,I(A(re)),1)),be[16]||(be[16]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,ove)):re.role==="cron"?(g(),ce(j3e,{key:2,text:re.text,cron:re.cron,"turn-id":re.id,"created-at":re.createdAt},null,8,["text","cron","turn-id","created-at"])):(g(),S("div",{key:3,class:"a-msg turn-anchor","data-turn-id":re.id},[Z(nge,{items:d.value.get(re.id)?.folded??[],live:re.id===c.value,parked:re.id===c.value&&te(re)===null,"streaming-tail-index":te(re),"seed-ms":y(Xee)(re),"created-ms":de(re),"duration-ms":re.durationMs,"tool-diff-panel":e.toolDiffPanel,mobile:"",onOpenMedia:be[1]||(be[1]=Fe=>p("openMedia",Fe)),onOpenFile:be[2]||(be[2]=Fe=>p("openFile",Fe)),onOpenToolDiff:be[3]||(be[3]=Fe=>p("openToolDiff",Fe)),onOpenAgent:be[4]||(be[4]=Fe=>p("openAgent",Fe))},null,8,["items","live","parked","streaming-tail-index","seed-ms","created-ms","duration-ms","tool-diff-panel"]),(g(!0),S(Me,null,rt(d.value.get(re.id)?.visible??[],(Fe,at)=>(g(),S(Me,{key:y(DT)(Fe,at)},[Fe.kind==="thinking"?(g(),ce(Tg,{key:0,text:Fe.thinking,mobile:"",streaming:pe(re,Fe),"started-at-ms":y(xd)(Fe.startedAt),"duration-ms":Fe.durationMs},null,8,["text","streaming","started-at-ms","duration-ms"])):Fe.kind==="text"&&Fe.text?(g(),S("div",ave,[Z(sa,{text:Fe.text,streaming:pe(re,Fe),"open-file":dt=>p("openFile",dt)},null,8,["text","streaming","open-file"])])):Fe.kind==="activity-run"?(g(),ce(WT,{key:2,items:Fe.items,mobile:"",streaming:ye(re,Fe),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:be[5]||(be[5]=dt=>p("openMedia",dt)),onOpenFile:be[6]||(be[6]=dt=>p("openFile",dt)),onOpenToolDiff:be[7]||(be[7]=dt=>p("openToolDiff",dt)),onOpenAgent:be[8]||(be[8]=dt=>p("openAgent",dt))},null,8,["items","streaming","tool-diff-panel"])):Fe.kind==="tool"?(g(),ce(Ag,{key:3,tool:Fe.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:be[9]||(be[9]=dt=>p("openMedia",dt)),onOpenFile:be[10]||(be[10]=dt=>p("openFile",dt)),onOpenToolDiff:be[11]||(be[11]=dt=>p("openToolDiff",dt)),onOpenAgent:be[12]||(be[12]=dt=>p("openAgent",dt))},null,8,["tool","tool-diff-panel"])):Fe.kind==="notification"?(g(),ce(f$,{key:4,items:Fe.items},null,8,["items"])):J("",!0)],64))),128)),re.id!==c.value&&(d.value.get(re.id)?.changes.length??0)>0?(g(),ce(bge,{key:0,changes:d.value.get(re.id)?.changes??[],cwd:e.cwd,onOpenDiff:Fe=>p("openTurnDiff",{turnId:re.id,changes:d.value.get(re.id)?.changes??[]}),onOpenFile:be[13]||(be[13]=Fe=>p("openFile",Fe))},null,8,["changes","cwd","onOpenDiff"])):J("",!0),re.id!==c.value&&Ke(ke)&&(Q(ke).trim().length>0||re.durationMs!==void 0)?(g(),S("div",cve,[Z(Cn,{text:`${re.durationMs} ms`},{default:ue(()=>[re.durationMs!==void 0?(g(),S("span",uve,I(y(Yee)(re.durationMs)),1)):J("",!0)]),_:2},1032,["text"]),Q(ke).trim().length>0?(g(),S("button",{key:0,class:"a-cpbtn","aria-label":y(o)("filePreview.copy"),onClick:Fe=>Y(ke)},[F.value!==re.id?(g(),ce(Le,{key:0,name:"copy",size:"sm"})):(g(),ce(Le,{key:1,name:"check",size:"sm"}))],8,dve)):J("",!0)])):J("",!0)],8,lve))],64))),128)),e.lastTurnReason==="failed"&&!e.working?(g(),S("div",fve,[_("span",pve,[Z(Le,{name:"alert-triangle",size:"sm"})]),_("div",hve,[_("span",mve,I(e.turnErrorKind==="max_steps"?y(o)("conversation.turnFailedMaxSteps"):y(o)("conversation.turnFailed")),1),e.turnErrorMessage?(g(),S("span",{key:0,class:"tf-sub",title:e.turnErrorMessage},I(e.turnErrorMessage),9,gve)):J("",!0)]),Z(It,{variant:"secondary",size:"sm",onClick:Ce},{default:ue(()=>[He(I(y(o)("conversation.turnFailedResume")),1)]),_:1})])):J("",!0),e.compaction?(g(),ce(_3e,{key:4,label:y(o)("conversation.compacting")},null,8,["label"])):J("",!0),u.value?(g(),S("div",vve,[Z(Nge,{label:f.value},null,8,["label"])])):J("",!0),e.queued.length>0?(g(),S("div",wve,[_("div",yve,[_("span",kve,[Z(Le,{name:"mail",size:"sm"}),He(" "+I(y(o)("composer.queueLabel"))+" · ",1),_("b",null,I(y(o)("composer.queuePending",{n:e.queued.length})),1)])]),(g(!0),S(Me,null,rt(e.queued,(re,ke)=>(g(),S("div",{key:re.id,class:Be(["u-turn q-turn",{"q-dragging":M.value===ke,"drop-before":R.value?.index===ke&&R.value.position==="before","drop-after":R.value?.index===ke&&R.value.position==="after"}]),onDragover:Fe=>E(ke,Fe),onDrop:Fe=>N(ke,Fe)},[ke===0?(g(),ce(Cn,{key:0,text:y(o)("composer.queueSteer")},{default:ue(()=>[_("button",{type:"button",class:"q-send","aria-label":y(o)("composer.queueSteer"),onClick:xt(Fe=>p("steerQueued",ke),["stop"])},[Z(Le,{name:"send",size:"lg"})],8,_ve)]),_:2},1032,["text"])):J("",!0),_("div",xve,[_("span",{class:"q-grip",title:y(o)("composer.queueDragTitle"),draggable:"true",onDragstart:Fe=>T(ke,Fe),onDragend:C},[Z(Le,{name:"grip",size:"sm"})],40,Sve),_("button",{type:"button",class:"q-body",title:y(o)("composer.editQueued"),onClick:Fe=>$(ke)},[re.text?(g(),S("span",Mve,[Z(aC,{text:re.text,interactive:!1},null,8,["text"])])):(g(),S("span",Ave,[Z(Le,{name:"file",size:"sm"}),He(" "+I(y(o)("composer.queuedAttachments",{n:re.attachments?.length??0})),1)]))],8,Cve),z(re)?(g(),S("div",Tve,[(g(!0),S(Me,null,rt(re.attachments,(Fe,at)=>(g(),S(Me,{key:at},[Fe.kind==="file"?(g(),S("span",Eve,[Z(Le,{name:"file",size:"sm"}),He(" "+I(Fe.name??Fe.fileId),1)])):(g(),ce(Kv,{key:1,url:Fe.url,kind:Fe.kind,"file-id":Fe.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):J("",!0),_("button",{type:"button",class:"q-rm","aria-label":y(o)("composer.remove"),onClick:xt(Fe=>p("unqueue",ke),["stop"])},[Z(Le,{name:"close",size:"sm"})],8,Ive)])],42,bve))),128))])):J("",!0)]),X.value!==null?(g(),S("div",Lve,I(y(o)("composer.attachmentOpenUnsupported",{name:X.value})),1)):J("",!0)],64))}}),Xv=mt(Nve,[["__scopeId","data-v-569816f3"]]),zve={class:"ch-id"},Bve={key:0,class:"ch-ws"},Rve={key:1,class:"ch-sep"},Fve=["onKeydown"],jve={class:"ch-ses"},Ove={key:0,class:"ch-pill ch-sync-pill"},Pve={key:0,class:"ch-ahead"},Hve={key:1,class:"ch-behind"},Dve={key:1,class:"ch-pill ch-diff-pill"},Vve={key:0,class:"ch-add"},Wve={key:1,class:"ch-del"},qve={class:"ch-pill ch-pr pr-merged ch-done-pill"},Uve=Ge({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean},sessionDone:{type:Boolean},pinned:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,r=B(()=>o.ahead??0),i=B(()=>o.behind??0),l=B(()=>o.gitDiffStats?.totalAdditions??0),a=B(()=>o.gitDiffStats?.totalDeletions??0),c=B(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(W){return W.trim().toLowerCase().replaceAll("_","-")}function f(W){const G=d(W);return u[G]?`pr-${G}`:"pr-unknown"}function p(W){return n(u[d(W)]??"header.prStatusUnknown")}const h=U(!1),m=U(null),k=U(null),x=U({});function w(W){const G=W.target;k.value?.el?.contains(G)||m.value?.el?.contains(G)||M()}function v(){M()}async function b(W){if(W.stopPropagation(),h.value){M();return}h.value=!0,document.addEventListener("mousedown",w),window.addEventListener("resize",v),await vt();const G=m.value?.el,ee=k.value?.el;if(!G||!ee)return;const se=G.getBoundingClientRect(),oe=4,Q=8,ge=ee.offsetWidth,xe=ee.offsetHeight;let Ke=se.bottom+oe;Ke+xe>window.innerHeight-Q&&(Ke=Math.max(Q,se.top-xe-oe));let et=se.left;et+ge>window.innerWidth-Q&&(et=Math.max(Q,se.right-ge)),x.value={top:`${Math.round(Ke)}px`,left:`${Math.round(et)}px`}}function M(){h.value=!1,document.removeEventListener("mousedown",w),window.removeEventListener("resize",v)}An(()=>{document.removeEventListener("mousedown",w),window.removeEventListener("resize",v)});function R(){s("copyAll"),M()}function z(){s("copyFinalSummary"),M()}const $=U(!1);function T(){o.sessionId&&ss(o.sessionId).then(W=>{W&&($.value=!0,setTimeout(()=>{$.value=!1},1200))})}const E=U(!1),N=U(""),C=U(null);async function O(){if(M(),!!o.sessionId){E.value=!0,N.value=o.sessionTitle??"",await vt();try{C.value?.focus(),C.value?.select()}catch{}}}function H(){const W=N.value.trim();W&&o.sessionId&&W!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,W),E.value=!1}function V(){E.value=!1}function A(){o.sessionId&&(M(),s("forkSession",o.sessionId))}function F(){o.sessionId&&(M(),s("exportSession",o.sessionId))}function j(){o.sessionId&&(M(),s("togglePin",o.sessionId))}function q(){o.sessionId&&(M(),s("archiveSession",o.sessionId))}function P(){o.sessionId&&(M(),s("restoreSession",o.sessionId))}return(W,G)=>(g(),S("header",{class:Be(["chat-header",{"macos-desktop":y(xg)}])},[_("div",zve,[e.workspaceName?(g(),S("span",Bve,I(e.workspaceName),1)):J("",!0),e.workspaceName&&e.sessionTitle?(g(),S("span",Rve,"/")):J("",!0),E.value?Zn((g(),S("input",{key:2,ref_key:"renameInputRef",ref:C,"onUpdate:modelValue":G[0]||(G[0]=ee=>N.value=ee),class:"ch-rename",type:"text",onKeydown:[Eo(xt(H,["stop"]),["enter"]),Eo(xt(V,["stop"]),["esc"])],onBlur:H,onClick:G[1]||(G[1]=xt(()=>{},["stop"]))},null,40,Fve)),[[Fs,N.value]]):e.sessionTitle?(g(),ce(Cn,{key:3,text:e.sessionTitle},{default:ue(()=>[_("span",jve,I(e.sessionTitle),1)]),_:1},8,["text"])):J("",!0)]),Z(Zt,{ref_key:"kebabRef",ref:m,class:Be(["ch-act-more",{open:h.value}]),label:y(n)("header.options"),"aria-expanded":h.value,"aria-haspopup":"menu",onClick:G[2]||(G[2]=xt(ee=>b(ee),["stop"]))},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),h.value?(g(),ce(qi,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:Wt(x.value),onClick:G[3]||(G[3]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{onClick:R},{default:ue(()=>[Z(Le,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),He(" "+I(e.copied?y(n)("header.copied"):y(n)("header.copyAll")),1)]),_:1}),Z(yn,{onClick:z},{default:ue(()=>[Z(Le,{name:"file-text",size:"sm"}),He(" "+I(y(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(g(),S(Me,{key:0},[Z(yn,{separator:""}),Z(yn,{onClick:T},{default:ue(()=>[Z(Le,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),He(" "+I($.value?y(n)("header.copied"):y(n)("header.copySessionId")),1)]),_:1}),e.sessionDone?J("",!0):(g(),ce(yn,{key:0,onClick:j},{default:ue(()=>[Z(Le,{name:e.pinned?"pushpin-fill":"pushpin-line",size:"sm"},null,8,["name"]),He(" "+I(e.pinned?y(n)("header.unpinSession"):y(n)("header.pinSession")),1)]),_:1})),Z(yn,{onClick:O},{default:ue(()=>[Z(Le,{name:"pencil",size:"sm"}),He(" "+I(y(n)("header.renameSession")),1)]),_:1}),Z(yn,{onClick:A},{default:ue(()=>[Z(Le,{name:"git-fork",size:"sm"}),He(" "+I(y(n)("header.forkSession")),1)]),_:1}),Z(yn,{onClick:F},{default:ue(()=>[Z(Le,{name:"download",size:"sm"}),He(" "+I(y(n)("header.exportSession")),1)]),_:1}),e.sessionDone?(g(),ce(yn,{key:1,onClick:P},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"}),He(" "+I(y(n)("header.reopenSession")),1)]),_:1})):(g(),ce(yn,{key:2,onClick:q},{default:ue(()=>[Z(Le,{name:"archive",size:"sm"}),He(" "+I(y(n)("header.markSessionDone")),1)]),_:1}))],64)):J("",!0)]),_:1},8,["style"])):J("",!0),G[6]||(G[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(g(),S("button",{key:1,type:"button",class:"ch-git",onClick:G[4]||(G[4]=ee=>s("openChanges"))},[_("span",{class:Be(["ch-branch",{"ch-detached":!e.branch}])},I(e.branch||y(n)("header.detached")),3),r.value>0||i.value>0?(g(),S("span",Ove,[r.value>0?(g(),S("span",Pve,"↑"+I(r.value),1)):J("",!0),i.value>0?(g(),S("span",Hve,"↓"+I(i.value),1)):J("",!0)])):J("",!0),c.value?(g(),S("span",Dve,[l.value>0?(g(),S("span",Vve,"+"+I(l.value),1)):J("",!0),a.value>0?(g(),S("span",Wve,"-"+I(a.value),1)):J("",!0)])):J("",!0)])):J("",!0),e.pr?(g(),S("button",{key:2,type:"button",class:Be(["ch-pill ch-pr",f(e.pr.state)]),onClick:G[5]||(G[5]=ee=>e.pr&&s("openPr",e.pr.url))},[Z(Le,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+I(e.pr.number)+" · "+I(p(e.pr.state)),1)],2)):J("",!0),e.sessionId&&e.sessionDone?(g(),S(Me,{key:3},[_("span",qve,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(n)("header.sessionDone")),1)]),Z(It,{variant:"secondary",size:"sm",onClick:P},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"}),He(" "+I(y(n)("header.reopenSession")),1)]),_:1})],64)):J("",!0)],2))}}),Zve=mt(Uve,[["__scopeId","data-v-a0c7719c"]]),Kve=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],uC=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Gve(e){if(e<=255)return Kve[e];let t=0,n=uC.length-1;for(;t<=n;){const o=t+n>>1,s=uC[o];if(es[1]){t=o+1;continue}return s[2]}return"L"}function Yve(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c=55296&&u<=56319&&c+1=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=Gve(d);(p==="R"||p==="AL"||p==="AN")&&(o=!0);for(let h=0;h=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u0?n[c-1]:l,f=u0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function n9e(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` +`)}function ge(){for(let me=i.turns.length-1;me>=0;me-=1)if(i.turns[me]?.role==="assistant")return Q(me);return""}function xe(){const me=ge();me.trim()&&ss(me).then(be=>{be&&(G.value=!0,p("copyConversationCopied"),ee!==null&&clearTimeout(ee),ee=setTimeout(()=>{ee=null,G.value=!1},2e3))}).catch(()=>{})}t({copyConversation:se,copyFinalSummary:xe});function Ke(me){const be=i.turns[me];if(!be||be.role!=="assistant")return!1;const ie=i.turns[me+1];return!ie||ie.role!=="assistant"}let et=null;function Y(me){const be=i.turns[me];if(!be)return;const ie=Q(me);ie.trim()&&ss(ie).then(ke=>{ke&&(F.value=be.id,et!==null&&clearTimeout(et),et=setTimeout(()=>{et=null,F.value=null},1400))}).catch(()=>{})}function ne(me){const be=me.text;be.trim()&&ss(be).then(ie=>{ie&&(F.value=me.id,et!==null&&clearTimeout(et),et=setTimeout(()=>{et=null,F.value=null},1400))}).catch(()=>{})}function D(me){return{kind:me.kind==="video"?"video":"image",url:me.url,path:me.name,fileId:me.fileId}}const X=U(null);let ve=null;function fe(me){if(me.kind==="image"||me.kind==="video"){p("openMedia",D(me));return}me.fileId!==void 0&&bN(me.fileId,me.name,me.mediaType).then(be=>{be==="unsupported"&&(X.value=me.name??me.fileId??"",ve!==null&&clearTimeout(ve),ve=setTimeout(()=>{ve=null,X.value=null},2400))})}function pe(me,be){return me.id!==c.value||Ga(be)?!1:be.sourceIndex===Ka(me).length-1}function te(me){if(me.id!==c.value)return null;const be=Ka(me),ie=be.at(-1);if(ie!==void 0&&Ga(ie))return null;if(ie?.kind==="tool"&&ie.tool.status==="running"){const ke=ie.tool.id;if(i.approvals.some(at=>at.toolCallId===ke)||(i.questions??[]).some(at=>at.toolCallId===ke))return null}return be.length-1}function de(me){if(!me.createdAt)return;const be=Date.parse(me.createdAt);return Number.isFinite(be)?be:void 0}function ye(me,be){if(me.id!==c.value)return!1;const ie=be.items.at(-1);return ie!==void 0&&Ga(ie)?!1:ie!==void 0&&ie.sourceIndex===Ka(me).length-1}function Ce(){p("continueTurn",o("conversation.turnFailedResumeText"))}return(me,be)=>(g(),S(Me,null,[_("div",ove,[e.sessionLoading?(g(),S("div",sve,[Z(Go,{size:"sm"}),_("span",ive,I(y(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(g(),S("div",rve)):J("",!0),e.hasMoreMessages||e.loadingMore?(g(),S("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Be(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(g(),S("span",lve,[Z(Go,{size:"sm"}),He(" "+I(y(o)("conversation.loadingOlder")),1)])):(g(),S("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:be[0]||(be[0]=ie=>p("loadOlderMessages"))},I(y(o)("conversation.loadOlder")),1))],2)):J("",!0),(g(!0),S(Me,null,it(e.turns,(ie,ke)=>(g(),S(Me,{key:ie.id},[ie.role==="user"?(g(),S("div",ave,[_("div",{class:Be(["u-bub turn-anchor",{undoing:j.value===ie.id}]),"data-turn-id":ie.id},[ie.attachments&&ie.attachments.length>0?(g(),S("div",uve,[(g(!0),S(Me,null,it(ie.attachments,(Fe,at)=>(g(),ce(S7,{key:at,kind:Fe.kind,name:Fe.name,url:Fe.url,"file-id":Fe.fileId,"media-type":Fe.mediaType,size:Fe.size,onActivate:dt=>fe(Fe)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):J("",!0),ie.pluginCommand?(g(),S("div",dve,[_("div",fve,[be[14]||(be[14]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+I(ie.pluginCommand.pluginId)+":"+I(ie.pluginCommand.commandName),1)])])):J("",!0),V(ie)!==null?(g(),S("div",{key:2,ref_for:!0,ref:Fe=>w(ie.id,Fe),class:Be(["u-text-wrap",{"u-text-wrap-args":!!ie.pluginCommand,"is-clamped":m.value[ie.id]&&!h.value[ie.id]}])},[_("div",{class:Be(ie.pluginCommand?"skill-act-args":"u-text")},[Z(dC,{text:V(ie)??"","open-file":Fe=>p("openFile",Fe)},null,8,["text","open-file"])],2),m.value[ie.id]?(g(),S("button",{key:0,type:"button",class:"u-text-toggle","aria-expanded":!!h.value[ie.id],onClick:Fe=>b(ie.id)},[He(I(y(o)(h.value[ie.id]?"conversation.userMessage.collapse":"conversation.userMessage.expand"))+" ",1),Z(Le,{class:"u-text-toggle-car",name:"chevron-down",size:"sm"})],8,pve)):J("",!0)],2)):J("",!0)],10,cve),ie.createdAt||H(ie)?(g(),S("div",hve,[H(ie)?(g(),S("div",{key:0,class:Be(["u-edit-wrap",{undoing:j.value===ie.id}])},[_("button",{type:"button",class:"u-edit","aria-label":y(o)("conversation.undoTooltip"),onClick:Fe=>P(ie)},[Z(Le,{name:"undo",size:"sm"})],8,mve)],2)):J("",!0),ie.text.trim().length>0?(g(),S("button",{key:1,type:"button",class:"u-copy","aria-label":y(o)("filePreview.copy"),onClick:xt(Fe=>ne(ie),["stop"])},[F.value!==ie.id?(g(),ce(Le,{key:0,name:"copy",size:"sm"})):(g(),ce(Le,{key:1,name:"check",size:"sm"}))],8,gve)):J("",!0),ie.createdAt?(g(),ce(Ev,{key:2,time:ie.createdAt},null,8,["time"])):J("",!0)])):J("",!0)])):ie.role==="compaction"?(g(),S("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":ie.id,role:"separator"},[be[15]||(be[15]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),ie.text?(g(),S("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Fe=>p("openCompaction",{turnId:ie.id})},[_("span",null,I(A(ie)),1),_("span",yve,I(y(o)("conversation.viewSummary")),1)],8,wve)):(g(),S("span",kve,I(A(ie)),1)),be[16]||(be[16]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,vve)):ie.role==="cron"?(g(),ce(V3e,{key:2,text:ie.text,cron:ie.cron,"turn-id":ie.id,"created-at":ie.createdAt},null,8,["text","cron","turn-id","created-at"])):(g(),S("div",{key:3,class:"a-msg turn-anchor","data-turn-id":ie.id},[Z(gge,{items:d.value.get(ie.id)?.folded??[],live:ie.id===c.value,parked:ie.id===c.value&&te(ie)===null,"streaming-tail-index":te(ie),"seed-ms":y(nte)(ie),"created-ms":de(ie),"duration-ms":ie.durationMs,"tool-diff-panel":e.toolDiffPanel,mobile:"",onOpenMedia:be[1]||(be[1]=Fe=>p("openMedia",Fe)),onOpenFile:be[2]||(be[2]=Fe=>p("openFile",Fe)),onOpenToolDiff:be[3]||(be[3]=Fe=>p("openToolDiff",Fe)),onOpenAgent:be[4]||(be[4]=Fe=>p("openAgent",Fe))},null,8,["items","live","parked","streaming-tail-index","seed-ms","created-ms","duration-ms","tool-diff-panel"]),(g(!0),S(Me,null,it(d.value.get(ie.id)?.visible??[],(Fe,at)=>(g(),S(Me,{key:y(qE)(Fe,at)},[Fe.kind==="thinking"?(g(),ce(Tg,{key:0,text:Fe.thinking,mobile:"",streaming:pe(ie,Fe),"started-at-ms":y(Sd)(Fe.startedAt),"duration-ms":Fe.durationMs},null,8,["text","streaming","started-at-ms","duration-ms"])):Fe.kind==="text"&&Fe.text?(g(),S("div",_ve,[Z(sa,{text:Fe.text,streaming:pe(ie,Fe),"open-file":dt=>p("openFile",dt)},null,8,["text","streaming","open-file"])])):Fe.kind==="activity-run"?(g(),ce(ZE,{key:2,items:Fe.items,mobile:"",streaming:ye(ie,Fe),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:be[5]||(be[5]=dt=>p("openMedia",dt)),onOpenFile:be[6]||(be[6]=dt=>p("openFile",dt)),onOpenToolDiff:be[7]||(be[7]=dt=>p("openToolDiff",dt)),onOpenAgent:be[8]||(be[8]=dt=>p("openAgent",dt))},null,8,["items","streaming","tool-diff-panel"])):Fe.kind==="tool"?(g(),ce(Eg,{key:3,tool:Fe.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:be[9]||(be[9]=dt=>p("openMedia",dt)),onOpenFile:be[10]||(be[10]=dt=>p("openFile",dt)),onOpenToolDiff:be[11]||(be[11]=dt=>p("openToolDiff",dt)),onOpenAgent:be[12]||(be[12]=dt=>p("openAgent",dt))},null,8,["tool","tool-diff-panel"])):Fe.kind==="notification"?(g(),ce(m$,{key:4,items:Fe.items},null,8,["items"])):J("",!0)],64))),128)),ie.id!==c.value&&(d.value.get(ie.id)?.changes.length??0)>0?(g(),ce(Bge,{key:0,changes:d.value.get(ie.id)?.changes??[],cwd:e.cwd,onOpenDiff:Fe=>p("openTurnDiff",{turnId:ie.id,changes:d.value.get(ie.id)?.changes??[]}),onOpenFile:be[13]||(be[13]=Fe=>p("openFile",Fe))},null,8,["changes","cwd","onOpenDiff"])):J("",!0),ie.id!==c.value&&Ke(ke)&&(Q(ke).trim().length>0||ie.durationMs!==void 0)?(g(),S("div",xve,[Z(Cn,{text:`${ie.durationMs} ms`},{default:ue(()=>[ie.durationMs!==void 0?(g(),S("span",Sve,I(y(tte)(ie.durationMs)),1)):J("",!0)]),_:2},1032,["text"]),Q(ke).trim().length>0?(g(),S("button",{key:0,class:"a-cpbtn","aria-label":y(o)("filePreview.copy"),onClick:Fe=>Y(ke)},[F.value!==ie.id?(g(),ce(Le,{key:0,name:"copy",size:"sm"})):(g(),ce(Le,{key:1,name:"check",size:"sm"}))],8,Cve)):J("",!0)])):J("",!0)],8,bve))],64))),128)),e.lastTurnReason==="failed"&&!e.working?(g(),S("div",Mve,[_("span",Ave,[Z(Le,{name:"alert-triangle",size:"sm"})]),_("div",Eve,[_("span",Tve,I(e.turnErrorKind==="max_steps"?y(o)("conversation.turnFailedMaxSteps"):y(o)("conversation.turnFailed")),1),e.turnErrorMessage?(g(),S("span",{key:0,class:"tf-sub",title:e.turnErrorMessage},I(e.turnErrorMessage),9,Ive)):J("",!0)]),Z(It,{variant:"secondary",size:"sm",onClick:Ce},{default:ue(()=>[He(I(y(o)("conversation.turnFailedResume")),1)]),_:1})])):J("",!0),e.compaction?(g(),ce(A3e,{key:4,label:y(o)("conversation.compacting")},null,8,["label"])):J("",!0),u.value?(g(),S("div",Lve,[Z(Zge,{label:f.value},null,8,["label"])])):J("",!0),e.queued.length>0?(g(),S("div",$ve,[_("div",Nve,[_("span",zve,[Z(Le,{name:"mail",size:"sm"}),He(" "+I(y(o)("composer.queueLabel"))+" · ",1),_("b",null,I(y(o)("composer.queuePending",{n:e.queued.length})),1)])]),(g(!0),S(Me,null,it(e.queued,(ie,ke)=>(g(),S("div",{key:ie.id,class:Be(["u-turn q-turn",{"q-dragging":M.value===ke,"drop-before":R.value?.index===ke&&R.value.position==="before","drop-after":R.value?.index===ke&&R.value.position==="after"}]),onDragover:Fe=>T(ke,Fe),onDrop:Fe=>N(ke,Fe)},[ke===0?(g(),ce(Cn,{key:0,text:y(o)("composer.queueSteer")},{default:ue(()=>[_("button",{type:"button",class:"q-send","aria-label":y(o)("composer.queueSteer"),onClick:xt(Fe=>p("steerQueued",ke),["stop"])},[Z(Le,{name:"send",size:"lg"})],8,Rve)]),_:2},1032,["text"])):J("",!0),_("div",Fve,[_("span",{class:"q-grip",title:y(o)("composer.queueDragTitle"),draggable:"true",onDragstart:Fe=>E(ke,Fe),onDragend:C},[Z(Le,{name:"grip",size:"sm"})],40,jve),_("button",{type:"button",class:"q-body",title:y(o)("composer.editQueued"),onClick:Fe=>$(ke)},[ie.text?(g(),S("span",Pve,[Z(dC,{text:ie.text,interactive:!1},null,8,["text"])])):(g(),S("span",Hve,[Z(Le,{name:"file",size:"sm"}),He(" "+I(y(o)("composer.queuedAttachments",{n:ie.attachments?.length??0})),1)]))],8,Ove),z(ie)?(g(),S("div",Dve,[(g(!0),S(Me,null,it(ie.attachments,(Fe,at)=>(g(),S(Me,{key:at},[Fe.kind==="file"?(g(),S("span",Vve,[Z(Le,{name:"file",size:"sm"}),He(" "+I(Fe.name??Fe.fileId),1)])):(g(),ce(Gv,{key:1,url:Fe.url,kind:Fe.kind,"file-id":Fe.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):J("",!0),_("button",{type:"button",class:"q-rm","aria-label":y(o)("composer.remove"),onClick:xt(Fe=>p("unqueue",ke),["stop"])},[Z(Le,{name:"close",size:"sm"})],8,Wve)])],42,Bve))),128))])):J("",!0)]),X.value!==null?(g(),S("div",qve,I(y(o)("composer.attachmentOpenUnsupported",{name:X.value})),1)):J("",!0)],64))}}),Jv=mt(Zve,[["__scopeId","data-v-569816f3"]]),Kve={class:"ch-id"},Gve={key:0,class:"ch-ws"},Yve={key:1,class:"ch-sep"},Xve=["onKeydown"],Jve={class:"ch-ses"},Qve={key:0,class:"ch-pill ch-sync-pill"},e9e={key:0,class:"ch-ahead"},t9e={key:1,class:"ch-behind"},n9e={key:1,class:"ch-pill ch-diff-pill"},o9e={key:0,class:"ch-add"},s9e={key:1,class:"ch-del"},i9e={class:"ch-pill ch-pr pr-merged ch-done-pill"},r9e=Ge({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean},sessionDone:{type:Boolean},pinned:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","togglePin","archiveSession","restoreSession","exportSession"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,i=B(()=>o.ahead??0),r=B(()=>o.behind??0),l=B(()=>o.gitDiffStats?.totalAdditions??0),a=B(()=>o.gitDiffStats?.totalDeletions??0),c=B(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(W){return W.trim().toLowerCase().replaceAll("_","-")}function f(W){const G=d(W);return u[G]?`pr-${G}`:"pr-unknown"}function p(W){return n(u[d(W)]??"header.prStatusUnknown")}const h=U(!1),m=U(null),k=U(null),x=U({});function v(W){const G=W.target;k.value?.el?.contains(G)||m.value?.el?.contains(G)||M()}function w(){M()}async function b(W){if(W.stopPropagation(),h.value){M();return}h.value=!0,document.addEventListener("mousedown",v),window.addEventListener("resize",w),await vt();const G=m.value?.el,ee=k.value?.el;if(!G||!ee)return;const se=G.getBoundingClientRect(),oe=4,Q=8,ge=ee.offsetWidth,xe=ee.offsetHeight;let Ke=se.bottom+oe;Ke+xe>window.innerHeight-Q&&(Ke=Math.max(Q,se.top-xe-oe));let et=se.left;et+ge>window.innerWidth-Q&&(et=Math.max(Q,se.right-ge)),x.value={top:`${Math.round(Ke)}px`,left:`${Math.round(et)}px`}}function M(){h.value=!1,document.removeEventListener("mousedown",v),window.removeEventListener("resize",w)}An(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",w)});function R(){s("copyAll"),M()}function z(){s("copyFinalSummary"),M()}const $=U(!1);function E(){o.sessionId&&ss(o.sessionId).then(W=>{W&&($.value=!0,setTimeout(()=>{$.value=!1},1200))})}const T=U(!1),N=U(""),C=U(null);async function O(){if(M(),!!o.sessionId){T.value=!0,N.value=o.sessionTitle??"",await vt();try{C.value?.focus(),C.value?.select()}catch{}}}function H(){const W=N.value.trim();W&&o.sessionId&&W!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,W),T.value=!1}function V(){T.value=!1}function A(){o.sessionId&&(M(),s("forkSession",o.sessionId))}function F(){o.sessionId&&(M(),s("exportSession",o.sessionId))}function j(){o.sessionId&&(M(),s("togglePin",o.sessionId))}function q(){o.sessionId&&(M(),s("archiveSession",o.sessionId))}function P(){o.sessionId&&(M(),s("restoreSession",o.sessionId))}return(W,G)=>(g(),S("header",{class:Be(["chat-header",{"macos-desktop":y(Sg)}])},[_("div",Kve,[e.workspaceName?(g(),S("span",Gve,I(e.workspaceName),1)):J("",!0),e.workspaceName&&e.sessionTitle?(g(),S("span",Yve,"/")):J("",!0),T.value?Zn((g(),S("input",{key:2,ref_key:"renameInputRef",ref:C,"onUpdate:modelValue":G[0]||(G[0]=ee=>N.value=ee),class:"ch-rename",type:"text",onKeydown:[To(xt(H,["stop"]),["enter"]),To(xt(V,["stop"]),["esc"])],onBlur:H,onClick:G[1]||(G[1]=xt(()=>{},["stop"]))},null,40,Xve)),[[Fs,N.value]]):e.sessionTitle?(g(),ce(Cn,{key:3,text:e.sessionTitle},{default:ue(()=>[_("span",Jve,I(e.sessionTitle),1)]),_:1},8,["text"])):J("",!0)]),Z(Zt,{ref_key:"kebabRef",ref:m,class:Be(["ch-act-more",{open:h.value}]),label:y(n)("header.options"),"aria-expanded":h.value,"aria-haspopup":"menu",onClick:G[2]||(G[2]=xt(ee=>b(ee),["stop"]))},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),h.value?(g(),ce(qr,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:Wt(x.value),onClick:G[3]||(G[3]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{onClick:R},{default:ue(()=>[Z(Le,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),He(" "+I(e.copied?y(n)("header.copied"):y(n)("header.copyAll")),1)]),_:1}),Z(yn,{onClick:z},{default:ue(()=>[Z(Le,{name:"file-text",size:"sm"}),He(" "+I(y(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(g(),S(Me,{key:0},[Z(yn,{separator:""}),Z(yn,{onClick:E},{default:ue(()=>[Z(Le,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),He(" "+I($.value?y(n)("header.copied"):y(n)("header.copySessionId")),1)]),_:1}),e.sessionDone?J("",!0):(g(),ce(yn,{key:0,onClick:j},{default:ue(()=>[Z(Le,{name:e.pinned?"pushpin-fill":"pushpin-line",size:"sm"},null,8,["name"]),He(" "+I(e.pinned?y(n)("header.unpinSession"):y(n)("header.pinSession")),1)]),_:1})),Z(yn,{onClick:O},{default:ue(()=>[Z(Le,{name:"pencil",size:"sm"}),He(" "+I(y(n)("header.renameSession")),1)]),_:1}),Z(yn,{onClick:A},{default:ue(()=>[Z(Le,{name:"git-fork",size:"sm"}),He(" "+I(y(n)("header.forkSession")),1)]),_:1}),Z(yn,{onClick:F},{default:ue(()=>[Z(Le,{name:"download",size:"sm"}),He(" "+I(y(n)("header.exportSession")),1)]),_:1}),e.sessionDone?(g(),ce(yn,{key:1,onClick:P},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"}),He(" "+I(y(n)("header.reopenSession")),1)]),_:1})):(g(),ce(yn,{key:2,onClick:q},{default:ue(()=>[Z(Le,{name:"archive",size:"sm"}),He(" "+I(y(n)("header.markSessionDone")),1)]),_:1}))],64)):J("",!0)]),_:1},8,["style"])):J("",!0),G[6]||(G[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(g(),S("button",{key:1,type:"button",class:"ch-git",onClick:G[4]||(G[4]=ee=>s("openChanges"))},[_("span",{class:Be(["ch-branch",{"ch-detached":!e.branch}])},I(e.branch||y(n)("header.detached")),3),i.value>0||r.value>0?(g(),S("span",Qve,[i.value>0?(g(),S("span",e9e,"↑"+I(i.value),1)):J("",!0),r.value>0?(g(),S("span",t9e,"↓"+I(r.value),1)):J("",!0)])):J("",!0),c.value?(g(),S("span",n9e,[l.value>0?(g(),S("span",o9e,"+"+I(l.value),1)):J("",!0),a.value>0?(g(),S("span",s9e,"-"+I(a.value),1)):J("",!0)])):J("",!0)])):J("",!0),e.pr?(g(),S("button",{key:2,type:"button",class:Be(["ch-pill ch-pr",f(e.pr.state)]),onClick:G[5]||(G[5]=ee=>e.pr&&s("openPr",e.pr.url))},[Z(Le,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+I(e.pr.number)+" · "+I(p(e.pr.state)),1)],2)):J("",!0),e.sessionId&&e.sessionDone?(g(),S(Me,{key:3},[_("span",i9e,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(n)("header.sessionDone")),1)]),Z(It,{variant:"secondary",size:"sm",onClick:P},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"}),He(" "+I(y(n)("header.reopenSession")),1)]),_:1})],64)):J("",!0)],2))}}),l9e=mt(r9e,[["__scopeId","data-v-a0c7719c"]]),a9e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],pC=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function c9e(e){if(e<=255)return a9e[e];let t=0,n=pC.length-1;for(;t<=n;){const o=t+n>>1,s=pC[o];if(es[1]){t=o+1;continue}return s[2]}return"L"}function u9e(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c=55296&&u<=56319&&c+1=56320&&h<=57343&&(d=(u-55296<<10)+(h-56320)+65536,f=2)}const p=c9e(d);(p==="R"||p==="AL"||p==="AN")&&(o=!0);for(let h=0;h=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u0?n[c-1]:l,f=u0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function g9e(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` `).replace(/[\r\f]/g,` -`):e}let Tm=null,o9e;function s9e(){return Tm===null&&(Tm=new Intl.Segmenter(o9e,{granularity:"word"})),Tm}const r9e=/\p{Script=Arabic}/u,k1=/\p{M}/u,Jv=/\p{Nd}/u;function dC(e){return r9e.test(e)}function fC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function wl(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(fC(s))return!0;t++;continue}}if(fC(n))return!0}}return!1}function i9e(e){const t=af(e);return t!==null&&(Qv.has(t)||S0.has(t))}const l9e=new Set([" "," ","⁠","\uFEFF"]),a9e=new Set(["-","‐","–","—"]);function c9e(e){const t=af(e);return t!==null&&l9e.has(t)}function u9e(e){const t=af(e);return t!==null&&a9e.has(t)}function wN(e,t){return c9e(e)?!1:t?!(i9e(e)||u9e(e)):!0}const Qv=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Dp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),e9=new Set(["'","’"]),S0=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),d9e=new Set([":",".","،","؛"]),f9e=new Set(["၏"]),p9e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function h9e(e){if(t9(e))return!0;let t=!1;for(const n of e){if(S0.has(n)||Wp(n)){t=!0;continue}if(!(t&&k1.test(n)))return!1}return t}function m9e(e){for(const t of e)if(!Qv.has(t)&&!S0.has(t))return!1;return e.length>0}function g9e(e){if(t9(e))return!0;for(const t of e)if(!Dp.has(t)&&!e9.has(t)&&!k1.test(t)&&!Wp(t))return!1;return e.length>0}function t9(e){let t=!1;for(const n of e)if(!(n==="\\"||k1.test(n))){if(Dp.has(n)||S0.has(n)||e9.has(n)){t=!0;continue}return!1}return t}function Vp(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const r=e.charCodeAt(s);return r>=55296&&r<=56319?s:n}function af(e){if(e.length===0)return null;const t=Vp(e,e.length);return e.slice(t)}function v9e(e){for(const t of e)if(!k1.test(t))return t;return null}function w9e(e){for(let t=e.length;t>0;){const n=Vp(e,t),o=e.slice(n,t);if(!k1.test(o))return o;t=n}return null}const y9e=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function k9e(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function Wp(e){const t=e.codePointAt(0);return t!==void 0&&k9e(t,y9e)}function b9e(e){const t=w9e(e);return t!==null&&Wp(t)}function _9e(e){const t=v9e(e);return t!==null&&Jv.test(t)}function x9e(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(k1.test(o)){n--;continue}if(Dp.has(o)||e9.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function S9e(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function pC(e,t,n,o){const s=t[o],r=e[o];if(s==null)return r;const i=n[o];if(r.length===i)return r;const l=s.repeat(i);return e[o]=l,l}function hC(e,t){return e&&t!==null&&d9e.has(t)}function C9e(e){const t=af(e);return t!==null&&f9e.has(t)}function M9e(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function S7(e){let t=e.length;for(;t>0;){const n=Vp(e,t),o=e.slice(n,t);if(p9e.has(o))return!0;if(!S0.has(o))return!1;t=n}return!1}function A9e(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const T9e=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ui(e){return e.length===1?e[0]:e.join("")}function E9e(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ui(n)}function I9e(e,t,n,o){if(!T9e.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let r=null,i=[],l=n,a=!1,c=0;for(const u of e){const d=A9e(u,o),f=d==="text"&&t;if(r!==null&&d===r&&f===a){i.push(u),c+=u.length;continue}r!==null&&s.push({text:Ui(i),isWordLike:a,kind:r,start:l}),r=d,i=[u],l=n+c,a=f,c+=u.length}return r!==null&&s.push({text:Ui(i),isWordLike:a,kind:r,start:l}),s}function C7(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const L9e=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function $9e(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:L9e.test(n)&&t+1=e.len||C7(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u0&&(t.push(Ui(a)),n.push(!0),o.push("text"),s.push(c),r=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const R9e=new Set([":","-","/","×",",",".","+","–","—"]),F9e=/[\p{P}\p{S}\p{Co}]/u,j9e=/\p{Emoji_Presentation}/u,O9e=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function P9e(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function yN(e){const t=e.charCodeAt(0);return t<128?P9e(t):!O9e.has(e)&&!j9e.test(e)&&F9e.test(e)}function mC(e){let t=!1;for(const n of e)if(!k1.test(n)){if(!yN(n))return!1;t=!0}return t}function H9e(e){for(let t=e.length;t>0;){const n=Vp(e,t),o=e.slice(n,t);if(k1.test(o)){t=n;continue}return yN(o)||Wp(o)}return!1}function D9e(e,t,n,o){const s=!t&&mC(e),r=!o&&mC(n),i=b9e(e),l=(t||i)&&H9e(e);return!s&&!r&&!l||wl(e)||wl(n)?!1:(t||s||i)&&(o||r)}function kN(e){for(const t of e)if(Jv.test(t))return!0;return!1}function R5(e){if(e.length===0)return!1;for(const t of e)if(!(Jv.test(t)||R9e.has(t)))return!1;return!0}function V9e(e){const t=[],n=[],o=[],s=[];for(let r=0;rr+1){t.push(Ui(c)),n.push(d),o.push("text"),s.push(e.starts[r]),r=u;continue}}t.push(i),n.push(a),o.push(l),s.push(e.starts[r]),r++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function q9e(e){const t=[],n=[],o=[],s=[];for(let r=0;r1;for(let c=0;c0&&a[V]==="text"&&E&&f[V]&&h[V]||$&&s>0&&a[V]==="text"&&m9e(z.text)&&f[V]||$&&s>0&&a[V]==="text"&&m[V]?A():$&&s>0&&a[V]==="text"&&z.isWordLike&&N&&k[V]?(A(),l[V]=!0):T!==null&&s>0&&a[V]==="text"&&u[V]===T?d[V]=(d[V]??1)+1:$&&!z.isWordLike&&s>0&&a[V]==="text"&&!f[V]&&(h9e(z.text)||z.text==="-"&&l[V])?A():(r[s]=z.text,i[s]=[z.text],l[s]=z.isWordLike,a[s]=z.kind,c[s]=z.start,u[s]=T,d[s]=T===null?0:1,f[s]=E,p[s]=N,h[s]=O,m[s]=H,k[s]=hC(N,C),s++)}for(let R=0;Rnull);let w=-1;for(let R=s-1;R>=0;R--){const z=r[R];if(z.length!==0){if(a[R]==="text"&&!l[R]&&w>=0&&a[w]==="text"&&(g9e(z)||z==="-"&&_9e(r[w]))){const $=x[w]??[];$.push(z),x[w]=$,c[w]=c[R],r[R]="";continue}w=R}}for(let R=0;R=0&&!wN(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||wl(p);continue}d(f),o.push(p),s.push(t.isWordLike[f]),r.push(h),i.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:r,starts:i}}function X9e(e,t,n="normal",o="normal"){const s=e9e(n),r=s.mode==="pre-wrap"?n9e(e):t9e(e);if(r.length===0)return{normalized:r,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const i=K9e(r,t,s),l=o==="keep-all"?Y9e(r,i,t.breakKeepAllAfterPunctuation):i;return{normalized:r,chunks:G9e(l,s),...l}}let ac=null;const gC=new Map;let cc=null;const J9e=96,Q9e=/\p{Emoji_Presentation}/u,ewe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Em=null;const vC=new Map;function n9(){if(ac!==null)return ac;if(typeof OffscreenCanvas<"u")return ac=new OffscreenCanvas(1,1).getContext("2d"),ac;if(typeof document<"u")return ac=document.createElement("canvas").getContext("2d"),ac;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function twe(e){let t=gC.get(e);return t||(t=new Map,gC.set(e,t)),t}function Wa(e,t){let n=t.get(e);return n===void 0&&(n={width:n9().measureText(e).width,containsCJK:wl(e)},t.set(e,n)),n}function qp(){if(cc!==null)return cc;if(typeof navigator>"u")return cc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},cc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return cc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},cc}function nwe(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function bN(){return Em===null&&(Em=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Em}function owe(e){return Q9e.test(e)||e.includes("️")}function swe(e){return ewe.test(e)}function rwe(e,t){let n=vC.get(e);if(n!==void 0)return n;const o=n9();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const r=document.createElement("span");r.style.font=e,r.style.display="inline-block",r.style.visibility="hidden",r.style.position="absolute",r.textContent="😀",document.body.appendChild(r);const i=r.getBoundingClientRect().width;document.body.removeChild(r),s-i>.5&&(n=s-i)}return vC.set(e,n),n}function iwe(e){let t=0;const n=bN();for(const o of n.segment(e))owe(o.segment)&&t++;return t}function lwe(e,t){return t.emojiCount===void 0&&(t.emojiCount=iwe(e)),t.emojiCount}function i0(e,t,n){return n===0?t.width:t.width-lwe(e,t)*n}function awe(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const r=bN(),i=[];for(const u of r.segment(e))i.push(u.segment);if(i.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of i){const f=Wa(d,n);u.push(i0(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||i.length>J9e){const u=[];let d=null,f=0;for(const p of i){const h=Wa(p,n),m=i0(p,h,o);if(d===null)u.push(m);else{const k=d+p,x=Wa(k,n);u.push(i0(k,x,o)-f)}d=p,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of i){a+=u;const d=Wa(a,n),f=i0(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function cwe(e,t){const n=n9();n.font=e;const o=twe(e),s=nwe(e),r=t?rwe(e,s):0;return{cache:o,fontSize:s,emojiCorrection:r}}function uwe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function _N(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function xN(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function o9(e,t){return t===0?0:e+t}function pwe(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function hwe(e,t,n,o,s){const r=t==="tab"?s+pwe(e,n):e.lineEndFitAdvances[n];return o9(o,r)}function wC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return o9(o,s)}function yC(e,t,n,o,s){const r=t==="tab"?s:e.lineEndPaintAdvances[n];return o9(o,r)}function mwe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function gwe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function F5(e,t,n){let o=t;for(;o0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let r=o-1;r>=t;r--){const i=e.kinds[r];if(!(i==="space"||i==="zero-width-break"||i==="hard-break")){if(i==="soft-hyphen"){if(r===o-1)return 0;continue}return r===t&&n>0||e.spacingGraphemeCounts[r]>0?e.letterSpacing:0}}return 0}function wwe(e,t,n,o,s,r){return t+vwe(e,n,o,s,r)}function ywe(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:i}=e;if(o.length===0)return 0;const a=qp().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,p=0,h=0,m=0,k=0,x=-1,w=0;function v(){x=-1,w=0}function b(E=m,N=k,C=d){u++,n?.(C,p,h,E,N),d=0,f=!1,v()}function M(E,N){f=!0,p=E,h=0,m=E+1,k=0,d=N}function R(E,N,C){f=!0,p=E,h=N,m=E,k=N+1,d=C}function z(E,N){if(!f){M(E,N);return}d+=N,m=E+1,k=0}function $(E,N){const C=r[E],O=i[E]??null;let H=O===null?-1:F5(O,0,N+1),V=-1,A=0,F=N;for(;Fc){if(O!==null&&V>N){b(E,V,A),F=V,H=F5(O,H,F+1),V=-1,A=0;continue}b(),R(E,F,j)}else d+=j,m=E,k=F+1;const q=F+1;O!==null&&O[H]===q&&(V=q,A=d,H++),F++}f&&m===E&&k===C.length&&(m=E+1,k=0)}let T=0;for(;T=o.length));){const E=o[T],N=s[T],C=_N(N);if(!f){E>c&&r[T]!==null?$(T,0):M(T,E),C&&(x=T+1,w=d-E),T++;continue}if(d+E>c){if(C){z(T,E),b(T+1,0,d-E),T++;continue}if(x>=0){if(m>x||m===x&&k>0){b();continue}b(x,0,w);continue}if(E>c&&r[T]!==null){b(),$(T,0),T++;continue}b();continue}z(T,E),C&&(x=T+1,w=d-E),T++}return f&&b(),u}function kwe(e,t,n){if(e.simpleLineWalkFastPath)return ywe(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:i,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=qp(),u=c.lineFitEpsilon,d=t+u;let f=0,p=0,h=!1,m=0,k=0,x=0,w=0,v=-1,b=0,M=0,R=null;function z(){v=-1,b=0,M=0,R=null}function $(){return R==="soft-hyphen"&&v===x&&w===0?M:p}function T(A=x,F=w,j){f++,n!==void 0&&n(wwe(e,j??$(),m,k,A,F),m,k,A,F),p=0,h=!1,z()}function E(A,F){h=!0,m=A,k=0,x=A+1,w=0,p=F}function N(A,F,j){h=!0,m=A,k=F,x=A,w=F+1,p=j}function C(A,F){if(!h){E(A,F);return}p+=F,x=A+1,w=0}function O(A,F,j,q,P,W){if(!F)return;const G=wC(e,A,j,P),ee=yC(e,A,j,P,q);v=j+1,b=p-W+G,M=p-W+ee,R=A}function H(A,F){const j=r[A],q=i[A]??null;let P=q===null?-1:F5(q,0,F+1),W=-1,G=0,ee=F;for(;eed){if(q!==null&&W>F){T(A,W,G),ee=W,P=F5(q,P,ee+1),W=-1,G=0;continue}T(),N(A,ee,se)}else p=ge,x=A,w=ee+1}const oe=ee+1;q!==null&&q[P]===oe&&(W=oe,G=p,P++),ee++}h&&x===A&&w===j.length&&(x=A+1,w=0)}function V(A){f++,n?.(0,A.startSegmentIndex,0,A.consumedEndSegmentIndex,0),z()}for(let A=0;A=F.endSegmentIndex));){const q=s[j],P=_N(q),W=fwe(e,h,j),G=q==="tab"?dwe(p+W,e.tabStopAdvance):o[j],ee=W+G,se=hwe(e,q,j,W,G);if(q==="soft-hyphen"){h&&(x=j+1,w=0,v=j+1,b=p+l,M=p+l,R=q),j++;continue}if(!h){se>d&&r[j]!==null?H(j,0):E(j,G),O(q,P,j,G,W,ee),j++;continue}if(p+se>d){const Q=p+wC(e,q,j,W),ge=p+yC(e,q,j,W,G);if(R==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){T(v,0,M);continue}if(P&&Q<=d){C(j,ee),T(j+1,0,ge),j++;continue}if(v>=0&&b<=d){if(x>v||x===v&&w>0){T();continue}const xe=v;T(xe,0,M),j=xe;continue}if(se>d&&r[j]!==null){T(),H(j,0),j++;continue}T();continue}C(j,ee),O(q,P,j,G,W,ee),j++}if(h){const q=v===F.consumedEndSegmentIndex?M:p;T(F.consumedEndSegmentIndex,0,q)}}return f}let Im=null;function s9(){return Im===null&&(Im=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Im}function bwe(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function _we(e,t){const n=[];let o=[],s=0,r=!1,i=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],r=!1,i=!1,l=!1)}function c(d,f,p){o=[d],s=f,r=p,i=S7(d),l=Dp.has(d)}function u(d,f){o.push(d),r=r||f;const p=S7(d);d.length===1&&S0.has(d)?i=i||p:i=p,l=!1}for(const d of s9().segment(e)){const f=d.segment,p=wl(f);if(o.length===0){c(f,d.index,p);continue}if(l||Qv.has(f)||S0.has(f)||t.carryCJKAfterClosingQuote&&p&&i){u(f,p);continue}if(!r&&!p){u(f,p);continue}a(),c(f,d.index,p)}return a(),n}function xwe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,r=!1;function i(a,c){const u=t[a].start,d=c=0&&!wN(t[a-1].text,n)&&l(a),s<0&&(s=a),r=r||wl(c.text)}return l(t.length),o}function kC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=s9();for(const s of o.segment(e))n++;return n}function Swe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Cwe(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of s9().segment(e))n++,Swe(o.segment)&&t.push(n);return t.length===0?null:t}function Mwe(e,t,n){return t>1?e+(t-1)*n:e}function Awe(e,t,n,o,s){const r=qp(),{cache:i,emojiCorrection:l}=cwe(t,swe(e.normalized)),a=i0("-",Wa("-",i),l)+(s===0?0:s*2),u=i0(" ",Wa(" ",i),l)*8,d=s!==0;if(e.len===0)return bwe();const f=[],p=[],h=[],m=[];let k=e.chunks.length<=1&&!d;const x=n?[]:null,w=[],v=[],b=[],M=n?[]:null,R=Array.from({length:e.len});function z(N,C,O,H,V,A,F,j,q){V!=="text"&&V!=="space"&&V!=="zero-width-break"&&(k=!1),f.push(C),p.push(O),h.push(H),m.push(V),x?.push(A),w.push(F),v.push(j),d&&b.push(q),M!==null&&M.push(N)}function $(N,C,O,H,V){const A=Wa(N,i),F=d?kC(N,C):0,j=Mwe(i0(N,A,l),F,s),q=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:j,P=q===0?0:q+(F>0?s:0),W=C==="space"||C==="zero-width-break"?0:j;if(V&&H&&N.length>1){let G="sum-graphemes";s!==0?G="segment-prefixes":R5(N)?G="pair-context":r.preferPrefixWidthsForBreakableRuns&&(G="segment-prefixes");const ee=awe(N,A,i,l,G),se=ee===null||o==="keep-all"?null:Cwe(N);z(N,j,P,W,C,O,ee,se,F);return}z(N,j,P,W,C,O,null,null,F)}for(let N=0;N{n>t&&(t=n)}),t}function $we(e){const t=e.toLowerCase(),n=[];let o=0;for(const s of e){const r=s.toLowerCase().length;for(let i=0;i=0&&ao[0]-s[0]),n=[];for(const o of t){const s=n.at(-1);s&&o[0]<=s[1]?s[1]=Math.max(s[1],o[1]):n.push([...o])}return n}function _C(e,t){if(!t||t.length===0||e.length===0)return[{text:e,hit:!1}];const n=[];let o=0;for(const[s,r]of Nwe(t)){const i=Math.max(0,Math.min(s,e.length)),l=Math.max(i,Math.min(r,e.length));l<=i||(i>o&&n.push({text:e.slice(o,i),hit:!1}),n.push({text:e.slice(i,l),hit:!0}),o=l)}return o0?n:[{text:e,hit:!1}]}function xC(e,t){const n=e.toLowerCase().indexOf(t);return n<0?void 0:[n,n+t.length]}function zwe(e,t){const n=e.toLowerCase();let o=-1,s=-1,r=0;for(let i=0;i0,a.value=v.scrollTop+v.clientHeight{const v={},b="var(--menu-scroll-fade)";let M;return l.value&&a.value?M=`linear-gradient(to bottom, transparent 0, black ${b}, black calc(100% - ${b}), transparent 100%)`:l.value?M=`linear-gradient(to bottom, transparent, black ${b})`:a.value&&(M=`linear-gradient(to top, transparent, black ${b})`),M&&(v.maskImage=M,v.WebkitMaskImage=M),u.value&&(v.maxHeight=u.value),Object.keys(v).length>0?v:void 0}),p=B(()=>{const v=c.value;return v?{top:`${v.top}px`,height:`${v.height}px`}:void 0});function h(){const v=t.value,b=n.value,M=v?.offsetParent;if(!v||!b||!M)return;const R=getComputedStyle(v),z=p2(v,"--space-2",8),$=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0),T=p2(b,o,Number.POSITIVE_INFINITY),E=window.visualViewport?.offsetTop??0,N=M.getBoundingClientRect().top-E-z-$;u.value=`${Math.max(Math.floor(Math.min(T,N)),0)}px`,vt(d)}function m(){const v=n.value;if(!v)return;const b=v.querySelectorAll('[role="option"]')[s?.value??-1];if(!b)return;const M=v.getBoundingClientRect(),R=b.getBoundingClientRect(),z=R.top-M.top+v.scrollTop,$=z+R.height;zv.scrollTop+v.clientHeight&&(v.scrollTop=$-v.clientHeight)}let k=null;function x(v){const b=n.value,M=c.value;if(!b||!M)return;v.preventDefault(),k?.();const R=v.pointerId;(v.target instanceof Element?v.target:null)?.setPointerCapture?.(R);const $=p2(b,"--menu-scrollbar-track-inset",0),T=b.clientHeight-$*2-M.height,E=b.scrollHeight-b.clientHeight,N=v.clientY,C=b.scrollTop,O=A=>{A.pointerId!==R||T<=0||(b.scrollTop=C+(A.clientY-N)/T*E)},H=A=>{A.pointerId===R&&k?.()};k=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),k=null},window.addEventListener("pointermove",O),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)}let w=null;return xn(()=>{if(typeof ResizeObserver=="function"&&n.value&&(w=new ResizeObserver(v=>{for(const b of v)b.target===n.value?d():h()}),w.observe(n.value),i)){const v=t.value?.offsetParent;v&&w.observe(v)}i&&(window.addEventListener("resize",h),window.visualViewport?.addEventListener("resize",h),window.visualViewport?.addEventListener("scroll",h),h()),d()}),An(()=>{w?.disconnect(),w=null,k?.(),window.removeEventListener("resize",h),window.visualViewport?.removeEventListener("resize",h),window.visualViewport?.removeEventListener("scroll",h)}),Ue(()=>[s?.value,r?.value],()=>{vt(()=>{d(),m()})}),{atTop:l,atBottom:a,thumb:c,scrollStyle:f,thumbStyle:p,onScroll:d,onThumbPointerDown:x}}const Rwe={key:0,class:"slash-empty",role:"status"},Fwe=["id","aria-selected","onMouseenter","onMousedown"],jwe={class:"slash-name"},Owe={key:0,class:"slash-match"},Pwe={class:"slash-desc"},Hwe={key:0,class:"slash-desc-match"},Dwe=Ge({__name:"SlashMenu",props:{items:{},activeIndex:{},query:{default:""},ranges:{default:()=>[]},layout:{default:"popup"}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=U(null);Vl(r);const i=U(null),l=B(()=>n.activeIndex),a=B(()=>n.items),{thumb:c,scrollStyle:u,thumbStyle:d,onScroll:f,onThumbPointerDown:p}=SN({menuEl:r,scrollEl:i,maxHeightVar:"--p-slash-menu-h",activeIndex:l,refreshKey:a,fitToViewport:n.layout!=="sheet"}),h=B(()=>n.items.map((m,k)=>{const x=m.isSkill?m.desc:s(m.desc),w=n.ranges[k]??Bwe(n.query,m.name,x);return{item:m,namePieces:_C(m.name,w.name),desc:x,descPieces:_C(x,w.desc)}}));return(m,k)=>(g(),S("div",{ref_key:"menuEl",ref:r,class:Be(["slash-menu",{"is-sheet":n.layout==="sheet"}]),"data-menu-frame":""},[n.items.length===0?(g(),S("div",Rwe,I(y(s)("composer.noCommands")),1)):J("",!0),_("div",{ref_key:"scrollEl",ref:i,class:"slash-scroll",role:"listbox",style:Wt(y(u)),onScroll:k[0]||(k[0]=(...x)=>y(f)&&y(f)(...x))},[(g(!0),S(Me,null,rt(h.value,(x,w)=>(g(),S("div",{id:`composer-slash-option-${w}`,key:`${x.item.name}-${w}`,class:Be(["slash-item",{active:w===n.activeIndex}]),role:"option","aria-selected":w===n.activeIndex,onMouseenter:v=>o("hover",w),onMousedown:xt(v=>o("select",x.item),["prevent"])},[_("span",jwe,[(g(!0),S(Me,null,rt(x.namePieces,(v,b)=>(g(),S(Me,{key:b},[v.hit?(g(),S("span",Owe,I(v.text),1)):(g(),S(Me,{key:1},[He(I(v.text),1)],64))],64))),128))]),_("span",Pwe,[(g(!0),S(Me,null,rt(x.descPieces,(v,b)=>(g(),S(Me,{key:b},[v.hit?(g(),S("span",Hwe,I(v.text),1)):(g(),S(Me,{key:1},[He(I(v.text),1)],64))],64))),128))])],42,Fwe))),128))],36),y(c)&&n.items.length>0?(g(),S("div",{key:1,class:"scroll-thumb",style:Wt(y(d)),onPointerdown:k[1]||(k[1]=(...x)=>y(p)&&y(p)(...x))},null,36)):J("",!0)],2))}}),SC=mt(Dwe,[["__scopeId","data-v-9f177a8d"]]),Vwe={key:0,class:"mention-state dim",role:"status"},Wwe={key:1,class:"mention-state dim",role:"status"},qwe=["id","aria-selected","onMouseenter","onMousedown"],Uwe=["innerHTML"],Zwe={class:"mention-name"},Kwe={key:0,class:"mention-hit"},Gwe={class:"mention-meta"},Ywe=["innerHTML"],Xwe={class:"mention-name"},Jwe={key:0,class:"mention-hit"},Qwe={key:0,class:"mention-meta"},eye={key:0,class:"mention-hit"},tye=Ge({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean,default:!1},stale:{type:Boolean,default:!1},layout:{default:"popup"}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=U(null);Vl(r);const i=U(null),l=B(()=>n.activeIndex),a=B(()=>n.items),{thumb:c,scrollStyle:u,thumbStyle:d,onScroll:f,onThumbPointerDown:p}=SN({menuEl:r,scrollEl:i,maxHeightVar:"--p-mention-menu-h",activeIndex:l,refreshKey:a,fitToViewport:n.layout!=="sheet"});function h(v){const b=v.endsWith("/")?v.slice(0,-1):v,M=b.lastIndexOf("/");return M===-1?"":b.slice(0,M)}function m(v){const b=v.file.path.endsWith("/")?v.file.path.slice(0,-1):v.file.path;return Lm(v.file.name,v.file.matchPositions,Math.max(0,b.length-v.file.name.length))}function k(v){return Lm(h(v.file.path),v.file.matchPositions,0)}function x(v){return Lm(v.skill.name,v.matchPositions,0)}function w(v){return v.kind==="skill"?`skill:${v.skill.name}`:v.file.path}return(v,b)=>(g(),S("div",{ref_key:"menuEl",ref:r,class:Be(["mention-menu",{"is-sheet":n.layout==="sheet"}]),"data-menu-frame":""},[n.loading&&n.items.length===0?(g(),S("div",Vwe,I(y(s)("mention.searching")),1)):n.items.length===0?(g(),S("div",Wwe,I(y(s)("mention.noMatch")),1)):J("",!0),n.loading&&n.items.length>0?(g(),ce(Go,{key:2,class:"mention-spin",size:"sm",label:y(s)("mention.searching")},null,8,["label"])):J("",!0),_("div",{ref_key:"scrollEl",ref:i,class:"mention-scroll",role:"listbox",style:Wt(y(u)),onScroll:b[0]||(b[0]=(...M)=>y(f)&&y(f)(...M))},[(g(!0),S(Me,null,rt(n.items,(M,R)=>(g(),S("div",{id:`composer-mention-option-${R}`,key:w(M),class:Be(["mention-item",{active:R===n.activeIndex,stale:n.stale&&M.kind!=="skill"}]),role:"option","aria-selected":R===n.activeIndex,onMouseenter:z=>o("hover",R),onMousedown:xt(z=>o("select",M),["prevent"])},[M.kind==="skill"?(g(),S(Me,{key:0},[_("span",{class:"mention-icon",innerHTML:y(ji)("sparkles","sm"),"aria-hidden":"true"},null,8,Uwe),_("span",Zwe,[(g(!0),S(Me,null,rt(x(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",Kwe,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))]),_("span",Gwe,I(M.skill.description),1)],64)):(g(),S(Me,{key:1},[_("span",{class:"mention-icon",innerHTML:y(mu)(M.file.path,M.file.name),"aria-hidden":"true"},null,8,Ywe),_("span",Xwe,[(g(!0),S(Me,null,rt(m(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",Jwe,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))]),h(M.file.path)?(g(),S("span",Qwe,[(g(!0),S(Me,null,rt(k(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",eye,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))])):J("",!0)],64))],42,qwe))),128))],36),y(c)&&n.items.length>0?(g(),S("div",{key:3,class:"scroll-thumb",style:Wt(y(d)),onPointerdown:b[1]||(b[1]=(...M)=>y(p)&&y(p)(...M))},null,36)):J("",!0)],2))}}),CC=mt(tye,[["__scopeId","data-v-0ac2fbc1"]]),CN=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/workflow",desc:"commands.dynamicWorkflow.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function nye(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const j5="skill:";function oye(e){return e.startsWith(j5)?e.slice(j5.length):e}function MN(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${j5}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...CN,...t]}function sye(e,t=CN){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const r=o.name.toLowerCase().replace(/^\//,"");let i=0;return r===n?i=3:r.startsWith(n)?i=2:r.includes(n)&&(i=1),{item:o,index:s,score:i}}).filter(({score:o})=>o>0).toSorted((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Up(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function AN(e){return e?.supportEfforts??[]}function rye(e){return e[Math.floor(e.length/2)]}function jd(e){if(Up(e)==="unsupported")return"off";const t=AN(e);return t.length>0?e?.defaultEffort??rye(t):"on"}function Zp(e){const t=AN(e),n=Up(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Od(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function iye(e,t){return Zp(e).includes(t)}function TN(e,t){return t==="off"?"off":t==="on"?jd(e):t}function r9(e,t){return t??jd(e)}function lye(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function aye(e,t,n){return!n||e===void 0?t:jd(e)}const O5=100;function cye(e){const t=hu(ln.inputHistory);if(Array.isArray(t)){const n=t.filter(r=>typeof r=="string"&&r.length>0);if(!e||n.length===0)return{};const o=n.length>O5?n.slice(-O5):n,s={[e]:o};return p1(ln.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function uye(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,r=U(cye(s())),i=B(()=>r.value[s()??""]??[]);let l=-1,a="";function c(x){const w=s();if(l=-1,!w)return;const v=x.trim();if(!v)return;const b=r.value[w]??[];if(b.at(-1)===v)return;const M=[...b,v],R=M.length>O5?M.slice(-O5):M;r.value={...r.value,[w]:R},p1(ln.inputHistory,r.value)}function u(){const x=n.value;return x?(x.selectionStart??0)===0:!1}function d(x){t.value=x,vt(()=>{const w=n.value;if(!w)return;o();const v=x.length;w.setSelectionRange(v,v)})}function f(){const x=i.value;if(x.length!==0){if(l===-1)a=t.value,l=x.length-1;else if(l>0)l-=1;else return;d(x[l])}}function p(){if(l===-1)return;const x=i.value;l0}return Ue(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:p,resetBrowsing:h,isBrowsing:m,hasHistory:k}}function dye(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:r,historyPush:i,clearDraft:l}=e,a=U(!1),c=U([]),u=U(0);function d(){const p=t.value;p.startsWith("/")&&!p.includes(" ")?(c.value=sye(p,MN(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(p){if(a.value=!1,p.acceptsInput){t.value=`${p.name} `,vt(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),o()});return}t.value="",l?.(),i(p.name),r(p.name)}return{open:a,items:c,active:u,update:d,select:f}}function fye(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s,searchSkills:r,insertSkill:i}=e,l=U(!1),a=U([]),c=U(0),u=U(!1),d=U(!1);let f=null,p=0;function h(){const w=t.value,v=n.value?.selectionStart??w.length;let b=v-1;for(;b>=0&&!/\s/.test(w[b]);)b--;b++;const M=w.slice(b,v);return M.startsWith("@")?{token:M.slice(1),start:b,end:v}:null}function m(){const w=h(),v=s(),b=r?.();if(!w||!v&&!b){l.value=!1,d.value=!1;return}const M=w.token;f!==null&&clearTimeout(f),f=setTimeout(async()=>{const R=++p;u.value=!0,l.value=!0,c.value=0,a.value.length>0&&(d.value=!0);try{const[z,$]=await Promise.all([v?v(M).catch(()=>[]):Promise.resolve([]),b?b(M).catch(()=>[]):Promise.resolve([])]);if(R!==p)return;a.value=[...z.map(T=>({kind:T.path.endsWith("/")?"folder":"file",file:{...T,matchPositions:bC(M,T.path)}})),...$.map(T=>({kind:"skill",skill:T,matchPositions:bC(M,T.name)}))]}catch{R===p&&(a.value=[])}finally{R===p&&(u.value=!1,d.value=!1)}},200)}function k(){f!==null&&clearTimeout(f),f=null,p++,l.value=!1,u.value=!1,d.value=!1}function x(w){const v=h();if(!v)return;if(l.value=!1,w.kind==="skill"){i?.(w.skill.name);return}const b=t.value,M=w.file.name||w.file.path.split(/[\\/]/).findLast(Boolean)||w.file.path,R=Mv({kind:w.kind,name:M,path:w.file.path});t.value=`${b.slice(0,v.start)}${R} ${b.slice(v.end)}`,vt(()=>{const z=n.value;if(!z)return;const $=v.start+R.length+1;z.setSelectionRange($,$),z.focus(),o()})}return{open:l,items:a,active:c,loading:u,stale:d,update:m,select:x,close:k,getMentionToken:h}}function pye(e){const{sessionId:t}=e;function n(c){return Yo(fk(c))??""}function o(c,u){const d=fk(c);u?vs(d,u):w0(d)}const s=U(n(t())),r=U(null);function i(){const c=r.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ue(s,c=>{vt(i),o(t(),c)}),Ue(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),vt(i))});function l(c){s.value=c,vt(()=>{const u=r.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),i()})}function a(){o(t(),"")}return{text:s,textareaRef:r,autosize:i,loadForEdit:l,clearDraft:a}}function hye(e){const{uploadImage:t,sessionId:n}=e,o=U({}),s=B(()=>o.value[n()??""]??[]),r=U(null),i=U(null),l=U(!1);let a=0;function c(){return`att_${++a}`}function u(F,j){o.value={...o.value,[F]:j}}function d(F){if(F.previewUrl!==void 0)try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":"file"}async function p(F){const j=t();if(!j)return;const q=n()??"";if(F.length!==0)for(const P of F){const W=f(P.type),G=c(),ee=W==="file"?void 0:URL.createObjectURL(P),se={localId:G,name:P.name,kind:W,previewUrl:ee,mediaType:P.type||"application/octet-stream",size:P.size,uploading:!0};u(q,[...o.value[q]??[],se]),j(P,P.name).then(oe=>{const Q=o.value[q]??[];u(q,Q.map(ge=>ge.localId===G?{...ge,uploading:!1,fileId:oe?.fileId,mediaType:oe?.mediaType??ge.mediaType,error:oe===null}:ge))}).catch(()=>{const oe=o.value[q]??[];u(q,oe.map(Q=>Q.localId===G?{...Q,uploading:!1,error:!0}:Q))})}}function h(F){const j=n()??"",q=o.value[j]??[],P=q.find(W=>W.localId===F);r.value?.localId===F&&(r.value=null),P&&d(P),u(j,q.filter(W=>W.localId!==F))}function m(F){r.value=F}function k(){r.value=null}function x(){i.value?.click()}function w(F){const j=F.target,q=Array.from(j.files??[]);p(q),j.value=""}function v(F){if(!t())return;const j=F.clipboardData;if(!j)return;const q=[],P=new Set,W=(G,ee)=>{const se=`${G.size}:${G.type}:${ee}`;if(P.has(se))return;P.add(se);const oe=G.type.split("/")[1]??"png",Q=ee.includes(".")?ee:`paste-${Date.now()}.${oe}`;q.push(G instanceof File?G:new File([G],Q,{type:G.type}))};for(const G of Array.from(j.items))if(G.kind==="file"){const ee=G.getAsFile();ee&&W(ee,ee.name||`paste-${Date.now()}.${G.type.split("/")[1]??"png"}`)}for(const G of Array.from(j.files))W(G,G.name);q.length!==0&&(F.preventDefault(),p(q))}let b=0;function M(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(q=>q.kind==="file")||(F.preventDefault(),F.stopPropagation(),l.value=!0)}function R(){l.value=!1}function z(F){if(b=0,l.value=!1,!t())return;F.preventDefault(),F.stopPropagation();const j=Array.from(F.dataTransfer?.files??[]);p(j)}function $(F){return Array.from(F.dataTransfer?.items??[]).some(j=>j.kind==="file")}function T(F){!t()||!$(F)||(F.preventDefault(),b+=1,l.value=!0)}function E(F){!t()||!$(F)||F.preventDefault()}function N(F){!t()||!$(F)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function C(F){if(b=0,l.value=!1,!t())return;F.preventDefault();const j=Array.from(F.dataTransfer?.files??[]);p(j)}function O(){const F=n()??"";for(const j of o.value[F]??[])d(j);u(F,[])}function H(F,j,q){const P=o.value[F]??[];P.some(W=>W.localId===j)&&u(F,P.map(W=>W.localId===j?{...W,...q}:W))}function V(F){return fetch(F).then(j=>{if(!j.ok)throw new Error(`fetch failed: ${j.status}`);return j.blob()})}function A(F){const j=n()??"";for(const q of o.value[j]??[])d(q);u(j,[]);for(const q of F){const P=c(),W=/^data:/i.test(q.url),G=/^blob:/i.test(q.url),ee=q.name??q.kind;if(q.fileId){const se={localId:P,name:ee,kind:q.kind,previewUrl:q.kind==="file"?void 0:q.url,uploading:!1,fileId:q.fileId};u(j,[...o.value[j]??[],se]),q.kind!=="file"&&!W&&!G&&At().getFileBlob(q.fileId).then(oe=>{const Q=URL.createObjectURL(oe);if(!(o.value[j]??[]).some(xe=>xe.localId===P)){URL.revokeObjectURL(Q);return}H(j,P,{previewUrl:Q})}).catch(()=>{})}else{if(!q.url)continue;const se=t();if(!se)continue;const oe={localId:P,name:ee,kind:q.kind,previewUrl:q.url,uploading:!0};u(j,[...o.value[j]??[],oe]),V(q.url).then(Q=>{const ge=ee.includes(".")?ee:`${ee}.${Q.type.split("/")[1]??"bin"}`;return se(Q,ge)}).then(Q=>{if(Q===null){const ge=o.value[j]??[];u(j,ge.filter(xe=>xe.localId!==P));return}H(j,P,{uploading:!1,fileId:Q.fileId})}).catch(()=>{const Q=o.value[j]??[];u(j,Q.filter(ge=>ge.localId!==P))})}}}return Ue(n,()=>{r.value=null}),xn(()=>{document.addEventListener("paste",v),document.addEventListener("dragenter",T),document.addEventListener("dragover",E),document.addEventListener("dragleave",N),document.addEventListener("drop",C)}),An(()=>{document.removeEventListener("paste",v),document.removeEventListener("dragenter",T),document.removeEventListener("dragover",E),document.removeEventListener("dragleave",N),document.removeEventListener("drop",C);for(const F of Object.values(o.value))for(const j of F)d(j);r.value=null}),{attachments:s,previewAttachment:r,fileInputRef:i,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:k,openFilePicker:x,handleFileInputChange:w,handleDragOver:M,handleDragLeave:R,handleDrop:z,clearAfterSubmit:O,loadAttachments:A}}const mye=640,gye=`(max-width: ${mye}px)`;function Kp(){const e=U(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(gye);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),An(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),An(()=>t.removeListener(n))),e}const vye={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},wye=["stroke-dasharray","stroke-dashoffset"],$m=7,yye=Ge({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*$m;return(o,s)=>(g(),S("svg",vye,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:$m,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:$m,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,wye)]))}}),kye=mt(yye,[["__scopeId","data-v-97f3cf66"]]),bye=["aria-selected","onClick"],_ye=Ge({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(g(),S("div",{class:Be(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(g(!0),S(Me,null,rt(e.options,r=>(g(),S("button",{key:r.value,class:Be(["ui-seg__item",{"is-on":r.value===e.modelValue}]),type:"button",role:"tab","aria-selected":r.value===e.modelValue,onClick:i=>n("update:modelValue",r.value)},I(r.label),11,bye))),128))],2))}}),nr=mt(_ye,[["__scopeId","data-v-bffb3dae"]]),Nm=["pythinking","pyreasoning","pypondering","pyplanning","pyiterating","pyorchestrating","reasonating","pondercrafting","neuroning","logic-weaving","rubber-duckoning","token-wrangling","bug-whispering","stack-divining","gizmo-tinkering"],EN=6e4;function xye(e=Date.now()){const t=Math.floor(e/EN)%Nm.length;return Nm[t]??Nm[0]}function Sye(e=Date.now()){return`${xye(e)}…`}const Wl=["⣷","⣯","⣟","⡿","⢿","⣻","⣽","⣾"],m0=80,Cye=["aria-label"],Mye=Ge({__name:"ActivitySpinner",props:{fast:{type:Boolean},label:{}},setup(e){const t=Wl.length*m0,n=m0/2,o=e,s=U(Date.now());let r;xn(()=>{o.label===void 0&&(r=setInterval(()=>{s.value=Date.now()},EN))}),An(()=>{r!==void 0&&clearInterval(r)});const i=B(()=>o.label??Sye(s.value));function l(a){return{"--spinner-frame-delay":`${a*m0-t}ms`,"--spinner-frame-fast-delay":`${a*n-t/2}ms`}}return(a,c)=>(g(),S("span",{class:Be(["activity-spin",{"activity-spin--fast":e.fast}]),"aria-label":i.value,role:"img"},[(g(!0),S(Me,null,rt(y(Wl),(u,d)=>(g(),S("span",{key:u,class:"activity-frame",style:Wt(l(d)),"aria-hidden":"true"},I(u),5))),128))],10,Cye))}}),zm=mt(Mye,[["__scopeId","data-v-c12d8332"]]),Aye=["disabled"],Tye={key:0,class:"leading"},Eye={class:"label"},Iye={key:1,class:"count"},Lye={key:2,class:"trailing"},$ye=Ge({__name:"MenuRow",props:{count:{},active:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(g(),S("button",{type:"button",class:Be(["menu-row",{active:e.active,selected:e.selected,disabled:e.disabled}]),disabled:e.disabled},[t.$slots.leading?(g(),S("span",Tye,[Tn(t.$slots,"leading",{},void 0,!0)])):J("",!0),_("span",Eye,[Tn(t.$slots,"label",{},()=>[Tn(t.$slots,"default",{},void 0,!0)],!0)]),e.count!==void 0?(g(),S("span",Iye,I(e.count),1)):J("",!0),t.$slots.trailing?(g(),S("span",Lye,[Tn(t.$slots,"trailing",{},void 0,!0)])):J("",!0)],10,Aye))}}),uc=mt($ye,[["__scopeId","data-v-261bf74a"]]),Nye=["aria-checked","disabled"],zye=Ge({__name:"SwitchToggle",props:{modelValue:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t;function s(){n.disabled||o("update:modelValue",!n.modelValue)}function r(i){n.disabled||i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),s())}return(i,l)=>(g(),S("button",{type:"button",class:"switch-toggle",role:"switch","aria-checked":e.modelValue,disabled:e.disabled,onClick:s,onKeydown:r},[...l[0]||(l[0]=[_("span",{class:"track","aria-hidden":"true"},null,-1),_("span",{class:"thumb","aria-hidden":"true"},null,-1)])],40,Nye))}}),MC=mt(zye,[["__scopeId","data-v-169237c7"]]);function Bye({initialized:e,onboardingCompleted:t,authReady:n}){return e?t?n?"app":"recovery":"first-run":"loading"}function Rye(e,t){return e||t}function Fye(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const jye=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Vi(e){const t=e.replaceAll("\\","/"),n=jye.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function Oye(e,t){const n=Vi(t.cwd);return e.find(o=>Vi(o.root)===n)?.id??t.workspaceId??t.cwd}function Pye(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,r=new Set(o.map(Vi)),i=new Map;for(const d of t){const f=Vi(d.root);r.has(f)||i.has(f)||i.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const p=Vi(f);r.has(p)||i.has(p)||i.set(p,{id:d.workspaceId??f,root:f,name:Fye(f),sessionCount:0})}const l=new Map;for(const d of n){const f=Oye(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Vi(d.root);!r.has(f)&&!a.includes(f)&&a.push(f)}const c=[...i.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>i.get(d).root.localeCompare(i.get(f).root));const u=[];for(const d of[...a,...c]){const f=i.get(d),p=l.get(f.id)??l.get(f.root)??0,h=s[f.id]===!1?p:Math.max(f.sessionCount,p);u.push({...f,sessionCount:h})}return u}function Hye(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(i=>i.id)),s=new Set(t.filter(i=>i.role==="user").map(i=>i.id)),r=e.filter(i=>{const l=Date.parse(i.createdAt);return!(Number.isNaN(l)||l>=n||o.has(i.id)||i.role==="user"&&i.promptId!==void 0&&s.has(i.promptId))});return r.length>0?[...r,...t]:t}function AC(e,t){const n=new Set(e.map(c=>c.id)),o=t.filter(c=>c.kind==="subagent"&&!n.has(c.id));if(o.length===0)return e;const s=new Map(e.map(c=>[c.id,c])),r=new Map;for(const c of e)c.kind==="subagent"&&c.agentId!==void 0&&!r.has(c.agentId)&&r.set(c.agentId,c);const i=new Set,l=o.map(c=>{const u=(c.backgroundTaskId!==void 0?s.get(c.backgroundTaskId):void 0)??r.get(c.id)??(c.agentId!==void 0?r.get(c.agentId):void 0);if(u===void 0)return c;i.add(u.id);const d=c.status==="running"&&u.status!=="running",f=u.completedAt!==void 0&&u.completedAtEstimated!==!0;return{...c,status:c.status==="running"?u.status:c.status,subagentPhase:d?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":c.subagentPhase,agentId:c.agentId??u.agentId,model:c.model??u.model,thinkingEffort:c.thinkingEffort??u.thinkingEffort,completedAt:f?u.completedAt:c.completedAt??u.completedAt,completedAtEstimated:f?u.completedAtEstimated:c.completedAt!==void 0?c.completedAtEstimated:u.completedAtEstimated,outputPreview:u.outputPreview??c.outputPreview,outputBytes:u.outputBytes??c.outputBytes}});return[...e.filter(c=>!i.has(c.id)),...l]}function Dye(e,t){if(e.length===0)return t;const n=new Map(t.map(i=>[i.id,i])),o=new Set(e.map(i=>i.id)),s=e.map(i=>{const l=n.get(i.id);return l?{...i,outputLines:l.outputLines,text:l.text}:i}),r=t.filter(i=>!o.has(i.id));return r.length===0?s:[...s,...r]}function Vye(e){const t=new Map,n=new Set;function o(r){const i=t.get(r);if(i!==void 0)return i;const l=(async()=>e(r))().finally(()=>{t.delete(r),n.delete(r)&&o(r)});return t.set(r,l),l}function s(r){if(t.has(r)){n.add(r);return}o(r)}return{run:o,request:s}}const Wye=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function qye(e){return Wye.has(e.type)}const Uye=50,Zye=100,M7=32*1024,Kye={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,Uye)},cancelTask(e){clearTimeout(e)}};function Gye(e,t,n={}){const o=n.scheduler??Kye,s=Math.max(1,Math.floor(n.maxItemsPerSlice??Zye)),r=[];let i=0,l=null,a=null,c=0,u=!1;const d=()=>r.length-i,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},p=()=>{i===r.length?(r.length=0,i=0):i>=1024&&(r.splice(0,i),i=0)};let h;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const x=++c,w=()=>{x===c&&h()};l=o.requestFrame(w),a=o.requestTask(w)};h=()=>{f();let x=0;for(;!u&&x{if(!u){if(t(x)){const w=r.length>i?r.at(-1):void 0,v=w===void 0?void 0:n.coalesce?.(w,x);v===void 0?r.push(x):r[r.length-1]=v,m();return}if(d()===0){e(x);return}r.push(x),h()}});return k.flush=()=>{if(!u){for(f();!u&&i{if(u||d()===0)return;let w=i;for(let v=i;v{u||(u=!0,f(),r.length=0,i=0)},k}function A7(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function Yye(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=A7(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=M7)return[e];const s=[];let r=0;for(;rr&&/[\uD800-\uDBFF]/u.test(o.value[i-1])&&/[\uDC00-\uDFFF]/u.test(o.value[i])&&(i-=1);const l=o.value.slice(r,i);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+r}}}),r=i}return s}function Xye(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=A7(e.appEvent),r=A7(t.appEvent);if(n===void 0||o===void 0||s===void 0||r===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==r.kind||n.kind!==s.kind||o.kind!==r.kind||o.offset!==n.offset+s.value.length||s.value.length+r.value.length>M7)return;const i=s.value+r.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:i}:{thinking:i}},meta:{...t.meta,stream:{...n}}}}const IN=[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],LN=new Set(["blue","mono"]),$N=new Set(["light","dark","system"]),NN=14,Jye=12,Qye=20,eke={small:12,medium:14,large:16,xlarge:18};function tke(){const e=Yo(ln.accent);return e&&LN.has(e)?e:"blue"}function nke(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function oke(){const e=Yo(ln.colorScheme);return e&&$N.has(e)?e:"system"}function ske(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#121212":e==="light"?"#ffffff":null;t.forEach(o=>{const r=(o.getAttribute("media")??"").includes("dark")?"#121212":"#ffffff";o.setAttribute("content",n??r)})}function i9(e){return Number.isFinite(e)?Math.min(Qye,Math.max(Jye,Math.round(e))):NN}function l9(e){const t=i9(e);return t<=13?"small":t<=15?"medium":t<=17?"large":"xlarge"}function zN(e){return eke[e]}function rke(){const e=Yo(ln.uiFontSize);return e===null?NN:i9(Number(e))}function ike(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=l9(e))}const a9=U(oke()),c9=U(tke()),u9=U(rke());Ue(a9,ske,{immediate:!0});Ue(c9,nke,{immediate:!0});Ue(u9,ike,{immediate:!0});function lke(e){$N.has(e)&&(a9.value=e,vs(ln.colorScheme,e))}function ake(e){LN.has(e)&&(c9.value=e,vs(ln.accent,e))}function cke(e){const t=i9(e);u9.value=t,vs(ln.uiFontSize,String(t))}const uke=600,dke=250,Gp=250,fke=1e3,pke=160,P5=U(!1);let e0=[],l0=null,H5=-Gp;function hke(){e0=[],H5=-Gp,P5.value=!1,l0!==null&&(clearTimeout(l0),l0=null)}function mke(){P5.value=!0,l0!==null&&clearTimeout(l0),l0=setTimeout(()=>{l0=null,e0=[],H5=-Gp,P5.value=!1},fke)}function gke(e){if(e<=0)return;const t=Date.now();e0.push({time:t,chars:e});const n=t-uke;if(e0=e0.filter(l=>l.time>=n),t-H5l+a.chars,0)/s*1e3>=pke&&mke()}function d9(){return{colorScheme:a9,accent:c9,uiFontSize:u9,fastMoon:P5,setColorScheme:lke,setAccent:ake,setUiFontSize:cke,resetFastMoon:hke,recordMoonDelta:gke}}function vke(e,t,n){return e==="idle"&&!t&&!n}function f9(e,t){const n=Yo(e);return n===null?t:n==="1"}const p9=U(f9(ln.notifyOnComplete,!0)),h9=U(f9(ln.notifyOnQuestion,!1)),m9=U(f9(ln.notifyOnApproval,!1)),g9=U(typeof Notification<"u"?Notification.permission:"denied"),wke="/favicon.ico";async function v9(e,t,n){if(!n){e.value=!1,vs(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}g9.value=o,o==="granted"&&(e.value=!0,vs(t,"1"))}function yke(e){return v9(p9,ln.notifyOnComplete,e)}function kke(e){return v9(h9,ln.notifyOnQuestion,e)}function bke(e){return v9(m9,ln.notifyOnApproval,e)}function w9(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function _ke(e){return{title:yo.global.t("settings.notifyTitle"),body:w9(e,yo.global.t("settings.notifyFallback"))}}function xke(e,t){return{title:yo.global.t("settings.notifyQuestionTitle"),body:w9(t,e,yo.global.t("settings.notifyQuestionFallback"))}}function Ske(e,t){return{title:yo.global.t("settings.notifyApprovalTitle"),body:w9(t,e,yo.global.t("settings.notifyApprovalFallback"))}}function y9(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(r=>{g9.value=r,r==="granted"&&TC(t,n,o)});return}TC(t,n,o)}}function TC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:wke});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Cke(e,t){y9(p9.value,t,_ke(t.sessionTitle),`pythinker-complete-${e}-${t.promptId??Date.now()}`)}function Mke(e){y9(h9.value,e,xke(e.sessionTitle,e.questionPreview),`pythinker-question-${e.questionId}`)}function Ake(e){y9(m9.value,e,Ske(e.sessionTitle,e.toolName),`pythinker-approval-${e.approvalId}`)}function Tke(){return{notifyOnComplete:p9,notifyOnQuestion:h9,notifyOnApproval:m9,notifyPermission:g9,setNotifyOnComplete:yke,setNotifyOnQuestion:kke,setNotifyOnApproval:bke,maybeNotifyCompletion:Cke,maybeNotifyQuestion:Mke,maybeNotifyApproval:Ake}}function Eke(){return Yo(ln.soundOnComplete)==="1"}const ku=U(Eke());function Ike(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Bm=null;function BN(){const e=Ike();if(!e)return null;if(Bm===null)try{Bm=new e}catch{return null}return Bm}function RN(){if(!ku.value)return;const e=BN();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Ol("sound: audio context resumed",{state:e.state})},t=>{Ol("sound: audio context resume rejected",{error:String(t)})})}let EC=!1;function Lke(){if(EC||typeof window>"u")return;EC=!0;const e=()=>{RN()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Lke();function $ke(e){ku.value=e,vs(ln.soundOnComplete,e?"1":"0"),e&&RN()}function IC(e,t,n,o,s){const r=e.createOscillator(),i=e.createGain();r.type="sine",r.frequency.value=t,r.connect(i),i.connect(e.destination);const l=e.currentTime+n;i.gain.setValueAtTime(1e-4,l),i.gain.exponentialRampToValueAtTime(s,l+.01),i.gain.exponentialRampToValueAtTime(1e-4,l+o),r.start(l),r.stop(l+o+.02)}function k9(){const e=BN();if(e===null){Ol("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Ol("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Ol("sound: context resumed for next time",{state:e.state})},t=>{Ol("sound: resume rejected",{error:String(t)})});return}try{IC(e,880,0,.16,.18),IC(e,1320,.1,.22,.16),Ol("sound: chime scheduled",{state:e.state})}catch(t){Ol("sound: failed to play",{error:String(t)})}}function Nke(){ku.value&&k9()}function zke(){ku.value&&k9()}function Bke(){ku.value&&k9()}function Rke(){return{soundOnComplete:ku,setSoundOnComplete:$ke,maybePlayCompletionSound:Nke,maybePlayQuestionSound:zke,maybePlayApprovalSound:Bke}}const Fke=1e3,jke=4096,LC=32*1024;function Oke(e,t){let n=null,o;const s=new Set;async function r(f){try{const h=await At().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:AC(h,e.tasksBySession[f]??[])},await i(f,h)}catch{}}async function i(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=At(),k=new Map;if(await Promise.all(h.map(async w=>{if((w.status==="completed"||w.status==="failed"||w.status==="cancelled")&&!s.has(w.id)&&!((w.outputLines?.length??0)>0))try{const b=await m.getTask(f,w.id,{withOutput:!0,outputBytes:LC});b.outputPreview!==void 0&&k.set(w.id,{preview:b.outputPreview,bytes:b.outputBytes}),s.add(w.id)}catch{}})),k.size===0)return;const x=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:x.map(w=>{const v=k.get(w.id)??(w.backgroundTaskId!==void 0?k.get(w.backgroundTaskId):void 0);return v?{...w,outputPreview:v.preview,outputBytes:v.bytes}:w})}}async function l(f){if(e.activeSessionId!==f)return;const p=At();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async v=>{const b=v.status==="running",M=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!b&&!M)&&!(M&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const R=await p.getTask(f,v.id,{withOutput:!0,outputBytes:b?jke:LC});R.outputPreview!==void 0&&m.set(v.id,{preview:R.outputPreview,bytes:R.outputBytes}),M&&s.add(v.id)}catch{}}));const k=e.tasksBySession[f]??[],x=new Map(k.map(v=>[v.id,v])),w=h.map(v=>{const b=x.get(v.id),M=m.get(v.id);return{...v,outputLines:b?.outputLines,text:b?.text,outputPreview:M?.preview??b?.outputPreview,outputBytes:M?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:AC(w,k)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Fke))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=U(0);let d=null;return Ue(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ue(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let k;p&&f!==void 0?a(f):f!==void 0?k=setTimeout(()=>{(e.tasksBySession[f]??[]).some(w=>w.status==="running")||c()},1500):c(),m(()=>{k!==void 0&&clearTimeout(k)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:r}}function Pke(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function Hke(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const r of e.split(` -`)){if(r.startsWith("diff --git")){s=!1;continue}if(!s&&Pke(r))continue;if(r.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(r);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:r});continue}if(!s||r.startsWith("\\"))continue;const i=r.charAt(0),l=r.slice(1);i==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):i==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):i===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const T7="/sessions/";function $C(e){const{pathname:t}=e;if(!t.startsWith(T7))return;const n=t.slice(T7.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function Dke(e){return e===void 0||e.length===0?"/":`${T7}${encodeURIComponent(e)}`}const Vke=50,E7=5,Wke=40402,qke=40410,Uke=40902,Zke=2e3;function Rm(e){return Ur(e)&&e.code===Uke}const Kke=40904;function Gke(e){return Ur(e)&&e.code===Kke}const W1=Rs({}),W3=Rs({}),Fm=Rs({}),il=Rs(new Set),Yp=new Map,C0=new Map,D5=new Map;let Yke=0;const Z1=new Map,Xke=3;let NC=0;function Jke(){return NC+=1,`${Date.now().toString(36)}-${NC}`}function Qke(e){return{generation:Yp.get(e)??0,pending:(C0.get(e)?.size??0)>0}}function I7(e){const t=++Yke;Yp.set(e,t);const n=C0.get(e)??new Set;return n.add(t),C0.set(e,n),t}function L7(e,t){const n=C0.get(e);if(n===void 0||(n.delete(t),n.size>0))return;C0.delete(e);const o=D5.get(e);D5.delete(e),o?.()}function ebe(e){Yp.delete(e),C0.delete(e),D5.delete(e),Z1.delete(e)}function tbe(e,t){return!t.pending&&t.generation===(Yp.get(e)??0)}function nbe(e,t){if((C0.get(e)?.size??0)===0){t();return}D5.set(e,t)}function obe(e,t){const{t:n}=yo.global,{confirm:o}=y1(),{taskPoller:s,sideChat:r,modelProvider:i,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:p,forgetSession:h,setActiveSessionId:m,updateSessionMessages:k,nextOptimisticMsgId:x,getEventConn:w,syncSessionFromSnapshot:v,reopenSession:b,hasLoadedMessages:M,refreshSessionStatus:R,refreshSessionGoal:z,persistSessionProfile:$,mergedWorkspaces:T,workspacesView:E,status:N,workspaceIdForSession:C,savePermissionToStorage:O,seedPermissionFromDaemonDefault:H,savePlanModeToStorage:V,saveDynamicWorkflowModeToStorage:A,saveGoalModeToStorage:F,draftModes:j,saveUnread:q,saveActiveWorkspaceToStorage:P,saveHiddenWorkspacesToStorage:W,goalErrorMessage:G,resetFastMoon:ee,initialized:se,connectIssue:oe,selectedDiffPath:Q,fileDiffLines:ge,fileDiffLoading:xe}=t;let Ke=!1;async function et(ie){if(e.messagesLoadingMoreBySession[ie])return;const _e=e.messagesBySession[ie];if(!_e||_e.length===0)return;const Ie=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ie]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ie]:!1};try{const je=await At().listMessages(ie,{beforeId:Ie,pageSize:Vke}),nt=[...je.items].toReversed();k(ie,kt=>[...nt,...kt]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[ie]:je.hasMore}}catch(je){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[ie]:!0},l("loadOlderMessages",je,{sessionId:ie})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[ie]:!1}}}function Y(ie){s.loadTasksForSession(ie),X(ie),R(ie),z(ie),Object.prototype.hasOwnProperty.call(i.skillsBySession.value,ie)||i.loadSkillsForSession(ie)}async function ne(ie){const _e=e.activeSessionId;if(_e){Q.value=ie,ge.value=[],xe.value=!0;try{const je=await At().getFileDiff(_e,ie);if(Q.value!==ie)return;ge.value=Hke(je.diff)}catch(Ie){Q.value===ie&&(ge.value=[]),console.warn("[loadFileDiff] diff unavailable for",ie,Ie)}finally{Q.value===ie&&(xe.value=!1)}}}function D(){Q.value=null,ge.value=[],xe.value=!1}async function X(ie){try{const Ie=await At().getGitStatus(ie);e.gitStatusBySession={...e.gitStatusBySession,[ie]:Ie}}catch{}}async function ve(){try{const _e=await At().getAuth();return e.authReady=_e.ready,e.defaultModel=_e.defaultModel,oe.value=null,"proceed"}catch(ie){return Ur(ie)&&(ie.code===401||ie.code===mN)?(oe.value=null,"server-auth-required"):(oe.value=(ie instanceof Error?ie.message:String(ie)).slice(0,140),"retry")}}async function fe(){let ie=!0;for(;;){const _e=await ve();if(_e!=="retry")return _e;ie&&(oe.value=null,ie=!1),await new Promise(Ie=>{setTimeout(Ie,Zke)})}}async function pe(){try{const ie=At();e.config=await ie.getConfig(),H()}catch{}}function te(ie){ie!=="manual"&&ie!=="auto"&&ie!=="yolo"||(e.permission=ie,O(ie),$({permissionMode:ie}))}function de(ie,_e){if(_e===ie)return;i.draftModel.value=null;const Ie=e.activeSessionId;if(!Ie)return;const je=e.sessions.find(nt=>nt.id===Ie);je===void 0||je.messageCount>0||je.busy||e.inFlightBySession[Ie]||!je.model||je.model.length===0||je.model!==ie||(d(Ie,nt=>({...nt,model:_e})),$({model:_e},Ie))}async function ye(ie){try{const _e=At(),Ie=e.defaultModel,je=await _e.setConfig(ie);e.config=je,e.defaultModel=je.defaultModel??null;const nt=je.defaultModel;return ie.defaultPermissionMode!==void 0&&te(je.defaultPermissionMode??ie.defaultPermissionMode),ie.defaultModel!==void 0&&nt!==null&&nt!==void 0&&nt.length>0&&de(Ie,nt),!0}catch(_e){return l("setConfig",_e),!1}}const Ce=100,me=30,be=720*60*1e3;async function re(){const ie=At(),_e=[];let Ie,je;for(;;){let nt;try{nt=await ie.listSessions({pageSize:Ce,beforeId:Ie,excludeEmpty:!0})}catch(kt){if(_e.length===0)throw kt;je=kt;break}if(_e.push(...nt.items),!nt.hasMore||nt.items.length===0)break;Ie=nt.items.at(-1).id}return{sessions:_e,error:je}}function ke(ie){const _e=new Map(e.sessions.map(Ie=>[Ie.id,Ie.usage]));u(ie.map(Ie=>{const je=_e.get(Ie.id);return je!==void 0&&g7(Ie.usage)&&!g7(je)?{...Ie,usage:je}:Ie}))}function Fe(ie){const _e=[...ie],Ie=new Set(_e.map(je=>je.id));for(const je of e.sessions)Ie.has(je.id)||(_e.push(je),Ie.add(je.id));return _e.sort((je,nt)=>new Date(nt.updatedAt).getTime()-new Date(je.updatedAt).getTime()),_e}async function at(ie){const _e=At(),Ie=[],je=Date.now(),nt=cn=>je-new Date(cn.updatedAt).getTime();let kt,Pt=!1,jt=!0,Ln;for(;;){let cn;try{cn=await _e.listSessions({workspaceId:ie,pageSize:E7,beforeId:kt,excludeEmpty:!0})}catch(qt){if(jt)throw qt;Ln=qt,Pt=!0;break}if(Pt=cn.hasMore,cn.items.length===0)break;const Rn=cn.items.at(-1),wo=nt(Rn)>=be;if(!jt&&wo){const qt=cn.items.findIndex(Nn=>nt(Nn)>=be),$n=qt>=0?qt+1:cn.items.length;Ie.push(...cn.items.slice(0,$n)),Pt=cn.hasMore||$nat(qt.id))),Ie=[],je=new Set,nt=new Map,kt=new Set;let Pt;for(let qt=0;qt<_e.length;qt++){const $n=_e[qt];if($n.status==="fulfilled"){nt.set($n.value.workspaceId,$n.value.page),$n.value.error!==void 0&&(kt.size===0&&(Pt=$n.value.error),kt.add($n.value.workspaceId));for(const Nn of $n.value.page.items)je.has(Nn.id)||(Ie.push(Nn),je.add(Nn.id));continue}kt.size===0&&(Pt=$n.reason),kt.add(ie[qt].id)}if(nt.size===0){l("load",Pt);return}const jt=new Set(ie.filter(qt=>kt.has(qt.id)).map(qt=>qt.root)),Ln=new Set(ie.map(qt=>qt.id));for(const qt of e.sessions)!(qt.workspaceId!==void 0&&Ln.has(qt.workspaceId)?kt.has(qt.workspaceId):jt.has(qt.cwd)||kt.has(C(qt)))||je.has(qt.id)||(Ie.push(qt),je.add(qt.id));const cn={},Rn={},wo={};for(const{id:qt}of ie){const $n=nt.get(qt);if($n===void 0){const Nn=e.sessionsHasMoreByWorkspace[qt],qe=e.sessionsCursorByWorkspace[qt],he=e.sessionsInitialCountByWorkspace[qt];Nn!==void 0&&(cn[qt]=Nn),qe!==void 0&&(Rn[qt]=qe),he!==void 0&&(wo[qt]=he);continue}cn[qt]=$n.hasMore,Rn[qt]=$n.items.length>0?$n.items.at(-1).id:void 0,wo[qt]=Math.max($n.items.length,E7)}return e.sessionsHasMoreByWorkspace=cn,e.sessionsCursorByWorkspace=Rn,e.sessionsInitialCountByWorkspace=wo,e.sessionsFullyLoaded=!1,Ie.sort((qt,$n)=>new Date($n.updatedAt).getTime()-new Date(qt.updatedAt).getTime()),kt.size>0&&l("load",Pt),Ie}async function $t(ie){if(e.sessionsLoadingMoreByWorkspace[ie]||e.sessionsHasMoreByWorkspace[ie]===!1)return;const _e=e.sessionsCursorByWorkspace[ie];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ie]:!0};try{const Ie=await At().listSessions({workspaceId:ie,pageSize:me,beforeId:_e,excludeEmpty:!0}),je=new Set(e.sessions.map(kt=>kt.id)),nt=Ie.items.filter(kt=>!je.has(kt.id));nt.length>0&&u([...e.sessions,...nt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[ie]:Ie.items.length>0?Ie.items.at(-1).id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[ie]:Ie.hasMore}}catch(Ie){l("loadMoreSessions",Ie)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[ie]:!1}}}}async function Tt(){if(e.sessionsFullyLoaded)return;const ie=await re().catch(je=>(console.warn("[pythinker-web] loadAllSessions failed; search covers only loaded sessions",je),null));if(ie===null)return;const _e=ie.error===void 0?ie.sessions:Fe(ie.sessions);if(ke(_e),e.sessionsFullyLoaded=ie.error===void 0,ie.error!==void 0)return;const Ie={};for(const je of e.workspaces)Ie[je.id]=!1;e.sessionsHasMoreByWorkspace=Ie}async function Qt(){const ie=await At().getMeta().catch(()=>null);ie!==null&&(e.serverVersion=ie.serverVersion,e.availableOpenInApps=ie.openInApps,e.dangerousBypassAuth=ie.dangerousBypassAuth,e.backend=ie.backend,e.experimentalFlagStates=ie.experimentalFlagStates,e.serverCapabilities=ie.capabilities)}async function Dt(){const ie=Date.now();let _e="accepted";us("app:load:start"),e.loading=!0;const Ie=!se.value;let je=!0;try{if(Ie&&await fe()==="server-auth-required"){je=!1,_e="auth-required";return}const nt=At();await Promise.all([nt.getHealth().catch(()=>null),Qt(),i.loadModels()]),Ie||await ve(),await pe(),await en();const kt=await dt(),Pt=kt??e.sessions;kt!==void 0&&ke(kt);const jt=Pt[0],Ln=e.activeWorkspaceId;!(Ln!==null&&T.value.some(wo=>wo.id===Ln))&&jt&&In(C(jt)),co();const Rn=typeof window<"u"?$C(window.location):void 0;!e.activeSessionId&&Rn!==void 0&&(e.sessions.some(qt=>qt.id===Rn)||await As(Rn))&&await oo(Rn,{urlMode:"replace"}),!e.activeSessionId&&Pt.length>0&&await oo(Pt[0].id,{urlMode:"replace"})}catch(nt){_e="failed",l("load",nt)}finally{e.loading=!1,je&&(se.value=!0),us("app:load:complete",{status:_e,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-ie})}}async function en(){try{const ie=At(),[_e,Ie]=await Promise.all([ie.listWorkspaces().catch(()=>[]),ie.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=kn(_e),e.fsHome=Ie.home||null,e.recentRoots=Ie.recentRoots}catch{}}function kn(ie){const _e=o3();return Object.keys(_e).length===0?ie:ie.map(Ie=>{const je=_e[Ie.root];return je!==void 0?{...Ie,name:je}:Ie})}function In(ie){e.activeWorkspaceId=ie,P(ie)}function Mn(ie){In(ie);const _e=e.sessions.filter(Ie=>C(Ie)===ie);if(_e.length>0){const Ie=_e[0];Ie&&Ie.id!==e.activeSessionId&&oo(Ie.id)}else m(void 0),no(void 0,"push")}function Re(ie){const _e=o3()[ie.root],Ie=_e!==void 0?{...ie,name:_e}:ie,je=Vi(Ie.root);e.hiddenWorkspaceRoots.some(Pt=>Vi(Pt)===je)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Pt=>Vi(Pt)!==je),W(e.hiddenWorkspaceRoots));const nt=e.workspaces.findIndex(Pt=>Pt.id===Ie.id||Pt.root===Ie.root);if(nt===-1){e.workspaces=[Ie,...e.workspaces];return}const kt=[...e.workspaces];kt[nt]=Ie,e.workspaces=kt}function lt(ie){if(ie.type==="workspaceCreated"||ie.type==="workspaceUpdated"){Re(ie.workspace);return}const _e=e.workspaces.find(je=>je.id===ie.workspaceId)?.root??ie.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],W(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(je=>je.id!==ie.workspaceId&&je.root!==_e),e.activeWorkspaceId===ie.workspaceId||e.activeWorkspaceId===_e){const je=E.value[0]?.id??null;if(e.activeWorkspaceId=je,je)P(je);else try{w0(ln.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,D(),no(void 0,"replace")}}function tt(){m(void 0),no(void 0,"push")}function ht(ie){In(ie),tt(),D()}async function bt(ie){const _e=T.value.find(Rn=>Rn.id===ie);if(!_e)return null;const Ie=e.thinking,je=At();let nt,kt=_e.root;try{const Rn=await je.addWorkspace({root:_e.root});nt=Rn.id,kt=Rn.root,Re(Rn)}catch{}const Pt=i.draftModel.value??void 0,jt=await je.createSession({workspaceId:nt,cwd:kt,model:Pt});i.draftModel.value=null;const Ln=Pt!==void 0&&(!jt.model||jt.model.length===0)?{...jt,model:Pt}:jt;f(Ln),In(jt.workspaceId??nt??ie),await oo(jt.id);const cn=jt.id;return Ie!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[cn]:Ie}),j.planMode&&(e.planModeBySession={...e.planModeBySession,[cn]:!0},V()),j.dynamicWorkflowMode&&(e.dynamicWorkflowModeBySession={...e.dynamicWorkflowModeBySession,[cn]:!0},A()),j.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[cn]:!0},F()),j.planMode=!1,j.dynamicWorkflowMode=!1,j.goalMode=!1,cn}async function Rt(ie,_e,Ie){if(!il.has(ie)){il.add(ie);try{const je=await bt(ie);if(!je)return;await Ct(je,_e,Ie)}catch(je){l("startSessionAndSendPrompt",je)}finally{il.delete(ie)}}}async function on(ie,_e,Ie){if(!il.has(ie)){il.add(ie);try{const je=await bt(ie);if(!je)return;const nt=e.planModeBySession[je]??!1,kt=e.dynamicWorkflowModeBySession[je]??!1,Pt=e.sessions.find(cn=>cn.id===je),jt=(Pt?.model&&Pt.model.length>0?Pt.model:e.defaultModel)??void 0;if(!await $({model:jt,planMode:nt,dynamicWorkflowMode:kt,permissionMode:e.permission},je))return;await i.activateSkill(_e,Ie,je)}catch(je){l("startSessionAndActivateSkill",je)}finally{il.delete(ie)}}}async function an(ie,_e){if(!il.has(ie)){il.add(ie);try{const Ie=await bt(ie);if(!Ie)return;await r.openSideChatOn(Ie,_e)}catch(Ie){l("startSessionAndOpenSideChat",Ie)}finally{il.delete(ie)}}}async function sn(ie){const _e=ie.trim();if(!_e)return!1;const Ie=At();try{const je=await Ie.addWorkspace({root:_e});return Re(je),ht(je.id),!0}catch(je){return console.warn("[pythinker-web] addWorkspaceByPath failed for",_e,je),!1}}async function Yn(ie){try{return await At().browseFs(ie)}catch{return{path:"",parent:null,entries:[]}}}async function Kt(){try{return await At().getFsHome()}catch{return{home:"",recentRoots:[]}}}function no(ie,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Ie=Dke(ie);if(window.location.pathname!==Ie)try{_e==="push"?window.history.pushState(null,"",Ie):window.history.replaceState(null,"",Ie)}catch{}}async function As(ie){try{const _e=await At().getSession(ie);return e.sessions.some(Ie=>Ie.id===_e.id)||p(_e),!0}catch{return!1}}function ys(){const ie=$C(window.location);if(ie===void 0){m(void 0);return}if(ie!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===ie)){oo(ie,{urlMode:"none"});return}(async()=>{if(await As(ie)){await oo(ie,{urlMode:"none"});return}const _e=e.sessions[0];_e?await oo(_e.id,{urlMode:"replace"}):(m(void 0),no(void 0,"replace"))})()}}let ao=!1;function co(){ao||typeof window>"u"||(ao=!0,window.addEventListener("popstate",ys))}async function oo(ie,_e){const Ie=M(ie),je=!Ie&&c.has(ie);c.delete(ie);try{no(ie,_e?.urlMode??"push"),e.sessionLoading=!Ie&&!je,m(ie),ee(),e.unreadBySession[ie]&&(e.unreadBySession={...e.unreadBySession,[ie]:!1},q({[ie]:!1})),D();const nt=e.sessions.find(kt=>kt.id===ie);if(nt){const kt=C(nt);e.activeWorkspaceId!==kt&&In(kt)}if(Ie){if(await b(ie)==="not-found")return}else if(await v(ie)==="not-found")return;Y(ie)}catch(nt){l("selectSession",nt,{sessionId:ie})}finally{e.activeSessionId===ie&&(e.sessionLoading=!1)}}async function Ct(ie,_e,Ie){const je=I7(ie);e.inFlightBySession={...e.inFlightBySession,[ie]:!0};const nt=x();try{const kt=At(),Pt=[];_e&&Pt.push({type:"text",text:_e});for(const Nn of Ie??[])Nn.kind==="video"?Pt.push({type:"video",source:{kind:"file",fileId:Nn.fileId}}):Nn.kind==="file"?Pt.push({type:"file",fileId:Nn.fileId,name:Nn.name??"",mediaType:Nn.mediaType||"application/octet-stream",size:Nn.size??0}):Pt.push({type:"image",source:{kind:"file",fileId:Nn.fileId}});if(Pt.length===0)return e.inFlightBySession={...e.inFlightBySession,[ie]:!1},"rejected";const jt={id:nt,sessionId:ie,role:"user",content:Pt,createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};k(ie,Nn=>[...Nn,jt]);const Ln=e.sessions.find(Nn=>Nn.id===ie),cn=(Ln?.model&&Ln.model.length>0?Ln.model:e.defaultModel)??void 0,Rn=e.planModeBySession[ie]??!1,wo=e.dynamicWorkflowModeBySession[ie]??!1,qt=e.goalModeBySession[ie]??!1;if(qt&&_e)try{await kt.updateSession(ie,{goalObjective:_e.trim()})}catch(Nn){return l("createGoal",Nn,{sessionId:ie}),e.inFlightBySession={...e.inFlightBySession,[ie]:!1},k(ie,qe=>qe.some(he=>he.id===nt)?qe.filter(he=>he.id!==nt):qe),"rejected"}const $n=await kt.submitPrompt(ie,{content:Pt,model:cn,thinking:await i.resolveThinkingForPrompt(ie,cn)??e.thinking,permissionMode:e.permission,planMode:Rn,dynamicWorkflowMode:wo});return qt&&(e.goalModeBySession={...e.goalModeBySession,[ie]:!1},F()),e.promptIdBySession={...e.promptIdBySession,[ie]:$n.promptId},k(ie,Nn=>{const qe=Nn.findIndex($e=>$e.id===nt);if(qe===-1)return Nn;const he=[...Nn];return he[qe]={...he[qe],promptId:he[qe].promptId??$n.promptId},he}),w()?.bindNextPromptId(ie,$n.promptId),"ok"}catch(kt){return e.inFlightBySession={...e.inFlightBySession,[ie]:!1},k(ie,Pt=>Pt.some(jt=>jt.id===nt)?Pt.filter(jt=>jt.id!==nt):Pt),l("sendPrompt",kt,{sessionId:ie}),Ur(kt)?"rejected":"uncertain"}finally{L7(ie,je)}}async function so(ie,_e){const Ie=e.activeSessionId;if(Ie){if(a.value!=="idle"||e.inFlightBySession[Ie]){Ze(ie,_e);return}if((e.queuedBySession[Ie]?.length??0)>0){Ze(ie,_e),Qe(Ie);return}await Ct(Ie,ie,_e)}}const Bn=new Map;function Pn(ie,_e){const Ie=(Bn.get(ie)??Promise.resolve()).catch(()=>{}).then(_e);return Bn.set(ie,Ie),Ie.finally(()=>{Bn.get(ie)===Ie&&Bn.delete(ie)})}function js(ie,_e){const Ie=e.activeSessionId;return Ie?Pn(Ie,()=>Os(Ie,ie,_e)):Promise.resolve()}async function Os(ie,_e,Ie){const je=e.queuedBySession[ie]??[],nt=[],kt=[];for(const cn of je){const Rn=cn.text.trim();Rn&&nt.push(Rn),cn.attachments?.length&&kt.push(...cn.attachments)}const Pt=_e.trim();if(Pt&&nt.push(Pt),Ie?.length&&kt.push(...Ie),nt.length===0&&kt.length===0||(je.length>0&&(e.queuedBySession={...e.queuedBySession,[ie]:[]}),await Lo(ie,nt.join(` +`):e}let Tm=null,v9e;function w9e(){return Tm===null&&(Tm=new Intl.Segmenter(v9e,{granularity:"word"})),Tm}const y9e=/\p{Script=Arabic}/u,k1=/\p{M}/u,Qv=/\p{Nd}/u;function hC(e){return y9e.test(e)}function mC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function wl(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(mC(s))return!0;t++;continue}}if(mC(n))return!0}}return!1}function k9e(e){const t=cf(e);return t!==null&&(e9.has(t)||S0.has(t))}const b9e=new Set([" "," ","⁠","\uFEFF"]),_9e=new Set(["-","‐","–","—"]);function x9e(e){const t=cf(e);return t!==null&&b9e.has(t)}function S9e(e){const t=cf(e);return t!==null&&_9e.has(t)}function _N(e,t){return x9e(e)?!1:t?!(k9e(e)||S9e(e)):!0}const e9=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Vp=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),t9=new Set(["'","’"]),S0=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),C9e=new Set([":",".","،","؛"]),M9e=new Set(["၏"]),A9e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function E9e(e){if(n9(e))return!0;let t=!1;for(const n of e){if(S0.has(n)||qp(n)){t=!0;continue}if(!(t&&k1.test(n)))return!1}return t}function T9e(e){for(const t of e)if(!e9.has(t)&&!S0.has(t))return!1;return e.length>0}function I9e(e){if(n9(e))return!0;for(const t of e)if(!Vp.has(t)&&!t9.has(t)&&!k1.test(t)&&!qp(t))return!1;return e.length>0}function n9(e){let t=!1;for(const n of e)if(!(n==="\\"||k1.test(n))){if(Vp.has(n)||S0.has(n)||t9.has(n)){t=!0;continue}return!1}return t}function Wp(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function cf(e){if(e.length===0)return null;const t=Wp(e,e.length);return e.slice(t)}function L9e(e){for(const t of e)if(!k1.test(t))return t;return null}function $9e(e){for(let t=e.length;t>0;){const n=Wp(e,t),o=e.slice(n,t);if(!k1.test(o))return o;t=n}return null}const N9e=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function z9e(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function qp(e){const t=e.codePointAt(0);return t!==void 0&&z9e(t,N9e)}function B9e(e){const t=$9e(e);return t!==null&&qp(t)}function R9e(e){const t=L9e(e);return t!==null&&Qv.test(t)}function F9e(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(k1.test(o)){n--;continue}if(Vp.has(o)||t9.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function j9e(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function gC(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function vC(e,t){return e&&t!==null&&C9e.has(t)}function O9e(e){const t=cf(e);return t!==null&&M9e.has(t)}function P9e(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function C7(e){let t=e.length;for(;t>0;){const n=Wp(e,t),o=e.slice(n,t);if(A9e.has(o))return!0;if(!S0.has(o))return!1;t=n}return!1}function H9e(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const D9e=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ur(e){return e.length===1?e[0]:e.join("")}function V9e(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ur(n)}function W9e(e,t,n,o){if(!D9e.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=H9e(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:Ur(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:Ur(r),isWordLike:a,kind:i,start:l}),s}function M7(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const q9e=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function U9e(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:q9e.test(n)&&t+1=e.len||M7(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u0&&(t.push(Ur(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const Y9e=new Set([":","-","/","×",",",".","+","–","—"]),X9e=/[\p{P}\p{S}\p{Co}]/u,J9e=/\p{Emoji_Presentation}/u,Q9e=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function ewe(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function xN(e){const t=e.charCodeAt(0);return t<128?ewe(t):!Q9e.has(e)&&!J9e.test(e)&&X9e.test(e)}function wC(e){let t=!1;for(const n of e)if(!k1.test(n)){if(!xN(n))return!1;t=!0}return t}function twe(e){for(let t=e.length;t>0;){const n=Wp(e,t),o=e.slice(n,t);if(k1.test(o)){t=n;continue}return xN(o)||qp(o)}return!1}function nwe(e,t,n,o){const s=!t&&wC(e),i=!o&&wC(n),r=B9e(e),l=(t||r)&&twe(e);return!s&&!i&&!l||wl(e)||wl(n)?!1:(t||s||r)&&(o||i)}function SN(e){for(const t of e)if(Qv.test(t))return!0;return!1}function F5(e){if(e.length===0)return!1;for(const t of e)if(!(Qv.test(t)||Y9e.has(t)))return!1;return!0}function owe(e){const t=[],n=[],o=[],s=[];for(let i=0;ii+1){t.push(Ur(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function iwe(e){const t=[],n=[],o=[],s=[];for(let i=0;i1;for(let c=0;c0&&a[V]==="text"&&T&&f[V]&&h[V]||$&&s>0&&a[V]==="text"&&T9e(z.text)&&f[V]||$&&s>0&&a[V]==="text"&&m[V]?A():$&&s>0&&a[V]==="text"&&z.isWordLike&&N&&k[V]?(A(),l[V]=!0):E!==null&&s>0&&a[V]==="text"&&u[V]===E?d[V]=(d[V]??1)+1:$&&!z.isWordLike&&s>0&&a[V]==="text"&&!f[V]&&(E9e(z.text)||z.text==="-"&&l[V])?A():(i[s]=z.text,r[s]=[z.text],l[s]=z.isWordLike,a[s]=z.kind,c[s]=z.start,u[s]=E,d[s]=E===null?0:1,f[s]=T,p[s]=N,h[s]=O,m[s]=H,k[s]=vC(N,C),s++)}for(let R=0;Rnull);let v=-1;for(let R=s-1;R>=0;R--){const z=i[R];if(z.length!==0){if(a[R]==="text"&&!l[R]&&v>=0&&a[v]==="text"&&(I9e(z)||z==="-"&&R9e(i[v]))){const $=x[v]??[];$.push(z),x[v]=$,c[v]=c[R],i[R]="";continue}v=R}}for(let R=0;R=0&&!_N(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||wl(p);continue}d(f),o.push(p),s.push(t.isWordLike[f]),i.push(h),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function dwe(e,t,n="normal",o="normal"){const s=h9e(n),i=s.mode==="pre-wrap"?g9e(e):m9e(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=awe(i,t,s),l=o==="keep-all"?uwe(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:cwe(l,s),...l}}let cc=null;const yC=new Map;let uc=null;const fwe=96,pwe=/\p{Emoji_Presentation}/u,hwe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Im=null;const kC=new Map;function o9(){if(cc!==null)return cc;if(typeof OffscreenCanvas<"u")return cc=new OffscreenCanvas(1,1).getContext("2d"),cc;if(typeof document<"u")return cc=document.createElement("canvas").getContext("2d"),cc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function mwe(e){let t=yC.get(e);return t||(t=new Map,yC.set(e,t)),t}function Wa(e,t){let n=t.get(e);return n===void 0&&(n={width:o9().measureText(e).width,containsCJK:wl(e)},t.set(e,n)),n}function Up(){if(uc!==null)return uc;if(typeof navigator>"u")return uc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},uc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return uc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},uc}function gwe(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function CN(){return Im===null&&(Im=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Im}function vwe(e){return pwe.test(e)||e.includes("️")}function wwe(e){return hwe.test(e)}function ywe(e,t){let n=kC.get(e);if(n!==void 0)return n;const o=o9();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return kC.set(e,n),n}function kwe(e){let t=0;const n=CN();for(const o of n.segment(e))vwe(o.segment)&&t++;return t}function bwe(e,t){return t.emojiCount===void 0&&(t.emojiCount=kwe(e)),t.emojiCount}function r0(e,t,n){return n===0?t.width:t.width-bwe(e,t)*n}function _we(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=CN(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=Wa(d,n);u.push(r0(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>fwe){const u=[];let d=null,f=0;for(const p of r){const h=Wa(p,n),m=r0(p,h,o);if(d===null)u.push(m);else{const k=d+p,x=Wa(k,n);u.push(r0(k,x,o)-f)}d=p,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Wa(a,n),f=r0(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function xwe(e,t){const n=o9();n.font=e;const o=mwe(e),s=gwe(e),i=t?ywe(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Swe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function MN(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function AN(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function s9(e,t){return t===0?0:e+t}function Awe(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Ewe(e,t,n,o,s){const i=t==="tab"?s+Awe(e,n):e.lineEndFitAdvances[n];return s9(o,i)}function bC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return s9(o,s)}function _C(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return s9(o,i)}function Twe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Iwe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function j5(e,t,n){let o=t;for(;o0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function $we(e,t,n,o,s,i){return t+Lwe(e,n,o,s,i)}function Nwe(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=Up().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,p=0,h=0,m=0,k=0,x=-1,v=0;function w(){x=-1,v=0}function b(T=m,N=k,C=d){u++,n?.(C,p,h,T,N),d=0,f=!1,w()}function M(T,N){f=!0,p=T,h=0,m=T+1,k=0,d=N}function R(T,N,C){f=!0,p=T,h=N,m=T,k=N+1,d=C}function z(T,N){if(!f){M(T,N);return}d+=N,m=T+1,k=0}function $(T,N){const C=i[T],O=r[T]??null;let H=O===null?-1:j5(O,0,N+1),V=-1,A=0,F=N;for(;Fc){if(O!==null&&V>N){b(T,V,A),F=V,H=j5(O,H,F+1),V=-1,A=0;continue}b(),R(T,F,j)}else d+=j,m=T,k=F+1;const q=F+1;O!==null&&O[H]===q&&(V=q,A=d,H++),F++}f&&m===T&&k===C.length&&(m=T+1,k=0)}let E=0;for(;E=o.length));){const T=o[E],N=s[E],C=MN(N);if(!f){T>c&&i[E]!==null?$(E,0):M(E,T),C&&(x=E+1,v=d-T),E++;continue}if(d+T>c){if(C){z(E,T),b(E+1,0,d-T),E++;continue}if(x>=0){if(m>x||m===x&&k>0){b();continue}b(x,0,v);continue}if(T>c&&i[E]!==null){b(),$(E,0),E++;continue}b();continue}z(E,T),C&&(x=E+1,v=d-T),E++}return f&&b(),u}function zwe(e,t,n){if(e.simpleLineWalkFastPath)return Nwe(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=Up(),u=c.lineFitEpsilon,d=t+u;let f=0,p=0,h=!1,m=0,k=0,x=0,v=0,w=-1,b=0,M=0,R=null;function z(){w=-1,b=0,M=0,R=null}function $(){return R==="soft-hyphen"&&w===x&&v===0?M:p}function E(A=x,F=v,j){f++,n!==void 0&&n($we(e,j??$(),m,k,A,F),m,k,A,F),p=0,h=!1,z()}function T(A,F){h=!0,m=A,k=0,x=A+1,v=0,p=F}function N(A,F,j){h=!0,m=A,k=F,x=A,v=F+1,p=j}function C(A,F){if(!h){T(A,F);return}p+=F,x=A+1,v=0}function O(A,F,j,q,P,W){if(!F)return;const G=bC(e,A,j,P),ee=_C(e,A,j,P,q);w=j+1,b=p-W+G,M=p-W+ee,R=A}function H(A,F){const j=i[A],q=r[A]??null;let P=q===null?-1:j5(q,0,F+1),W=-1,G=0,ee=F;for(;eed){if(q!==null&&W>F){E(A,W,G),ee=W,P=j5(q,P,ee+1),W=-1,G=0;continue}E(),N(A,ee,se)}else p=ge,x=A,v=ee+1}const oe=ee+1;q!==null&&q[P]===oe&&(W=oe,G=p,P++),ee++}h&&x===A&&v===j.length&&(x=A+1,v=0)}function V(A){f++,n?.(0,A.startSegmentIndex,0,A.consumedEndSegmentIndex,0),z()}for(let A=0;A=F.endSegmentIndex));){const q=s[j],P=MN(q),W=Mwe(e,h,j),G=q==="tab"?Cwe(p+W,e.tabStopAdvance):o[j],ee=W+G,se=Ewe(e,q,j,W,G);if(q==="soft-hyphen"){h&&(x=j+1,v=0,w=j+1,b=p+l,M=p+l,R=q),j++;continue}if(!h){se>d&&i[j]!==null?H(j,0):T(j,G),O(q,P,j,G,W,ee),j++;continue}if(p+se>d){const Q=p+bC(e,q,j,W),ge=p+_C(e,q,j,W,G);if(R==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){E(w,0,M);continue}if(P&&Q<=d){C(j,ee),E(j+1,0,ge),j++;continue}if(w>=0&&b<=d){if(x>w||x===w&&v>0){E();continue}const xe=w;E(xe,0,M),j=xe;continue}if(se>d&&i[j]!==null){E(),H(j,0),j++;continue}E();continue}C(j,ee),O(q,P,j,G,W,ee),j++}if(h){const q=w===F.consumedEndSegmentIndex?M:p;E(F.consumedEndSegmentIndex,0,q)}}return f}let Lm=null;function i9(){return Lm===null&&(Lm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Lm}function Bwe(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Rwe(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,p){o=[d],s=f,i=p,r=C7(d),l=Vp.has(d)}function u(d,f){o.push(d),i=i||f;const p=C7(d);d.length===1&&S0.has(d)?r=r||p:r=p,l=!1}for(const d of i9().segment(e)){const f=d.segment,p=wl(f);if(o.length===0){c(f,d.index,p);continue}if(l||e9.has(f)||S0.has(f)||t.carryCJKAfterClosingQuote&&p&&r){u(f,p);continue}if(!i&&!p){u(f,p);continue}a(),c(f,d.index,p)}return a(),n}function Fwe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c=0&&!_N(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||wl(c.text)}return l(t.length),o}function xC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=i9();for(const s of o.segment(e))n++;return n}function jwe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Owe(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of i9().segment(e))n++,jwe(o.segment)&&t.push(n);return t.length===0?null:t}function Pwe(e,t,n){return t>1?e+(t-1)*n:e}function Hwe(e,t,n,o,s){const i=Up(),{cache:r,emojiCorrection:l}=xwe(t,wwe(e.normalized)),a=r0("-",Wa("-",r),l)+(s===0?0:s*2),u=r0(" ",Wa(" ",r),l)*8,d=s!==0;if(e.len===0)return Bwe();const f=[],p=[],h=[],m=[];let k=e.chunks.length<=1&&!d;const x=n?[]:null,v=[],w=[],b=[],M=n?[]:null,R=Array.from({length:e.len});function z(N,C,O,H,V,A,F,j,q){V!=="text"&&V!=="space"&&V!=="zero-width-break"&&(k=!1),f.push(C),p.push(O),h.push(H),m.push(V),x?.push(A),v.push(F),w.push(j),d&&b.push(q),M!==null&&M.push(N)}function $(N,C,O,H,V){const A=Wa(N,r),F=d?xC(N,C):0,j=Pwe(r0(N,A,l),F,s),q=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:j,P=q===0?0:q+(F>0?s:0),W=C==="space"||C==="zero-width-break"?0:j;if(V&&H&&N.length>1){let G="sum-graphemes";s!==0?G="segment-prefixes":F5(N)?G="pair-context":i.preferPrefixWidthsForBreakableRuns&&(G="segment-prefixes");const ee=_we(N,A,r,l,G),se=ee===null||o==="keep-all"?null:Owe(N);z(N,j,P,W,C,O,ee,se,F);return}z(N,j,P,W,C,O,null,null,F)}for(let N=0;N{n>t&&(t=n)}),t}function Uwe(e){const t=e.toLowerCase(),n=[];let o=0;for(const s of e){const i=s.toLowerCase().length;for(let r=0;r=0&&ao[0]-s[0]),n=[];for(const o of t){const s=n.at(-1);s&&o[0]<=s[1]?s[1]=Math.max(s[1],o[1]):n.push([...o])}return n}function CC(e,t){if(!t||t.length===0||e.length===0)return[{text:e,hit:!1}];const n=[];let o=0;for(const[s,i]of Zwe(t)){const r=Math.max(0,Math.min(s,e.length)),l=Math.max(r,Math.min(i,e.length));l<=r||(r>o&&n.push({text:e.slice(o,r),hit:!1}),n.push({text:e.slice(r,l),hit:!0}),o=l)}return o0?n:[{text:e,hit:!1}]}function MC(e,t){const n=e.toLowerCase().indexOf(t);return n<0?void 0:[n,n+t.length]}function Kwe(e,t){const n=e.toLowerCase();let o=-1,s=-1,i=0;for(let r=0;r0,a.value=w.scrollTop+w.clientHeight{const w={},b="var(--menu-scroll-fade)";let M;return l.value&&a.value?M=`linear-gradient(to bottom, transparent 0, black ${b}, black calc(100% - ${b}), transparent 100%)`:l.value?M=`linear-gradient(to bottom, transparent, black ${b})`:a.value&&(M=`linear-gradient(to top, transparent, black ${b})`),M&&(w.maskImage=M,w.WebkitMaskImage=M),u.value&&(w.maxHeight=u.value),Object.keys(w).length>0?w:void 0}),p=B(()=>{const w=c.value;return w?{top:`${w.top}px`,height:`${w.height}px`}:void 0});function h(){const w=t.value,b=n.value,M=w?.offsetParent;if(!w||!b||!M)return;const R=getComputedStyle(w),z=h2(w,"--space-2",8),$=(parseFloat(R.paddingTop)||0)+(parseFloat(R.paddingBottom)||0),E=h2(b,o,Number.POSITIVE_INFINITY),T=window.visualViewport?.offsetTop??0,N=M.getBoundingClientRect().top-T-z-$;u.value=`${Math.max(Math.floor(Math.min(E,N)),0)}px`,vt(d)}function m(){const w=n.value;if(!w)return;const b=w.querySelectorAll('[role="option"]')[s?.value??-1];if(!b)return;const M=w.getBoundingClientRect(),R=b.getBoundingClientRect(),z=R.top-M.top+w.scrollTop,$=z+R.height;zw.scrollTop+w.clientHeight&&(w.scrollTop=$-w.clientHeight)}let k=null;function x(w){const b=n.value,M=c.value;if(!b||!M)return;w.preventDefault(),k?.();const R=w.pointerId;(w.target instanceof Element?w.target:null)?.setPointerCapture?.(R);const $=h2(b,"--menu-scrollbar-track-inset",0),E=b.clientHeight-$*2-M.height,T=b.scrollHeight-b.clientHeight,N=w.clientY,C=b.scrollTop,O=A=>{A.pointerId!==R||E<=0||(b.scrollTop=C+(A.clientY-N)/E*T)},H=A=>{A.pointerId===R&&k?.()};k=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),k=null},window.addEventListener("pointermove",O),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)}let v=null;return xn(()=>{if(typeof ResizeObserver=="function"&&n.value&&(v=new ResizeObserver(w=>{for(const b of w)b.target===n.value?d():h()}),v.observe(n.value),r)){const w=t.value?.offsetParent;w&&v.observe(w)}r&&(window.addEventListener("resize",h),window.visualViewport?.addEventListener("resize",h),window.visualViewport?.addEventListener("scroll",h),h()),d()}),An(()=>{v?.disconnect(),v=null,k?.(),window.removeEventListener("resize",h),window.visualViewport?.removeEventListener("resize",h),window.visualViewport?.removeEventListener("scroll",h)}),Ue(()=>[s?.value,i?.value],()=>{vt(()=>{d(),m()})}),{atTop:l,atBottom:a,thumb:c,scrollStyle:f,thumbStyle:p,onScroll:d,onThumbPointerDown:x}}const Ywe={key:0,class:"slash-empty",role:"status"},Xwe=["id","aria-selected","onMouseenter","onMousedown"],Jwe={class:"slash-name"},Qwe={key:0,class:"slash-match"},eye={class:"slash-desc"},tye={key:0,class:"slash-desc-match"},nye=Ge({__name:"SlashMenu",props:{items:{},activeIndex:{},query:{default:""},ranges:{default:()=>[]},layout:{default:"popup"}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=U(null);Vl(i);const r=U(null),l=B(()=>n.activeIndex),a=B(()=>n.items),{thumb:c,scrollStyle:u,thumbStyle:d,onScroll:f,onThumbPointerDown:p}=EN({menuEl:i,scrollEl:r,maxHeightVar:"--p-slash-menu-h",activeIndex:l,refreshKey:a,fitToViewport:n.layout!=="sheet"}),h=B(()=>n.items.map((m,k)=>{const x=m.isSkill?m.desc:s(m.desc),v=n.ranges[k]??Gwe(n.query,m.name,x);return{item:m,namePieces:CC(m.name,v.name),desc:x,descPieces:CC(x,v.desc)}}));return(m,k)=>(g(),S("div",{ref_key:"menuEl",ref:i,class:Be(["slash-menu",{"is-sheet":n.layout==="sheet"}]),"data-menu-frame":""},[n.items.length===0?(g(),S("div",Ywe,I(y(s)("composer.noCommands")),1)):J("",!0),_("div",{ref_key:"scrollEl",ref:r,class:"slash-scroll",role:"listbox",style:Wt(y(u)),onScroll:k[0]||(k[0]=(...x)=>y(f)&&y(f)(...x))},[(g(!0),S(Me,null,it(h.value,(x,v)=>(g(),S("div",{id:`composer-slash-option-${v}`,key:`${x.item.name}-${v}`,class:Be(["slash-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:w=>o("hover",v),onMousedown:xt(w=>o("select",x.item),["prevent"])},[_("span",Jwe,[(g(!0),S(Me,null,it(x.namePieces,(w,b)=>(g(),S(Me,{key:b},[w.hit?(g(),S("span",Qwe,I(w.text),1)):(g(),S(Me,{key:1},[He(I(w.text),1)],64))],64))),128))]),_("span",eye,[(g(!0),S(Me,null,it(x.descPieces,(w,b)=>(g(),S(Me,{key:b},[w.hit?(g(),S("span",tye,I(w.text),1)):(g(),S(Me,{key:1},[He(I(w.text),1)],64))],64))),128))])],42,Xwe))),128))],36),y(c)&&n.items.length>0?(g(),S("div",{key:1,class:"scroll-thumb",style:Wt(y(d)),onPointerdown:k[1]||(k[1]=(...x)=>y(p)&&y(p)(...x))},null,36)):J("",!0)],2))}}),AC=mt(nye,[["__scopeId","data-v-9f177a8d"]]),oye={key:0,class:"mention-state dim",role:"status"},sye={key:1,class:"mention-state dim",role:"status"},iye=["id","aria-selected","onMouseenter","onMousedown"],rye=["innerHTML"],lye={class:"mention-name"},aye={key:0,class:"mention-hit"},cye={class:"mention-meta"},uye=["innerHTML"],dye={class:"mention-name"},fye={key:0,class:"mention-hit"},pye={key:0,class:"mention-meta"},hye={key:0,class:"mention-hit"},mye=Ge({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean,default:!1},stale:{type:Boolean,default:!1},layout:{default:"popup"}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=U(null);Vl(i);const r=U(null),l=B(()=>n.activeIndex),a=B(()=>n.items),{thumb:c,scrollStyle:u,thumbStyle:d,onScroll:f,onThumbPointerDown:p}=EN({menuEl:i,scrollEl:r,maxHeightVar:"--p-mention-menu-h",activeIndex:l,refreshKey:a,fitToViewport:n.layout!=="sheet"});function h(w){const b=w.endsWith("/")?w.slice(0,-1):w,M=b.lastIndexOf("/");return M===-1?"":b.slice(0,M)}function m(w){const b=w.file.path.endsWith("/")?w.file.path.slice(0,-1):w.file.path;return $m(w.file.name,w.file.matchPositions,Math.max(0,b.length-w.file.name.length))}function k(w){return $m(h(w.file.path),w.file.matchPositions,0)}function x(w){return $m(w.skill.name,w.matchPositions,0)}function v(w){return w.kind==="skill"?`skill:${w.skill.name}`:w.file.path}return(w,b)=>(g(),S("div",{ref_key:"menuEl",ref:i,class:Be(["mention-menu",{"is-sheet":n.layout==="sheet"}]),"data-menu-frame":""},[n.loading&&n.items.length===0?(g(),S("div",oye,I(y(s)("mention.searching")),1)):n.items.length===0?(g(),S("div",sye,I(y(s)("mention.noMatch")),1)):J("",!0),n.loading&&n.items.length>0?(g(),ce(Go,{key:2,class:"mention-spin",size:"sm",label:y(s)("mention.searching")},null,8,["label"])):J("",!0),_("div",{ref_key:"scrollEl",ref:r,class:"mention-scroll",role:"listbox",style:Wt(y(u)),onScroll:b[0]||(b[0]=(...M)=>y(f)&&y(f)(...M))},[(g(!0),S(Me,null,it(n.items,(M,R)=>(g(),S("div",{id:`composer-mention-option-${R}`,key:v(M),class:Be(["mention-item",{active:R===n.activeIndex,stale:n.stale&&M.kind!=="skill"}]),role:"option","aria-selected":R===n.activeIndex,onMouseenter:z=>o("hover",R),onMousedown:xt(z=>o("select",M),["prevent"])},[M.kind==="skill"?(g(),S(Me,{key:0},[_("span",{class:"mention-icon",innerHTML:y(jr)("sparkles","sm"),"aria-hidden":"true"},null,8,rye),_("span",lye,[(g(!0),S(Me,null,it(x(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",aye,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))]),_("span",cye,I(M.skill.description),1)],64)):(g(),S(Me,{key:1},[_("span",{class:"mention-icon",innerHTML:y(gu)(M.file.path,M.file.name),"aria-hidden":"true"},null,8,uye),_("span",dye,[(g(!0),S(Me,null,it(m(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",fye,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))]),h(M.file.path)?(g(),S("span",pye,[(g(!0),S(Me,null,it(k(M),(z,$)=>(g(),S(Me,{key:$},[z.hit?(g(),S("span",hye,I(z.text),1)):(g(),S(Me,{key:1},[He(I(z.text),1)],64))],64))),128))])):J("",!0)],64))],42,iye))),128))],36),y(c)&&n.items.length>0?(g(),S("div",{key:3,class:"scroll-thumb",style:Wt(y(d)),onPointerdown:b[1]||(b[1]=(...M)=>y(p)&&y(p)(...M))},null,36)):J("",!0)],2))}}),EC=mt(mye,[["__scopeId","data-v-0ac2fbc1"]]),TN=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/workflow",desc:"commands.dynamicWorkflow.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function gye(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const O5="skill:";function vye(e){return e.startsWith(O5)?e.slice(O5.length):e}function IN(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${O5}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...TN,...t]}function wye(e,t=TN){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).toSorted((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Zp(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function LN(e){return e?.supportEfforts??[]}function yye(e){return e[Math.floor(e.length/2)]}function Od(e){if(Zp(e)==="unsupported")return"off";const t=LN(e);return t.length>0?e?.defaultEffort??yye(t):"on"}function Kp(e){const t=LN(e),n=Zp(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Pd(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function kye(e,t){return Kp(e).includes(t)}function $N(e,t){return t==="off"?"off":t==="on"?Od(e):t}function r9(e,t){return t??Od(e)}function bye(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function _ye(e,t,n){return!n||e===void 0?t:Od(e)}const P5=100;function xye(e){const t=mu(ln.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>P5?n.slice(-P5):n,s={[e]:o};return p1(ln.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Sye(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=U(xye(s())),r=B(()=>i.value[s()??""]??[]);let l=-1,a="";function c(x){const v=s();if(l=-1,!v)return;const w=x.trim();if(!w)return;const b=i.value[v]??[];if(b.at(-1)===w)return;const M=[...b,w],R=M.length>P5?M.slice(-P5):M;i.value={...i.value,[v]:R},p1(ln.inputHistory,i.value)}function u(){const x=n.value;return x?(x.selectionStart??0)===0:!1}function d(x){t.value=x,vt(()=>{const v=n.value;if(!v)return;o();const w=x.length;v.setSelectionRange(w,w)})}function f(){const x=r.value;if(x.length!==0){if(l===-1)a=t.value,l=x.length-1;else if(l>0)l-=1;else return;d(x[l])}}function p(){if(l===-1)return;const x=r.value;l0}return Ue(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:p,resetBrowsing:h,isBrowsing:m,hasHistory:k}}function Cye(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=U(!1),c=U([]),u=U(0);function d(){const p=t.value;p.startsWith("/")&&!p.includes(" ")?(c.value=wye(p,IN(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(p){if(a.value=!1,p.acceptsInput){t.value=`${p.name} `,vt(()=>{const h=n.value;if(!h)return;const m=t.value.length;h.setSelectionRange(m,m),h.focus(),o()});return}t.value="",l?.(),r(p.name),i(p.name)}return{open:a,items:c,active:u,update:d,select:f}}function Mye(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s,searchSkills:i,insertSkill:r}=e,l=U(!1),a=U([]),c=U(0),u=U(!1),d=U(!1);let f=null,p=0;function h(){const v=t.value,w=n.value?.selectionStart??v.length;let b=w-1;for(;b>=0&&!/\s/.test(v[b]);)b--;b++;const M=v.slice(b,w);return M.startsWith("@")?{token:M.slice(1),start:b,end:w}:null}function m(){const v=h(),w=s(),b=i?.();if(!v||!w&&!b){l.value=!1,d.value=!1;return}const M=v.token;f!==null&&clearTimeout(f),f=setTimeout(async()=>{const R=++p;u.value=!0,l.value=!0,c.value=0,a.value.length>0&&(d.value=!0);try{const[z,$]=await Promise.all([w?w(M).catch(()=>[]):Promise.resolve([]),b?b(M).catch(()=>[]):Promise.resolve([])]);if(R!==p)return;a.value=[...z.map(E=>({kind:E.path.endsWith("/")?"folder":"file",file:{...E,matchPositions:SC(M,E.path)}})),...$.map(E=>({kind:"skill",skill:E,matchPositions:SC(M,E.name)}))]}catch{R===p&&(a.value=[])}finally{R===p&&(u.value=!1,d.value=!1)}},200)}function k(){f!==null&&clearTimeout(f),f=null,p++,l.value=!1,u.value=!1,d.value=!1}function x(v){const w=h();if(!w)return;if(l.value=!1,v.kind==="skill"){r?.(v.skill.name);return}const b=t.value,M=v.file.name||v.file.path.split(/[\\/]/).findLast(Boolean)||v.file.path,R=Av({kind:v.kind,name:M,path:v.file.path});t.value=`${b.slice(0,w.start)}${R} ${b.slice(w.end)}`,vt(()=>{const z=n.value;if(!z)return;const $=w.start+R.length+1;z.setSelectionRange($,$),z.focus(),o()})}return{open:l,items:a,active:c,loading:u,stale:d,update:m,select:x,close:k,getMentionToken:h}}function Aye(e){const{sessionId:t}=e;function n(c){return Yo(pk(c))??""}function o(c,u){const d=pk(c);u?vs(d,u):w0(d)}const s=U(n(t())),i=U(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Ue(s,c=>{vt(r),o(t(),c)}),Ue(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),vt(r))});function l(c){s.value=c,vt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Eye(e){const{uploadImage:t,sessionId:n}=e,o=U({}),s=B(()=>o.value[n()??""]??[]),i=U(null),r=U(null),l=U(!1);let a=0;function c(){return`att_${++a}`}function u(F,j){o.value={...o.value,[F]:j}}function d(F){if(F.previewUrl!==void 0)try{URL.revokeObjectURL(F.previewUrl)}catch{}}function f(F){return F.startsWith("image/")?"image":F.startsWith("video/")?"video":"file"}async function p(F){const j=t();if(!j)return;const q=n()??"";if(F.length!==0)for(const P of F){const W=f(P.type),G=c(),ee=W==="file"?void 0:URL.createObjectURL(P),se={localId:G,name:P.name,kind:W,previewUrl:ee,mediaType:P.type||"application/octet-stream",size:P.size,uploading:!0};u(q,[...o.value[q]??[],se]),j(P,P.name).then(oe=>{const Q=o.value[q]??[];u(q,Q.map(ge=>ge.localId===G?{...ge,uploading:!1,fileId:oe?.fileId,mediaType:oe?.mediaType??ge.mediaType,error:oe===null}:ge))}).catch(()=>{const oe=o.value[q]??[];u(q,oe.map(Q=>Q.localId===G?{...Q,uploading:!1,error:!0}:Q))})}}function h(F){const j=n()??"",q=o.value[j]??[],P=q.find(W=>W.localId===F);i.value?.localId===F&&(i.value=null),P&&d(P),u(j,q.filter(W=>W.localId!==F))}function m(F){i.value=F}function k(){i.value=null}function x(){r.value?.click()}function v(F){const j=F.target,q=Array.from(j.files??[]);p(q),j.value=""}function w(F){if(!t())return;const j=F.clipboardData;if(!j)return;const q=[],P=new Set,W=(G,ee)=>{const se=`${G.size}:${G.type}:${ee}`;if(P.has(se))return;P.add(se);const oe=G.type.split("/")[1]??"png",Q=ee.includes(".")?ee:`paste-${Date.now()}.${oe}`;q.push(G instanceof File?G:new File([G],Q,{type:G.type}))};for(const G of Array.from(j.items))if(G.kind==="file"){const ee=G.getAsFile();ee&&W(ee,ee.name||`paste-${Date.now()}.${G.type.split("/")[1]??"png"}`)}for(const G of Array.from(j.files))W(G,G.name);q.length!==0&&(F.preventDefault(),p(q))}let b=0;function M(F){!t()||!Array.from(F.dataTransfer?.items??[]).some(q=>q.kind==="file")||(F.preventDefault(),F.stopPropagation(),l.value=!0)}function R(){l.value=!1}function z(F){if(b=0,l.value=!1,!t())return;F.preventDefault(),F.stopPropagation();const j=Array.from(F.dataTransfer?.files??[]);p(j)}function $(F){return Array.from(F.dataTransfer?.items??[]).some(j=>j.kind==="file")}function E(F){!t()||!$(F)||(F.preventDefault(),b+=1,l.value=!0)}function T(F){!t()||!$(F)||F.preventDefault()}function N(F){!t()||!$(F)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function C(F){if(b=0,l.value=!1,!t())return;F.preventDefault();const j=Array.from(F.dataTransfer?.files??[]);p(j)}function O(){const F=n()??"";for(const j of o.value[F]??[])d(j);u(F,[])}function H(F,j,q){const P=o.value[F]??[];P.some(W=>W.localId===j)&&u(F,P.map(W=>W.localId===j?{...W,...q}:W))}function V(F){return fetch(F).then(j=>{if(!j.ok)throw new Error(`fetch failed: ${j.status}`);return j.blob()})}function A(F){const j=n()??"";for(const q of o.value[j]??[])d(q);u(j,[]);for(const q of F){const P=c(),W=/^data:/i.test(q.url),G=/^blob:/i.test(q.url),ee=q.name??q.kind;if(q.fileId){const se={localId:P,name:ee,kind:q.kind,previewUrl:q.kind==="file"?void 0:q.url,uploading:!1,fileId:q.fileId};u(j,[...o.value[j]??[],se]),q.kind!=="file"&&!W&&!G&&At().getFileBlob(q.fileId).then(oe=>{const Q=URL.createObjectURL(oe);if(!(o.value[j]??[]).some(xe=>xe.localId===P)){URL.revokeObjectURL(Q);return}H(j,P,{previewUrl:Q})}).catch(()=>{})}else{if(!q.url)continue;const se=t();if(!se)continue;const oe={localId:P,name:ee,kind:q.kind,previewUrl:q.url,uploading:!0};u(j,[...o.value[j]??[],oe]),V(q.url).then(Q=>{const ge=ee.includes(".")?ee:`${ee}.${Q.type.split("/")[1]??"bin"}`;return se(Q,ge)}).then(Q=>{if(Q===null){const ge=o.value[j]??[];u(j,ge.filter(xe=>xe.localId!==P));return}H(j,P,{uploading:!1,fileId:Q.fileId})}).catch(()=>{const Q=o.value[j]??[];u(j,Q.filter(ge=>ge.localId!==P))})}}}return Ue(n,()=>{i.value=null}),xn(()=>{document.addEventListener("paste",w),document.addEventListener("dragenter",E),document.addEventListener("dragover",T),document.addEventListener("dragleave",N),document.addEventListener("drop",C)}),An(()=>{document.removeEventListener("paste",w),document.removeEventListener("dragenter",E),document.removeEventListener("dragover",T),document.removeEventListener("dragleave",N),document.removeEventListener("drop",C);for(const F of Object.values(o.value))for(const j of F)d(j);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:h,openAttachmentPreview:m,closeAttachmentPreview:k,openFilePicker:x,handleFileInputChange:v,handleDragOver:M,handleDragLeave:R,handleDrop:z,clearAfterSubmit:O,loadAttachments:A}}const Tye=640,Iye=`(max-width: ${Tye}px)`;function Gp(){const e=U(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Iye);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),An(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),An(()=>t.removeListener(n))),e}const Lye={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},$ye=["stroke-dasharray","stroke-dashoffset"],Nm=7,Nye=Ge({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*Nm;return(o,s)=>(g(),S("svg",Lye,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:Nm,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:Nm,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,$ye)]))}}),zye=mt(Nye,[["__scopeId","data-v-97f3cf66"]]),Bye=["aria-selected","onClick"],Rye=Ge({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(g(),S("div",{class:Be(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(g(!0),S(Me,null,it(e.options,i=>(g(),S("button",{key:i.value,class:Be(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},I(i.label),11,Bye))),128))],2))}}),ni=mt(Rye,[["__scopeId","data-v-bffb3dae"]]),zm=["pythinking","pyreasoning","pypondering","pyplanning","pyiterating","pyorchestrating","reasonating","pondercrafting","neuroning","logic-weaving","rubber-duckoning","token-wrangling","bug-whispering","stack-divining","gizmo-tinkering"],NN=6e4;function Fye(e=Date.now()){const t=Math.floor(e/NN)%zm.length;return zm[t]??zm[0]}function jye(e=Date.now()){return`${Fye(e)}…`}const Wl=["⣷","⣯","⣟","⡿","⢿","⣻","⣽","⣾"],m0=80,Oye=["aria-label"],Pye=Ge({__name:"ActivitySpinner",props:{fast:{type:Boolean},label:{}},setup(e){const t=Wl.length*m0,n=m0/2,o=e,s=U(Date.now());let i;xn(()=>{o.label===void 0&&(i=setInterval(()=>{s.value=Date.now()},NN))}),An(()=>{i!==void 0&&clearInterval(i)});const r=B(()=>o.label??jye(s.value));function l(a){return{"--spinner-frame-delay":`${a*m0-t}ms`,"--spinner-frame-fast-delay":`${a*n-t/2}ms`}}return(a,c)=>(g(),S("span",{class:Be(["activity-spin",{"activity-spin--fast":e.fast}]),"aria-label":r.value,role:"img"},[(g(!0),S(Me,null,it(y(Wl),(u,d)=>(g(),S("span",{key:u,class:"activity-frame",style:Wt(l(d)),"aria-hidden":"true"},I(u),5))),128))],10,Oye))}}),Bm=mt(Pye,[["__scopeId","data-v-c12d8332"]]),Hye=["disabled"],Dye={key:0,class:"leading"},Vye={class:"label"},Wye={key:1,class:"count"},qye={key:2,class:"trailing"},Uye=Ge({__name:"MenuRow",props:{count:{},active:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(g(),S("button",{type:"button",class:Be(["menu-row",{active:e.active,selected:e.selected,disabled:e.disabled}]),disabled:e.disabled},[t.$slots.leading?(g(),S("span",Dye,[En(t.$slots,"leading",{},void 0,!0)])):J("",!0),_("span",Vye,[En(t.$slots,"label",{},()=>[En(t.$slots,"default",{},void 0,!0)],!0)]),e.count!==void 0?(g(),S("span",Wye,I(e.count),1)):J("",!0),t.$slots.trailing?(g(),S("span",qye,[En(t.$slots,"trailing",{},void 0,!0)])):J("",!0)],10,Hye))}}),dc=mt(Uye,[["__scopeId","data-v-261bf74a"]]),Zye=["aria-checked","disabled"],Kye=Ge({__name:"SwitchToggle",props:{modelValue:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t;function s(){n.disabled||o("update:modelValue",!n.modelValue)}function i(r){n.disabled||r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),s())}return(r,l)=>(g(),S("button",{type:"button",class:"switch-toggle",role:"switch","aria-checked":e.modelValue,disabled:e.disabled,onClick:s,onKeydown:i},[...l[0]||(l[0]=[_("span",{class:"track","aria-hidden":"true"},null,-1),_("span",{class:"thumb","aria-hidden":"true"},null,-1)])],40,Zye))}}),TC=mt(Kye,[["__scopeId","data-v-169237c7"]]);function Gye({initialized:e,onboardingCompleted:t,authReady:n}){return e?t?n?"app":"recovery":"first-run":"loading"}function Yye(e,t){return e||t}function Xye(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const Jye=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Vr(e){const t=e.replaceAll("\\","/"),n=Jye.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function Qye(e,t){const n=Vr(t.cwd);return e.find(o=>Vr(o.root)===n)?.id??t.workspaceId??t.cwd}function eke(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(Vr)),r=new Map;for(const d of t){const f=Vr(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const p=Vr(f);i.has(p)||r.has(p)||r.set(p,{id:d.workspaceId??f,root:f,name:Xye(f),sessionCount:0})}const l=new Map;for(const d of n){const f=Qye(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Vr(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),p=l.get(f.id)??l.get(f.root)??0,h=s[f.id]===!1?p:Math.max(f.sessionCount,p);u.push({...f,sessionCount:h})}return u}function tke(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function IC(e,t){const n=new Set(e.map(c=>c.id)),o=t.filter(c=>c.kind==="subagent"&&!n.has(c.id));if(o.length===0)return e;const s=new Map(e.map(c=>[c.id,c])),i=new Map;for(const c of e)c.kind==="subagent"&&c.agentId!==void 0&&!i.has(c.agentId)&&i.set(c.agentId,c);const r=new Set,l=o.map(c=>{const u=(c.backgroundTaskId!==void 0?s.get(c.backgroundTaskId):void 0)??i.get(c.id)??(c.agentId!==void 0?i.get(c.agentId):void 0);if(u===void 0)return c;r.add(u.id);const d=c.status==="running"&&u.status!=="running",f=u.completedAt!==void 0&&u.completedAtEstimated!==!0;return{...c,status:c.status==="running"?u.status:c.status,subagentPhase:d?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":c.subagentPhase,agentId:c.agentId??u.agentId,model:c.model??u.model,thinkingEffort:c.thinkingEffort??u.thinkingEffort,routing:c.routing??u.routing,currentRoutingEnvRevision:c.currentRoutingEnvRevision??u.currentRoutingEnvRevision,completedAt:f?u.completedAt:c.completedAt??u.completedAt,completedAtEstimated:f?u.completedAtEstimated:c.completedAt!==void 0?c.completedAtEstimated:u.completedAtEstimated,outputPreview:u.outputPreview??c.outputPreview,outputBytes:u.outputBytes??c.outputBytes}});return[...e.filter(c=>!r.has(c.id)),...l]}function nke(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function oke(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const ske=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ike(e){return ske.has(e.type)}const rke=50,lke=100,A7=32*1024,ake={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,rke)},cancelTask(e){clearTimeout(e)}};function cke(e,t,n={}){const o=n.scheduler??ake,s=Math.max(1,Math.floor(n.maxItemsPerSlice??lke)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},p=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let h;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const x=++c,v=()=>{x===c&&h()};l=o.requestFrame(v),a=o.requestTask(v)};h=()=>{f();let x=0;for(;!u&&x{if(!u){if(t(x)){const v=i.length>r?i.at(-1):void 0,w=v===void 0?void 0:n.coalesce?.(v,x);w===void 0?i.push(x):i[i.length-1]=w,m();return}if(d()===0){e(x);return}i.push(x),h()}});return k.flush=()=>{if(!u){for(f();!u&&r{if(u||d()===0)return;let v=r;for(let w=r;w{u||(u=!0,f(),i.length=0,r=0)},k}function E7(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function uke(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=E7(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=A7)return[e];const s=[];let i=0;for(;ii&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function dke(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=E7(e.appEvent),i=E7(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>A7)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const zN=[{value:"small",label:"S"},{value:"medium",label:"M"},{value:"large",label:"L"},{value:"xlarge",label:"XL"}],BN=new Set(["blue","mono"]),RN=new Set(["light","dark","system"]),FN=14,fke=12,pke=20,hke={small:12,medium:14,large:16,xlarge:18};function mke(){const e=Yo(ln.accent);return e&&BN.has(e)?e:"blue"}function gke(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function vke(){const e=Yo(ln.colorScheme);return e&&RN.has(e)?e:"system"}function wke(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#121212":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#121212":"#ffffff";o.setAttribute("content",n??i)})}function l9(e){return Number.isFinite(e)?Math.min(pke,Math.max(fke,Math.round(e))):FN}function a9(e){const t=l9(e);return t<=13?"small":t<=15?"medium":t<=17?"large":"xlarge"}function jN(e){return hke[e]}function yke(){const e=Yo(ln.uiFontSize);return e===null?FN:l9(Number(e))}function kke(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=a9(e))}const c9=U(vke()),u9=U(mke()),d9=U(yke());Ue(c9,wke,{immediate:!0});Ue(u9,gke,{immediate:!0});Ue(d9,kke,{immediate:!0});function bke(e){RN.has(e)&&(c9.value=e,vs(ln.colorScheme,e))}function _ke(e){BN.has(e)&&(u9.value=e,vs(ln.accent,e))}function xke(e){const t=l9(e);d9.value=t,vs(ln.uiFontSize,String(t))}const Ske=600,Cke=250,Yp=250,Mke=1e3,Ake=160,H5=U(!1);let e0=[],l0=null,D5=-Yp;function Eke(){e0=[],D5=-Yp,H5.value=!1,l0!==null&&(clearTimeout(l0),l0=null)}function Tke(){H5.value=!0,l0!==null&&clearTimeout(l0),l0=setTimeout(()=>{l0=null,e0=[],D5=-Yp,H5.value=!1},Mke)}function Ike(e){if(e<=0)return;const t=Date.now();e0.push({time:t,chars:e});const n=t-Ske;if(e0=e0.filter(l=>l.time>=n),t-D5l+a.chars,0)/s*1e3>=Ake&&Tke()}function f9(){return{colorScheme:c9,accent:u9,uiFontSize:d9,fastMoon:H5,setColorScheme:bke,setAccent:_ke,setUiFontSize:xke,resetFastMoon:Eke,recordMoonDelta:Ike}}function Lke(e,t,n){return e==="idle"&&!t&&!n}function p9(e,t){const n=Yo(e);return n===null?t:n==="1"}const h9=U(p9(ln.notifyOnComplete,!0)),m9=U(p9(ln.notifyOnQuestion,!1)),g9=U(p9(ln.notifyOnApproval,!1)),v9=U(typeof Notification<"u"?Notification.permission:"denied"),$ke="/favicon.ico";async function w9(e,t,n){if(!n){e.value=!1,vs(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}v9.value=o,o==="granted"&&(e.value=!0,vs(t,"1"))}function Nke(e){return w9(h9,ln.notifyOnComplete,e)}function zke(e){return w9(m9,ln.notifyOnQuestion,e)}function Bke(e){return w9(g9,ln.notifyOnApproval,e)}function y9(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Rke(e){return{title:yo.global.t("settings.notifyTitle"),body:y9(e,yo.global.t("settings.notifyFallback"))}}function Fke(e,t){return{title:yo.global.t("settings.notifyQuestionTitle"),body:y9(t,e,yo.global.t("settings.notifyQuestionFallback"))}}function jke(e,t){return{title:yo.global.t("settings.notifyApprovalTitle"),body:y9(t,e,yo.global.t("settings.notifyApprovalFallback"))}}function k9(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{v9.value=i,i==="granted"&&LC(t,n,o)});return}LC(t,n,o)}}function LC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:$ke});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Oke(e,t){k9(h9.value,t,Rke(t.sessionTitle),`pythinker-complete-${e}-${t.promptId??Date.now()}`)}function Pke(e){k9(m9.value,e,Fke(e.sessionTitle,e.questionPreview),`pythinker-question-${e.questionId}`)}function Hke(e){k9(g9.value,e,jke(e.sessionTitle,e.toolName),`pythinker-approval-${e.approvalId}`)}function Dke(){return{notifyOnComplete:h9,notifyOnQuestion:m9,notifyOnApproval:g9,notifyPermission:v9,setNotifyOnComplete:Nke,setNotifyOnQuestion:zke,setNotifyOnApproval:Bke,maybeNotifyCompletion:Oke,maybeNotifyQuestion:Pke,maybeNotifyApproval:Hke}}function Vke(){return Yo(ln.soundOnComplete)==="1"}const bu=U(Vke());function Wke(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Rm=null;function ON(){const e=Wke();if(!e)return null;if(Rm===null)try{Rm=new e}catch{return null}return Rm}function PN(){if(!bu.value)return;const e=ON();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Ol("sound: audio context resumed",{state:e.state})},t=>{Ol("sound: audio context resume rejected",{error:String(t)})})}let $C=!1;function qke(){if($C||typeof window>"u")return;$C=!0;const e=()=>{PN()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}qke();function Uke(e){bu.value=e,vs(ln.soundOnComplete,e?"1":"0"),e&&PN()}function NC(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function b9(){const e=ON();if(e===null){Ol("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Ol("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Ol("sound: context resumed for next time",{state:e.state})},t=>{Ol("sound: resume rejected",{error:String(t)})});return}try{NC(e,880,0,.16,.18),NC(e,1320,.1,.22,.16),Ol("sound: chime scheduled",{state:e.state})}catch(t){Ol("sound: failed to play",{error:String(t)})}}function Zke(){bu.value&&b9()}function Kke(){bu.value&&b9()}function Gke(){bu.value&&b9()}function Yke(){return{soundOnComplete:bu,setSoundOnComplete:Uke,maybePlayCompletionSound:Zke,maybePlayQuestionSound:Kke,maybePlayApprovalSound:Gke}}const Xke=1e3,Jke=4096,zC=32*1024;function Qke(e,t){let n=null,o;const s=new Set;async function i(f){try{const h=await At().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:IC(h,e.tasksBySession[f]??[])},await r(f,h)}catch{}}async function r(f,p){if(e.activeSessionId!==f)return;const h=p??e.tasksBySession[f]??[],m=At(),k=new Map;if(await Promise.all(h.map(async v=>{if((v.status==="completed"||v.status==="failed"||v.status==="cancelled")&&!s.has(v.id)&&!((v.outputLines?.length??0)>0))try{const b=await m.getTask(f,v.id,{withOutput:!0,outputBytes:zC});b.outputPreview!==void 0&&k.set(v.id,{preview:b.outputPreview,bytes:b.outputBytes}),s.add(v.id)}catch{}})),k.size===0)return;const x=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:x.map(v=>{const w=k.get(v.id)??(v.backgroundTaskId!==void 0?k.get(v.backgroundTaskId):void 0);return w?{...v,outputPreview:w.preview,outputBytes:w.bytes}:v})}}async function l(f){if(e.activeSessionId!==f)return;const p=At();let h;try{h=await p.listTasks(f)}catch{return}const m=new Map;await Promise.all(h.map(async w=>{const b=w.status==="running",M=w.status==="completed"||w.status==="failed"||w.status==="cancelled";if(!(!b&&!M)&&!(M&&(s.has(w.id)||(w.outputLines?.length??0)>0)))try{const R=await p.getTask(f,w.id,{withOutput:!0,outputBytes:b?Jke:zC});R.outputPreview!==void 0&&m.set(w.id,{preview:R.outputPreview,bytes:R.outputBytes}),M&&s.add(w.id)}catch{}}));const k=e.tasksBySession[f]??[],x=new Map(k.map(w=>[w.id,w])),v=h.map(w=>{const b=x.get(w.id),M=m.get(w.id);return{...w,outputLines:b?.outputLines,text:b?.text,outputPreview:M?.preview??b?.outputPreview,outputBytes:M?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:IC(v,k)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},Xke))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=U(0);let d=null;return Ue(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Ue(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const p=e.tasksBySession[f]??[];return{sid:f,hasRunning:p.some(h=>h.status==="running")}},({sid:f,hasRunning:p},h,m)=>{let k;p&&f!==void 0?a(f):f!==void 0?k=setTimeout(()=>{(e.tasksBySession[f]??[]).some(v=>v.status==="running")||c()},1500):c(),m(()=>{k!==void 0&&clearTimeout(k)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}function ebe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function tbe(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(` +`)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&ebe(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const T7="/sessions/";function BC(e){const{pathname:t}=e;if(!t.startsWith(T7))return;const n=t.slice(T7.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function nbe(e){return e===void 0||e.length===0?"/":`${T7}${encodeURIComponent(e)}`}const obe=50,I7=5,sbe=40402,ibe=40410,rbe=40902,lbe=2e3;function Fm(e){return Ui(e)&&e.code===rbe}const abe=40904;function cbe(e){return Ui(e)&&e.code===abe}const W1=Rs({}),q3=Rs({}),jm=Rs({}),rl=Rs(new Set),Xp=new Map,C0=new Map,V5=new Map;let ube=0;const Z1=new Map,dbe=3;let RC=0;function fbe(){return RC+=1,`${Date.now().toString(36)}-${RC}`}function pbe(e){return{generation:Xp.get(e)??0,pending:(C0.get(e)?.size??0)>0}}function L7(e){const t=++ube;Xp.set(e,t);const n=C0.get(e)??new Set;return n.add(t),C0.set(e,n),t}function $7(e,t){const n=C0.get(e);if(n===void 0||(n.delete(t),n.size>0))return;C0.delete(e);const o=V5.get(e);V5.delete(e),o?.()}function hbe(e){Xp.delete(e),C0.delete(e),V5.delete(e),Z1.delete(e)}function mbe(e,t){return!t.pending&&t.generation===(Xp.get(e)??0)}function gbe(e,t){if((C0.get(e)?.size??0)===0){t();return}V5.set(e,t)}function vbe(e,t){const{t:n}=yo.global,{confirm:o}=y1(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:p,forgetSession:h,setActiveSessionId:m,updateSessionMessages:k,nextOptimisticMsgId:x,getEventConn:v,syncSessionFromSnapshot:w,reopenSession:b,hasLoadedMessages:M,refreshSessionStatus:R,refreshSessionGoal:z,persistSessionProfile:$,mergedWorkspaces:E,workspacesView:T,status:N,workspaceIdForSession:C,savePermissionToStorage:O,seedPermissionFromDaemonDefault:H,savePlanModeToStorage:V,saveDynamicWorkflowModeToStorage:A,saveGoalModeToStorage:F,draftModes:j,saveUnread:q,saveActiveWorkspaceToStorage:P,saveHiddenWorkspacesToStorage:W,goalErrorMessage:G,resetFastMoon:ee,initialized:se,connectIssue:oe,selectedDiffPath:Q,fileDiffLines:ge,fileDiffLoading:xe}=t;let Ke=!1;async function et(re){if(e.messagesLoadingMoreBySession[re])return;const _e=e.messagesBySession[re];if(!_e||_e.length===0)return;const Ie=_e[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[re]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[re]:!1};try{const je=await At().listMessages(re,{beforeId:Ie,pageSize:obe}),nt=[...je.items].toReversed();k(re,kt=>[...nt,...kt]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[re]:je.hasMore}}catch(je){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[re]:!0},l("loadOlderMessages",je,{sessionId:re})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[re]:!1}}}function Y(re){s.loadTasksForSession(re),X(re),R(re),z(re),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,re)||r.loadSkillsForSession(re)}async function ne(re){const _e=e.activeSessionId;if(_e){Q.value=re,ge.value=[],xe.value=!0;try{const je=await At().getFileDiff(_e,re);if(Q.value!==re)return;ge.value=tbe(je.diff)}catch(Ie){Q.value===re&&(ge.value=[]),console.warn("[loadFileDiff] diff unavailable for",re,Ie)}finally{Q.value===re&&(xe.value=!1)}}}function D(){Q.value=null,ge.value=[],xe.value=!1}async function X(re){try{const Ie=await At().getGitStatus(re);e.gitStatusBySession={...e.gitStatusBySession,[re]:Ie}}catch{}}async function ve(){try{const _e=await At().getAuth();return e.authReady=_e.ready,e.defaultModel=_e.defaultModel,oe.value=null,"proceed"}catch(re){return Ui(re)&&(re.code===401||re.code===yN)?(oe.value=null,"server-auth-required"):(oe.value=(re instanceof Error?re.message:String(re)).slice(0,140),"retry")}}async function fe(){let re=!0;for(;;){const _e=await ve();if(_e!=="retry")return _e;re&&(oe.value=null,re=!1),await new Promise(Ie=>{setTimeout(Ie,lbe)})}}async function pe(){try{const re=At();e.config=await re.getConfig(),H()}catch{}}function te(re){re!=="manual"&&re!=="auto"&&re!=="yolo"||(e.permission=re,O(re),$({permissionMode:re}))}function de(re,_e){if(_e===re)return;r.draftModel.value=null;const Ie=e.activeSessionId;if(!Ie)return;const je=e.sessions.find(nt=>nt.id===Ie);je===void 0||je.messageCount>0||je.busy||e.inFlightBySession[Ie]||!je.model||je.model.length===0||je.model!==re||(d(Ie,nt=>({...nt,model:_e})),$({model:_e},Ie))}async function ye(re){try{const _e=At(),Ie=e.defaultModel,je=await _e.setConfig(re);e.config=je,e.defaultModel=je.defaultModel??null;const nt=je.defaultModel;return re.defaultPermissionMode!==void 0&&te(je.defaultPermissionMode??re.defaultPermissionMode),re.defaultModel!==void 0&&nt!==null&&nt!==void 0&&nt.length>0&&de(Ie,nt),!0}catch(_e){return l("setConfig",_e),!1}}const Ce=100,me=30,be=720*60*1e3;async function ie(){const re=At(),_e=[];let Ie,je;for(;;){let nt;try{nt=await re.listSessions({pageSize:Ce,beforeId:Ie,excludeEmpty:!0})}catch(kt){if(_e.length===0)throw kt;je=kt;break}if(_e.push(...nt.items),!nt.hasMore||nt.items.length===0)break;Ie=nt.items.at(-1).id}return{sessions:_e,error:je}}function ke(re){const _e=new Map(e.sessions.map(Ie=>[Ie.id,Ie.usage]));u(re.map(Ie=>{const je=_e.get(Ie.id);return je!==void 0&&v7(Ie.usage)&&!v7(je)?{...Ie,usage:je}:Ie}))}function Fe(re){const _e=[...re],Ie=new Set(_e.map(je=>je.id));for(const je of e.sessions)Ie.has(je.id)||(_e.push(je),Ie.add(je.id));return _e.sort((je,nt)=>new Date(nt.updatedAt).getTime()-new Date(je.updatedAt).getTime()),_e}async function at(re){const _e=At(),Ie=[],je=Date.now(),nt=cn=>je-new Date(cn.updatedAt).getTime();let kt,Pt=!1,jt=!0,Ln;for(;;){let cn;try{cn=await _e.listSessions({workspaceId:re,pageSize:I7,beforeId:kt,excludeEmpty:!0})}catch(qt){if(jt)throw qt;Ln=qt,Pt=!0;break}if(Pt=cn.hasMore,cn.items.length===0)break;const Rn=cn.items.at(-1),wo=nt(Rn)>=be;if(!jt&&wo){const qt=cn.items.findIndex(Nn=>nt(Nn)>=be),$n=qt>=0?qt+1:cn.items.length;Ie.push(...cn.items.slice(0,$n)),Pt=cn.hasMore||$nat(qt.id))),Ie=[],je=new Set,nt=new Map,kt=new Set;let Pt;for(let qt=0;qt<_e.length;qt++){const $n=_e[qt];if($n.status==="fulfilled"){nt.set($n.value.workspaceId,$n.value.page),$n.value.error!==void 0&&(kt.size===0&&(Pt=$n.value.error),kt.add($n.value.workspaceId));for(const Nn of $n.value.page.items)je.has(Nn.id)||(Ie.push(Nn),je.add(Nn.id));continue}kt.size===0&&(Pt=$n.reason),kt.add(re[qt].id)}if(nt.size===0){l("load",Pt);return}const jt=new Set(re.filter(qt=>kt.has(qt.id)).map(qt=>qt.root)),Ln=new Set(re.map(qt=>qt.id));for(const qt of e.sessions)!(qt.workspaceId!==void 0&&Ln.has(qt.workspaceId)?kt.has(qt.workspaceId):jt.has(qt.cwd)||kt.has(C(qt)))||je.has(qt.id)||(Ie.push(qt),je.add(qt.id));const cn={},Rn={},wo={};for(const{id:qt}of re){const $n=nt.get(qt);if($n===void 0){const Nn=e.sessionsHasMoreByWorkspace[qt],qe=e.sessionsCursorByWorkspace[qt],he=e.sessionsInitialCountByWorkspace[qt];Nn!==void 0&&(cn[qt]=Nn),qe!==void 0&&(Rn[qt]=qe),he!==void 0&&(wo[qt]=he);continue}cn[qt]=$n.hasMore,Rn[qt]=$n.items.length>0?$n.items.at(-1).id:void 0,wo[qt]=Math.max($n.items.length,I7)}return e.sessionsHasMoreByWorkspace=cn,e.sessionsCursorByWorkspace=Rn,e.sessionsInitialCountByWorkspace=wo,e.sessionsFullyLoaded=!1,Ie.sort((qt,$n)=>new Date($n.updatedAt).getTime()-new Date(qt.updatedAt).getTime()),kt.size>0&&l("load",Pt),Ie}async function $t(re){if(e.sessionsLoadingMoreByWorkspace[re]||e.sessionsHasMoreByWorkspace[re]===!1)return;const _e=e.sessionsCursorByWorkspace[re];if(_e!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[re]:!0};try{const Ie=await At().listSessions({workspaceId:re,pageSize:me,beforeId:_e,excludeEmpty:!0}),je=new Set(e.sessions.map(kt=>kt.id)),nt=Ie.items.filter(kt=>!je.has(kt.id));nt.length>0&&u([...e.sessions,...nt]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[re]:Ie.items.length>0?Ie.items.at(-1).id:_e},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[re]:Ie.hasMore}}catch(Ie){l("loadMoreSessions",Ie)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[re]:!1}}}}async function Et(){if(e.sessionsFullyLoaded)return;const re=await ie().catch(je=>(console.warn("[pythinker-web] loadAllSessions failed; search covers only loaded sessions",je),null));if(re===null)return;const _e=re.error===void 0?re.sessions:Fe(re.sessions);if(ke(_e),e.sessionsFullyLoaded=re.error===void 0,re.error!==void 0)return;const Ie={};for(const je of e.workspaces)Ie[je.id]=!1;e.sessionsHasMoreByWorkspace=Ie}async function Qt(){const re=await At().getMeta().catch(()=>null);re!==null&&(e.serverVersion=re.serverVersion,e.availableOpenInApps=re.openInApps,e.dangerousBypassAuth=re.dangerousBypassAuth,e.backend=re.backend,e.experimentalFlagStates=re.experimentalFlagStates,e.serverCapabilities=re.capabilities)}async function Dt(){const re=Date.now();let _e="accepted";us("app:load:start"),e.loading=!0;const Ie=!se.value;let je=!0;try{if(Ie&&await fe()==="server-auth-required"){je=!1,_e="auth-required";return}const nt=At();await Promise.all([nt.getHealth().catch(()=>null),Qt(),r.loadModels()]),Ie||await ve(),await pe(),await en();const kt=await dt(),Pt=kt??e.sessions;kt!==void 0&&ke(kt);const jt=Pt[0],Ln=e.activeWorkspaceId;!(Ln!==null&&E.value.some(wo=>wo.id===Ln))&&jt&&In(C(jt)),co();const Rn=typeof window<"u"?BC(window.location):void 0;!e.activeSessionId&&Rn!==void 0&&(e.sessions.some(qt=>qt.id===Rn)||await As(Rn))&&await oo(Rn,{urlMode:"replace"}),!e.activeSessionId&&Pt.length>0&&await oo(Pt[0].id,{urlMode:"replace"})}catch(nt){_e="failed",l("load",nt)}finally{e.loading=!1,je&&(se.value=!0),us("app:load:complete",{status:_e,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-re})}}async function en(){try{const re=At(),[_e,Ie]=await Promise.all([re.listWorkspaces().catch(()=>[]),re.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=kn(_e),e.fsHome=Ie.home||null,e.recentRoots=Ie.recentRoots}catch{}}function kn(re){const _e=s3();return Object.keys(_e).length===0?re:re.map(Ie=>{const je=_e[Ie.root];return je!==void 0?{...Ie,name:je}:Ie})}function In(re){e.activeWorkspaceId=re,P(re)}function Mn(re){In(re);const _e=e.sessions.filter(Ie=>C(Ie)===re);if(_e.length>0){const Ie=_e[0];Ie&&Ie.id!==e.activeSessionId&&oo(Ie.id)}else m(void 0),no(void 0,"push")}function Re(re){const _e=s3()[re.root],Ie=_e!==void 0?{...re,name:_e}:re,je=Vr(Ie.root);e.hiddenWorkspaceRoots.some(Pt=>Vr(Pt)===je)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Pt=>Vr(Pt)!==je),W(e.hiddenWorkspaceRoots));const nt=e.workspaces.findIndex(Pt=>Pt.id===Ie.id||Pt.root===Ie.root);if(nt===-1){e.workspaces=[Ie,...e.workspaces];return}const kt=[...e.workspaces];kt[nt]=Ie,e.workspaces=kt}function lt(re){if(re.type==="workspaceCreated"||re.type==="workspaceUpdated"){Re(re.workspace);return}const _e=e.workspaces.find(je=>je.id===re.workspaceId)?.root??re.root;if(_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],W(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(je=>je.id!==re.workspaceId&&je.root!==_e),e.activeWorkspaceId===re.workspaceId||e.activeWorkspaceId===_e){const je=T.value[0]?.id??null;if(e.activeWorkspaceId=je,je)P(je);else try{w0(ln.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,D(),no(void 0,"replace")}}function tt(){m(void 0),no(void 0,"push")}function ht(re){In(re),tt(),D()}async function bt(re){const _e=E.value.find(Rn=>Rn.id===re);if(!_e)return null;const Ie=e.thinking,je=At();let nt,kt=_e.root;try{const Rn=await je.addWorkspace({root:_e.root});nt=Rn.id,kt=Rn.root,Re(Rn)}catch{}const Pt=r.draftModel.value??void 0,jt=await je.createSession({workspaceId:nt,cwd:kt,model:Pt});r.draftModel.value=null;const Ln=Pt!==void 0&&(!jt.model||jt.model.length===0)?{...jt,model:Pt}:jt;f(Ln),In(jt.workspaceId??nt??re),await oo(jt.id);const cn=jt.id;return Ie!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[cn]:Ie}),j.planMode&&(e.planModeBySession={...e.planModeBySession,[cn]:!0},V()),j.dynamicWorkflowMode&&(e.dynamicWorkflowModeBySession={...e.dynamicWorkflowModeBySession,[cn]:!0},A()),j.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[cn]:!0},F()),j.planMode=!1,j.dynamicWorkflowMode=!1,j.goalMode=!1,cn}async function Rt(re,_e,Ie){if(!rl.has(re)){rl.add(re);try{const je=await bt(re);if(!je)return;await Ct(je,_e,Ie)}catch(je){l("startSessionAndSendPrompt",je)}finally{rl.delete(re)}}}async function on(re,_e,Ie){if(!rl.has(re)){rl.add(re);try{const je=await bt(re);if(!je)return;const nt=e.planModeBySession[je]??!1,kt=e.dynamicWorkflowModeBySession[je]??!1,Pt=e.sessions.find(cn=>cn.id===je),jt=(Pt?.model&&Pt.model.length>0?Pt.model:e.defaultModel)??void 0;if(!await $({model:jt,planMode:nt,dynamicWorkflowMode:kt,permissionMode:e.permission},je))return;await r.activateSkill(_e,Ie,je)}catch(je){l("startSessionAndActivateSkill",je)}finally{rl.delete(re)}}}async function an(re,_e){if(!rl.has(re)){rl.add(re);try{const Ie=await bt(re);if(!Ie)return;await i.openSideChatOn(Ie,_e)}catch(Ie){l("startSessionAndOpenSideChat",Ie)}finally{rl.delete(re)}}}async function sn(re){const _e=re.trim();if(!_e)return!1;const Ie=At();try{const je=await Ie.addWorkspace({root:_e});return Re(je),ht(je.id),!0}catch(je){return console.warn("[pythinker-web] addWorkspaceByPath failed for",_e,je),!1}}async function Yn(re){try{return await At().browseFs(re)}catch{return{path:"",parent:null,entries:[]}}}async function Kt(){try{return await At().getFsHome()}catch{return{home:"",recentRoots:[]}}}function no(re,_e){if(_e==="none"||typeof window>"u"||!window.history)return;const Ie=nbe(re);if(window.location.pathname!==Ie)try{_e==="push"?window.history.pushState(null,"",Ie):window.history.replaceState(null,"",Ie)}catch{}}async function As(re){try{const _e=await At().getSession(re);return e.sessions.some(Ie=>Ie.id===_e.id)||p(_e),!0}catch{return!1}}function ys(){const re=BC(window.location);if(re===void 0){m(void 0);return}if(re!==e.activeSessionId){if(e.sessions.some(_e=>_e.id===re)){oo(re,{urlMode:"none"});return}(async()=>{if(await As(re)){await oo(re,{urlMode:"none"});return}const _e=e.sessions[0];_e?await oo(_e.id,{urlMode:"replace"}):(m(void 0),no(void 0,"replace"))})()}}let ao=!1;function co(){ao||typeof window>"u"||(ao=!0,window.addEventListener("popstate",ys))}async function oo(re,_e){const Ie=M(re),je=!Ie&&c.has(re);c.delete(re);try{no(re,_e?.urlMode??"push"),e.sessionLoading=!Ie&&!je,m(re),ee(),e.unreadBySession[re]&&(e.unreadBySession={...e.unreadBySession,[re]:!1},q({[re]:!1})),D();const nt=e.sessions.find(kt=>kt.id===re);if(nt){const kt=C(nt);e.activeWorkspaceId!==kt&&In(kt)}if(Ie){if(await b(re)==="not-found")return}else if(await w(re)==="not-found")return;Y(re)}catch(nt){l("selectSession",nt,{sessionId:re})}finally{e.activeSessionId===re&&(e.sessionLoading=!1)}}async function Ct(re,_e,Ie){const je=L7(re);e.inFlightBySession={...e.inFlightBySession,[re]:!0};const nt=x();try{const kt=At(),Pt=[];_e&&Pt.push({type:"text",text:_e});for(const Nn of Ie??[])Nn.kind==="video"?Pt.push({type:"video",source:{kind:"file",fileId:Nn.fileId}}):Nn.kind==="file"?Pt.push({type:"file",fileId:Nn.fileId,name:Nn.name??"",mediaType:Nn.mediaType||"application/octet-stream",size:Nn.size??0}):Pt.push({type:"image",source:{kind:"file",fileId:Nn.fileId}});if(Pt.length===0)return e.inFlightBySession={...e.inFlightBySession,[re]:!1},"rejected";const jt={id:nt,sessionId:re,role:"user",content:Pt,createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};k(re,Nn=>[...Nn,jt]);const Ln=e.sessions.find(Nn=>Nn.id===re),cn=(Ln?.model&&Ln.model.length>0?Ln.model:e.defaultModel)??void 0,Rn=e.planModeBySession[re]??!1,wo=e.dynamicWorkflowModeBySession[re]??!1,qt=e.goalModeBySession[re]??!1;if(qt&&_e)try{await kt.updateSession(re,{goalObjective:_e.trim()})}catch(Nn){return l("createGoal",Nn,{sessionId:re}),e.inFlightBySession={...e.inFlightBySession,[re]:!1},k(re,qe=>qe.some(he=>he.id===nt)?qe.filter(he=>he.id!==nt):qe),"rejected"}const $n=await kt.submitPrompt(re,{content:Pt,model:cn,thinking:await r.resolveThinkingForPrompt(re,cn)??e.thinking,permissionMode:e.permission,planMode:Rn,dynamicWorkflowMode:wo});return qt&&(e.goalModeBySession={...e.goalModeBySession,[re]:!1},F()),e.promptIdBySession={...e.promptIdBySession,[re]:$n.promptId},k(re,Nn=>{const qe=Nn.findIndex($e=>$e.id===nt);if(qe===-1)return Nn;const he=[...Nn];return he[qe]={...he[qe],promptId:he[qe].promptId??$n.promptId},he}),v()?.bindNextPromptId(re,$n.promptId),"ok"}catch(kt){return e.inFlightBySession={...e.inFlightBySession,[re]:!1},k(re,Pt=>Pt.some(jt=>jt.id===nt)?Pt.filter(jt=>jt.id!==nt):Pt),l("sendPrompt",kt,{sessionId:re}),Ui(kt)?"rejected":"uncertain"}finally{$7(re,je)}}async function so(re,_e){const Ie=e.activeSessionId;if(Ie){if(a.value!=="idle"||e.inFlightBySession[Ie]){Ze(re,_e);return}if((e.queuedBySession[Ie]?.length??0)>0){Ze(re,_e),Qe(Ie);return}await Ct(Ie,re,_e)}}const Bn=new Map;function Pn(re,_e){const Ie=(Bn.get(re)??Promise.resolve()).catch(()=>{}).then(_e);return Bn.set(re,Ie),Ie.finally(()=>{Bn.get(re)===Ie&&Bn.delete(re)})}function js(re,_e){const Ie=e.activeSessionId;return Ie?Pn(Ie,()=>Os(Ie,re,_e)):Promise.resolve()}async function Os(re,_e,Ie){const je=e.queuedBySession[re]??[],nt=[],kt=[];for(const cn of je){const Rn=cn.text.trim();Rn&&nt.push(Rn),cn.attachments?.length&&kt.push(...cn.attachments)}const Pt=_e.trim();if(Pt&&nt.push(Pt),Ie?.length&&kt.push(...Ie),nt.length===0&&kt.length===0||(je.length>0&&(e.queuedBySession={...e.queuedBySession,[re]:[]}),await Lo(re,nt.join(` -`),kt)!=="rejected"||je.length===0))return;const Ln=e.queuedBySession[ie]??[];e.queuedBySession={...e.queuedBySession,[ie]:[...je,...Ln]}}function Ts(ie){const _e=e.activeSessionId;if(!_e)return Promise.resolve();const Ie=(e.queuedBySession[_e]??[])[ie];if(Ie===void 0)return Promise.resolve();const je=Ie.id??Ie.text;return Pn(_e,()=>ks(_e,je))}async function ks(ie,_e){const Ie=e.queuedBySession[ie]??[],je=Ie.findIndex(cn=>(cn.id??cn.text)===_e),nt=je>=0?Ie[je]:void 0;if(nt===void 0)return;const kt=nt.attachments??[];if(nt.text.trim().length===0&&kt.length===0)return;const Pt=[...Ie];if(Pt.splice(je,1),e.queuedBySession={...e.queuedBySession,[ie]:Pt},await Lo(ie,nt.text,kt)!=="rejected"||!e.sessions.some(cn=>cn.id===ie))return;const Ln=[...e.queuedBySession[ie]??[]];Ln.splice(Math.min(je,Ln.length),0,nt),e.queuedBySession={...e.queuedBySession,[ie]:Ln}}async function Lo(ie,_e,Ie){if(a.value==="idle"&&!e.inFlightBySession[ie])return Ct(ie,_e,Ie);const je=[];_e&&je.push({type:"text",text:_e});for(const jt of Ie)jt.kind==="video"?je.push({type:"video",source:{kind:"file",fileId:jt.fileId}}):jt.kind==="file"?je.push({type:"file",fileId:jt.fileId,name:jt.name??"",mediaType:jt.mediaType||"application/octet-stream",size:jt.size??0}):je.push({type:"image",source:{kind:"file",fileId:jt.fileId}});const nt=x(),kt={id:nt,sessionId:ie,role:"user",content:je,createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};k(ie,jt=>[...jt,kt]);const Pt=I7(ie);try{const jt=At(),Ln=e.sessions.find(wo=>wo.id===ie),cn=(Ln?.model&&Ln.model.length>0?Ln.model:e.defaultModel)??void 0,Rn=await jt.submitPrompt(ie,{content:je,model:cn,thinking:await i.resolveThinkingForPrompt(ie,cn)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[ie]??!1,dynamicWorkflowMode:e.dynamicWorkflowModeBySession[ie]??!1});if(k(ie,wo=>{const qt=wo.findIndex(Nn=>Nn.id===nt);if(qt===-1)return wo;const $n=[...wo];return $n[qt]={...$n[qt],promptId:$n[qt].promptId??Rn.promptId},$n}),Rn.status!=="queued")return e.promptIdBySession={...e.promptIdBySession,[ie]:Rn.promptId},w()?.bindNextPromptId(ie,Rn.promptId),"ok";try{await jt.steerPrompts(ie,[Rn.promptId])}catch{return"ok"}return"ok"}catch(jt){return k(ie,Ln=>Ln.filter(cn=>cn.id!==nt)),l("steer",jt,{sessionId:ie}),Ur(jt)?"rejected":"uncertain"}finally{L7(ie,Pt)}}async function Ro(ie,_e){try{const je=await At().uploadFile({file:ie,name:_e});return{fileId:je.id,name:je.name,mediaType:je.mediaType}}catch(Ie){return l("uploadImage",Ie),null}}function Ze(ie,_e){const Ie=e.activeSessionId;if(!Ie)return;const je=e.queuedBySession[Ie]??[],nt={text:ie,attachments:_e,id:Jke()};e.queuedBySession={...e.queuedBySession,[Ie]:[...je,nt]}}function Qe(ie){const[_e,...Ie]=e.queuedBySession[ie]??[];_e!==void 0&&(e.queuedBySession={...e.queuedBySession,[ie]:Ie},Ct(ie,_e.text,_e.attachments).then(je=>{if(je==="ok"){Z1.delete(ie);return}if(je==="uncertain"){Z1.delete(ie);return}if(!e.sessions.some(Ln=>Ln.id===ie)){Z1.delete(ie);return}const nt=_e.id??_e.text,kt=Z1.get(ie),Pt=kt!==void 0&&kt.key===nt?kt.count+1:1;if(Pt>=Xke){Z1.delete(ie),(e.queuedBySession[ie]?.length??0)>0&&Qe(ie);return}Z1.set(ie,{key:nt,count:Pt});const jt=e.queuedBySession[ie]??[];e.queuedBySession={...e.queuedBySession,[ie]:[_e,...jt]}}))}function ct(ie,_e){const Ie=e.inFlightBySession[ie]===!0;if(e.inFlightBySession={...e.inFlightBySession,[ie]:!1},e.promptIdBySession[ie]!==void 0){const nt={...e.promptIdBySession};delete nt[ie],e.promptIdBySession=nt}return ie===e.activeSessionId&&ee(),(Ie||_e?.turnWasActive===!0||(e.turnActiveBySession[ie]??!1))&&Qe(ie),Ie}function mn(ie,_e){_e.inFlightTurn!==null&&_e.busy||ct(ie)}async function _o(){const ie=e.activeSessionId;if(!ie)return;const _e=e.sessions.find(nt=>nt.id===ie);let Ie=e.promptIdBySession[ie];if(Ie===void 0){const nt=_e?.currentPromptId;nt!==void 0&&nt.length>0&&!nt.startsWith("pr_")&&(Ie=nt)}const je=At();if(Ie!==void 0)try{if((await je.abortPrompt(ie,Ie)).aborted)return;const kt={...e.promptIdBySession};delete kt[ie],e.promptIdBySession=kt}catch(nt){if(Ur(nt)&&nt.code===Wke){const kt={...e.promptIdBySession};delete kt[ie],e.promptIdBySession=kt}else{l("abortCurrentPrompt",nt,{sessionId:ie});return}}try{await je.abortSession(ie)}catch(nt){l("abortCurrentPrompt",nt,{sessionId:ie})}}function Un(ie,_e){const Ie=e.approvalsBySession[ie]??[];e.approvalsBySession={...e.approvalsBySession,[ie]:Ie.filter(je=>je.approvalId!==_e)}}function Ps(ie,_e){const Ie=e.questionsBySession[ie]??[];e.questionsBySession={...e.questionsBySession,[ie]:Ie.filter(je=>je.questionId!==_e)}}async function Je(ie,_e){const Ie=e.activeSessionId;if(Ie&&!W3[ie]){W3[ie]=!0;try{const je=At(),nt={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await je.respondApproval(Ie,ie,nt),Un(Ie,ie)}catch(je){Rm(je)?Un(Ie,ie):l("respondApproval",je,{sessionId:Ie})}finally{delete W3[ie]}}}async function ze(ie,_e){const Ie=e.activeSessionId;if(Ie&&!W1[ie]){W1[ie]="answer";try{await At().respondQuestion(Ie,ie,_e),Ps(Ie,ie)}catch(je){Rm(je)?Ps(Ie,ie):l("respondQuestion",je,{sessionId:Ie})}finally{delete W1[ie]}}}async function wt(ie){const _e=e.activeSessionId;if(_e&&!W1[ie]){W1[ie]="dismiss";try{await At().dismissQuestion(_e,ie),Ps(_e,ie)}catch(Ie){Rm(Ie)?Ps(_e,ie):l("dismissQuestion",Ie,{sessionId:_e})}finally{delete W1[ie]}}}async function Mt(ie){const _e=e.activeSessionId;if(_e&&!Fm[ie]){Fm[ie]=!0;try{const Ie=At(),je=(e.tasksBySession[_e]??[]).find(kt=>kt.id===ie)?.backgroundTaskId;await Ie.cancelTask(_e,je??ie);const nt=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:nt.map(kt=>kt.id===ie?{...kt,status:"cancelled"}:kt)}}catch(Ie){Gke(Ie)||l("cancelTask",Ie,{sessionId:_e})}finally{delete Fm[ie]}}}function tn(ie){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:ie},V(),$({planMode:ie})):j.planMode=ie}function Xn(){const ie=e.activeSessionId,_e=ie?e.planModeBySession[ie]??!1:j.planMode;tn(!_e)}function Jn(ie){const _e=e.activeSessionId;_e?(e.dynamicWorkflowModeBySession={...e.dynamicWorkflowModeBySession,[_e]:ie},A(),$({dynamicWorkflowMode:ie})):j.dynamicWorkflowMode=ie}async function Es(){const ie=e.activeSessionId,Ie=!(ie?e.dynamicWorkflowModeBySession[ie]??!1:j.dynamicWorkflowMode);Ie&&e.permission==="manual"&&!await o({title:n("workspace.dynamicWorkflowEnableTitle"),message:n("workspace.dynamicWorkflowEnableConfirm"),variant:"primary"})||Jn(Ie)}function Xo(ie){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:ie},F()):j.goalMode=ie}function ro(){const ie=e.activeSessionId,_e=ie?e.goalModeBySession[ie]??!1:j.goalMode;Xo(!_e)}async function uo(ie){const _e=ie.trim();if(!_e||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let Ie=e.activeSessionId;if(!Ie){const je=e.activeWorkspaceId,nt=je&&E.value.some(kt=>kt.id===je)?je:E.value[0]?.id??null;if(!nt)return;try{Ie=await bt(nt)??void 0}catch(kt){l("createGoal",kt);return}if(!Ie)return}try{await At().updateSession(Ie,{goalObjective:_e})}catch(je){l("createGoal",je,{sessionId:Ie,message:G(je)});return}e.goalModeBySession[Ie]&&(e.goalModeBySession={...e.goalModeBySession,[Ie]:!1},F()),e.activeSessionId===Ie?await so(_e):await Ct(Ie,_e)}function vn(ie){const _e=e.activeSessionId;_e&&Promise.resolve(At().updateSession(_e,{goalControl:ie})).catch(Ie=>{l("controlGoal",Ie,{sessionId:_e,message:G(Ie)})})}function Hs(ie){e.permission=ie,O(ie),$({permissionMode:ie})}function bs(ie){const _e=[...e.warnings];_e.splice(ie,1),e.warnings=_e}async function Ci(ie,_e){try{await At().updateSession(ie,{title:_e}),d(ie,je=>({...je,title:_e}))}catch(Ie){l("renameSession",Ie,{sessionId:ie})}}async function ir(ie){try{const Ie=await At().generateSessionTitle(ie,{force:!0,source:"digest"});return Ie.title.length>0?Ie.title:null}catch(_e){return console.warn("[pythinker-web] generateSessionTitle failed for",ie,_e),null}}async function Is(ie,_e){const Ie=e.workspaces.find(nt=>nt.id===ie)?.root,je=()=>{e.workspaces=e.workspaces.map(nt=>nt.id===ie?{...nt,name:_e}:nt)};try{if(await At().updateWorkspace(ie,{name:_e}),Ie!==void 0){const nt=o3();Ie in nt&&(delete nt[Ie],pk(nt))}je()}catch(nt){if(Ie!==void 0&&Ur(nt)&&nt.code===qke){pk({...o3(),[Ie]:_e}),je();return}l("renameWorkspace",nt)}}async function Ys(ie){const _e=e.workspaces.find(kt=>kt.id===ie)?.root??T.value.find(kt=>kt.id===ie)?.root??ie,Ie=e.activeSessionId?e.sessions.find(kt=>kt.id===e.activeSessionId):void 0,je=e.activeWorkspaceId===ie||e.activeWorkspaceId===_e,nt=!!(Ie&&(Ie.cwd===_e||Ie.workspaceId===ie||C(Ie)===ie));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],W(e.hiddenWorkspaceRoots));try{await At().deleteWorkspace(ie)}catch(kt){console.warn("[pythinker-web] deleteWorkspace registry cleanup failed for",ie,kt)}if(e.workspaces=e.workspaces.filter(kt=>kt.id!==ie&&kt.root!==_e),je||nt){const kt=E.value[0]?.id??null;if(e.activeWorkspaceId=kt,kt)P(kt);else try{w0(ln.activeWorkspace)}catch{}}(je||nt)&&(m(void 0),e.sessionLoading=!1,D(),no(void 0,"replace"))}async function io(ie){try{await At().archiveSession(ie),h(ie),r.clearSideChatForSession(ie);const{[ie]:Ie,...je}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=je,e.activeSessionId===ie){const nt=e.sessions[0];nt?await oo(nt.id,{urlMode:"replace"}):(m(void 0),no(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:ie})}}async function Io(ie){if(Ke)return!1;const _e=ie??e.activeSessionId;if(!_e){const je=n("commands.export.noSession");return us("export:failed",{status:"no-session"}),l("exportSession",new Error(je),{message:je}),!1}Ke=!0;const Ie=Date.now();us("export:start",{sessionId:_e});try{const je=T8e(),{blob:nt,fileName:kt}=await At().exportSession(_e,je);if(typeof document>"u")throw new Error("Document is unavailable");const Pt=URL.createObjectURL(nt);let jt;try{jt=document.createElement("a"),jt.href=Pt,jt.download=kt,document.body.append(jt),jt.click()}finally{jt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Pt)}catch{}},0)}return us("export:accepted",{sessionId:_e,status:"accepted",zipBytes:nt.size,durationMs:Date.now()-Ie}),!0}catch(je){const nt=typeof je=="object"&&je!==null?je:void 0;return us("export:failed",{sessionId:_e,status:"failed",durationMs:Date.now()-Ie,errorName:typeof nt?.name=="string"?nt.name:typeof je,errorCode:typeof nt?.code=="number"?nt.code:void 0,requestId:typeof nt?.requestId=="string"?nt.requestId:void 0,phase:typeof nt?.phase=="string"?nt.phase:void 0,httpStatus:typeof nt?.status=="number"?nt.status:void 0}),l("exportSession",je,{sessionId:_e}),!1}finally{Ke=!1}}async function yr(ie){try{const _e=await At().restoreSession(ie);return f(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:ie}),!1}}function kr(ie){return At().listSessions({archivedOnly:!0,beforeId:ie?.beforeId,pageSize:ie?.pageSize??50})}function si(ie){const _e=e.activeSessionId;_e&&At().compactSession(_e,ie).catch(Ie=>{l("compact",Ie,{sessionId:_e})})}async function Or(ie){const _e=ie??e.activeSessionId;if(_e)try{const Ie=await At().forkSession(_e);f(Ie),await oo(Ie.id)}catch(Ie){l("fork",Ie,{sessionId:_e})}}async function Pr(ie=1){const _e=e.activeSessionId;if(!_e)return null;const Ie=(()=>{const je=e.messagesBySession[_e]??[];for(let nt=je.length-1;nt>=0;nt--){const kt=je[nt];if(kt.role==="user"&&!(kt.metadata?.origin&&kt.metadata.origin.kind!=="user"))return kt.content.filter(Pt=>Pt.type==="text").map(Pt=>Pt.text).join(` -`)}return null})();try{return await At().undoSession(_e,ie),await v(_e),Ie}catch(je){return l("undo",je,{sessionId:_e}),null}}function Ee(ie){const _e=e.activeSessionId;if(!_e)return;const Ie=e.queuedBySession[_e]??[];if(ie<0||ie>=Ie.length)return;const je=[...Ie];je.splice(ie,1),e.queuedBySession={...e.queuedBySession,[_e]:je}}function Ae(ie,_e){const Ie=e.activeSessionId;if(!Ie)return;const je=e.queuedBySession[Ie]??[];if(ie===_e||ie<0||ie>=je.length||_e<0||_e>=je.length)return;const nt=[...je],[kt]=nt.splice(ie,1);kt!==void 0&&(nt.splice(_e,0,kt),e.queuedBySession={...e.queuedBySession,[Ie]:nt})}async function De(ie){const _e=e.activeSessionId;if(!_e)return[];try{return(await At().listDirectory(_e,{path:ie,includeGitStatus:!0})).items}catch{return[]}}async function Ut(ie){const _e=e.activeSessionId;if(!_e)return null;try{const je=await At().readFile(_e,{path:ie});return{path:je.path,content:je.content,encoding:je.encoding,mime:je.mime,languageId:je.languageId,isBinary:je.isBinary,size:je.size,lineCount:je.lineCount}}catch(Ie){return console.warn("[pythinker-web] readFileContent failed for",ie,Ie),null}}const dn=10485760;function zn(ie){const _e=e.activeSessionId;return _e?At().getFileDownloadUrl(_e,ie):null}async function So(ie,_e){const Ie=e.activeSessionId;if(!Ie)return!1;try{return await At().openFile(Ie,{path:ie,line:_e}),!0}catch(je){return l("openFile",je,{sessionId:Ie}),!1}}async function Jo(ie){const _e=e.activeSessionId;if(!_e)return;const Ie=N.value.cwd||".";try{await At().openInApp(_e,ie,Ie)}catch(je){l("openInApp",je,{sessionId:_e})}}async function Qo(ie){const _e=e.activeSessionId;if(!_e)return!1;try{return await At().revealFile(_e,{path:ie}),!0}catch(Ie){return l("revealFile",Ie,{sessionId:_e}),!1}}async function Mi(ie,_e){const Ie=e.activeSessionId;if(!Ie)return!1;try{return await At().revealSavedPlan(Ie,{agentId:ie,toolCallId:_e}),!0}catch(je){return l("revealSavedPlan",je,{sessionId:Ie}),!1}}async function es(ie){if(/^(https?:|data:|blob:)/i.test(ie))return ie;const _e=e.activeSessionId;if(!_e)return ie;let Ie=ie;if(Ie.startsWith("/")){const je=e.sessions.find(nt=>nt.id===_e)?.cwd;if(je&&(Ie===je||Ie.startsWith(je.endsWith("/")?je:`${je}/`))){if(Ie=Ie.slice(je.length).replace(/^\//,""),!Ie)return ie}else return ie}try{const nt=await At().readFile(_e,{path:Ie,length:dn});return!nt.isBinary||nt.encoding!=="base64"||nt.truncated?ie:`data:${nt.mime};base64,${nt.content}`}catch{return ie}}async function is(ie){const _e=e.sessions.find(je=>je.id===e.activeSessionId),Ie=_e===void 0?e.activeWorkspaceId:C(_e);if(!Ie)return[];try{return(await At().searchFiles(Ie,{query:ie,limit:20})).items.map(kt=>({path:kt.path,name:kt.name}))}catch{return[]}}return{loadFileDiff:ne,clearFileDiff:D,loadGitStatus:X,checkAuth:ve,loadConfig:pe,updateConfig:ye,listAllSessionsGlobal:re,load:Dt,refreshServerMeta:Qt,loadWorkspaces:en,loadMoreSessions:$t,loadAllSessions:Tt,selectWorkspace:In,openWorkspace:Mn,upsertWorkspacePreserveOrder:Re,applyWorkspaceEvent:lt,clearActiveSession:tt,openWorkspaceDraft:ht,startSessionAndSendPrompt:Rt,startSessionAndActivateSkill:on,startSessionAndOpenSideChat:an,addWorkspaceByPath:sn,browseFs:Yn,getFsHome:Kt,writeSessionUrl:no,fetchSessionIntoList:As,onSessionRoutePopState:ys,bindSessionRoute:co,selectSession:oo,submitPromptInternal:Ct,finishPromptLocal:ct,localTurnStartState:Qke,isLocalTurnSnapshotCurrent:tbe,afterLocalTurnStartsSettle:nbe,handleSessionSnapshot:mn,sendPrompt:so,steerPrompt:js,steerQueued:Ts,uploadImage:Ro,enqueue:Ze,unqueue:Ee,reorderQueue:Ae,abortCurrentPrompt:_o,respondApproval:Je,respondQuestion:ze,dismissQuestion:wt,pendingQuestionActions:W1,pendingApprovalActions:W3,cancelTask:Mt,setPlanMode:tn,togglePlanMode:Xn,setDynamicWorkflowMode:Jn,toggleDynamicWorkflowMode:Es,setGoalMode:Xo,toggleGoalMode:ro,createGoal:uo,controlGoal:vn,setPermission:Hs,dismissWarning:bs,renameSession:Ci,generateSessionTitle:ir,renameWorkspace:Is,deleteWorkspace:Ys,archiveSession:io,exportSession:Io,restoreSession:yr,loadArchivedSessions:kr,compact:si,forkSession:Or,undo:Pr,listDir:De,readFileContent:Ut,getFileDownloadUrl:zn,openWorkspaceFile:So,openInApp:Jo,revealWorkspaceFile:Qo,revealSavedPlan:Mi,resolveImageUrl:es,searchFiles:is,loadOlderMessages:et,refreshSessionSidecars:Y,isStartingFirstPrompt:()=>il.size>0}}const FN=ln.starredModels,zC=new Error("profile persist failed");function sbe(){try{const e=Yo(FN);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function rbe(e){try{vs(FN,JSON.stringify(e))}catch{}}function ibe(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:r,updateSession:i,updateSessionMessages:l}=t,a=U([]),c=U(sbe()),u=U({}),d=U({}),f=U([]),p=U([]),h=U(null);function m(P){if(!(P==null||P.length===0))return a.value.find(W=>W.id===P)??a.value.find(W=>W.model===P)}function k(){const P=e.activeSessionId?e.sessions.find(G=>G.id===e.activeSessionId):void 0,W=P===void 0?h.value??e.defaultModel:P.model||e.defaultModel;return m(W)?.id??W??void 0}function x(P){if(P===void 0)return;const W=m(P);return W===void 0?void 0:jd(W)}function w(P,W){const G=P==null?void 0:e.thinkingBySession[P];return G!==void 0&&iye(W,G)?G:jd(W)}function v(P,W){if(W===void 0)return;const G=m(W);return G===void 0?void 0:w(P,G)}async function b(P,W){return P!=null&&e.thinkingBySession[P]===void 0&&await o(P),v(P,W)}function M(P){e.thinking=P;const W=e.activeSessionId;return P!==void 0&&W!==null&&W!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:P}),P}Ue([()=>e.activeSessionId,()=>k(),()=>{const P=e.activeSessionId;return P==null?void 0:e.thinkingBySession[P]}],()=>{const P=m(k());P!==void 0&&(e.thinking=w(e.activeSessionId,P))});function R(P){At().setConfig({thinking:lye(P,m(k())?.supportEfforts)}).catch(W=>n("setConfig",W))}async function z(P){try{const G=await At().listSkills(P);u.value={...u.value,[P]:G}}catch{}}async function $(P){try{const G=await At().listSkillsForWorkspace(P);d.value={...d.value,[P]:G}}catch{}}async function T(){try{const P=At();a.value=await P.listModels();const W=m(k());W!==void 0&&(e.thinking=w(e.activeSessionId,W))}catch(P){n("loadModels",P)}}async function E(){try{const P=At();f.value=await P.listProviders()}catch(P){n("loadProviders",P)}}async function N(){try{const P=At();p.value=await P.listCatalogProviders()}catch(P){n("loadCatalogProviders",P)}}async function C(P){const W=e.activeSessionId,G=m(P),ee=e.thinking,se=W?e.sessions.find(ge=>ge.id===W)?.model:void 0,oe=k()!==(G?.id??P),Q=aye(G,ee,oe);if(!W)return h.value=P,e.thinking=Q,Q!==ee&&Q!==void 0&&R(Q),!0;i(W,ge=>({...ge,model:P})),Q!==ee&&(e.thinking=Q,Q!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:Q}));try{await At().updateSession(W,{model:P,thinking:Q!==ee?Q:void 0})}catch(ge){return i(W,xe=>({...xe,model:se??xe.model})),Q!==ee&&(e.thinking=ee,ee!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:ee})),n("setModel",ge,{sessionId:W}),!1}return Q!==ee&&Q!==void 0&&R(Q),await o(W),!0}function O(P){const W=new Set(c.value);W.has(P)?W.delete(P):W.add(P),c.value=Array.from(W),rbe(c.value)}async function H(P,W,G){const ee=G??e.activeSessionId;if(!ee)return;const se=r.value==="idle"&&!e.inFlightBySession[ee],oe=`msg_skill_opt_${Date.now().toString(36)}`,Q=se?I7(ee):void 0;if(se){e.inFlightBySession={...e.inFlightBySession,[ee]:!0};const ge={id:oe,sessionId:ee,role:"user",content:[{type:"text",text:`/${P}${W?` ${W}`:""}`}],createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:P,skillArgs:W}}};l(ee,xe=>[...xe,ge])}try{const ge=e.sessions.find(et=>et.id===ee)?.model,xe=(ge&&ge.length>0?ge:e.defaultModel)??void 0;if(!await s({thinking:await b(ee,xe)??e.thinking},ee))throw zC;await At().activateSkill(ee,P,W)}catch(ge){se&&(e.inFlightBySession={...e.inFlightBySession,[ee]:!1},l(ee,xe=>xe.filter(Ke=>Ke.id!==oe))),ge!==zC&&n("activateSkill",ge,{sessionId:ee})}finally{Q!==void 0&&L7(ee,Q)}}async function V(P){try{await At().importCatalogProvider(P),await Promise.all([E(),T()])}catch(W){n("importCatalogProvider",W)}}async function A(P){try{await At().deleteProvider(P),await Promise.all([E(),T()])}catch(W){n("deleteProvider",W)}}async function F(P){try{const W=await At().refreshProvider(P);for(const G of W.failed)n("refreshProvider",new Error(G.reason),{message:G.provider});await Promise.all([E(),T()])}catch(W){n("refreshProvider",W)}}async function j(){try{const P=await At().refreshAllProviders();for(const W of P.failed)n("refreshAllProviders",new Error(W.reason),{message:W.provider});await Promise.all([E(),T()])}catch(P){n("refreshAllProviders",P)}}function q(P){const W=M(P);s({thinking:W}),W!==void 0&&R(W)}return{models:a,starredModelIds:c,providers:f,catalogProviders:p,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:z,loadSkillsForWorkspace:$,loadModels:T,loadProviders:E,loadCatalogProviders:N,setModel:C,thinkingLevelForModelId:x,thinkingLevelForSessionId:v,resolveThinkingForPrompt:b,toggleStarModel:O,activateSkill:H,importCatalogProvider:V,addProvider:P=>V({catalogId:P.type,apiKey:P.apiKey,baseUrl:P.baseUrl}),deleteProvider:A,refreshProvider:F,refreshAllProviders:j,setThinking:q}}const jN="pythinkerWeb.compaction",lbe=/^read[_-]?media(?:file)?$/i,abe=/^data:([^;]+);base64,(.*)$/s,cbe=/^<(image|video|audio)\s+path="([^"]+)">$/,ube=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,dbe=/Mime type:\s*([^.\s]+)/i,fbe=/Size:\s*(\d+)\s*bytes/i,pbe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,hbe="Image compressed to fit model limits:",mbe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function gbe(e){return e.includes(hbe)?e.replace(mbe,""):e}function vbe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function wbe(e){const t=ube.exec(e.trim());return t?{kind:t[1],path:vbe(t[2])}:null}const ON=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,ybe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function kbe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return ON.test(o)?o:void 0}const bbe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function _be(e){const t=bbe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=ybe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&ON.test(o)?o:void 0}}function xbe(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Sbe(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Cbe(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const r=s.url;return typeof r=="string"?{kind:n,url:r}:null}function Mbe(e,t){if(!lbe.test(e))return;const n=Sbe(t);if(n===null)return;let o,s,r,i,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,h=cbe.exec(p);h&&(s=h[1],o=h[2]);const m=dbe.exec(p);m?.[1]&&(r=m[1]);const k=fbe.exec(p);k?.[1]&&(i=Number(k[1]));const x=pbe.exec(p);x?.[1]&&x[2]&&(l=`${x[1]}x${x[2]}`);continue}const f=Cbe(d);f&&(a=f)}if(a===null)return;const c=abe.exec(a.url);return c?.[1]&&(r=c[1]),c?.[2]&&(i=xbe(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:r,bytes:Number.isFinite(i)?i:void 0,dimensions:l}}function Abe(e){if(e!=null){if(typeof e=="string")return e.split(` +`),kt)!=="rejected"||je.length===0))return;const Ln=e.queuedBySession[re]??[];e.queuedBySession={...e.queuedBySession,[re]:[...je,...Ln]}}function Es(re){const _e=e.activeSessionId;if(!_e)return Promise.resolve();const Ie=(e.queuedBySession[_e]??[])[re];if(Ie===void 0)return Promise.resolve();const je=Ie.id??Ie.text;return Pn(_e,()=>ks(_e,je))}async function ks(re,_e){const Ie=e.queuedBySession[re]??[],je=Ie.findIndex(cn=>(cn.id??cn.text)===_e),nt=je>=0?Ie[je]:void 0;if(nt===void 0)return;const kt=nt.attachments??[];if(nt.text.trim().length===0&&kt.length===0)return;const Pt=[...Ie];if(Pt.splice(je,1),e.queuedBySession={...e.queuedBySession,[re]:Pt},await Lo(re,nt.text,kt)!=="rejected"||!e.sessions.some(cn=>cn.id===re))return;const Ln=[...e.queuedBySession[re]??[]];Ln.splice(Math.min(je,Ln.length),0,nt),e.queuedBySession={...e.queuedBySession,[re]:Ln}}async function Lo(re,_e,Ie){if(a.value==="idle"&&!e.inFlightBySession[re])return Ct(re,_e,Ie);const je=[];_e&&je.push({type:"text",text:_e});for(const jt of Ie)jt.kind==="video"?je.push({type:"video",source:{kind:"file",fileId:jt.fileId}}):jt.kind==="file"?je.push({type:"file",fileId:jt.fileId,name:jt.name??"",mediaType:jt.mediaType||"application/octet-stream",size:jt.size??0}):je.push({type:"image",source:{kind:"file",fileId:jt.fileId}});const nt=x(),kt={id:nt,sessionId:re,role:"user",content:je,createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};k(re,jt=>[...jt,kt]);const Pt=L7(re);try{const jt=At(),Ln=e.sessions.find(wo=>wo.id===re),cn=(Ln?.model&&Ln.model.length>0?Ln.model:e.defaultModel)??void 0,Rn=await jt.submitPrompt(re,{content:je,model:cn,thinking:await r.resolveThinkingForPrompt(re,cn)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[re]??!1,dynamicWorkflowMode:e.dynamicWorkflowModeBySession[re]??!1});if(k(re,wo=>{const qt=wo.findIndex(Nn=>Nn.id===nt);if(qt===-1)return wo;const $n=[...wo];return $n[qt]={...$n[qt],promptId:$n[qt].promptId??Rn.promptId},$n}),Rn.status!=="queued")return e.promptIdBySession={...e.promptIdBySession,[re]:Rn.promptId},v()?.bindNextPromptId(re,Rn.promptId),"ok";try{await jt.steerPrompts(re,[Rn.promptId])}catch{return"ok"}return"ok"}catch(jt){return k(re,Ln=>Ln.filter(cn=>cn.id!==nt)),l("steer",jt,{sessionId:re}),Ui(jt)?"rejected":"uncertain"}finally{$7(re,Pt)}}async function Ro(re,_e){try{const je=await At().uploadFile({file:re,name:_e});return{fileId:je.id,name:je.name,mediaType:je.mediaType}}catch(Ie){return l("uploadImage",Ie),null}}function Ze(re,_e){const Ie=e.activeSessionId;if(!Ie)return;const je=e.queuedBySession[Ie]??[],nt={text:re,attachments:_e,id:fbe()};e.queuedBySession={...e.queuedBySession,[Ie]:[...je,nt]}}function Qe(re){const[_e,...Ie]=e.queuedBySession[re]??[];_e!==void 0&&(e.queuedBySession={...e.queuedBySession,[re]:Ie},Ct(re,_e.text,_e.attachments).then(je=>{if(je==="ok"){Z1.delete(re);return}if(je==="uncertain"){Z1.delete(re);return}if(!e.sessions.some(Ln=>Ln.id===re)){Z1.delete(re);return}const nt=_e.id??_e.text,kt=Z1.get(re),Pt=kt!==void 0&&kt.key===nt?kt.count+1:1;if(Pt>=dbe){Z1.delete(re),(e.queuedBySession[re]?.length??0)>0&&Qe(re);return}Z1.set(re,{key:nt,count:Pt});const jt=e.queuedBySession[re]??[];e.queuedBySession={...e.queuedBySession,[re]:[_e,...jt]}}))}function ct(re,_e){const Ie=e.inFlightBySession[re]===!0;if(e.inFlightBySession={...e.inFlightBySession,[re]:!1},e.promptIdBySession[re]!==void 0){const nt={...e.promptIdBySession};delete nt[re],e.promptIdBySession=nt}return re===e.activeSessionId&&ee(),(Ie||_e?.turnWasActive===!0||(e.turnActiveBySession[re]??!1))&&Qe(re),Ie}function mn(re,_e){_e.inFlightTurn!==null&&_e.busy||ct(re)}async function _o(){const re=e.activeSessionId;if(!re)return;const _e=e.sessions.find(nt=>nt.id===re);let Ie=e.promptIdBySession[re];if(Ie===void 0){const nt=_e?.currentPromptId;nt!==void 0&&nt.length>0&&!nt.startsWith("pr_")&&(Ie=nt)}const je=At();if(Ie!==void 0)try{if((await je.abortPrompt(re,Ie)).aborted)return;const kt={...e.promptIdBySession};delete kt[re],e.promptIdBySession=kt}catch(nt){if(Ui(nt)&&nt.code===sbe){const kt={...e.promptIdBySession};delete kt[re],e.promptIdBySession=kt}else{l("abortCurrentPrompt",nt,{sessionId:re});return}}try{await je.abortSession(re)}catch(nt){l("abortCurrentPrompt",nt,{sessionId:re})}}function Un(re,_e){const Ie=e.approvalsBySession[re]??[];e.approvalsBySession={...e.approvalsBySession,[re]:Ie.filter(je=>je.approvalId!==_e)}}function Ps(re,_e){const Ie=e.questionsBySession[re]??[];e.questionsBySession={...e.questionsBySession,[re]:Ie.filter(je=>je.questionId!==_e)}}async function Je(re,_e){const Ie=e.activeSessionId;if(Ie&&!q3[re]){q3[re]=!0;try{const je=At(),nt={decision:_e.decision,scope:_e.scope,feedback:_e.feedback,selectedLabel:_e.selectedLabel};await je.respondApproval(Ie,re,nt),Un(Ie,re)}catch(je){Fm(je)?Un(Ie,re):l("respondApproval",je,{sessionId:Ie})}finally{delete q3[re]}}}async function ze(re,_e){const Ie=e.activeSessionId;if(Ie&&!W1[re]){W1[re]="answer";try{await At().respondQuestion(Ie,re,_e),Ps(Ie,re)}catch(je){Fm(je)?Ps(Ie,re):l("respondQuestion",je,{sessionId:Ie})}finally{delete W1[re]}}}async function wt(re){const _e=e.activeSessionId;if(_e&&!W1[re]){W1[re]="dismiss";try{await At().dismissQuestion(_e,re),Ps(_e,re)}catch(Ie){Fm(Ie)?Ps(_e,re):l("dismissQuestion",Ie,{sessionId:_e})}finally{delete W1[re]}}}async function Mt(re){const _e=e.activeSessionId;if(_e&&!jm[re]){jm[re]=!0;try{const Ie=At(),je=(e.tasksBySession[_e]??[]).find(kt=>kt.id===re)?.backgroundTaskId;await Ie.cancelTask(_e,je??re);const nt=e.tasksBySession[_e]??[];e.tasksBySession={...e.tasksBySession,[_e]:nt.map(kt=>kt.id===re?{...kt,status:"cancelled"}:kt)}}catch(Ie){cbe(Ie)||l("cancelTask",Ie,{sessionId:_e})}finally{delete jm[re]}}}function tn(re){const _e=e.activeSessionId;_e?(e.planModeBySession={...e.planModeBySession,[_e]:re},V(),$({planMode:re})):j.planMode=re}function Xn(){const re=e.activeSessionId,_e=re?e.planModeBySession[re]??!1:j.planMode;tn(!_e)}function Jn(re){const _e=e.activeSessionId;_e?(e.dynamicWorkflowModeBySession={...e.dynamicWorkflowModeBySession,[_e]:re},A(),$({dynamicWorkflowMode:re})):j.dynamicWorkflowMode=re}async function Ts(){const re=e.activeSessionId,Ie=!(re?e.dynamicWorkflowModeBySession[re]??!1:j.dynamicWorkflowMode);Ie&&e.permission==="manual"&&!await o({title:n("workspace.dynamicWorkflowEnableTitle"),message:n("workspace.dynamicWorkflowEnableConfirm"),variant:"primary"})||Jn(Ie)}function Xo(re){const _e=e.activeSessionId;_e?(e.goalModeBySession={...e.goalModeBySession,[_e]:re},F()):j.goalMode=re}function io(){const re=e.activeSessionId,_e=re?e.goalModeBySession[re]??!1:j.goalMode;Xo(!_e)}async function uo(re){const _e=re.trim();if(!_e||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:_e}),variant:"primary"}))return;let Ie=e.activeSessionId;if(!Ie){const je=e.activeWorkspaceId,nt=je&&T.value.some(kt=>kt.id===je)?je:T.value[0]?.id??null;if(!nt)return;try{Ie=await bt(nt)??void 0}catch(kt){l("createGoal",kt);return}if(!Ie)return}try{await At().updateSession(Ie,{goalObjective:_e})}catch(je){l("createGoal",je,{sessionId:Ie,message:G(je)});return}e.goalModeBySession[Ie]&&(e.goalModeBySession={...e.goalModeBySession,[Ie]:!1},F()),e.activeSessionId===Ie?await so(_e):await Ct(Ie,_e)}function vn(re){const _e=e.activeSessionId;_e&&Promise.resolve(At().updateSession(_e,{goalControl:re})).catch(Ie=>{l("controlGoal",Ie,{sessionId:_e,message:G(Ie)})})}function Hs(re){e.permission=re,O(re),$({permissionMode:re})}function bs(re){const _e=[...e.warnings];_e.splice(re,1),e.warnings=_e}async function Cr(re,_e){try{await At().updateSession(re,{title:_e}),d(re,je=>({...je,title:_e}))}catch(Ie){l("renameSession",Ie,{sessionId:re})}}async function ri(re){try{const Ie=await At().generateSessionTitle(re,{force:!0,source:"digest"});return Ie.title.length>0?Ie.title:null}catch(_e){return console.warn("[pythinker-web] generateSessionTitle failed for",re,_e),null}}async function Is(re,_e){const Ie=e.workspaces.find(nt=>nt.id===re)?.root,je=()=>{e.workspaces=e.workspaces.map(nt=>nt.id===re?{...nt,name:_e}:nt)};try{if(await At().updateWorkspace(re,{name:_e}),Ie!==void 0){const nt=s3();Ie in nt&&(delete nt[Ie],hk(nt))}je()}catch(nt){if(Ie!==void 0&&Ui(nt)&&nt.code===ibe){hk({...s3(),[Ie]:_e}),je();return}l("renameWorkspace",nt)}}async function Ys(re){const _e=e.workspaces.find(kt=>kt.id===re)?.root??E.value.find(kt=>kt.id===re)?.root??re,Ie=e.activeSessionId?e.sessions.find(kt=>kt.id===e.activeSessionId):void 0,je=e.activeWorkspaceId===re||e.activeWorkspaceId===_e,nt=!!(Ie&&(Ie.cwd===_e||Ie.workspaceId===re||C(Ie)===re));_e&&!e.hiddenWorkspaceRoots.includes(_e)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,_e],W(e.hiddenWorkspaceRoots));try{await At().deleteWorkspace(re)}catch(kt){console.warn("[pythinker-web] deleteWorkspace registry cleanup failed for",re,kt)}if(e.workspaces=e.workspaces.filter(kt=>kt.id!==re&&kt.root!==_e),je||nt){const kt=T.value[0]?.id??null;if(e.activeWorkspaceId=kt,kt)P(kt);else try{w0(ln.activeWorkspace)}catch{}}(je||nt)&&(m(void 0),e.sessionLoading=!1,D(),no(void 0,"replace"))}async function ro(re){try{await At().archiveSession(re),h(re),i.clearSideChatForSession(re);const{[re]:Ie,...je}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=je,e.activeSessionId===re){const nt=e.sessions[0];nt?await oo(nt.id,{urlMode:"replace"}):(m(void 0),no(void 0,"replace"))}}catch(_e){l("archiveSession",_e,{sessionId:re})}}async function Io(re){if(Ke)return!1;const _e=re??e.activeSessionId;if(!_e){const je=n("commands.export.noSession");return us("export:failed",{status:"no-session"}),l("exportSession",new Error(je),{message:je}),!1}Ke=!0;const Ie=Date.now();us("export:start",{sessionId:_e});try{const je=N8e(),{blob:nt,fileName:kt}=await At().exportSession(_e,je);if(typeof document>"u")throw new Error("Document is unavailable");const Pt=URL.createObjectURL(nt);let jt;try{jt=document.createElement("a"),jt.href=Pt,jt.download=kt,document.body.append(jt),jt.click()}finally{jt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Pt)}catch{}},0)}return us("export:accepted",{sessionId:_e,status:"accepted",zipBytes:nt.size,durationMs:Date.now()-Ie}),!0}catch(je){const nt=typeof je=="object"&&je!==null?je:void 0;return us("export:failed",{sessionId:_e,status:"failed",durationMs:Date.now()-Ie,errorName:typeof nt?.name=="string"?nt.name:typeof je,errorCode:typeof nt?.code=="number"?nt.code:void 0,requestId:typeof nt?.requestId=="string"?nt.requestId:void 0,phase:typeof nt?.phase=="string"?nt.phase:void 0,httpStatus:typeof nt?.status=="number"?nt.status:void 0}),l("exportSession",je,{sessionId:_e}),!1}finally{Ke=!1}}async function yi(re){try{const _e=await At().restoreSession(re);return f(_e),!0}catch(_e){return l("restoreSession",_e,{sessionId:re}),!1}}function ki(re){return At().listSessions({archivedOnly:!0,beforeId:re?.beforeId,pageSize:re?.pageSize??50})}function sr(re){const _e=e.activeSessionId;_e&&At().compactSession(_e,re).catch(Ie=>{l("compact",Ie,{sessionId:_e})})}async function Oi(re){const _e=re??e.activeSessionId;if(_e)try{const Ie=await At().forkSession(_e);f(Ie),await oo(Ie.id)}catch(Ie){l("fork",Ie,{sessionId:_e})}}async function Pi(re=1){const _e=e.activeSessionId;if(!_e)return null;const Ie=(()=>{const je=e.messagesBySession[_e]??[];for(let nt=je.length-1;nt>=0;nt--){const kt=je[nt];if(kt.role==="user"&&!(kt.metadata?.origin&&kt.metadata.origin.kind!=="user"))return kt.content.filter(Pt=>Pt.type==="text").map(Pt=>Pt.text).join(` +`)}return null})();try{return await At().undoSession(_e,re),await w(_e),Ie}catch(je){return l("undo",je,{sessionId:_e}),null}}function Te(re){const _e=e.activeSessionId;if(!_e)return;const Ie=e.queuedBySession[_e]??[];if(re<0||re>=Ie.length)return;const je=[...Ie];je.splice(re,1),e.queuedBySession={...e.queuedBySession,[_e]:je}}function Ae(re,_e){const Ie=e.activeSessionId;if(!Ie)return;const je=e.queuedBySession[Ie]??[];if(re===_e||re<0||re>=je.length||_e<0||_e>=je.length)return;const nt=[...je],[kt]=nt.splice(re,1);kt!==void 0&&(nt.splice(_e,0,kt),e.queuedBySession={...e.queuedBySession,[Ie]:nt})}async function De(re){const _e=e.activeSessionId;if(!_e)return[];try{return(await At().listDirectory(_e,{path:re,includeGitStatus:!0})).items}catch{return[]}}async function Ut(re){const _e=e.activeSessionId;if(!_e)return null;try{const je=await At().readFile(_e,{path:re});return{path:je.path,content:je.content,encoding:je.encoding,mime:je.mime,languageId:je.languageId,isBinary:je.isBinary,size:je.size,lineCount:je.lineCount}}catch(Ie){return console.warn("[pythinker-web] readFileContent failed for",re,Ie),null}}const dn=10485760;function zn(re){const _e=e.activeSessionId;return _e?At().getFileDownloadUrl(_e,re):null}async function So(re,_e){const Ie=e.activeSessionId;if(!Ie)return!1;try{return await At().openFile(Ie,{path:re,line:_e}),!0}catch(je){return l("openFile",je,{sessionId:Ie}),!1}}async function Jo(re){const _e=e.activeSessionId;if(!_e)return;const Ie=N.value.cwd||".";try{await At().openInApp(_e,re,Ie)}catch(je){l("openInApp",je,{sessionId:_e})}}async function Qo(re){const _e=e.activeSessionId;if(!_e)return!1;try{return await At().revealFile(_e,{path:re}),!0}catch(Ie){return l("revealFile",Ie,{sessionId:_e}),!1}}async function Mr(re,_e){const Ie=e.activeSessionId;if(!Ie)return!1;try{return await At().revealSavedPlan(Ie,{agentId:re,toolCallId:_e}),!0}catch(je){return l("revealSavedPlan",je,{sessionId:Ie}),!1}}async function es(re){if(/^(https?:|data:|blob:)/i.test(re))return re;const _e=e.activeSessionId;if(!_e)return re;let Ie=re;if(Ie.startsWith("/")){const je=e.sessions.find(nt=>nt.id===_e)?.cwd;if(je&&(Ie===je||Ie.startsWith(je.endsWith("/")?je:`${je}/`))){if(Ie=Ie.slice(je.length).replace(/^\//,""),!Ie)return re}else return re}try{const nt=await At().readFile(_e,{path:Ie,length:dn});return!nt.isBinary||nt.encoding!=="base64"||nt.truncated?re:`data:${nt.mime};base64,${nt.content}`}catch{return re}}async function rs(re){const _e=e.sessions.find(je=>je.id===e.activeSessionId),Ie=_e===void 0?e.activeWorkspaceId:C(_e);if(!Ie)return[];try{return(await At().searchFiles(Ie,{query:re,limit:20})).items.map(kt=>({path:kt.path,name:kt.name}))}catch{return[]}}return{loadFileDiff:ne,clearFileDiff:D,loadGitStatus:X,checkAuth:ve,loadConfig:pe,updateConfig:ye,listAllSessionsGlobal:ie,load:Dt,refreshServerMeta:Qt,loadWorkspaces:en,loadMoreSessions:$t,loadAllSessions:Et,selectWorkspace:In,openWorkspace:Mn,upsertWorkspacePreserveOrder:Re,applyWorkspaceEvent:lt,clearActiveSession:tt,openWorkspaceDraft:ht,startSessionAndSendPrompt:Rt,startSessionAndActivateSkill:on,startSessionAndOpenSideChat:an,addWorkspaceByPath:sn,browseFs:Yn,getFsHome:Kt,writeSessionUrl:no,fetchSessionIntoList:As,onSessionRoutePopState:ys,bindSessionRoute:co,selectSession:oo,submitPromptInternal:Ct,finishPromptLocal:ct,localTurnStartState:pbe,isLocalTurnSnapshotCurrent:mbe,afterLocalTurnStartsSettle:gbe,handleSessionSnapshot:mn,sendPrompt:so,steerPrompt:js,steerQueued:Es,uploadImage:Ro,enqueue:Ze,unqueue:Te,reorderQueue:Ae,abortCurrentPrompt:_o,respondApproval:Je,respondQuestion:ze,dismissQuestion:wt,pendingQuestionActions:W1,pendingApprovalActions:q3,cancelTask:Mt,setPlanMode:tn,togglePlanMode:Xn,setDynamicWorkflowMode:Jn,toggleDynamicWorkflowMode:Ts,setGoalMode:Xo,toggleGoalMode:io,createGoal:uo,controlGoal:vn,setPermission:Hs,dismissWarning:bs,renameSession:Cr,generateSessionTitle:ri,renameWorkspace:Is,deleteWorkspace:Ys,archiveSession:ro,exportSession:Io,restoreSession:yi,loadArchivedSessions:ki,compact:sr,forkSession:Oi,undo:Pi,listDir:De,readFileContent:Ut,getFileDownloadUrl:zn,openWorkspaceFile:So,openInApp:Jo,revealWorkspaceFile:Qo,revealSavedPlan:Mr,resolveImageUrl:es,searchFiles:rs,loadOlderMessages:et,refreshSessionSidecars:Y,isStartingFirstPrompt:()=>rl.size>0}}const HN=ln.starredModels,FC=new Error("profile persist failed");function wbe(){try{const e=Yo(HN);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function ybe(e){try{vs(HN,JSON.stringify(e))}catch{}}function kbe(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=U([]),c=U(wbe()),u=U({}),d=U({}),f=U([]),p=U([]),h=U(null);function m(P){if(!(P==null||P.length===0))return a.value.find(W=>W.id===P)??a.value.find(W=>W.model===P)}function k(){const P=e.activeSessionId?e.sessions.find(G=>G.id===e.activeSessionId):void 0,W=P===void 0?h.value??e.defaultModel:P.model||e.defaultModel;return m(W)?.id??W??void 0}function x(P){if(P===void 0)return;const W=m(P);return W===void 0?void 0:Od(W)}function v(P,W){const G=P==null?void 0:e.thinkingBySession[P];return G!==void 0&&kye(W,G)?G:Od(W)}function w(P,W){if(W===void 0)return;const G=m(W);return G===void 0?void 0:v(P,G)}async function b(P,W){return P!=null&&e.thinkingBySession[P]===void 0&&await o(P),w(P,W)}function M(P){e.thinking=P;const W=e.activeSessionId;return P!==void 0&&W!==null&&W!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:P}),P}Ue([()=>e.activeSessionId,()=>k(),()=>{const P=e.activeSessionId;return P==null?void 0:e.thinkingBySession[P]}],()=>{const P=m(k());P!==void 0&&(e.thinking=v(e.activeSessionId,P))});function R(P){At().setConfig({thinking:bye(P,m(k())?.supportEfforts)}).catch(W=>n("setConfig",W))}async function z(P){try{const G=await At().listSkills(P);u.value={...u.value,[P]:G}}catch{}}async function $(P){try{const G=await At().listSkillsForWorkspace(P);d.value={...d.value,[P]:G}}catch{}}async function E(){try{const P=At();a.value=await P.listModels();const W=m(k());W!==void 0&&(e.thinking=v(e.activeSessionId,W))}catch(P){n("loadModels",P)}}async function T(){try{const P=At();f.value=await P.listProviders()}catch(P){n("loadProviders",P)}}async function N(){try{const P=At();p.value=await P.listCatalogProviders()}catch(P){n("loadCatalogProviders",P)}}async function C(P){const W=e.activeSessionId,G=m(P),ee=e.thinking,se=W?e.sessions.find(ge=>ge.id===W)?.model:void 0,oe=k()!==(G?.id??P),Q=_ye(G,ee,oe);if(!W)return h.value=P,e.thinking=Q,Q!==ee&&Q!==void 0&&R(Q),!0;r(W,ge=>({...ge,model:P})),Q!==ee&&(e.thinking=Q,Q!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:Q}));try{await At().updateSession(W,{model:P,thinking:Q!==ee?Q:void 0})}catch(ge){return r(W,xe=>({...xe,model:se??xe.model})),Q!==ee&&(e.thinking=ee,ee!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[W]:ee})),n("setModel",ge,{sessionId:W}),!1}return Q!==ee&&Q!==void 0&&R(Q),await o(W),!0}function O(P){const W=new Set(c.value);W.has(P)?W.delete(P):W.add(P),c.value=Array.from(W),ybe(c.value)}async function H(P,W,G){const ee=G??e.activeSessionId;if(!ee)return;const se=i.value==="idle"&&!e.inFlightBySession[ee],oe=`msg_skill_opt_${Date.now().toString(36)}`,Q=se?L7(ee):void 0;if(se){e.inFlightBySession={...e.inFlightBySession,[ee]:!0};const ge={id:oe,sessionId:ee,role:"user",content:[{type:"text",text:`/${P}${W?` ${W}`:""}`}],createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:P,skillArgs:W}}};l(ee,xe=>[...xe,ge])}try{const ge=e.sessions.find(et=>et.id===ee)?.model,xe=(ge&&ge.length>0?ge:e.defaultModel)??void 0;if(!await s({thinking:await b(ee,xe)??e.thinking},ee))throw FC;await At().activateSkill(ee,P,W)}catch(ge){se&&(e.inFlightBySession={...e.inFlightBySession,[ee]:!1},l(ee,xe=>xe.filter(Ke=>Ke.id!==oe))),ge!==FC&&n("activateSkill",ge,{sessionId:ee})}finally{Q!==void 0&&$7(ee,Q)}}async function V(P){try{await At().importCatalogProvider(P),await Promise.all([T(),E()])}catch(W){n("importCatalogProvider",W)}}async function A(P){try{await At().deleteProvider(P),await Promise.all([T(),E()])}catch(W){n("deleteProvider",W)}}async function F(P){try{const W=await At().refreshProvider(P);for(const G of W.failed)n("refreshProvider",new Error(G.reason),{message:G.provider});await Promise.all([T(),E()])}catch(W){n("refreshProvider",W)}}async function j(){try{const P=await At().refreshAllProviders();for(const W of P.failed)n("refreshAllProviders",new Error(W.reason),{message:W.provider});await Promise.all([T(),E()])}catch(P){n("refreshAllProviders",P)}}function q(P){const W=M(P);s({thinking:W}),W!==void 0&&R(W)}return{models:a,starredModelIds:c,providers:f,catalogProviders:p,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:z,loadSkillsForWorkspace:$,loadModels:E,loadProviders:T,loadCatalogProviders:N,setModel:C,thinkingLevelForModelId:x,thinkingLevelForSessionId:w,resolveThinkingForPrompt:b,toggleStarModel:O,activateSkill:H,importCatalogProvider:V,addProvider:P=>V({catalogId:P.type,apiKey:P.apiKey,baseUrl:P.baseUrl}),deleteProvider:A,refreshProvider:F,refreshAllProviders:j,setThinking:q}}const DN="pythinkerWeb.compaction",bbe=/^read[_-]?media(?:file)?$/i,_be=/^data:([^;]+);base64,(.*)$/s,xbe=/^<(image|video|audio)\s+path="([^"]+)">$/,Sbe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Cbe=/Mime type:\s*([^.\s]+)/i,Mbe=/Size:\s*(\d+)\s*bytes/i,Abe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Ebe="Image compressed to fit model limits:",Tbe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Ibe(e){return e.includes(Ebe)?e.replace(Tbe,""):e}function Lbe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function $be(e){const t=Sbe.exec(e.trim());return t?{kind:t[1],path:Lbe(t[2])}:null}const VN=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Nbe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function zbe(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return VN.test(o)?o:void 0}const Bbe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Rbe(e){const t=Bbe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Nbe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&VN.test(o)?o:void 0}}function Fbe(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function jbe(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function Obe(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Pbe(e,t){if(!bbe.test(e))return;const n=jbe(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const p=d.text,h=xbe.exec(p);h&&(s=h[1],o=h[2]);const m=Cbe.exec(p);m?.[1]&&(i=m[1]);const k=Mbe.exec(p);k?.[1]&&(r=Number(k[1]));const x=Abe.exec(p);x?.[1]&&x[2]&&(l=`${x[1]}x${x[2]}`);continue}const f=Obe(d);f&&(a=f)}if(a===null)return;const c=_be.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Fbe(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Hbe(e){if(e!=null){if(typeof e=="string")return e.split(` `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(` `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(` `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(` -`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Tbe(e){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,prompt:e.command,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,dynamicWorkflowIndex:e.dynamicWorkflowIndex}}function Ebe(e,t){const n=e.split(` +`)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Dbe(e){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,prompt:e.command,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,dynamicWorkflowIndex:e.dynamicWorkflowIndex}}function Vbe(e,t){const n=e.split(` `),o=t.split(` -`),s=[];return n.forEach((r,i)=>{s.push({kind:"rem",gutter:String(i+1),text:`- ${r}`})}),o.forEach((r,i)=>{s.push({kind:"add",gutter:String(i+1),text:`+ ${r}`})}),s}function Ibe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Ebe(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(r=>{const i=r??{};return{title:typeof i.title=="string"?i.title:"",status:typeof i.status=="string"?i.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,i=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:i.length>0?i:void 0}}return{kind:"generic",summary:e.action}}function Lbe(e){const t=` +`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function Wbe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Vbe(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function qbe(e){const t=` `,n=` -`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):$be(e)}function $be(e){const t=e.split(` +`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Ube(e)}function Ube(e){const t=e.split(` `);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function Nbe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function zbe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return Lbe(t)}function Bbe(e,t){const n=e.metadata?.origin??{},o=zbe(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Rbe(e,t,n){const{text:o,cron:s}=Bbe(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function Fbe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function jbe(e){return e.metadata?.origin?.kind==="compaction_summary"}function Obe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function Pbe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function Hbe(e){let t="",n="";const o=[],s=[];for(const r of e)r.type==="text"?t+=r.text:r.type==="thinking"?n+=r.thinking:r.type==="toolUse"?o.push(r.toolCallId):s.push(JSON.stringify(r));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function Dbe(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function b9(e,t,n,o=!0,s={}){const r=[];let i=1;const l=new Map;for(const p of t)l.set(p.toolCallId,p);let a=null;function c(p=!1){if(!a)return;const h=a;if(a=null,!p||!o)for(let m=0;mv.kind==="tool"&&v.tool.id===x.id);w&&w.kind==="tool"&&(w.tool=x)}r.push({id:h.id,role:"assistant",no:i++,text:h.textParts.join(` +`):e}function Zbe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Kbe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return qbe(t)}function Gbe(e,t){const n=e.metadata?.origin??{},o=Kbe(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Ybe(e,t,n){const{text:o,cron:s}=Gbe(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function Xbe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Jbe(e){return e.metadata?.origin?.kind==="compaction_summary"}function Qbe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function e_e(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function t_e(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function n_e(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function _9(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const p of t)l.set(p.toolCallId,p);let a=null;function c(p=!1){if(!a)return;const h=a;if(a=null,!p||!o)for(let m=0;mw.kind==="tool"&&w.tool.id===x.id);v&&v.kind==="tool"&&(v.tool=x)}i.push({id:h.id,role:"assistant",no:r++,text:h.textParts.join(` `),thinking:h.thinkingParts.length>0?h.thinkingParts.join(` `):void 0,tools:h.tools.length>0?h.tools:void 0,blocks:h.blocks.length>0?h.blocks:void 0,approval:h.approval,approvalId:h.approvalId,durationMs:h.durationMs})}function u(p,h){for(const m of h)if(m.type==="text"){if(m.text){p.textParts.push(m.text);const k=p.blocks.at(-1);k&&k.kind==="text"?k.text+=` `+m.text:p.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){p.thinkingParts.push(m.thinking);const k=p.blocks.at(-1);k&&k.kind==="thinking"?(k.thinking+=` -`+m.thinking,k.durationMs=m.durationMs):p.blocks.push({kind:"thinking",thinking:m.thinking,startedAt:m.startedAt,durationMs:m.durationMs})}}else if(m.type==="toolUse"){const k=l.get(m.toolCallId),x={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?s[m.toolCallId]?.path:void 0};p.tools.push(x),p.blocks.push({kind:"tool",tool:x}),k&&(p.approval=Ibe(k),p.approvalId=k.approvalId)}else if(m.type==="toolResult"){const k=p.tools.findIndex(x=>x.id===m.toolCallId);if(k!==-1){const x=p.tools[k],w={...x,status:m.isError?"error":"ok",output:Abe(m.output),media:m.isError?void 0:Mbe(x.name,m.output)};w.name==="ExitPlanMode"&&!w.planPath&&(w.planPath=Pbe(w.output)),p.tools[k]=w;const v=p.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=w)}}}function d(p,h){for(const m of h){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const k=p.tools.findIndex(b=>b.id===m.toolCallId);if(k===-1)continue;const x=p.tools[k];if(x.output!==void 0)continue;const w={...x,output:m.outputLines};p.tools[k]=w;const v=p.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=w)}}function f(p){if(p.type==="image"||p.type==="video"){const h=p.type,m=p.source;if(m.kind==="url")return{url:m.url,kind:h};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:h};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:h,fileId:m.fileId}}if(p.type==="file"&&n){if(p.mediaType.startsWith("image/"))return{url:n(p.fileId),kind:"image",fileId:p.fileId};if(p.mediaType.startsWith("video/"))return{url:n(p.fileId),kind:"video",fileId:p.fileId}}}for(const p of e){if(p.role==="system")continue;if(jbe(p)){c();const w=p.metadata?.[jN];r.push({id:p.id,role:"compaction",no:i,text:p.content.filter(v=>v.type==="text").map(v=>v.text).join(` -`),compaction:{trigger:w?.trigger,tokensBefore:w?.tokensBefore,tokensAfter:w?.tokensAfter}});continue}if(p.role==="user"){const w=Nbe(p);if(w!==void 0){c(),r.push(Rbe(p,i++,w));continue}const v=p.metadata?.origin?.kind;if(v==="task"||v==="background_task"||v==="task_notification"){const T=p.content.filter(C=>C.type==="text").map(C=>C.text).join(` -`),E=U3e(p.metadata),N=E?[E]:d$(T);if(N.length>0){a??={id:p.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[]};for(const C of N)a.blocks.push({kind:"notification",notification:{...C,createdAt:p.createdAt}})}continue}if(c(),!Fbe(p))continue;const b=p.metadata?.origin,M=b?.kind==="skill_activation"&&b?.trigger==="user-slash",R=b?.kind==="plugin_command"&&b?.trigger==="user-slash",z=[],$=[];for(const T of p.content){if(T.type==="text")if(M)z.push(b.skillArgs??"");else if(R)z.push(b.commandArgs??"");else{const N=wbe(T.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const H=kbe(N.path);if(H){$.push({url:n(H),kind:N.kind,fileId:H});continue}}const C=_be(T.text);if(C){$.push({kind:"file",url:C.fileId&&n?n(C.fileId):"",fileId:C.fileId,name:C.name,mediaType:C.mediaType,size:C.size});continue}const O=gbe(T.text);if(O!==T.text&&O.trim().length===0)continue;z.push(O)}const E=f(T);if(E){$.push({url:E.url,kind:E.kind,name:T.type==="file"?T.name:void 0,fileId:E.fileId});continue}T.type==="file"&&n&&$.push({kind:"file",url:n(T.fileId),fileId:T.fileId,name:T.name,mediaType:T.mediaType||void 0,size:T.size})}r.push({id:p.id,role:"user",no:i++,text:z.join(` -`),attachments:$.length>0?$:void 0,skillActivation:M?{name:b.skillName,args:b.skillArgs}:void 0,pluginCommand:R?{pluginId:b.pluginId,commandName:b.commandName,args:b.commandArgs}:void 0,createdAt:p.createdAt});continue}if(p.role==="tool"){a&&u(a,p.content);continue}const h=p.promptId;Obe(a,h)?a!==null&&a.promptId===void 0&&h!==void 0&&(a.promptId=h):(c(),a={id:p.id,promptId:h,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:p.durationMs});const k=a;if(k===null)continue;const x=Hbe(p.content);if(k.promptId!==void 0&&k.foldedSigs.some(w=>Dbe(w,x))){d(k,p.content);continue}k.foldedSigs.push(x),u(k,p.content)}return c(!0),r}function Vbe(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:r,resolveThinkingForPrompt:i}=t,l=U({}),a=B(()=>{const E=e.activeSessionId;if(!E)return null;const N=l.value[E];return N?{parentId:E,agentId:N.agentId}:null}),c=B(()=>a.value?.parentId??null),u=B(()=>a.value!==null),d=B(()=>{const E=a.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),f=B(()=>{const E=a.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(N=>N.id===E.agentId&&N.status==="running"):!1}),p=B(()=>{const E=a.value;if(!E)return[];const N=e.sideChatMessagesByAgent[E.agentId]??[];return b9(N,[],C=>At().getFileUrl(C),f.value)});function h(E,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:N(e.sideChatMessagesByAgent[E]??[])}}function m(E,N){h(E,C=>[...C,N])}function k(E){h(E,N=>{const C=[...N].reverse().findIndex(H=>H.role==="user");if(C===-1)return N;const O=N.length-1-C;return N.filter((H,V)=>V!==O)})}function x(E,N){h(E,C=>{const O=[...C];for(let H=O.length-1;H>=0;H-=1){const V=O[H];if(V.role==="user")return O[H]={...V,promptId:V.promptId??N},O}return C})}function w(E,N,C){C&&h(E,O=>{const H=O.at(-1);if(H?.role==="assistant"){const V=H.content[0],A=V?.type==="text"?V.text:"";return[...O.slice(0,-1),{...H,content:[{type:"text",text:`${A}${C}`}]}]}return[...O,{id:o(),sessionId:N,role:"assistant",content:[{type:"text",text:C}],createdAt:new Date().toISOString()}]})}function v(E,N,C){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!C)return;const H=(e.sideChatMessagesByAgent[E]??[]).at(-1);(H?.role==="assistant"&&H.content[0]?.type==="text"?H.content[0].text:"").trim().length>0||w(E,N,C)}async function b(E){const N=e.activeSessionId;N&&await M(N,E)}async function M(E,N){if(!l.value[E]){let C;try{({agentId:C}=await At().startBtw(E))}catch(O){n("openSideChat",O,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[C]:e.sideChatMessagesByAgent[C]??[]},l.value={...l.value,[E]:{agentId:C}},s(),r()?.markSideChannelAgent(C)}N&&N.trim()&&await R(E,N.trim())}async function R(E,N){const C=l.value[E],O=N.trim();if(!C||!O)return;const H=E,V=C.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[V]:!0};const A={id:o(),sessionId:H,role:"user",content:[{type:"text",text:O}],createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};m(V,A);try{const F=e.sessions.find(P=>P.id===H),j=(F?.model&&F.model.length>0?F.model:e.defaultModel)??void 0,q=await At().submitPrompt(H,{content:[{type:"text",text:O}],agentId:V,model:j,thinking:await i(H,j)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[H]??!1,dynamicWorkflowMode:e.dynamicWorkflowModeBySession[H]??!1});x(V,q.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[H]:[...e.sideChatUserMessageIdsBySession[H]??[],q.userMessageId]}}catch(F){n("sendSideChatPrompt",F,{sessionId:H}),k(V),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[V]:!1}}}function z(){const E=e.activeSessionId;if(!E)return;const{[E]:N,...C}=l.value;l.value=C}async function $(E){const N=a.value;N&&await R(N.parentId,E)}function T(E){if(!l.value[E])return;const{[E]:N,...C}=l.value;l.value=C}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:p,appendSideChatAssistantText:w,finishSideChatAgent:v,openSideChat:b,openSideChatOn:M,closeSideChat:z,sendSideChatPrompt:$,clearSideChatForSession:T}}const BC=20;class Wbe{constructor(t,n,o,s,r){this.sessionId=t,this.agentId=n,this.fetchPage=o,this.onChange=s,this.onGap=r,this.transcript=new X4e(n)}transcript;refreshPromise=null;buffered=[];agentsValue=[];seqValue;loadingOlderValue=!1;loadOlderErrorValue=!1;refreshErrorValue=!1;get snapshot(){return this.transcript.snapshot()}get agents(){return this.agentsValue}get seq(){return this.seqValue}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlderValue}get loadOlderError(){return this.loadOlderErrorValue}get refreshError(){return this.refreshErrorValue}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshErrorValue=!1;const t=this.fetchPage({pageSize:BC}).then(n=>this.applyPage(n,!0)).catch(n=>{throw this.refreshErrorValue=!0,n}).finally(()=>{this.refreshPromise=null,this.flushBuffered(),this.onChange()});return this.refreshPromise=t,this.onChange(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seqValue=n),this.refreshErrorValue=!1,this.onChange()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlderValue)return this.buffered.push({ops:t,seq:n}),!1;if(n!==void 0&&this.seqValue!==void 0){if(n<=this.seqValue)return!0;if(n!==this.seqValue+1)return this.onGap(),!1}const o=this.transcript.apply(t);return n!==void 0&&(this.seqValue=n),o.gap!==void 0&&this.onGap(),o.accepted.length>0&&this.onChange(),o.gap===void 0}async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlderValue)return;const t=this.snapshot.items.find(n=>n.kind==="turn");if(t?.kind==="turn"){this.loadingOlderValue=!0,this.loadOlderErrorValue=!1,this.onChange();try{const n=await this.fetchPage({beforeTurn:t.turnId,pageSize:BC});this.applyPage(n,!1)}catch(n){throw this.loadOlderErrorValue=!0,n}finally{this.loadingOlderValue=!1,this.flushBuffered(),this.onChange()}}}applyPage(t,n){this.agentsValue=t.agents;const o=this.snapshot,s=n?t.snapshot:{...t.snapshot,items:qbe(t.snapshot.items,o.items),hasMoreOlder:t.snapshot.hasMoreOlder};this.receiveReset(s,n?t.seq:void 0)}flushBuffered(){const t=this.buffered;this.buffered=[];for(const n of t)this.applyOps(n.ops,n.seq)}}function qbe(e,t){const n=new Set,o=[];for(const s of[...e,...t]){const r=M4e(s);n.has(r)||(n.add(r),o.push(s))}return o}function RC(e,t){return`${e}\0${t}`}function Ube(e){const t=new Map,n=new Map,o=new Map;function s(u){u.version.value+=1}function r(u,d,f){const p=e.getEventConnection();p!==null&&(p.subscribeTranscript(u,d,f),o.set(u,d))}function i(u,d){const f=RC(u,d),p=t.get(f);if(p!==void 0)return p;let h;return h={channel:new Wbe(u,d,k=>e.api.getSessionTranscript(u,{...k,agentId:d}),()=>s(h),()=>void l(h)),version:jo(0)},t.set(f,h),h}async function l(u){try{await u.channel.refresh(),n.get(u.channel.sessionId)===u.channel.agentId&&r(u.channel.sessionId,u.channel.agentId,u.channel.seq)}catch{n.get(u.channel.sessionId)===u.channel.agentId&&r(u.channel.sessionId,u.channel.agentId)}}function a(u,d){e.connectEventsIfNeeded(),n.set(u,d);const f=i(u,d);return f.channel.snapshot.items.length>0||f.channel.seq!==void 0?r(u,d,f.channel.seq):l(f),f}function c(u,d){if(n.get(u)!==d)return;n.delete(u);const f=o.get(u);f!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(u,[f]),o.delete(u))}return{getEntry(u,d){return t.get(RC(u,d))},activate:a,deactivate:c,receiveReset(u,d,f,p){if(n.get(u)!==d)return;i(u,d).channel.receiveReset(f,p)},applyOps(u,d,f,p){return n.get(u)!==d?!0:i(u,d).channel.applyOps(f,p)},forgetSession(u){const d=n.get(u);d!==void 0&&c(u,d);for(const f of t.keys())f.startsWith(`${u}\0`)&&t.delete(f)}}}const Zbe="pythinkerWeb.optimisticUserMessage",FC="Sub Agent";function Kbe(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function Gbe(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Ybe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function jm(e){return e.role==="user"&&e.metadata?.[Zbe]===!0}function Xbe(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function Jbe(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function Qbe(e,t){if(e.role!=="assistant"||t.role!=="assistant"||e.promptId===void 0||e.promptId!==t.promptId)return!1;const n=o=>JSON.stringify(o.content.map(s=>s.type==="thinking"?{type:s.type,thinking:s.thinking}:s.type==="toolUse"?{type:s.type,toolCallId:s.toolCallId,toolName:s.toolName,input:s.input}:s));return n(e)===n(t)}const e_e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function jC(e){let t="",n=0;for(const o of e.content)o.type==="text"?e_e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function t_e(e,t){const n=jC(e),o=jC(t);return n.text===o.text&&n.media===o.media}function n_e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(jm(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(jm(s)&&Jbe(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(jm(s)&&t_e(s,t))return o}return-1}function o_e(e,t,n){let o=!1;const s=e.map(r=>{let i=!1;const l=r.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(i=!0,{...a,outputLines:[...a.outputLines??[],n]}));return i?(o=!0,{...r,content:l}):r});return o?s:e}function q3(e,t,n=e.length){for(let o=0;o{typeof l=="number"||typeof l=="boolean"?n.push({label:i,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:i,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[i,l]of Object.entries(s))i==="statusCode"||i==="requestId"||o(i,l);const r=(e.code!==void 0?s_e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${r}`),message:e.message,details:n.length>0?n:void 0}}function i_e(e,t,n){const o=Gbe(e);switch(Ybe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionArchived":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,r=o.compactionBySession[s],{[s]:i,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:r?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[jN]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":{const s=t.message.sessionId,r=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&r>a.updatedAt?{...a,updatedAt:r}:a);const i=o.messagesBySession[s]??[];if(!i.some(a=>a.id===t.message.id||Qbe(a,t.message))){if(t.message.role==="user"&&!Xbe(t.message)){const a=n_e(i,t.message);if(a!==-1){const c=[...i],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...i,t.message]}break}case"messageUpdated":{const s=t.sessionId,r=o.messagesBySession[s]??[];o.messagesBySession[s]=r.map(i=>{if(i.id!==t.messageId)return i;const l=t.content.map((c,u)=>{const d=i.content[u];return c.type==="thinking"&&d?.type==="thinking"?{...c,startedAt:d.startedAt,durationMs:d.durationMs}:c}),a=Date.now();return q3(l,a,l.length-1),(t.status!=="pending"||t.durationMs!==void 0)&&q3(l,a),{...i,content:l,durationMs:t.durationMs??i.durationMs}});break}case"assistantDelta":{const s=t.sessionId,r=o.messagesBySession[s]??[];o.messagesBySession[s]=r.map(i=>{if(i.id!==t.messageId)return i;const l=[...i.content],a=t.contentIndex,c=l.length<=a;for(;l.length<=a;)l.push({type:"text",text:""});const u=l[a];let d;return t.delta.text!==void 0?u.type==="text"&&!c?d={type:"text",text:u.text+t.delta.text}:(q3(l,Date.now(),a),d={type:"text",text:t.delta.text}):t.delta.thinking!==void 0?u.type==="thinking"?d={type:"thinking",thinking:u.thinking+t.delta.thinking,signature:u.signature,startedAt:u.startedAt,durationMs:u.durationMs}:(q3(l,Date.now(),a),d={type:"thinking",thinking:t.delta.thinking,startedAt:new Date().toISOString()}):d=u,l[a]=d,{...i,content:l}});break}case"toolOutput":{const s=t.sessionId,r=o.messagesBySession[s]??[];o.messagesBySession[s]=o_e(r,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,i=o.approvalsBySession[s]??[];o.approvalsBySession[s]=i.filter(l=>l.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,i=o.questionsBySession[s]??[];o.questionsBySession[s]=i.filter(l=>l.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],i=r.findIndex(l=>l.id===t.task.id);if(i===-1)o.tasksBySession[s]=[...r,t.task];else{const l=[...r],a=r[i],c=a.kind==="subagent"&&(a.status==="completed"||a.status==="failed"||a.status==="cancelled")&&t.task.kind==="subagent"&&t.task.status==="running"&&t.task.subagentPhase==="queued",u=!c&&a.completedAt!==void 0&&a.completedAtEstimated!==!0&&t.task.completedAtEstimated===!0;l[i]={...t.task,outputLines:c?t.task.outputLines:a.outputLines,text:c?t.task.text:a.text,completedAt:u?a.completedAt:t.task.completedAt,completedAtEstimated:u?a.completedAtEstimated:t.task.completedAtEstimated,description:t.task.description===FC&&a.description!==FC?a.description:t.task.description,dynamicWorkflowIndex:t.task.dynamicWorkflowIndex??a.dynamicWorkflowIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(i=>{if(i.id!==t.taskId)return i;if(i.kind==="subagent"&&t.kind==="text")return{...i,text:(i.text??"")+t.outputChunk};const l=i.outputLines??[];if(l.at(-1)===t.outputChunk)return i;const a=[...l,t.outputChunk];return{...i,outputLines:i.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(i=>{if(i.id!==t.taskId&&i.backgroundTaskId!==t.taskId)return i;const l=i.status==="completed"||i.status==="failed"||i.status==="cancelled";return{...i,status:l?i.status:t.status,completedAt:i.completedAt??new Date().toISOString(),completedAtEstimated:i.completedAt===void 0?!0:i.completedAtEstimated,outputPreview:t.outputPreview??i.outputPreview,outputBytes:t.outputBytes??i.outputBytes}});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,r_e(s)];else if(s&&s._agentWarning){const r=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${yo.global.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${r}`]}break}}return o}function l_e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function a_e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||sr(s.toolName)!=="todo")continue;let r=s.input;if(typeof r=="string")try{r=JSON.parse(r)}catch{continue}const i=r?.todos;if(Array.isArray(i))return i.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:l_e(a.status)}]:[]})}}return[]}const c_e=["queued","working","suspended","completed","failed","cancelled"];function PN(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function u_e(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function d_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.dynamicWorkflowIndex===void 0)continue;const o=n.parentToolCallId??"dynamic-workflow",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:PN(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,dynamicWorkflowIndex:n.dynamicWorkflowIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((i,l)=>i.dynamicWorkflowIndex-l.dynamicWorkflowIndex||i.id.localeCompare(l.id)),r=u_e();for(const i of s)r[i.phase]++;return{id:n,members:s,counts:r}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.dynamicWorkflowIndex??0,r=o.members.at(0)?.dynamicWorkflowIndex??0;return s!==r?s-r:n.id.localeCompare(o.id)})}function f_e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of c_e)(s==="completed"||s==="failed"||s==="cancelled")&&(t+=o.counts[s])}return{done:t,total:n}}function p_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:PN(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,dynamicWorkflowIndex:n.dynamicWorkflowIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,r)=>s.dynamicWorkflowIndex-r.dynamicWorkflowIndex||s.id.localeCompare(r.id)));return t}const Rl=d9(),ul=Tke(),Pd=Rke(),HN=ln.permission,DN=ln.activeWorkspace,VN=ln.planMode,WN=ln.planArmed,qN=ln.dynamicWorkflowMode,UN=ln.goalMode,OC=40401,ZN=ln.onboarded;w0(ln.codeFont);w0(ln.theme);w0(ln.thinking);function KN(){try{const e=Yo(HN);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return null}function h_e(e){try{vs(HN,e)}catch{}}function U3(e){const t=Yo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,r]of Object.entries(n))r===!0&&(o[s]=!0);return o}catch{return{}}}function Xp(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);vs(e,JSON.stringify(n))}catch{}}function GN(){Xp(VN,Te.planModeBySession)}function m_e(){Xp(WN,Te.planArmedBySession)}function YN(){Xp(qN,Te.dynamicWorkflowModeBySession)}function XN(){Xp(UN,Te.goalModeBySession)}function g_e(){try{return Yo(DN)}catch{return null}}const JN=ln.hiddenWorkspaces;function v_e(){try{const e=Yo(JN);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function w_e(e){try{vs(JN,JSON.stringify(e))}catch{}}function y_e(e){try{vs(DN,e)}catch{}}function k_e(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Te=Rs({...Kbe(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlagStates:[],workspaceName:"pythinker-web",connection:"disconnected",permission:KN()??"manual",thinking:void 0,thinkingBySession:{},planModeBySession:U3(VN),planArmedBySession:U3(WN),dynamicWorkflowModeBySession:U3(qN),goalModeBySession:U3(UN),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:bg(),authReady:!1,defaultModel:null,workspaces:[],activeWorkspaceId:g_e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:v_e(),availableOpenInApps:[],serverCapabilities:{},config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),cf=Rs({planMode:!1,dynamicWorkflowMode:!1,goalMode:!1}),b_e=KN()!==null;function __e(){if(b_e)return;const e=Te.config?.defaultPermissionMode;(e==="auto"||e==="yolo"||e==="manual")&&(Te.permission=e)}function QN(e){Te.sessions=e}function Jp(e,t){Te.sessions=Te.sessions.map(n=>n.id===e?t(n):n)}function x_e(e){Te.sessions=[e,...Te.sessions.filter(t=>t.id!==e.id)]}function S_e(e){Te.sessions=[...Te.sessions,e]}function C_e(e){Te.sessions=Te.sessions.filter(t=>t.id!==e)}function ez(){const e=Te.activeSessionId;e&&Te.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!1},_g({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===ln.unread&&(Te.unreadBySession=bg(),ez())});function $7(){if(Jr===null||!Jr.health().stale)return;us("ws:stale-reconnect",{sessionId:Te.activeSessionId,status:"stale"}),Ol("ws: stale socket on focus, reconnecting",{activeSessionId:Te.activeSessionId}),Jr.reconnect();const e=Te.activeSessionId;e&&q5.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(ez(),$7())});typeof window<"u"&&(window.addEventListener("focus",$7),window.addEventListener("online",$7));function _9(e){Te.activeSessionId=e}function M_e(e){Te.messagesBySession=e}function A_e(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t}}function tz(e,t){Te.messagesBySession={...Te.messagesBySession,[e]:t(Te.messagesBySession[e]??[])}}function T_e(e){const{[e]:t,...n}=Te.messagesBySession;Te.messagesBySession=n}function nz(e){Jr?.unsubscribe(e),J_e(e),V5.discard(({meta:t})=>t.sessionId===e),C_e(e),T_e(e),delete Te.approvalsBySession[e],delete Te.questionsBySession[e],delete Te.tasksBySession[e],delete Te.goalBySession[e],delete Te.gitStatusBySession[e],delete Te.lastSeqBySession[e],delete Te.compactionBySession[e],delete Te.messagesLoadingMoreBySession[e],delete Te.messagesHasMoreBySession[e],delete Te.messagesLoadMoreErrorBySession[e],delete z7[e],W5.delete(e),k4.delete(e),dz.delete(e),ebe(e),delete Te.queuedBySession[e],delete Te.promptIdBySession[e],delete Te.inFlightBySession[e],delete Te.turnActiveBySession[e],delete Te.planModeBySession[e],delete Te.planArmedBySession[e],delete Te.dynamicWorkflowModeBySession[e],delete Te.goalModeBySession[e],delete Te.thinkingBySession[e],GN(),m_e(),YN(),XN()}const oz=U(null),sz=U([]),rz=U(!1),Qp=U(!1),iz=U(null);async function uf(e){let t;try{t=await At().getSessionStatus(e)}catch{return}Jp(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Te.dynamicWorkflowModeBySession={...Te.dynamicWorkflowModeBySession,[e]:t.dynamicWorkflowMode},Te.planModeBySession={...Te.planModeBySession,[e]:t.planMode},(t.permission==="auto"||t.permission==="yolo"||t.permission==="manual")&&(Te.permission=t.permission),t.thinkingEffort.length>0&&(Te.thinkingBySession={...Te.thinkingBySession,[e]:t.thinkingEffort})}async function E_e(e){const t=Te.goalVersionBySession[e]??0;let n;try{n=await At().getSessionGoal(e)}catch{return}if((Te.goalVersionBySession[e]??0)!==t)return;const o={...Te.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,Te.goalBySession=o}function lz(e,t){const n=t??Te.activeSessionId;return n?Promise.resolve(At().updateSession(n,e)).then(()=>uf(n)).then(()=>!0).catch(o=>(L0("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const az=ln.conversationToc;function I_e(){try{const e=Yo(az);return e===null?!0:e==="true"}catch{return!0}}function L_e(e){try{vs(az,e?"true":"false")}catch{}}const cz=U(I_e());function $_e(e){cz.value=e,L_e(e)}function N_e(e){try{return Yo(e)??""}catch{return""}}const x9=U(N_e(ZN)==="1");function z_e(e){x9.value=e;try{vs(ZN,e?"1":"0")}catch{}}let Jr=null;const N7=Ube({api:At(),connectEventsIfNeeded:S9,getEventConnection:()=>Jr});let PC=0;function uz(){return PC+=1,`msg_opt_${Date.now().toString(36)}_${PC}`}function B_e(e,t,n){const o={sessions:Te.sessions,activeSessionId:Te.activeSessionId,messagesBySession:Te.messagesBySession,approvalsBySession:Te.approvalsBySession,planReviewByToolCallId:Te.planReviewByToolCallId,questionsBySession:Te.questionsBySession,tasksBySession:Te.tasksBySession,goalBySession:Te.goalBySession,goalVersionBySession:Te.goalVersionBySession,lastSeqBySession:Te.lastSeqBySession,turnActiveBySession:Te.turnActiveBySession,compactionBySession:Te.compactionBySession,config:Te.config,warnings:Te.warnings},s=i_e(o,e,{sessionId:t,seq:n});QN(s.sessions),_9(s.activeSessionId),M_e(s.messagesBySession),Te.approvalsBySession=s.approvalsBySession,Te.planReviewByToolCallId=s.planReviewByToolCallId,Te.questionsBySession=s.questionsBySession,Te.tasksBySession=s.tasksBySession,Te.goalBySession=s.goalBySession,Te.goalVersionBySession=s.goalVersionBySession,Te.lastSeqBySession=s.lastSeqBySession,Te.turnActiveBySession=s.turnActiveBySession,Te.compactionBySession=s.compactionBySession,Te.config=s.config??null,Te.warnings=s.warnings,e.type==="configChanged"&&(Te.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(xo.loadModels(),xo.loadProviders()),e.type==="sessionUsageUpdated"&&(e.dynamicWorkflowMode!==void 0&&(Te.dynamicWorkflowModeBySession={...Te.dynamicWorkflowModeBySession,[e.sessionId]:e.dynamicWorkflowMode}),e.planMode!==void 0&&(Te.planModeBySession={...Te.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(Te.thinkingBySession={...Te.thinkingBySession,[e.sessionId]:e.thinking}))}function R_e(e,t){const n=Te.lastSeqBySession[t.sessionId]??0,o=Te.turnActiveBySession[t.sessionId]??!1;B_e(e,t.sessionId,t.seq);const s=ur.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:r}=s,i=t.sessionId;e.type==="agentDelta"&&e.agentId===r?e.delta.text&&ur.appendSideChatAssistantText(r,i,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===r?ur.finishSideChatAgent(r,i):e.type==="taskProgress"&&e.taskId===r?ur.appendSideChatAssistantText(r,i,e.outputChunk):e.type==="taskCompleted"&&e.taskId===r&&ur.finishSideChatAgent(r,i,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const r=e.message.sessionId;Te.promptIdBySession[r]!==e.message.promptId&&(Te.promptIdBySession={...Te.promptIdBySession,[r]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===Te.activeSessionId&&Rl.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const r=e.reason;kSe(e.sessionId,r==="cancelled"||r==="failed"||r==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&ySe(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Te.promptIdBySession[e.sessionId]===e.promptId&&zt.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&bSe(e.sessionId,e.question),e.type==="approvalRequested"&&_Se(e.sessionId,e.approval)}const V5=Gye(({appEvent:e,meta:t})=>R_e(e,t),({appEvent:e})=>qye(e),{coalesce:Xye});function S9(){if(Jr!==null||typeof WebSocket>"u")return;us("ws:connection",{status:"connecting"}),Te.connection="connecting",Jr=At().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){zt.applyWorkspaceEvent(t);return}for(const o of Yye({appEvent:t,meta:n}))V5(o)},onResync(t,n,o){us("ws:resync",{sessionId:t,status:"required",seq:n}),V5.flush(),W5.add(t),q5.request(t)},onError(t,n,o){us("ws:error",{status:"failed",errorCode:t,fatal:o}),C9({severity:"error",title:yo.global.t("warnings.wsTitle"),message:n,details:[Fo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){us("ws:connection",{status:t?"connected":"disconnected"}),Te.connected=t,Te.connection=t?"connected":"disconnected",t&&(W_e(),zt.refreshServerMeta())},onTranscriptReset(t,n,o,s){N7.receiveReset(t,n,o,s)},onTranscriptOps(t,n,o,s){return N7.applyOps(t,n,o,s)}})}const z7={},W5=new Set,k4=new Set,dz=new Set;function F_e(e){return Ur(e)&&e.code===OC?!0:typeof e=="object"&&e!==null&&e.code===OC}function Fo(e,t){if(!(t==null||t===""))return{label:yo.global.t(`warnings.details.${e}`),value:fz(t)}}function fz(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function j_e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function O_e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function P_e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function H_e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function HC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function D_e(e,t,n){const o=Uv(t),s=Ur(t),r=o||s?t.timestamp:void 0,i=o||s?t.durationMs:void 0,l=[Fo("operation",e),Fo("sessionId",n??Te.activeSessionId),Fo("connection",Te.connection),Fo("timestamp",H_e(r??Date.now()))];return o?l.push(Fo("duration",HC(i)),Fo("request",`${t.method} ${t.path}`),Fo("endpoint",t.url),Fo("requestId",t.requestId),Fo("phase",t.phase),Fo("timeout",`${t.timeoutMs}ms`),Fo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Fo("contentType",t.contentType),Fo("responsePreview",t.bodyPreview),Fo("cause",t.cause)):s?l.push(Fo("duration",HC(i)),Fo("code",t.code),Fo("requestId",t.requestId),Fo("message",t.message),Fo("details",t.details)):l.push(Fo("errorName",j_e(t)),Fo("message",O_e(t)??fz(t)),Fo("stack",P_e(t))),l.filter(a=>a!==void 0)}function V_e(e,t,n={}){const o=Uv(t),s=Ur(t),r=n.title??(o?yo.global.t("warnings.daemonNetworkTitle"):s?yo.global.t("warnings.daemonApiTitle"):yo.global.t("warnings.operationFailedTitle")),i=n.message??(o?yo.global.t("warnings.daemonNetworkMessage"):s?t.message:yo.global.t("warnings.operationFailedMessage"));return{severity:"error",title:r,message:i,details:D_e(e,t,n.sessionId)}}function C9(e){Te.warnings=[...Te.warnings,e]}function W_e(){const e=yo.global.t("warnings.wsTitle"),t=Te.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Te.warnings.length&&(Te.warnings=t)}function L0(e,t,n){console.error(`[pythinker-web] operation failed: ${e}`,t);const o=Ur(t),s=Uv(t);us("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),C9(V_e(e,t,n))}const q_e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function U_e(e){if(!Ur(e))return;const t=q_e[e.code];return t?yo.global.t(t):void 0}async function Z_e(e){if(nz(e),Te.activeSessionId!==e)return;const t=Te.sessions[0];t?await zt.selectSession(t.id,{urlMode:"replace"}):(_9(void 0),Te.sessionLoading=!1,zt.writeSessionUrl(void 0,"replace"))}const DC=new Set;async function K_e(e){if(!DC.has(e)){DC.add(e);try{const t=await At().getSessionWarnings(e),n=yo.global.t("warnings.noteLabel");for(const o of t)C9(`${n}: ${o.message}`)}catch{}}}async function M9(e){const t=zt.localTurnStartState(e);try{const o=await At().getSessionSnapshot(e);if(!Te.sessions.some(a=>a.id===e))return"ok";V5.flush();const s=Te.lastSeqBySession[e]??0,r=z7[e];if(!(W5.has(e)||U5.has(e))&&r!==void 0&&r===o.epoch&&s>o.asOfSeq)return k4.delete(e)||(k4.add(e),q5.request(e)),"ok";if(!zt.isLocalTurnSnapshotCurrent(e,t))return zt.afterLocalTurnStartsSettle(e,()=>{q5.request(e)}),"ok";const l=g7(o.session.usage);Jp(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),A_e(e,Hye(Te.messagesBySession[e]??[],o.messages)),Te.tasksBySession={...Te.tasksBySession,[e]:Dye(o.subagents,Te.tasksBySession[e]??[])},Te.messagesHasMoreBySession={...Te.messagesHasMoreBySession,[e]:o.hasMoreMessages},Te.approvalsBySession={...Te.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Te.planReviewByToolCallId={...Te.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}Te.questionsBySession={...Te.questionsBySession,[e]:o.pendingQuestions},Te.lastSeqBySession={...Te.lastSeqBySession,[e]:o.asOfSeq},z7[e]=o.epoch,W5.delete(e),k4.delete(e),zt.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...Te.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],Te.turnActiveBySession=a}return S9(),Jr&&(Jr.seedSnapshot(e,o),Jr.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),X_e(e)),U5.delete(e),l&&uf(e),K_e(e),"ok"}catch(n){return F_e(n)?(await Z_e(e),"not-found"):(L0("getSessionSnapshot",n,{title:yo.global.t("warnings.sessionSnapshotTitle"),message:yo.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const q5=Vye(M9);function G_e(e){return Object.prototype.hasOwnProperty.call(Te.messagesBySession,e)}const Y_e=4,Fl=[],U5=new Set;function X_e(e){const t=Fl.indexOf(e);for(t!==-1&&Fl.splice(t,1),Fl.unshift(e);Fl.length>Y_e;){let n=-1;for(let s=Fl.length-1;s>=0;s--)if(Fl[s]!==Te.activeSessionId){n=s;break}if(n===-1)break;const[o]=Fl.splice(n,1);if(o===void 0)break;Jr?.unsubscribe(o),U5.add(o)}}function J_e(e){const t=Fl.indexOf(e);t!==-1&&Fl.splice(t,1),U5.delete(e)}async function Q_e(e){return M9(e)}function A9(e,t){return(Te.inFlightBySession[e]??!1)||(Te.turnActiveBySession[e]??!1)||(t??Te.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function T9(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return yo.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const r=o/864e5;return r<7?`${Math.round(r)}d`:r<30?`${Math.round(r/7)}w`:r<365?`${Math.round(r/30)}mo`:`${Math.round(r/365)}y`}catch{return e}}const exe=3e4,Hd=U(0);let Om=null;function txe(){Om===null&&(Om=setInterval(()=>{Hd.value=(Hd.value+1)%Number.MAX_SAFE_INTEGER},exe),Om.unref?.())}function nxe(e,t){const n=e.split(` +`+m.thinking,k.durationMs=m.durationMs):p.blocks.push({kind:"thinking",thinking:m.thinking,startedAt:m.startedAt,durationMs:m.durationMs})}}else if(m.type==="toolUse"){const k=l.get(m.toolCallId),x={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?s[m.toolCallId]?.path:void 0};p.tools.push(x),p.blocks.push({kind:"tool",tool:x}),k&&(p.approval=Wbe(k),p.approvalId=k.approvalId)}else if(m.type==="toolResult"){const k=p.tools.findIndex(x=>x.id===m.toolCallId);if(k!==-1){const x=p.tools[k],v={...x,status:m.isError?"error":"ok",output:Hbe(m.output),media:m.isError?void 0:Pbe(x.name,m.output)};v.name==="ExitPlanMode"&&!v.planPath&&(v.planPath=e_e(v.output)),p.tools[k]=v;const w=p.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);w&&w.kind==="tool"&&(w.tool=v)}}}function d(p,h){for(const m of h){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const k=p.tools.findIndex(b=>b.id===m.toolCallId);if(k===-1)continue;const x=p.tools[k];if(x.output!==void 0)continue;const v={...x,output:m.outputLines};p.tools[k]=v;const w=p.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);w&&w.kind==="tool"&&(w.tool=v)}}function f(p){if(p.type==="image"||p.type==="video"){const h=p.type,m=p.source;if(m.kind==="url")return{url:m.url,kind:h};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:h};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:h,fileId:m.fileId}}if(p.type==="file"&&n){if(p.mediaType.startsWith("image/"))return{url:n(p.fileId),kind:"image",fileId:p.fileId};if(p.mediaType.startsWith("video/"))return{url:n(p.fileId),kind:"video",fileId:p.fileId}}}for(const p of e){if(p.role==="system")continue;if(Jbe(p)){c();const v=p.metadata?.[DN];i.push({id:p.id,role:"compaction",no:r,text:p.content.filter(w=>w.type==="text").map(w=>w.text).join(` +`),compaction:{trigger:v?.trigger,tokensBefore:v?.tokensBefore,tokensAfter:v?.tokensAfter}});continue}if(p.role==="user"){const v=Zbe(p);if(v!==void 0){c(),i.push(Ybe(p,r++,v));continue}const w=p.metadata?.origin?.kind;if(w==="task"||w==="background_task"||w==="task_notification"){const E=p.content.filter(C=>C.type==="text").map(C=>C.text).join(` +`),T=X3e(p.metadata),N=T?[T]:h$(E);if(N.length>0){a??={id:p.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[]};for(const C of N)a.blocks.push({kind:"notification",notification:{...C,createdAt:p.createdAt}})}continue}if(c(),!Xbe(p))continue;const b=p.metadata?.origin,M=b?.kind==="skill_activation"&&b?.trigger==="user-slash",R=b?.kind==="plugin_command"&&b?.trigger==="user-slash",z=[],$=[];for(const E of p.content){if(E.type==="text")if(M)z.push(b.skillArgs??"");else if(R)z.push(b.commandArgs??"");else{const N=$be(E.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const H=zbe(N.path);if(H){$.push({url:n(H),kind:N.kind,fileId:H});continue}}const C=Rbe(E.text);if(C){$.push({kind:"file",url:C.fileId&&n?n(C.fileId):"",fileId:C.fileId,name:C.name,mediaType:C.mediaType,size:C.size});continue}const O=Ibe(E.text);if(O!==E.text&&O.trim().length===0)continue;z.push(O)}const T=f(E);if(T){$.push({url:T.url,kind:T.kind,name:E.type==="file"?E.name:void 0,fileId:T.fileId});continue}E.type==="file"&&n&&$.push({kind:"file",url:n(E.fileId),fileId:E.fileId,name:E.name,mediaType:E.mediaType||void 0,size:E.size})}i.push({id:p.id,role:"user",no:r++,text:z.join(` +`),attachments:$.length>0?$:void 0,skillActivation:M?{name:b.skillName,args:b.skillArgs}:void 0,pluginCommand:R?{pluginId:b.pluginId,commandName:b.commandName,args:b.commandArgs}:void 0,createdAt:p.createdAt});continue}if(p.role==="tool"){a&&u(a,p.content);continue}const h=p.promptId;Qbe(a,h)?a!==null&&a.promptId===void 0&&h!==void 0&&(a.promptId=h):(c(),a={id:p.id,promptId:h,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:p.durationMs});const k=a;if(k===null)continue;const x=t_e(p.content);if(k.promptId!==void 0&&k.foldedSigs.some(v=>n_e(v,x))){d(k,p.content);continue}k.foldedSigs.push(x),u(k,p.content)}return c(!0),i}function o_e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=U({}),a=B(()=>{const T=e.activeSessionId;if(!T)return null;const N=l.value[T];return N?{parentId:T,agentId:N.agentId}:null}),c=B(()=>a.value?.parentId??null),u=B(()=>a.value!==null),d=B(()=>{const T=a.value;return T?!!e.sideChatSendingByAgent[T.agentId]:!1}),f=B(()=>{const T=a.value;return T?e.sideChatSendingByAgent[T.agentId]?!0:(e.tasksBySession[T.parentId]??[]).some(N=>N.id===T.agentId&&N.status==="running"):!1}),p=B(()=>{const T=a.value;if(!T)return[];const N=e.sideChatMessagesByAgent[T.agentId]??[];return _9(N,[],C=>At().getFileUrl(C),f.value)});function h(T,N){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[T]:N(e.sideChatMessagesByAgent[T]??[])}}function m(T,N){h(T,C=>[...C,N])}function k(T){h(T,N=>{const C=[...N].reverse().findIndex(H=>H.role==="user");if(C===-1)return N;const O=N.length-1-C;return N.filter((H,V)=>V!==O)})}function x(T,N){h(T,C=>{const O=[...C];for(let H=O.length-1;H>=0;H-=1){const V=O[H];if(V.role==="user")return O[H]={...V,promptId:V.promptId??N},O}return C})}function v(T,N,C){C&&h(T,O=>{const H=O.at(-1);if(H?.role==="assistant"){const V=H.content[0],A=V?.type==="text"?V.text:"";return[...O.slice(0,-1),{...H,content:[{type:"text",text:`${A}${C}`}]}]}return[...O,{id:o(),sessionId:N,role:"assistant",content:[{type:"text",text:C}],createdAt:new Date().toISOString()}]})}function w(T,N,C){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[T]:!1},!C)return;const H=(e.sideChatMessagesByAgent[T]??[]).at(-1);(H?.role==="assistant"&&H.content[0]?.type==="text"?H.content[0].text:"").trim().length>0||v(T,N,C)}async function b(T){const N=e.activeSessionId;N&&await M(N,T)}async function M(T,N){if(!l.value[T]){let C;try{({agentId:C}=await At().startBtw(T))}catch(O){n("openSideChat",O,{sessionId:T});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[C]:e.sideChatMessagesByAgent[C]??[]},l.value={...l.value,[T]:{agentId:C}},s(),i()?.markSideChannelAgent(C)}N&&N.trim()&&await R(T,N.trim())}async function R(T,N){const C=l.value[T],O=N.trim();if(!C||!O)return;const H=T,V=C.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[V]:!0};const A={id:o(),sessionId:H,role:"user",content:[{type:"text",text:O}],createdAt:new Date().toISOString(),metadata:{"pythinkerWeb.optimisticUserMessage":!0}};m(V,A);try{const F=e.sessions.find(P=>P.id===H),j=(F?.model&&F.model.length>0?F.model:e.defaultModel)??void 0,q=await At().submitPrompt(H,{content:[{type:"text",text:O}],agentId:V,model:j,thinking:await r(H,j)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[H]??!1,dynamicWorkflowMode:e.dynamicWorkflowModeBySession[H]??!1});x(V,q.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[H]:[...e.sideChatUserMessageIdsBySession[H]??[],q.userMessageId]}}catch(F){n("sendSideChatPrompt",F,{sessionId:H}),k(V),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[V]:!1}}}function z(){const T=e.activeSessionId;if(!T)return;const{[T]:N,...C}=l.value;l.value=C}async function $(T){const N=a.value;N&&await R(N.parentId,T)}function E(T){if(!l.value[T])return;const{[T]:N,...C}=l.value;l.value=C}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:p,appendSideChatAssistantText:v,finishSideChatAgent:w,openSideChat:b,openSideChatOn:M,closeSideChat:z,sendSideChatPrompt:$,clearSideChatForSession:E}}const jC=20;class s_e{constructor(t,n,o,s,i){this.sessionId=t,this.agentId=n,this.fetchPage=o,this.onChange=s,this.onGap=i,this.transcript=new n5e(n)}transcript;refreshPromise=null;buffered=[];agentsValue=[];seqValue;loadingOlderValue=!1;loadOlderErrorValue=!1;refreshErrorValue=!1;get snapshot(){return this.transcript.snapshot()}get agents(){return this.agentsValue}get seq(){return this.seqValue}get loading(){return this.refreshPromise!==null}get loadingOlder(){return this.loadingOlderValue}get loadOlderError(){return this.loadOlderErrorValue}get refreshError(){return this.refreshErrorValue}refresh(){if(this.refreshPromise!==null)return this.refreshPromise;this.refreshErrorValue=!1;const t=this.fetchPage({pageSize:jC}).then(n=>this.applyPage(n,!0)).catch(n=>{throw this.refreshErrorValue=!0,n}).finally(()=>{this.refreshPromise=null,this.flushBuffered(),this.onChange()});return this.refreshPromise=t,this.onChange(),t}receiveReset(t,n){this.transcript.receive([{op:"reset",agentId:this.agentId,snapshot:t}]),n!==void 0&&(this.seqValue=n),this.refreshErrorValue=!1,this.onChange()}applyOps(t,n){if(this.refreshPromise!==null||this.loadingOlderValue)return this.buffered.push({ops:t,seq:n}),!1;if(n!==void 0&&this.seqValue!==void 0){if(n<=this.seqValue)return!0;if(n!==this.seqValue+1)return this.onGap(),!1}const o=this.transcript.apply(t);return n!==void 0&&(this.seqValue=n),o.gap!==void 0&&this.onGap(),o.accepted.length>0&&this.onChange(),o.gap===void 0}async loadOlder(){if(!this.snapshot.hasMoreOlder||this.loadingOlderValue)return;const t=this.snapshot.items.find(n=>n.kind==="turn");if(t?.kind==="turn"){this.loadingOlderValue=!0,this.loadOlderErrorValue=!1,this.onChange();try{const n=await this.fetchPage({beforeTurn:t.turnId,pageSize:jC});this.applyPage(n,!1)}catch(n){throw this.loadOlderErrorValue=!0,n}finally{this.loadingOlderValue=!1,this.flushBuffered(),this.onChange()}}}applyPage(t,n){this.agentsValue=t.agents;const o=this.snapshot,s=n?t.snapshot:{...t.snapshot,items:i_e(t.snapshot.items,o.items),hasMoreOlder:t.snapshot.hasMoreOlder};this.receiveReset(s,n?t.seq:void 0)}flushBuffered(){const t=this.buffered;this.buffered=[];for(const n of t)this.applyOps(n.ops,n.seq)}}function i_e(e,t){const n=new Set,o=[];for(const s of[...e,...t]){const i=L4e(s);n.has(i)||(n.add(i),o.push(s))}return o}function OC(e,t){return`${e}\0${t}`}function r_e(e){const t=new Map,n=new Map,o=new Map;function s(u){u.version.value+=1}function i(u,d,f){const p=e.getEventConnection();p!==null&&(p.subscribeTranscript(u,d,f),o.set(u,d))}function r(u,d){const f=OC(u,d),p=t.get(f);if(p!==void 0)return p;let h;return h={channel:new s_e(u,d,k=>e.api.getSessionTranscript(u,{...k,agentId:d}),()=>s(h),()=>void l(h)),version:jo(0)},t.set(f,h),h}async function l(u){try{await u.channel.refresh(),n.get(u.channel.sessionId)===u.channel.agentId&&i(u.channel.sessionId,u.channel.agentId,u.channel.seq)}catch{n.get(u.channel.sessionId)===u.channel.agentId&&i(u.channel.sessionId,u.channel.agentId)}}function a(u,d){e.connectEventsIfNeeded(),n.set(u,d);const f=r(u,d);return f.channel.snapshot.items.length>0||f.channel.seq!==void 0?i(u,d,f.channel.seq):l(f),f}function c(u,d){if(n.get(u)!==d)return;n.delete(u);const f=o.get(u);f!==void 0&&(e.getEventConnection()?.unsubscribeTranscript(u,[f]),o.delete(u))}return{getEntry(u,d){return t.get(OC(u,d))},activate:a,deactivate:c,receiveReset(u,d,f,p){if(n.get(u)!==d)return;r(u,d).channel.receiveReset(f,p)},applyOps(u,d,f,p){return n.get(u)!==d?!0:r(u,d).channel.applyOps(f,p)},forgetSession(u){const d=n.get(u);d!==void 0&&c(u,d);for(const f of t.keys())f.startsWith(`${u}\0`)&&t.delete(f)}}}const l_e="pythinkerWeb.optimisticUserMessage",PC="Sub Agent";function a_e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function c_e(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function u_e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Om(e){return e.role==="user"&&e.metadata?.[l_e]===!0}function d_e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function f_e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function p_e(e,t){if(e.role!=="assistant"||t.role!=="assistant"||e.promptId===void 0||e.promptId!==t.promptId)return!1;const n=o=>JSON.stringify(o.content.map(s=>s.type==="thinking"?{type:s.type,thinking:s.thinking}:s.type==="toolUse"?{type:s.type,toolCallId:s.toolCallId,toolName:s.toolName,input:s.input}:s));return n(e)===n(t)}const h_e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function HC(e){let t="",n=0;for(const o of e.content)o.type==="text"?h_e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function m_e(e,t){const n=HC(e),o=HC(t);return n.text===o.text&&n.media===o.media}function g_e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Om(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Om(s)&&f_e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Om(s)&&m_e(s,t))return o}return-1}function v_e(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}function U3(e,t,n=e.length){for(let o=0;o{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?w_e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function k_e(e,t,n){const o=c_e(e);switch(u_e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionArchived":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[DN]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id||p_e(a,t.message))){if(t.message.role==="user"&&!d_e(t.message)){const a=g_e(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=t.content.map((c,u)=>{const d=r.content[u];return c.type==="thinking"&&d?.type==="thinking"?{...c,startedAt:d.startedAt,durationMs:d.durationMs}:c}),a=Date.now();return U3(l,a,l.length-1),(t.status!=="pending"||t.durationMs!==void 0)&&U3(l,a),{...r,content:l,durationMs:t.durationMs??r.durationMs}});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex,c=l.length<=a;for(;l.length<=a;)l.push({type:"text",text:""});const u=l[a];let d;return t.delta.text!==void 0?u.type==="text"&&!c?d={type:"text",text:u.text+t.delta.text}:(U3(l,Date.now(),a),d={type:"text",text:t.delta.text}):t.delta.thinking!==void 0?u.type==="thinking"?d={type:"thinking",thinking:u.thinking+t.delta.thinking,signature:u.signature,startedAt:u.startedAt,durationMs:u.durationMs}:(U3(l,Date.now(),a),d={type:"thinking",thinking:t.delta.thinking,startedAt:new Date().toISOString()}):d=u,l[a]=d,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=v_e(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r],c=a.kind==="subagent"&&(a.status==="completed"||a.status==="failed"||a.status==="cancelled")&&t.task.kind==="subagent"&&t.task.status==="running"&&t.task.subagentPhase==="queued",u=!c&&a.completedAt!==void 0&&a.completedAtEstimated!==!0&&t.task.completedAtEstimated===!0;l[r]={...t.task,outputLines:c?t.task.outputLines:a.outputLines,text:c?t.task.text:a.text,completedAt:u?a.completedAt:t.task.completedAt,completedAtEstimated:u?a.completedAtEstimated:t.task.completedAtEstimated,description:t.task.description===PC&&a.description!==PC?a.description:t.task.description,dynamicWorkflowIndex:t.task.dynamicWorkflowIndex??a.dynamicWorkflowIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId&&r.backgroundTaskId!==t.taskId)return r;const l=r.status==="completed"||r.status==="failed"||r.status==="cancelled";return{...r,status:l?r.status:t.status,completedAt:r.completedAt??new Date().toISOString(),completedAtEstimated:r.completedAt===void 0?!0:r.completedAtEstimated,outputPreview:t.outputPreview??r.outputPreview,outputBytes:t.outputBytes??r.outputBytes}});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,y_e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${yo.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function b_e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function __e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||si(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:b_e(a.status)}]:[]})}}return[]}const x_e=["queued","working","suspended","completed","failed","cancelled"];function WN(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function S_e(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function C_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.dynamicWorkflowIndex===void 0)continue;const o=n.parentToolCallId??"dynamic-workflow",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,routing:n.routing,currentRoutingEnvRevision:n.currentRoutingEnvRevision,startedAt:n.startedAt,completedAt:n.completedAt,phase:WN(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,dynamicWorkflowIndex:n.dynamicWorkflowIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.dynamicWorkflowIndex-l.dynamicWorkflowIndex||r.id.localeCompare(l.id)),i=S_e();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.dynamicWorkflowIndex??0,i=o.members.at(0)?.dynamicWorkflowIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function M_e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of x_e)(s==="completed"||s==="failed"||s==="cancelled")&&(t+=o.counts[s])}return{done:t,total:n}}function A_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,routing:n.routing,currentRoutingEnvRevision:n.currentRoutingEnvRevision,startedAt:n.startedAt,completedAt:n.completedAt,phase:WN(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,dynamicWorkflowIndex:n.dynamicWorkflowIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.dynamicWorkflowIndex-i.dynamicWorkflowIndex||s.id.localeCompare(i.id)));return t}const Rl=f9(),ul=Dke(),Hd=Yke(),qN=ln.permission,UN=ln.activeWorkspace,ZN=ln.planMode,KN=ln.planArmed,GN=ln.dynamicWorkflowMode,YN=ln.goalMode,DC=40401,XN=ln.onboarded;w0(ln.codeFont);w0(ln.theme);w0(ln.thinking);function JN(){try{const e=Yo(qN);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return null}function E_e(e){try{vs(qN,e)}catch{}}function Z3(e){const t=Yo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function Jp(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);vs(e,JSON.stringify(n))}catch{}}function QN(){Jp(ZN,Ee.planModeBySession)}function T_e(){Jp(KN,Ee.planArmedBySession)}function ez(){Jp(GN,Ee.dynamicWorkflowModeBySession)}function tz(){Jp(YN,Ee.goalModeBySession)}function I_e(){try{return Yo(UN)}catch{return null}}const nz=ln.hiddenWorkspaces;function L_e(){try{const e=Yo(nz);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function $_e(e){try{vs(nz,JSON.stringify(e))}catch{}}function N_e(e){try{vs(UN,e)}catch{}}function z_e(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const Ee=Rs({...a_e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",experimentalFlagStates:[],workspaceName:"pythinker-web",connection:"disconnected",permission:JN()??"manual",thinking:void 0,thinkingBySession:{},planModeBySession:Z3(ZN),planArmedBySession:Z3(KN),dynamicWorkflowModeBySession:Z3(GN),goalModeBySession:Z3(YN),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:_g(),authReady:!1,defaultModel:null,workspaces:[],activeWorkspaceId:I_e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:L_e(),availableOpenInApps:[],serverCapabilities:{},config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),uf=Rs({planMode:!1,dynamicWorkflowMode:!1,goalMode:!1}),B_e=JN()!==null;function R_e(){if(B_e)return;const e=Ee.config?.defaultPermissionMode;(e==="auto"||e==="yolo"||e==="manual")&&(Ee.permission=e)}function oz(e){Ee.sessions=e}function Qp(e,t){Ee.sessions=Ee.sessions.map(n=>n.id===e?t(n):n)}function F_e(e){Ee.sessions=[e,...Ee.sessions.filter(t=>t.id!==e.id)]}function j_e(e){Ee.sessions=[...Ee.sessions,e]}function O_e(e){Ee.sessions=Ee.sessions.filter(t=>t.id!==e)}function sz(){const e=Ee.activeSessionId;e&&Ee.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(Ee.unreadBySession={...Ee.unreadBySession,[e]:!1},xg({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===ln.unread&&(Ee.unreadBySession=_g(),sz())});function N7(){if(Ji===null||!Ji.health().stale)return;us("ws:stale-reconnect",{sessionId:Ee.activeSessionId,status:"stale"}),Ol("ws: stale socket on focus, reconnecting",{activeSessionId:Ee.activeSessionId}),Ji.reconnect();const e=Ee.activeSessionId;e&&U5.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(sz(),N7())});typeof window<"u"&&(window.addEventListener("focus",N7),window.addEventListener("online",N7));function x9(e){Ee.activeSessionId=e}function P_e(e){Ee.messagesBySession=e}function H_e(e,t){Ee.messagesBySession={...Ee.messagesBySession,[e]:t}}function iz(e,t){Ee.messagesBySession={...Ee.messagesBySession,[e]:t(Ee.messagesBySession[e]??[])}}function D_e(e){const{[e]:t,...n}=Ee.messagesBySession;Ee.messagesBySession=n}function rz(e){Ji?.unsubscribe(e),fxe(e),W5.discard(({meta:t})=>t.sessionId===e),O_e(e),D_e(e),delete Ee.approvalsBySession[e],delete Ee.questionsBySession[e],delete Ee.tasksBySession[e],delete Ee.goalBySession[e],delete Ee.gitStatusBySession[e],delete Ee.lastSeqBySession[e],delete Ee.compactionBySession[e],delete Ee.messagesLoadingMoreBySession[e],delete Ee.messagesHasMoreBySession[e],delete Ee.messagesLoadMoreErrorBySession[e],delete B7[e],q5.delete(e),b4.delete(e),mz.delete(e),hbe(e),delete Ee.queuedBySession[e],delete Ee.promptIdBySession[e],delete Ee.inFlightBySession[e],delete Ee.turnActiveBySession[e],delete Ee.planModeBySession[e],delete Ee.planArmedBySession[e],delete Ee.dynamicWorkflowModeBySession[e],delete Ee.goalModeBySession[e],delete Ee.thinkingBySession[e],QN(),T_e(),ez(),tz()}const lz=U(null),az=U([]),cz=U(!1),e6=U(!1),uz=U(null);async function df(e){let t;try{t=await At().getSessionStatus(e)}catch{return}Qp(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),Ee.dynamicWorkflowModeBySession={...Ee.dynamicWorkflowModeBySession,[e]:t.dynamicWorkflowMode},Ee.planModeBySession={...Ee.planModeBySession,[e]:t.planMode},(t.permission==="auto"||t.permission==="yolo"||t.permission==="manual")&&(Ee.permission=t.permission),t.thinkingEffort.length>0&&(Ee.thinkingBySession={...Ee.thinkingBySession,[e]:t.thinkingEffort})}async function V_e(e){const t=Ee.goalVersionBySession[e]??0;let n;try{n=await At().getSessionGoal(e)}catch{return}if((Ee.goalVersionBySession[e]??0)!==t)return;const o={...Ee.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,Ee.goalBySession=o}function dz(e,t){const n=t??Ee.activeSessionId;return n?Promise.resolve(At().updateSession(n,e)).then(()=>df(n)).then(()=>!0).catch(o=>(L0("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const fz=ln.conversationToc;function W_e(){try{const e=Yo(fz);return e===null?!0:e==="true"}catch{return!0}}function q_e(e){try{vs(fz,e?"true":"false")}catch{}}const pz=U(W_e());function U_e(e){pz.value=e,q_e(e)}function Z_e(e){try{return Yo(e)??""}catch{return""}}const S9=U(Z_e(XN)==="1");function K_e(e){S9.value=e;try{vs(XN,e?"1":"0")}catch{}}let Ji=null;const z7=r_e({api:At(),connectEventsIfNeeded:C9,getEventConnection:()=>Ji});let VC=0;function hz(){return VC+=1,`msg_opt_${Date.now().toString(36)}_${VC}`}function G_e(e,t,n){const o={sessions:Ee.sessions,activeSessionId:Ee.activeSessionId,messagesBySession:Ee.messagesBySession,approvalsBySession:Ee.approvalsBySession,planReviewByToolCallId:Ee.planReviewByToolCallId,questionsBySession:Ee.questionsBySession,tasksBySession:Ee.tasksBySession,goalBySession:Ee.goalBySession,goalVersionBySession:Ee.goalVersionBySession,lastSeqBySession:Ee.lastSeqBySession,turnActiveBySession:Ee.turnActiveBySession,compactionBySession:Ee.compactionBySession,config:Ee.config,warnings:Ee.warnings},s=k_e(o,e,{sessionId:t,seq:n});oz(s.sessions),x9(s.activeSessionId),P_e(s.messagesBySession),Ee.approvalsBySession=s.approvalsBySession,Ee.planReviewByToolCallId=s.planReviewByToolCallId,Ee.questionsBySession=s.questionsBySession,Ee.tasksBySession=s.tasksBySession,Ee.goalBySession=s.goalBySession,Ee.goalVersionBySession=s.goalVersionBySession,Ee.lastSeqBySession=s.lastSeqBySession,Ee.turnActiveBySession=s.turnActiveBySession,Ee.compactionBySession=s.compactionBySession,Ee.config=s.config??null,Ee.warnings=s.warnings,e.type==="configChanged"&&(Ee.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(xo.loadModels(),xo.loadProviders()),e.type==="sessionUsageUpdated"&&(e.dynamicWorkflowMode!==void 0&&(Ee.dynamicWorkflowModeBySession={...Ee.dynamicWorkflowModeBySession,[e.sessionId]:e.dynamicWorkflowMode}),e.planMode!==void 0&&(Ee.planModeBySession={...Ee.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(Ee.thinkingBySession={...Ee.thinkingBySession,[e.sessionId]:e.thinking}))}function Y_e(e,t){const n=Ee.lastSeqBySession[t.sessionId]??0,o=Ee.turnActiveBySession[t.sessionId]??!1;G_e(e,t.sessionId,t.seq);const s=ui.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&ui.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?ui.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?ui.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&ui.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;Ee.promptIdBySession[i]!==e.message.promptId&&(Ee.promptIdBySession={...Ee.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===Ee.activeSessionId&&Rl.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;zSe(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&NSe(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&Ee.promptIdBySession[e.sessionId]===e.promptId&&zt.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&BSe(e.sessionId,e.question),e.type==="approvalRequested"&&RSe(e.sessionId,e.approval)}const W5=cke(({appEvent:e,meta:t})=>Y_e(e,t),({appEvent:e})=>ike(e),{coalesce:dke});function C9(){if(Ji!==null||typeof WebSocket>"u")return;us("ws:connection",{status:"connecting"}),Ee.connection="connecting",Ji=At().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){zt.applyWorkspaceEvent(t);return}for(const o of uke({appEvent:t,meta:n}))W5(o)},onResync(t,n,o){us("ws:resync",{sessionId:t,status:"required",seq:n}),W5.flush(),q5.add(t),U5.request(t)},onError(t,n,o){us("ws:error",{status:"failed",errorCode:t,fatal:o}),M9({severity:"error",title:yo.global.t("warnings.wsTitle"),message:n,details:[Fo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){us("ws:connection",{status:t?"connected":"disconnected"}),Ee.connected=t,Ee.connection=t?"connected":"disconnected",t&&(sxe(),zt.refreshServerMeta())},onTranscriptReset(t,n,o,s){z7.receiveReset(t,n,o,s)},onTranscriptOps(t,n,o,s){return z7.applyOps(t,n,o,s)}})}const B7={},q5=new Set,b4=new Set,mz=new Set;function X_e(e){return Ui(e)&&e.code===DC?!0:typeof e=="object"&&e!==null&&e.code===DC}function Fo(e,t){if(!(t==null||t===""))return{label:yo.global.t(`warnings.details.${e}`),value:gz(t)}}function gz(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function J_e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Q_e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function exe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function txe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function WC(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function nxe(e,t,n){const o=Zv(t),s=Ui(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Fo("operation",e),Fo("sessionId",n??Ee.activeSessionId),Fo("connection",Ee.connection),Fo("timestamp",txe(i??Date.now()))];return o?l.push(Fo("duration",WC(r)),Fo("request",`${t.method} ${t.path}`),Fo("endpoint",t.url),Fo("requestId",t.requestId),Fo("phase",t.phase),Fo("timeout",`${t.timeoutMs}ms`),Fo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Fo("contentType",t.contentType),Fo("responsePreview",t.bodyPreview),Fo("cause",t.cause)):s?l.push(Fo("duration",WC(r)),Fo("code",t.code),Fo("requestId",t.requestId),Fo("message",t.message),Fo("details",t.details)):l.push(Fo("errorName",J_e(t)),Fo("message",Q_e(t)??gz(t)),Fo("stack",exe(t))),l.filter(a=>a!==void 0)}function oxe(e,t,n={}){const o=Zv(t),s=Ui(t),i=n.title??(o?yo.global.t("warnings.daemonNetworkTitle"):s?yo.global.t("warnings.daemonApiTitle"):yo.global.t("warnings.operationFailedTitle")),r=n.message??(o?yo.global.t("warnings.daemonNetworkMessage"):s?t.message:yo.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:nxe(e,t,n.sessionId)}}function M9(e){Ee.warnings=[...Ee.warnings,e]}function sxe(){const e=yo.global.t("warnings.wsTitle"),t=Ee.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==Ee.warnings.length&&(Ee.warnings=t)}function L0(e,t,n){console.error(`[pythinker-web] operation failed: ${e}`,t);const o=Ui(t),s=Zv(t);us("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),M9(oxe(e,t,n))}const ixe={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function rxe(e){if(!Ui(e))return;const t=ixe[e.code];return t?yo.global.t(t):void 0}async function lxe(e){if(rz(e),Ee.activeSessionId!==e)return;const t=Ee.sessions[0];t?await zt.selectSession(t.id,{urlMode:"replace"}):(x9(void 0),Ee.sessionLoading=!1,zt.writeSessionUrl(void 0,"replace"))}const qC=new Set;async function axe(e){if(!qC.has(e)){qC.add(e);try{const t=await At().getSessionWarnings(e),n=yo.global.t("warnings.noteLabel");for(const o of t)M9(`${n}: ${o.message}`)}catch{}}}async function A9(e){const t=zt.localTurnStartState(e);try{const o=await At().getSessionSnapshot(e);if(!Ee.sessions.some(a=>a.id===e))return"ok";W5.flush();const s=Ee.lastSeqBySession[e]??0,i=B7[e];if(!(q5.has(e)||Z5.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return b4.delete(e)||(b4.add(e),U5.request(e)),"ok";if(!zt.isLocalTurnSnapshotCurrent(e,t))return zt.afterLocalTurnStartsSettle(e,()=>{U5.request(e)}),"ok";const l=v7(o.session.usage);Qp(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),H_e(e,tke(Ee.messagesBySession[e]??[],o.messages)),Ee.tasksBySession={...Ee.tasksBySession,[e]:nke(o.subagents,Ee.tasksBySession[e]??[])},Ee.messagesHasMoreBySession={...Ee.messagesHasMoreBySession,[e]:o.hasMoreMessages},Ee.approvalsBySession={...Ee.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(Ee.planReviewByToolCallId={...Ee.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}Ee.questionsBySession={...Ee.questionsBySession,[e]:o.pendingQuestions},Ee.lastSeqBySession={...Ee.lastSeqBySession,[e]:o.asOfSeq},B7[e]=o.epoch,q5.delete(e),b4.delete(e),zt.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...Ee.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],Ee.turnActiveBySession=a}return C9(),Ji&&(Ji.seedSnapshot(e,o),Ji.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),dxe(e)),Z5.delete(e),l&&df(e),axe(e),"ok"}catch(n){return X_e(n)?(await lxe(e),"not-found"):(L0("getSessionSnapshot",n,{title:yo.global.t("warnings.sessionSnapshotTitle"),message:yo.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const U5=oke(A9);function cxe(e){return Object.prototype.hasOwnProperty.call(Ee.messagesBySession,e)}const uxe=4,Fl=[],Z5=new Set;function dxe(e){const t=Fl.indexOf(e);for(t!==-1&&Fl.splice(t,1),Fl.unshift(e);Fl.length>uxe;){let n=-1;for(let s=Fl.length-1;s>=0;s--)if(Fl[s]!==Ee.activeSessionId){n=s;break}if(n===-1)break;const[o]=Fl.splice(n,1);if(o===void 0)break;Ji?.unsubscribe(o),Z5.add(o)}}function fxe(e){const t=Fl.indexOf(e);t!==-1&&Fl.splice(t,1),Z5.delete(e)}async function pxe(e){return A9(e)}function E9(e,t){return(Ee.inFlightBySession[e]??!1)||(Ee.turnActiveBySession[e]??!1)||(t??Ee.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function T9(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return yo.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const hxe=3e4,Dd=U(0);let Pm=null;function mxe(){Pm===null&&(Pm=setInterval(()=>{Dd.value=(Dd.value+1)%Number.MAX_SAFE_INTEGER},hxe),Pm.unref?.())}function gxe(e,t){const n=e.split(` `),o=t.split(` -`),s=[];return n.forEach((r,i)=>{s.push({kind:"rem",gutter:String(i+1),text:`- ${r}`})}),o.forEach((r,i)=>{s.push({kind:"add",gutter:String(i+1),text:`+ ${r}`})}),s}function oxe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:nxe(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,r=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:r}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",r=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:r}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",r=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:r}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,r=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:r}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(r=>{const i=r??{};return{title:typeof i.title=="string"?i.title:"",status:typeof i.status=="string"?i.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,i=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:i.length>0?i:void 0}}return{kind:"generic",summary:e.action}}function sxe(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function rxe(e){const t=Te.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const r of s.content){if(r.type!=="toolUse"||r.toolName!=="Bash"&&r.toolName!=="bash")continue;const i=r.input,l=i&&typeof i.command=="string"?i.command:void 0;l&&n.set(r.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const r of s.content){if(r.type!=="toolResult")continue;if((typeof r.output=="string"?r.output:r.output!==void 0?JSON.stringify(r.output):"").includes(o)){const l=n.get(r.toolCallId);if(l)return l}}}function ixe(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":e.status==="cancelled"?t="cancelled":t="fail";let n="",o;if(e.status==="running"&&e.startedAt){o=Date.now()-new Date(e.startedAt).getTime();const l=Math.round(o/1e3),a=Math.floor(l/60),c=l%60;n=yo.global.t("tasks.timingRunning",{time:`${a}:${String(c).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){o=new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime();const l=Math.round(o/1e3);n=yo.global.t("tasks.timingDone",{sec:l})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,r=e.command??rxe(e),i=e.kind==="bash"&&r?`$ ${r}`:void 0;return{id:e.id,agentId:e.agentId,backgroundTaskId:e.backgroundTaskId,name:e.description,kind:e.kind,state:t,timing:n,durationMs:o,meta:i,output:s,subagentType:e.subagentType,phase:e.subagentPhase,model:e.model,thinkingEffort:e.thinkingEffort,dynamicWorkflowIndex:e.dynamicWorkflowIndex,swarmIndex:e.swarmIndex,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,createdAt:e.createdAt,completedAt:e.completedAt}}const lxe=B(()=>{const e=Te.sessions.find(n=>n.id===Te.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Te.workspaceName,branch:t}}),axe=B(()=>(Hd.value,Te.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:T9(e.updatedAt),busy:A9(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),cxe=B(()=>Te.activeSessionId??""),uxe=B(()=>{const e=Te.activeSessionId;if(e)return xo.skillsBySession.value[e]??[];const t=t6.value;return t?xo.skillsByWorkspace.value[t]??[]:[]}),B2=U({}),B7=U([]),R7=U(!1),Ha=U([]),F7=U(!1),vc=U({}),dxe=B(()=>{const e=Te.activeSessionId;return e?vc.value[e]??{}:{}});async function fxe(e){B2.value={...B2.value,[e]:!0};try{await xo.loadSkillsForSession(e)}finally{B2.value={...B2.value,[e]:!1}}}async function pxe(){R7.value=!0;try{B7.value=await At().listConnectors()}catch{B7.value=[]}finally{R7.value=!1}}async function pz(){F7.value=!0;try{Ha.value=await At().listPlugins()}catch{Ha.value=[]}finally{F7.value=!1}}async function hxe(e,t){const n=Ha.value.find(o=>o.id===e)?.enabled;Ha.value=Ha.value.map(o=>o.id===e?{...o,enabled:t}:o);try{await At().setPluginEnabled(e,t)}catch(o){n!==void 0&&(Ha.value=Ha.value.map(s=>s.id===e?{...s,enabled:n}:s)),L0("setPluginEnabled",o);return}await pz()}async function mxe(e){await Promise.all([fxe(e),pxe(),pz()])}async function gxe(e){const t=Te.activeSessionId;if(!t)return;const n=vc.value[t]??{};vc.value={...vc.value,[t]:{...n,...e}};try{await At().updateSession(t,e)}catch(o){throw vc.value={...vc.value,[t]:n},L0("updateCapabilities",o,{sessionId:t}),o}}const E9=B(()=>{const e=Te.activeSessionId;return e?Te.inFlightBySession[e]??!1:!1}),vxe=B(()=>zt.isStartingFirstPrompt()),ur=Vbe(Te,{pushOperationFailure:L0,nextOptimisticMsgId:uz,connectEventsIfNeeded:S9,getEventConn:()=>Jr,resolveThinkingForPrompt:(e,t)=>xo.resolveThinkingForPrompt(e,t)}),lu=B(()=>{const e=Te.activeSessionId;if(!e)return[];const t=ur.sideChatTargetBySession.value[e]?.agentId;return(Te.tasksBySession[e]??[]).filter(n=>n.id!==t)}),hz=Oke(Te,lu),wxe=B(()=>{const e=Te.activeSessionId;if(!e)return[];const t=new Set(Te.sideChatUserMessageIdsBySession[e]??[]),n=(Te.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Te.approvalsBySession[e]??[];return b9(n,o,s=>At().getFileUrl(s),e6.value,Te.planReviewByToolCallId)}),e6=B(()=>{const e=Te.activeSessionId;return e?(Te.turnActiveBySession[e]??!1)||(Te.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),yxe=B(()=>E9.value||e6.value),VC=new Map,kxe=B(()=>{hz.taskClock.value;const e=lu.value.filter(o=>o.kind==="subagent"&&o.runInBackground).toSorted((o,s)=>Date.parse(o.createdAt)-Date.parse(s.createdAt)),t=Te.activeSessionId??"__draft__",n=VC.get(t)??{indexes:new Map,next:1};VC.set(t,n);for(const o of e){const r=n.indexes.get(o.id)??(o.backgroundTaskId?n.indexes.get(o.backgroundTaskId):void 0)??n.next++;n.indexes.set(o.id,r),o.backgroundTaskId&&n.indexes.set(o.backgroundTaskId,r)}return lu.value.map(o=>{const s=ixe(o);return o.kind==="subagent"&&o.runInBackground&&(s.dynamicWorkflowIndex=o.dynamicWorkflowIndex??n.indexes.get(o.id)),s})}),bxe=B(()=>{const e=Te.activeSessionId;if(!e)return{};const t={};for(const n of Te.messagesBySession[e]??[])for(const o of n.content){if(o.type!=="toolUse"||o.toolName!=="ExitPlanMode")continue;const s=o.input&&typeof o.input=="object"?o.input:{},r=Te.planReviewByToolCallId[o.toolCallId],i=r?.plan??(typeof s.plan=="string"?s.plan:void 0),l=r?.path??(typeof s.path=="string"?s.path:void 0)??(typeof s.planPath=="string"?s.planPath:void 0);t[o.toolCallId]={agentId:"main",toolCallId:o.toolCallId,turnId:n.id,source:"interaction",plan:i,path:l}}return t}),mz=B(()=>d_e(lu.value)),_xe=B(()=>p_e(lu.value)),wc=B(()=>{const e=Te.activeSessionId;return e?Te.goalBySession[e]??null:null}),xxe=B(()=>{const e=Te.activeSessionId;return e?a_e(Te.messagesBySession[e]??[]):[]}),Sxe=B(()=>{const e=Te.activeSessionId;return e?Te.compactionBySession[e]??null:null}),Cxe=B(()=>Te.connection),Mxe=B(()=>Te.loading),Axe=B(()=>Te.sessionLoading),Txe=B(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadingMoreBySession[e]??!1:!1}),Exe=B(()=>{const e=Te.activeSessionId;return e?Te.messagesHasMoreBySession[e]??!1:!1}),Ixe=B(()=>{const e=Te.activeSessionId;return e?Te.messagesLoadMoreErrorBySession[e]??!1:!1}),Lxe=B(()=>Te.serverVersion),$xe=B(()=>Te.backend),Nxe=B(()=>Te.experimentalFlagStates);function zxe(e){return Te.experimentalFlagStates.find(t=>t.id===e)}const Bxe=B(()=>Te.dangerousBypassAuth);function Rxe(){Te.dangerousBypassAuth=!1}const Fxe=B(()=>Te.permission),jxe=B(()=>Te.thinking),gz=B(()=>{const e=Te.activeSessionId;return e?Te.planModeBySession[e]??!1:cf.planMode}),Oxe=B(()=>{const e=Te.activeSessionId;return e?Te.planArmedBySession[e]??!1:cf.planMode}),Pxe=B(()=>{const e=Te.activeSessionId;return e?Te.dynamicWorkflowModeBySession[e]??!1:cf.dynamicWorkflowMode}),Hxe=B(()=>{const e=Te.activeSessionId;return e?Te.goalModeBySession[e]??!1:cf.goalMode}),Dxe=B(()=>{const e=f_e(mz.value);return{plan:gz.value,goal:wc.value&&wc.value.status!=="complete"?{status:wc.value.status,turnsUsed:wc.value.turnsUsed,elapsedMs:wc.value.wallClockMs}:null,dynamicWorkflow:e.total>0?e:null}}),Vxe=B(()=>{const e=Te.activeSessionId;if(!e)return[];const t=At();return(Te.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Wxe=B(()=>Te.warnings),qxe=B(()=>{const e=Te.activeSessionId;return e?(Te.questionsBySession[e]??[]).map(sxe):[]}),Uxe=B(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:oxe(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),I9=B(()=>{const e=Te.activeSessionId;return e?(Te.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Te.questionsBySession[e]??[]).length>0?"awaiting-question":E9.value||e6.value?"running":"idle":"idle"}),xo=ibe(Te,{pushOperationFailure:L0,refreshSessionStatus:uf,persistSessionProfile:lz,activity:I9,updateSession:Jp,updateSessionMessages:tz}),j7=B(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Zxe=B(()=>{const e=Te.activeSessionId;return e?Te.gitStatusBySession[e]?.pullRequest??null:null}),Kxe=B(()=>{const e=Te.activeSessionId;if(!e)return[];const t=Te.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).toSorted((n,o)=>n.path.localeCompare(o.path)):[]}),Gxe=B(()=>{const e=Te.activeSessionId;if(!e)return null;const t=Te.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),vz=B(()=>{const e=Te.sessions.find(i=>i.id===Te.activeSessionId),t=j7.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?xo.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Te.defaultModel)??"—",s=xo.models.value.find(i=>i.id===o)??xo.models.value.find(i=>i.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Te.permission,branch:t,cwd:e?.cwd??"",isGitRepo:j7.value!==null}}),Yxe=B(()=>sz.value),Xxe=B(()=>Te.sessions.find(t=>t.id===Te.activeSessionId)?.usage.totalCostUsd??0),L9=B(()=>Te.authReady),O7=U(null);Ue(Qp,e=>{e&&O7.value===null&&(O7.value=L9.value)},{immediate:!0});const wz=B(()=>Rye(x9.value,O7.value??!1)),Jxe=B(()=>Bye({initialized:Qp.value,onboardingCompleted:wz.value,authReady:L9.value})),Qxe=B(()=>Te.defaultModel),eSe=B(()=>Te.config),tSe=B(()=>{const e=Te.activeSessionId;if(!e)return{};const t=Te.gitStatusBySession[e];return t?{...t.entries}:{}});function au(e){const t=Vi(e.cwd);return Te.workspaces.find(n=>Vi(n.root)===t)?.id??e.workspaceId??e.cwd}const $9=B(()=>Pye({workspaces:Te.workspaces,sessions:Te.sessions,hiddenWorkspaceRoots:Te.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Te.sessionsHasMoreByWorkspace})),Z5=U(HP()),cu=U(DP()==="manual"?"manual":"recent");function nSe(e){const t=hu(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}const pl=U(nSe(ln.pinnedSessions)),b4=U(Yo(ln.pinnedCollapsed)==="true");function oSe(e){pl.value=pl.value.includes(e)?pl.value.filter(t=>t!==e):[...pl.value,e],p1(ln.pinnedSessions,pl.value)}function sSe(e){const t=new Set(pl.value),n=e.filter(o=>t.has(o));pl.value=[...n,...pl.value.filter(o=>!n.includes(o))],p1(ln.pinnedSessions,pl.value)}function rSe(){b4.value=!b4.value,vs(ln.pinnedCollapsed,String(b4.value))}Ue(()=>[$9.value.map(e=>e.id).join("\0"),Te.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=VP(n,Z5.value);o!==null&&(Z5.value=o,kT(o))});const M0=B(()=>{const e=$9.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:k_e(t.root,Te.fsHome),sessionCount:t.sessionCount}));if(cu.value==="recent"){const t=new Map;for(const n of Te.sessions){if(n.parentSessionId)continue;const o=au(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return UP(e,t)}return WP(e,Z5.value)}),t6=B(()=>{const e=Te.activeWorkspaceId,t=M0.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ue(t6,e=>{e&&(Object.prototype.hasOwnProperty.call(xo.skillsByWorkspace.value,e)||xo.loadSkillsForWorkspace(e))},{immediate:!0});const iSe=B(()=>{const e=t6.value;return e?M0.value.find(t=>t.id===e)??null:null}),lSe=B(()=>{Hd.value;const e=new Set(M0.value.map(n=>n.id)),t=new Map(M0.value.map(n=>[n.id,n.name]));return Te.sessions.filter(n=>!n.parentSessionId&&e.has(au(n))).map(n=>{const o=au(n);return{id:n.id,title:n.title,time:T9(n.updatedAt),busy:A9(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),aSe=B(()=>{Hd.value;const e=new Map;for(const t of Te.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=au(t),o={id:t.id,title:t.title,time:T9(t.updatedAt),busy:A9(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return M0.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Te.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Te.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Te.sessionsInitialCountByWorkspace[t.id]??E7}))});function cSe(e){Z5.value=e,kT(e),cu.value!=="manual"&&(cu.value="manual",bT("manual"))}function uSe(e){cu.value!==e&&(cu.value=e,bT(e))}const yz=B(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),dSe=B(()=>{const e={};for(const[t,n]of Object.entries(Te.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Te.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),fSe=B(()=>{const e={};for(const[t,n]of Object.entries(Te.unreadBySession))n&&(e[t]=!0);return e}),pSe=B(()=>{const e={},t=yz.value;for(const n of Te.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=au(n);e[s]=(e[s]??0)+o}return e}),hSe=B(()=>Te.recentRoots),mSe=B(()=>Te.availableOpenInApps),gSe=B(()=>Te.serverCapabilities.fs_write===!0),zt=obe(Te,{taskPoller:hz,sideChat:ur,modelProvider:xo,pushOperationFailure:L0,activity:I9,sessionsKnownEmpty:dz,setSessions:QN,updateSession:Jp,upsertSessionFront:x_e,appendSession:S_e,forgetSession:nz,setActiveSessionId:_9,updateSessionMessages:tz,nextOptimisticMsgId:uz,getEventConn:()=>Jr,syncSessionFromSnapshot:M9,reopenSession:Q_e,hasLoadedMessages:G_e,refreshSessionStatus:uf,refreshSessionGoal:E_e,persistSessionProfile:lz,mergedWorkspaces:$9,workspacesView:M0,status:vz,workspaceIdForSession:au,savePermissionToStorage:h_e,seedPermissionFromDaemonDefault:__e,savePlanModeToStorage:GN,saveDynamicWorkflowModeToStorage:YN,saveGoalModeToStorage:XN,draftModes:cf,saveUnread:_g,saveActiveWorkspaceToStorage:y_e,saveHiddenWorkspacesToStorage:w_e,goalErrorMessage:U_e,resetFastMoon:Rl.resetFastMoon,initialized:Qp,connectIssue:iz,selectedDiffPath:oz,fileDiffLines:sz,fileDiffLoading:rz});async function vSe(){await zt.loadConfig(),await Promise.all([zt.checkAuth(),xo.loadModels(),xo.loadProviders()])}function wSe(e,t){const n=Te.sessions.find(o=>o.id===e);return n?zt.renameSession(e,TT(t,n.title)):Promise.resolve()}function N9(e){return e===Te.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function ySe(e){if(Te.turnActiveBySession[e]){const t={...Te.turnActiveBySession};delete t[e],Te.turnActiveBySession=t}Te.inFlightBySession[e]&&(Te.inFlightBySession={...Te.inFlightBySession,[e]:!1})}function kSe(e,t,n){const o=Te.promptIdBySession[e];zt.finishPromptLocal(e,{turnWasActive:n}),e===Te.activeSessionId?(zt.loadGitStatus(e),uf(e)):t==="idle"&&(Te.unreadBySession={...Te.unreadBySession,[e]:!0},_g({[e]:!0}));const s=(Te.approvalsBySession[e]??[]).length>0,r=(Te.questionsBySession[e]??[]).length>0;vke(t,s,r)&&ul.maybeNotifyCompletion(e,{isUserWatching:N9(e),sessionTitle:Te.sessions.find(i=>i.id===e)?.title??"",promptId:o,onClick:()=>{zt.selectSession(e)}}),t==="idle"&&Pd.maybePlayCompletionSound()}function bSe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",r=o&&s?`${o}: ${s}`:s||o;ul.maybeNotifyQuestion({isUserWatching:N9(e),sessionTitle:Te.sessions.find(i=>i.id===e)?.title??"",questionPreview:r,questionId:t.questionId,onClick:()=>{zt.selectSession(e)}}),Pd.maybePlayQuestionSound()}function _Se(e,t){ul.maybeNotifyApproval({isUserWatching:N9(e),sessionTitle:Te.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{zt.selectSession(e)}}),Pd.maybePlayApprovalSound()}function b1(){return txe(),{workspace:lxe,sessions:axe,activeSessionId:cxe,workspacesView:M0,workspaceSortMode:cu,pinnedSessionIds:pl,pinnedCollapsed:b4,visibleWorkspace:iSe,activeWorkspaceId:t6,sessionsForView:lSe,workspaceGroups:aSe,attentionBySession:yz,pendingBySession:dSe,attentionByWorkspace:pSe,unreadBySession:fSe,recentRoots:hSe,turns:wxe,tasks:kxe,activeAppTasks:lu,auxiliaryTranscripts:N7,todos:xxe,goal:wc,dynamicWorkflows:mz,dynamicWorkflowMembersByToolCallId:_xe,activationBadges:Dxe,compaction:Sxe,status:vz,sessionCost:Xxe,fileDiff:Yxe,selectedDiffPath:oz,fileDiffLoading:rz,changes:Kxe,gitInfo:j7,gitDiffStats:Gxe,activePullRequest:Zxe,changesByPath:tSe,pendingApprovals:Uxe,availableOpenInApps:mSe,fsWriteSupported:gSe,connection:Cxe,loading:Mxe,sessionLoading:Axe,loadingMoreMessages:Txe,hasMoreMessages:Exe,loadMoreMessagesError:Ixe,serverVersion:Lxe,backend:$xe,experimentalFlagStates:Nxe,experimentalFlagState:zxe,dangerousBypassAuth:Bxe,clearDangerousBypassAuth:Rxe,initialized:Qp,connectIssue:iz,permission:Fxe,thinking:jxe,planMode:gz,planArmed:Oxe,sessionPlans:bxe,dynamicWorkflowMode:Pxe,goalMode:Hxe,queued:Vxe,warnings:Wxe,questions:qxe,activity:I9,turnActive:e6,inFlight:E9,working:yxe,isStartingFirstPrompt:vxe,fastMoon:Rl.fastMoon,models:xo.models,starredModelIds:xo.starredModelIds,providers:xo.providers,uiFontSize:Rl.uiFontSize,setUiFontSize:Rl.setUiFontSize,conversationToc:cz,setConversationToc:$_e,colorScheme:Rl.colorScheme,setColorScheme:Rl.setColorScheme,accent:Rl.accent,setAccent:Rl.setAccent,notifyOnComplete:ul.notifyOnComplete,notifyOnQuestion:ul.notifyOnQuestion,notifyOnApproval:ul.notifyOnApproval,notifyPermission:ul.notifyPermission,setNotifyOnComplete:ul.setNotifyOnComplete,setNotifyOnQuestion:ul.setNotifyOnQuestion,setNotifyOnApproval:ul.setNotifyOnApproval,soundOnComplete:Pd.soundOnComplete,setSoundOnComplete:Pd.setSoundOnComplete,onboarded:x9,setOnboarded:z_e,onboardingCompleted:wz,appState:Jxe,load:zt.load,selectSession:zt.selectSession,clearActiveSession:zt.clearActiveSession,loadOlderMessages:zt.loadOlderMessages,loadWorkspaces:zt.loadWorkspaces,loadMoreSessions:zt.loadMoreSessions,loadAllSessions:zt.loadAllSessions,selectWorkspace:zt.selectWorkspace,openWorkspace:zt.openWorkspace,openWorkspaceDraft:zt.openWorkspaceDraft,startSessionAndSendPrompt:zt.startSessionAndSendPrompt,startSessionAndActivateSkill:zt.startSessionAndActivateSkill,startSessionAndOpenSideChat:zt.startSessionAndOpenSideChat,addWorkspaceByPath:zt.addWorkspaceByPath,browseFs:zt.browseFs,getFsHome:zt.getFsHome,sendPrompt:zt.sendPrompt,steerPrompt:zt.steerPrompt,steerQueued:zt.steerQueued,sideChatVisible:ur.sideChatVisible,sideChatSessionId:ur.sideChatSessionId,sideChatTurns:ur.sideChatTurns,sideChatRunning:ur.sideChatRunning,sideChatSending:ur.sideChatSending,openSideChat:ur.openSideChat,closeSideChat:ur.closeSideChat,sendSideChatPrompt:ur.sendSideChatPrompt,uploadImage:zt.uploadImage,abortCurrentPrompt:zt.abortCurrentPrompt,respondApproval:zt.respondApproval,respondQuestion:zt.respondQuestion,dismissQuestion:zt.dismissQuestion,pendingQuestionActions:zt.pendingQuestionActions,pendingApprovalActions:zt.pendingApprovalActions,cancelTask:zt.cancelTask,setPermission:zt.setPermission,setThinking:xo.setThinking,setPlanMode:zt.setPlanMode,togglePlanMode:zt.togglePlanMode,setDynamicWorkflowMode:zt.setDynamicWorkflowMode,toggleDynamicWorkflowMode:zt.toggleDynamicWorkflowMode,setGoalMode:zt.setGoalMode,toggleGoalMode:zt.toggleGoalMode,createGoal:zt.createGoal,controlGoal:zt.controlGoal,enqueue:zt.enqueue,dismissWarning:zt.dismissWarning,renameSession:zt.renameSession,renameWorkspace:zt.renameWorkspace,deleteWorkspace:zt.deleteWorkspace,reorderWorkspaces:cSe,setWorkspaceSortMode:uSe,togglePinnedSession:oSe,reorderPinnedSessions:sSe,togglePinnedCollapsed:rSe,setSessionEmoji:wSe,archiveSession:zt.archiveSession,exportSession:zt.exportSession,restoreSession:zt.restoreSession,loadArchivedSessions:zt.loadArchivedSessions,compact:zt.compact,forkSession:zt.forkSession,generateSessionTitle:zt.generateSessionTitle,undo:zt.undo,unqueue:zt.unqueue,reorderQueue:zt.reorderQueue,searchFiles:zt.searchFiles,loadGitStatus:zt.loadGitStatus,loadFileDiff:zt.loadFileDiff,clearFileDiff:zt.clearFileDiff,listDir:zt.listDir,readFileContent:zt.readFileContent,getFileDownloadUrl:zt.getFileDownloadUrl,openWorkspaceFile:zt.openWorkspaceFile,openInApp:zt.openInApp,revealWorkspaceFile:zt.revealWorkspaceFile,revealSavedPlan:zt.revealSavedPlan,resolveImageUrl:zt.resolveImageUrl,getFileUrl:e=>At().getFileUrl(e),loadModels:xo.loadModels,loadProviders:xo.loadProviders,skills:uxe,skillsLoadingBySession:B2,connectors:B7,connectorsLoading:R7,plugins:Ha,pluginsLoading:F7,activeSessionCapabilities:dxe,loadCapabilityData:mxe,updateCapabilities:gxe,setPluginEnabled:hxe,activateSkill:xo.activateSkill,setModel:xo.setModel,toggleStarModel:xo.toggleStarModel,addProvider:xo.addProvider,deleteProvider:xo.deleteProvider,refreshProvider:xo.refreshProvider,refreshAllProviders:xo.refreshAllProviders,authReady:L9,defaultModel:Qxe,config:eSe,updateConfig:zt.updateConfig,refreshServerMeta:zt.refreshServerMeta,checkAuth:zt.checkAuth,refreshRuntimeState:vSe}}const xSe=["aria-expanded","aria-label"],SSe={class:"capability-trigger-label"},CSe={class:"capability-panel"},MSe={class:"capability-viewport"},ASe={class:"capability-view"},TSe={key:1,class:"capability-group"},ESe={class:"capability-group-title"},ISe={class:"capability-caption"},LSe={key:0,class:"capability-loading"},$Se={class:"capability-view capability-view-secondary"},NSe={class:"capability-caption"},zSe={key:0,class:"capability-loading"},BSe={class:"capability-caption"},RSe={key:0,class:"capability-loading"},FSe=Ge({__name:"CapabilityMenu",props:{sessionId:{},triggerless:{type:Boolean}},setup(e,{expose:t}){const n=e,{t:o}=Lt(),s=b1(),r=U(null),i=U(null),l=U(!1),a=U("root"),c=U([]),u=B(()=>n.sessionId===s.activeSessionId.value?s.skills.value:[]),d=B(()=>{const H=n.sessionId;return H?s.skillsLoadingBySession.value[H]===!0:!1}),f=B(()=>s.connectors.value),p=B(()=>s.connectorsLoading.value),h=B(()=>s.plugins.value),m=B(()=>s.pluginsLoading.value),k=B(()=>n.sessionId===s.activeSessionId.value?s.activeSessionCapabilities.value:{}),x=B(()=>d.value||u.value.length>0),w=B(()=>p.value||f.value.length>0),v=B(()=>m.value||h.value.length>0),b=B(()=>{switch(a.value){case"skills":return o("capabilityMenu.skills.title");case"plugins":return o("capabilityMenu.plugins.title");case"root":return""}}),M=B(()=>{switch(a.value){case"skills":return u.value.length;case"plugins":return h.value.length;case"root":return 0}});function R(){c.value=k.value.mcpServers!==void 0?[...k.value.mcpServers]:f.value.map(H=>H.id)}Ue([()=>n.sessionId,f,k],R,{immediate:!0}),Ue([u,d,h,m],()=>{a.value==="skills"&&!d.value&&u.value.length===0&&(a.value="root"),a.value==="plugins"&&!m.value&&h.value.length===0&&(a.value="root")});function z(){if(l.value=!l.value,!l.value){a.value="root";return}n.sessionId&&s.loadCapabilityData(n.sessionId)}t({toggleOpen:z});function $(){l.value=!1,a.value="root"}const T={tools:Promise.resolve(),mcpServers:Promise.resolve()},E={tools:0,mcpServers:0};function N(H,V,A){const F=++E[H],j=n.sessionId,q=T[H].then(async()=>{if(n.sessionId===j)try{await s.updateCapabilities({[H]:[...V.value]})}catch{F===E[H]&&n.sessionId===j&&(V.value=A)}});return T[H]=q,q}function C(H,V){const A=[...c.value],F=new Set(A);return V?F.add(H):F.delete(H),c.value=[...F],N("mcpServers",c,A)}function O(H,V){s.setPluginEnabled(H,V)}return(H,V)=>(g(),S("div",{ref_key:"rootRef",ref:r,class:"capability-control"},[n.triggerless?J("",!0):(g(),S("button",{key:0,ref_key:"triggerRef",ref:i,type:"button",class:Be(["capability-trigger",{open:l.value}]),"aria-expanded":l.value,"aria-haspopup":"dialog","aria-label":y(o)("capabilityMenu.triggerLabel"),onClick:xt(z,["stop"])},[V[5]||(V[5]=P2('',1)),_("span",SSe,I(y(o)("capabilityMenu.trigger")),1)],10,xSe)),Z(LT,{anchor:n.triggerless?r.value:i.value,open:l.value,label:y(o)("capabilityMenu.triggerLabel"),onClose:$},{default:ue(()=>[_("div",CSe,[_("div",MSe,[_("div",{class:Be(["capability-track",{"is-drilled":a.value!=="root"}])},[_("div",ASe,[x.value?(g(),ce(uc,{key:0,count:u.value.length,onClick:V[0]||(V[0]=A=>a.value="skills")},{label:ue(()=>[He(I(y(o)("capabilityMenu.skills.title")),1)]),trailing:ue(()=>[...V[6]||(V[6]=[_("svg",{class:"chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m6 3 5 5-5 5"})],-1)])]),_:1},8,["count"])):J("",!0),w.value?(g(),S("div",TSe,[_("div",ESe,I(y(o)("capabilityMenu.mcp.title")),1),_("p",ISe,I(y(o)("capabilityMenu.mcp.caption")),1),p.value?(g(),S("div",LSe,[Z(zm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},rt(f.value,A=>(g(),ce(uc,{key:A.id,class:"mcp-row",selected:c.value.includes(A.id),title:A.name,onClick:F=>void C(A.id,!c.value.includes(A.id))},{label:ue(()=>[He(I(A.name),1)]),trailing:ue(()=>[Z(MC,{"model-value":c.value.includes(A.id),"aria-label":y(o)("capabilityMenu.mcp.toggle",{name:A.name}),onClick:V[1]||(V[1]=xt(()=>{},["stop"])),"onUpdate:modelValue":F=>void C(A.id,F)},null,8,["model-value","aria-label","onUpdate:modelValue"])]),_:2},1032,["selected","title","onClick"]))),128))])):J("",!0),v.value?(g(),ce(uc,{key:2,count:h.value.length,onClick:V[2]||(V[2]=A=>a.value="plugins")},{label:ue(()=>[He(I(y(o)("capabilityMenu.plugins.title")),1)]),trailing:ue(()=>[...V[7]||(V[7]=[_("svg",{class:"chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m6 3 5 5-5 5"})],-1)])]),_:1},8,["count"])):J("",!0)]),_("div",$Se,[a.value!=="root"?(g(),ce(uc,{key:0,class:"capability-back",count:M.value,onClick:V[3]||(V[3]=A=>a.value="root")},{leading:ue(()=>[...V[8]||(V[8]=[_("svg",{class:"back-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m10 3-5 5 5 5"})],-1)])]),label:ue(()=>[He(I(b.value||y(o)("capabilityMenu.back")),1)]),_:1},8,["count"])):J("",!0),a.value==="skills"?(g(),S(Me,{key:1},[_("p",NSe,I(y(o)("capabilityMenu.skills.caption")),1),d.value?(g(),S("div",zSe,[Z(zm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},rt(u.value,A=>(g(),ce(uc,{key:A.name,class:"skill-row",disabled:"",title:A.description},{label:ue(()=>[He(I(A.name),1)]),_:2},1032,["title"]))),128))],64)):a.value==="plugins"?(g(),S(Me,{key:2},[_("p",BSe,I(y(o)("capabilityMenu.plugins.caption")),1),m.value?(g(),S("div",RSe,[Z(zm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},rt(h.value,A=>(g(),ce(uc,{key:A.id,class:"plugin-row",selected:A.enabled,title:A.displayName,onClick:F=>O(A.id,!A.enabled)},{label:ue(()=>[He(I(A.displayName),1)]),trailing:ue(()=>[Z(MC,{"model-value":A.enabled,"aria-label":y(o)("capabilityMenu.plugins.toggle",{name:A.displayName}),onClick:V[4]||(V[4]=xt(()=>{},["stop"])),"onUpdate:modelValue":F=>O(A.id,F)},null,8,["model-value","aria-label","onUpdate:modelValue"])]),_:2},1032,["selected","title","onClick"]))),128))],64)):J("",!0)])],2)])])]),_:1},8,["anchor","open","label"])],512))}}),jSe=mt(FSe,[["__scopeId","data-v-ff3a96c4"]]);let h2=0,Pm=null;function kz(){function e(){typeof document>"u"||(h2+=1,h2===1&&(Pm=document.body.style.overflow,document.body.style.overflow="hidden"))}function t(){h2<=0||(h2-=1,h2===0&&typeof document<"u"&&(document.body.style.overflow=Pm??"",Pm=null))}return{lock:e,unlock:t}}const OSe={key:0,class:"sheet-root"},PSe=["aria-label"],HSe=["aria-label"],DSe={key:0,class:"sheet-head"},VSe={class:"sheet-title"},WSe={class:"sheet-body"},qSe=Ge({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,{lock:r,unlock:i}=kz();function l(){s("update:modelValue",!1),s("close")}function a(c){c.key==="Escape"&&o.closeOnEsc&&l()}return Ue(()=>o.modelValue,c=>{typeof document>"u"||(c?(r(),document.addEventListener("keydown",a)):(i(),document.removeEventListener("keydown",a)))},{immediate:!0}),An(()=>{typeof document<"u"&&(i(),document.removeEventListener("keydown",a))}),(c,u)=>(g(),ce(gi,{name:"sheet"},{default:ue(()=>[e.modelValue?(g(),S("div",OSe,[_("div",{class:"sheet-scrim",onClick:l}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||y(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":y(n)("mobile.closeSheet"),onClick:l},null,8,HSe),e.title?(g(),S("div",DSe,[_("span",VSe,I(e.title),1)])):J("",!0),_("div",WSe,[Tn(c.$slots,"default",{},void 0,!0)])],8,PSe)])):J("",!0)]),_:3}))}}),Kc=mt(qSe,[["__scopeId","data-v-92ecd88c"]]),USe={class:"att-lightbox-card"},ZSe=["src"],KSe=["src","alt"],GSe={class:"att-lightbox-name"},YSe={key:0,class:"att-strip"},XSe={class:"att-scroll-content"},JSe={key:1,class:"att-row"},QSe={key:0,class:"att-more"},eCe={class:"cin-wrap"},tCe=["onClick"],nCe={class:"am-icon"},oCe={class:"am-name"},sCe={key:0,class:"am-desc"},rCe={class:"input-row"},iCe=["placeholder","disabled","aria-expanded","aria-controls","aria-activedescendant"],lCe=["aria-label"],aCe={class:"toolbar-left"},cCe=["aria-label","onKeydown"],uCe={class:"perm-pill-label"},dCe=["onClick"],fCe={class:"pd-info"},pCe={class:"pd-desc"},hCe={class:"pd-check"},mCe={key:1,class:"workflow-chip"},gCe={class:"workflow-label"},vCe={class:"toolbar-right"},wCe=["aria-label"],yCe=["aria-expanded","aria-label"],kCe=["disabled","aria-expanded","aria-label","onKeydown"],bCe={class:"thinking-pill-label"},_Ce=["aria-label"],xCe=["aria-label","disabled"],SCe={class:"md-list"},CCe={key:0,class:"md-section"},MCe=["onClick"],ACe={class:"md-check"},TCe={class:"md-name"},ECe={class:"md-provider"},ICe={key:1,class:"md-divider"},LCe={key:2,class:"md-section"},$Ce=["onClick"],NCe={class:"md-check"},zCe={class:"md-name"},BCe={key:0,class:"md-divider"},RCe={class:"md-check md-more-icon"},FCe={class:"md-name"},jCe=["aria-label","onKeydown"],OCe={class:"thinking-dropdown-title"},PCe={class:"thinking-cache-note"},HCe={class:"drop-card"},DCe={class:"msheet-search"},VCe={class:"msheet-search"},WCe=["onClick"],qCe={class:"am-icon"},UCe={class:"am-name"},ZCe={key:0,class:"am-desc"},WC=36,KCe=Ge({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},working:{type:Boolean,default:!1},goalMode:{type:Boolean},workflowActive:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean,default:!1}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=B(()=>o.starting?i("composer.starting"):o.running?i("composer.placeholderRunning"):o.goalMode?i("status.goalPlaceholder"):o.planArmed||o.planMode?i("status.planPlaceholder"):i("composer.placeholder")),r=n,{t:i,locale:l}=Lt(),a=Kp(),{text:c,textareaRef:u,autosize:d,loadForEdit:f,clearDraft:p}=pye({sessionId:()=>o.sessionId});function h(){o.planArmed||o.planMode||(o.goalMode&&r("toggleGoal"),r("togglePlan"))}function m(){if(De.value){r("focusGoal");return}o.goalMode||((o.planArmed||o.planMode)&&r("togglePlan"),r("toggleGoal"))}const k=U(!1);function x(){k.value=!k.value,vt(()=>{d(),M(),u.value?.focus()})}function w(){k.value&&(k.value=!1,vt(d))}function v(Se){if(typeof getComputedStyle>"u")return WC;const it=Number.parseFloat(getComputedStyle(Se).minHeight);return Number.isFinite(it)&&it>0?it:WC}const b=U(!1);function M(){const Se=u.value;b.value=!!Se&&Se.scrollHeight>v(Se)}Ue(c,()=>{vt(M)}),Ue(()=>o.sessionId,()=>{k.value=!1,z.value=!1,C.value=!1});const R=uye({text:c,textareaRef:u,autosize:d,sessionId:()=>o.sessionId}),{open:z,items:$,active:T,update:E,select:N}=dye({text:c,textareaRef:u,autosize:d,skills:()=>o.skills,emitCommand:Se=>{if(Se==="/plan"){h();return}if(Se==="/goal"){m();return}r("command",Se)},historyPush:Se=>R.push(Se),clearDraft:p}),{open:C,items:O,active:H,loading:V,stale:A,update:F,select:j,close:q,getMentionToken:P}=fye({text:c,textareaRef:u,autosize:d,searchFiles:()=>o.searchFiles}),W=U(null),G=U(null),ee=U(null);function se(Se){u.value?.setSelectionRange(Se,Se)}const oe=B({get:()=>c.value.startsWith("/")?c.value.slice(1):c.value,set:Se=>{c.value=`/${Se}`,vt(()=>{se(c.value.length),E()})}}),Q=B({get:()=>{const Se=ee.value;return Se?c.value.slice(Se.start+1,Se.end):""},set:Se=>{const it=ee.value;if(!it)return;c.value=`${c.value.slice(0,it.start)}@${Se}${c.value.slice(it.end)}`;const pt=it.start+Se.length+1;ee.value={start:it.start,end:pt},vt(()=>{se(pt),F()})}});Ue([z,a],async([Se,it])=>{!Se||!it||(await vt(),W.value?.focus())}),Ue([C,a],async([Se,it])=>{!Se||!it||(ee.value=P(),await vt(),G.value?.focus())});function ge(){z.value=!1,u.value?.focus()}function xe(Se){Se||ge()}function Ke(){q(),ee.value=null,u.value?.focus()}function et(Se){Se||Ke()}function Y(){R.resetBrowsing(),E(),F()}const{attachments:ne,previewAttachment:D,fileInputRef:X,isDragOver:ve,removeAttachment:fe,openAttachmentPreview:pe,closeAttachmentPreview:te,openFilePicker:de,handleFileInputChange:ye,handleDragOver:Ce,handleDragLeave:me,handleDrop:be,clearAfterSubmit:re,loadAttachments:ke}=hye({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});function Fe(){const Se=ne.value.map(it=>it.localId);for(const it of Se)fe(it)}const at=B(()=>ne.value.filter(Se=>Se.kind!=="file")),dt=B(()=>ne.value.filter(Se=>Se.kind==="file")),$t=U(null),Tt=U(null),Qt=U(!1);let Dt=null;function en(){const Se=$t.value;Qt.value=Se!==null&&Se.scrollHeight>Se.clientHeight+1}Ue($t,Se=>{Dt?.disconnect(),Dt=null,Se&&typeof ResizeObserver=="function"&&(Dt=new ResizeObserver(en),Dt.observe(Se)),en()},{immediate:!0}),Ue(ne,()=>void vt(en),{deep:!0}),Ue(()=>[at.value.length,dt.value.length],([Se,it],[pt,un])=>{Se<=pt&&it<=un||vt(()=>{const Co=$t.value;Co&&(Co.scrollTop=Se>pt&&Tt.value?Tt.value.offsetHeight-Co.clientHeight:Co.scrollHeight)})}),xn(()=>{c.value&&vt(()=>{d(),M()})}),An(()=>{document.removeEventListener("click",Jn,!0),Dt?.disconnect(),nt?.disconnect(),Jo?.disconnect(),an()});function kn(){u.value?.focus({preventScroll:!0})}function In(Se){ke(Se)}const Mn=B(()=>z.value||C.value||Ct.value||so.value||Bn.value||is.value),Re=B(()=>c.value.trim().length===0&&ne.value.length===0);t({loadForEdit:f,loadAttachmentsForEdit:In,focus:kn,anyPopupOpen:Mn,isEmpty:Re});function lt(Se){return{fileId:Se.fileId,kind:Se.kind,name:Se.name,mediaType:Se.mediaType,size:Se.size}}function tt(Se){if(Se.kind==="file"){Se.fileId!==void 0&&vN(Se.fileId,Se.name,Se.mediaType);return}pe(Se)}function ht(){const Se=c.value.trim();if(ne.value.some(un=>un.uploading))return;const it=ne.value.filter(un=>!un.uploading&&!un.error&&un.fileId);if(!Se&&it.length===0)return;if(R.push(Se),Se==="/plan"){c.value="",p(),z.value=!1,w(),h();return}if(Se==="/goal"){c.value="",p(),z.value=!1,w(),m();return}if(Se){const un=nye(Se),Co=un?MN(o.skills).some(Vo=>Vo.name===un.cmd||Vo.name===`/${j5}${un.cmd.slice(1)}`):!1;if(un&&Co){c.value="",p(),z.value=!1,w(),r("command",un.arg?`${un.cmd} ${un.arg}`:un.cmd);return}}const pt={text:Se,attachments:it.map(un=>lt(un))};D.value=null,re(),c.value="",p(),z.value=!1,C.value=!1,w(),r("submit",pt)}function bt(){if(!o.running||ne.value.some(un=>un.uploading))return;const Se=c.value.trim(),it=ne.value.filter(un=>!un.uploading&&!un.error&&un.fileId);if(!Se&&it.length===0&&o.queued.length===0)return;const pt={text:Se,attachments:it.map(un=>lt(un))};re(),R.push(Se),c.value="",p(),z.value=!1,C.value=!1,w(),r("steer",pt)}let Rt=!1,on=null;function an(){on!==null&&(clearTimeout(on),on=null)}function sn(){an(),Rt=!0}function Yn(){an(),on=setTimeout(()=>{on=null,Rt=!1},0)}function Kt(Se){return Rt||Se.isComposing||Se.keyCode===229}function no(Se){if(!Kt(Se)){if(Ut.value&&Se.key==="Backspace"&&!Se.shiftKey&&!Se.altKey&&!Se.metaKey&&!Se.ctrlKey){const it=u.value;if(it&&it.selectionStart===0&&it.selectionEnd===0){Se.preventDefault(),Qo();return}}if(Se.key==="Escape"){if(is.value){Se.preventDefault(),jt();return}if(Ct.value){Se.preventDefault(),wt();return}if(so.value){Se.preventDefault(),ze();return}if(Bn.value){Se.preventDefault(),tn();return}}if(z.value){if(Se.key==="Escape"){Se.preventDefault(),z.value=!1;return}if(Se.key==="Tab"&&$.value.length===0){z.value=!1;return}if(Se.key==="ArrowDown"){Se.preventDefault(),T.value=(T.value+1)%$.value.length;return}if(Se.key==="ArrowUp"){Se.preventDefault(),T.value=(T.value-1+$.value.length)%$.value.length;return}if(Se.key==="Enter"||Se.key==="Tab"){Se.preventDefault();const it=$.value[T.value];it&&N(it);return}}if(C.value&&!V.value){if(Se.key==="ArrowDown"){Se.preventDefault(),H.value=(H.value+1)%Math.max(1,O.value.length);return}if(Se.key==="ArrowUp"){Se.preventDefault(),H.value=(H.value-1+Math.max(1,O.value.length))%Math.max(1,O.value.length);return}if(Se.key==="Enter"||Se.key==="Tab"){Se.preventDefault();const it=O.value[H.value];it&&j(it);return}if(Se.key==="Escape"){Se.preventDefault(),C.value=!1;return}}if(Se.key==="s"&&(Se.ctrlKey||Se.metaKey)&&!Se.shiftKey&&!Se.altKey){o.running&&(Se.preventDefault(),bt());return}if(!k.value&&!z.value&&!C.value&&!Se.shiftKey&&!Se.altKey&&!Se.metaKey&&!Se.ctrlKey){const it=R.isBrowsing();if(Se.key==="ArrowUp"&&R.hasHistory()&&(it||R.caretAtTextStart())){Se.preventDefault(),R.recallOlder(),z.value=!1;return}if(Se.key==="ArrowDown"&&it){Se.preventDefault(),R.recallNewer(),z.value=!1;return}}if(Se.key==="Enter"&&!Se.shiftKey){if(k.value&&!(Se.metaKey||Se.ctrlKey))return;Se.preventDefault(),ht()}}}const As=B(()=>i("composer.send")),ys=B(()=>!!o.uploadImage),ao=B(()=>!ne.value.some(Se=>Se.uploading)&&(c.value.trim()!==""||ne.value.some(Se=>!Se.error&&Se.fileId))),co=B(()=>{if(z.value)return"composer-slash-menu";if(C.value)return"composer-mention-menu"}),oo=B(()=>{if(z.value&&$.value.length>0)return`composer-slash-option-${T.value}`;if(C.value&&O.value.length>0)return`composer-mention-option-${H.value}`}),Ct=U(!1),so=U(!1),Bn=U(!1),Pn=U(null),js=U(null),Os=U(null),Ts=U(null),ks=U(null),Lo=U(null),Ro=U(null),Ze=U(null);Vl(Lo),Vl(Ro),Vl(Ze);const Qe=U(""),ct=U(""),mn=U(""),_o=U(""),Un=U(!1);function Ps(){Ct.value=!Ct.value,Ct.value&&(Xo(),so.value=!1,Bn.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0))}function Je(){io.value||(so.value=!so.value,so.value&&(ro(),Ct.value=!1,Bn.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0)))}function ze(){so.value=!1,Xn()}function wt(){Ct.value=!1,Xn()}function Mt(){Bn.value=!Bn.value,Bn.value&&(Es(),Ct.value=!1,so.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0))}function tn(){Bn.value=!1,Xn()}function Xn(){!Ct.value&&!so.value&&!Bn.value&&!is.value&&document.removeEventListener("click",Jn,!0)}function Jn(Se){const it=Se.target;Pn.value?.contains(it)||ie.value?.contains(it)||_e.value?.contains(it)||(wt(),ze(),tn(),jt())}function Es(){const Se=js.value,it=Pn.value;Qe.value=Se&&it?`${Math.round(Se.getBoundingClientRect().left-it.getBoundingClientRect().left)}px`:""}function Xo(){const Se=Os.value,it=Pn.value;ct.value=Se&&it?`${Math.round(it.getBoundingClientRect().right-Se.getBoundingClientRect().right)}px`:""}function ro(){const Se=Ts.value,it=Pn.value;mn.value=Se&&it?`${Math.round(it.getBoundingClientRect().right-Se.getBoundingClientRect().right)}px`:""}const uo=B(()=>{const Se=o.status?.ctxMax??0;return Se<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Se*100)))}),vn=B(()=>{const Se=na(o.status?.ctxUsed??0),it=na(o.status?.ctxMax??0);return i("status.ctxTooltip",{used:Se,max:it,pct:uo.value})}),Hs=B(()=>uo.value>=80),bs=B(()=>o.models?.find(Se=>Se.id===o.status?.modelId)),Ci=B(()=>Up(bs.value)),ir=B(()=>Zp(bs.value)),Is=B(()=>r9(bs.value,o.thinking)),Ys=B(()=>ir.value.includes(Is.value)?Is.value:""),io=B(()=>Ci.value==="unsupported"||ir.value.length<=1),Io=B(()=>{const Se=(bs.value?.supportEfforts?.length??0)>0,it=Is.value;return Se&&it!=="on"&&it!=="off"?Od(it):si(it)}),yr=B(()=>i("composer.thinkingControl",{level:Io.value}));function kr(Se){io.value||(r("setThinking",TN(bs.value,Se)),ze())}function si(Se){return Se==="on"?i("status.thinkingOn"):Se==="off"?i("status.thinkingOff"):Od(Se)}const Or=B(()=>ir.value.map(Se=>({value:Se,label:si(Se)}))),Pr=B(()=>o.planArmed===!0||o.planMode===!0),Ee=B(()=>o.workflowActive===!0),Ae=B(()=>o.goal?.status??o.activationBadges?.goal?.status??null),De=B(()=>Ae.value!==null&&Ae.value!=="complete"),Ut=B(()=>o.goalMode?"goal":o.planArmed?"plan":null),dn=U(null),zn=U(""),So=B(()=>zn.value?{textIndent:zn.value}:void 0);let Jo=null;function Qo(){Ut.value==="goal"?r("toggleGoal"):Ut.value==="plan"&&r("togglePlan")}function Mi(){const Se=dn.value;zn.value=Se?`calc(${Se.offsetWidth}px + var(--space-1-5) - var(--space-05))`:""}Ue(Ut,async Se=>{if(Jo?.disconnect(),Jo=null,!Se){zn.value="";return}await vt(),Mi(),typeof ResizeObserver=="function"&&dn.value&&(Jo=new ResizeObserver(Mi),Jo.observe(dn.value))},{immediate:!0});const es=U(null),is=U(!1),ie=U(null),_e=U(null);Vl(ie),Vl(_e);const Ie=U(null),je=U(null);let nt=null;const kt=B(()=>{const Se=[];return ys.value&&Se.push({id:"files",icon:"attachment",nameKey:"composer.addFiles",action:qt}),a.value&&Se.push({id:"slash",icon:"terminal",nameKey:"composer.addSlash",descKey:"composer.addSlashDesc",action:$n},{id:"mention",icon:"link",nameKey:"composer.addMention",descKey:"composer.addMentionDesc",action:Nn}),Se.push({id:"capabilities",icon:"sliders",nameKey:"capabilityMenu.trigger",action:qe},{id:"goal",icon:"target",nameKey:"status.goalLabel",descKey:"composer.addGoalDesc",action:he},{id:"plan",icon:"file-edit",nameKey:"status.planLabel",descKey:"composer.addPlanDesc",action:$e},{id:"workflow",icon:"sparkles",nameKey:"status.dynamicWorkflowLabel",descKey:"composer.addWorkflowDesc",action:bn}),Se});function Pt(){const Se=Ie.value;if(!Se||Se.scrollHeight<=Se.clientHeight+1){je.value=null;return}const it=getComputedStyle(Se),pt=Number.parseFloat(it.getPropertyValue("--menu-scrollbar-track-inset"))||0,un=Number.parseFloat(it.getPropertyValue("--menu-scrollbar-thumb-min"))||24,Co=Se.clientHeight-pt*2,Vo=Math.max(un,Se.clientHeight/Se.scrollHeight*Co),Wo=Se.scrollHeight-Se.clientHeight;je.value={top:Se.offsetTop+pt+Se.scrollTop/Wo*(Co-Vo),height:Vo}}Ue(is,async Se=>{nt?.disconnect(),nt=null,je.value=null,Se&&(await vt(),Pt(),typeof ResizeObserver=="function"&&Ie.value&&(nt=new ResizeObserver(Pt),nt.observe(Ie.value)))});function jt(){is.value=!1,Xn()}function Ln(Se){Se||jt()}function cn(){if(is.value){jt();return}wt(),ze(),tn(),z.value=!1,C.value=!1,is.value=!0,document.addEventListener("click",Jn,!0),vt(()=>{(a.value?_e.value:ie.value)?.querySelector(".am-row")?.focus()})}function Rn(Se){Se.action(),a.value&&Se.id==="files"||u.value?.focus()}function wo(Se){if(Se.key==="Escape"){Se.preventDefault(),jt(),u.value?.focus();return}if(Se.key==="Tab"){jt();return}if(Se.key!=="ArrowDown"&&Se.key!=="ArrowUp")return;Se.preventDefault();const it=a.value?_e.value:ie.value,pt=Array.from(it?.querySelectorAll(".am-row")??[]);if(pt.length===0)return;const un=pt.indexOf(document.activeElement),Co=Se.key==="ArrowDown"?(un+1)%pt.length:(un-1+pt.length)%pt.length;pt[Co]?.focus()}function qt(){jt(),de()}function $n(){jt(),c.value="/",vt(()=>{se(1),E()})}function Nn(){jt(),c.value="@",vt(()=>{se(1),F()})}function qe(){jt(),es.value?.toggleOpen()}function he(){jt(),o.goalMode||m()}function $e(){jt(),Pr.value||h()}function bn(){jt(),Ee.value||r("toggleWorkflow")}const ri=[{mode:"manual",icon:"fingerprint",color:"var(--color-text)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",icon:"shield-question",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",icon:"full-access",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Ls=U(null),$0=U("");function ua(Se){const it={};return Se&&(it["--composer-menu-desc-width"]=Se),it}const bu=B(()=>{const Se=ua($0.value);return Qe.value&&(Se.left=Qe.value),Se}),da=B(()=>{const Se={};return ct.value&&(Se.right=ct.value),_o.value&&(Se.maxHeight=_o.value),Se}),n6=B(()=>{const Se={};return mn.value&&(Se.right=mn.value),Se});let kl=null;function _u(Se){const it=Number.parseFloat(Se);return Number.isFinite(it)?it:0}function N0(Se){return`${Se.fontStyle||"normal"} ${Se.fontWeight||"400"} ${Se.fontSize} ${Se.fontFamily}`}function _1(Se){return Se.letterSpacing==="normal"?0:_u(Se.letterSpacing)}function df(Se,it){if(!Se)return 0;const pt=Iwe(Se,N0(it),{letterSpacing:_1(it)});return Lwe(pt)}function ff(){const Se=Ls.value?.querySelector(".pd-desc");if(!Se)return;const it=getComputedStyle(Se),pt=Math.max(0,...ri.map(un=>df(i(un.descKey),it)));$0.value=pt>0?`${Math.ceil(pt)}px`:""}function xu(){typeof window>"u"||(kl!==null&&window.cancelAnimationFrame(kl),vt(()=>{kl=window.requestAnimationFrame(()=>{kl=null,ff()})}))}Ue(l,xu,{immediate:!0}),xn(()=>{xu(),document.fonts?.ready.then(xu)}),An(()=>{kl!==null&&(window.cancelAnimationFrame(kl),kl=null)});function fa(Se){r("setPermission",Se),tn()}const Xs=B(()=>ri.find(Se=>Se.mode===o.status?.permission)),x1=B(()=>Xs.value?i(Xs.value.labelKey):""),o6=B(()=>Xs.value?.icon??"fingerprint"),pa=U(!1),Ai=U(!1);let pf=0,hf=0,bl=null;function mf(Se,it,pt){const un=Se.getPropertyValue(it).trim(),Co=Number.parseFloat(un);return Number.isFinite(Co)?un.endsWith("em")?Co*Number.parseFloat(Se.fontSize):Co:pt}function s6(Se){return Se.scrollWidth>Se.clientWidth+1||Se.clientWidth===0&&(Se.textContent?.length??0)>0}function ha(){const Se=Pn.value;if(!Se)return;const it=getComputedStyle(Se),pt=mf(it,"--composer-valve-floor",56),un=mf(it,"--composer-valve-expand-margin",48),Co=Se.getBoundingClientRect().width;if(Ai.value){Co>hf+un&&(Ai.value=!1,vt(ha));return}if(pa.value&&Co>pf+un){pa.value=!1,vt(ha);return}const Vo=ks.value;!Vo||!s6(Vo)||Vo.getBoundingClientRect().width>=pt||(pa.value?(hf=Co,Ai.value=!0):(pf=Co,pa.value=!0),vt(ha))}xn(()=>{typeof ResizeObserver=="function"&&Pn.value&&(bl=new ResizeObserver(ha),bl.observe(Pn.value)),document.fonts?.ready.then(ha)}),Ue([x1,Ee,Hs,Io,()=>o.status?.model,()=>o.working,l],()=>{pa.value=!1,Ai.value=!1,vt(ha)}),An(()=>{bl?.disconnect(),bl=null});const z0=B(()=>bs.value?.provider??""),Su=B(()=>!z0.value||!o.models?.length?[]:o.models.filter(Se=>Se.provider===z0.value)),gf=B(()=>new Set(o.starredIds??[]));function Cu(Se){return gf.value.has(Se)}const Qi=B(()=>o.models?.length?o.models.filter(Se=>Cu(Se.id)&&Se.provider!==z0.value):[]);function Mu(){const Se=Lo.value,it=Pn.value;if(!Se||!it)return;const pt=getComputedStyle(Se),un=_u(pt.getPropertyValue("--space-1"))||4,Co=_u(pt.getPropertyValue("--space-2"))||8,Vo=window.visualViewport,Wo=Vo?.offsetTop??0,S1=Wo+(Vo?.height??window.innerHeight),Hr=it.getBoundingClientRect(),Ei=Hr.top-Wo-un-Co,Ii=S1-Hr.bottom-un-Co;Se.offsetHeight>Ei&&Ii>Ei?(Un.value=!0,_o.value=`${Math.max(Math.floor(Ii),0)}px`):(Un.value=!1,_o.value=`${Math.max(Math.floor(Ei),0)}px`)}function Ti(){wt()}function vf(){window.addEventListener("resize",Ti),window.visualViewport?.addEventListener("resize",Ti),window.visualViewport?.addEventListener("scroll",Ti)}function Au(){window.removeEventListener("resize",Ti),window.visualViewport?.removeEventListener("resize",Ti),window.visualViewport?.removeEventListener("scroll",Ti)}Ue(Ct,async Se=>{if(!Se){Au();return}vf(),Un.value=!1,_o.value="",await vt(),Mu(),(Lo.value?.querySelector(".md-row.is-current")??Lo.value?.querySelector(".md-row"))?.focus()}),An(Au);function wf(Se){if(Se.key!=="ArrowDown"&&Se.key!=="ArrowUp")return;const it=Array.from(Lo.value?.querySelectorAll(".md-row:not(:disabled)")??[]);if(it.length===0)return;Se.preventDefault();const pt=it.indexOf(document.activeElement),un=Se.key==="ArrowDown"?(pt+1)%it.length:(pt-1+it.length)%it.length;it[un]?.focus()}function Tu(Se){r("selectModel",Se),wt()}return(Se,it)=>(g(),S("div",{class:Be(["composer",{"drag-over":y(ve),expanded:k.value}]),onDragover:it[26]||(it[26]=(...pt)=>y(Ce)&&y(Ce)(...pt)),onDragleave:it[27]||(it[27]=(...pt)=>y(me)&&y(me)(...pt)),onDrop:it[28]||(it[28]=(...pt)=>y(be)&&y(be)(...pt))},[y(D)?(g(),S("div",{key:0,class:"att-lightbox",onClick:it[1]||(it[1]=xt((...pt)=>y(te)&&y(te)(...pt),["self"]))},[_("div",USe,[Z(Cn,{text:y(i)("model.close")},{default:ue(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:it[0]||(it[0]=(...pt)=>y(te)&&y(te)(...pt))},"✕")]),_:1},8,["text"]),y(D).kind==="video"?(g(),S("video",{key:0,class:"att-lightbox-media",src:y(D).previewUrl,controls:"",playsinline:""},null,8,ZSe)):(g(),S("img",{key:1,class:"att-lightbox-media",src:y(D).previewUrl,alt:y(D).name},null,8,KSe)),_("div",GSe,I(y(D).name),1)])])):J("",!0),_("div",{class:Be(["composer-card",{"labels-collapsed":pa.value}])},[y(ne).length>0?(g(),S("div",YSe,[_("div",{ref_key:"attachmentScrollRef",ref:$t,class:Be(["att-scroll",{"is-overflowing":Qt.value}])},[_("div",XSe,[at.value.length>0?(g(),S("div",{key:0,ref_key:"attachmentMediaRowRef",ref:Tt,class:"att-row att-row-media"},[(g(!0),S(Me,null,rt(at.value,pt=>(g(),ce(x7,{key:pt.localId,kind:pt.kind,name:pt.name,url:pt.previewUrl,"file-id":pt.fileId,"media-type":pt.mediaType,size:pt.size,uploading:pt.uploading,error:pt.error,removable:"","remove-label":y(i)("composer.removeNamed",{name:pt.name}),onActivate:un=>tt(pt),onRemove:un=>y(fe)(pt.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))],512)):J("",!0),dt.value.length>0?(g(),S("div",JSe,[(g(!0),S(Me,null,rt(dt.value,pt=>(g(),ce(x7,{key:pt.localId,kind:"file",name:pt.name,"media-type":pt.mediaType,size:pt.size,uploading:pt.uploading,error:pt.error,removable:"","remove-label":y(i)("composer.removeNamed",{name:pt.name}),onActivate:un=>tt(pt),onRemove:un=>y(fe)(pt.localId)},null,8,["name","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):J("",!0)])],2),Qt.value?(g(),S("span",QSe,I(y(i)("composer.attachmentCount",{n:y(ne).length})),1)):J("",!0),y(ne).length>=2?(g(),ce(Cn,{key:1,text:y(i)("composer.clearAll")},{default:ue(()=>[Z(Zt,{class:"att-clear",size:"sm",label:y(i)("composer.clearAll"),onClick:Fe},{default:ue(()=>[Z(Le,{name:"trash"})]),_:1},8,["label"])]),_:1},8,["text"])):J("",!0)])):J("",!0),_("div",eCe,[y(z)&&!y(a)?(g(),ce(SC,{key:0,id:"composer-slash-menu",items:y($),"active-index":y(T),onSelect:y(N),onHover:it[2]||(it[2]=pt=>T.value=pt)},null,8,["items","active-index","onSelect"])):J("",!0),y(C)&&!y(a)?(g(),ce(CC,{key:1,id:"composer-mention-menu",items:y(O),"active-index":y(H),loading:y(V),stale:y(A),onSelect:y(j),onHover:it[3]||(it[3]=pt=>H.value=pt)},null,8,["items","active-index","loading","stale","onSelect"])):J("",!0),Z(gi,{name:"composer-menu-pop"},{default:ue(()=>[is.value&&!y(a)?(g(),S("div",{key:0,ref_key:"modesMenuRef",ref:ie,class:"add-menu",onClick:it[5]||(it[5]=xt(()=>{},["stop"])),onKeydown:wo},[_("div",{ref_key:"addMenuScrollRef",ref:Ie,class:"am-scroll",role:"menu",onScroll:Pt},[(g(!0),S(Me,null,rt(kt.value,pt=>(g(),S("button",{key:pt.id,type:"button",class:"am-row",role:"menuitem",onMousedown:it[4]||(it[4]=xt(()=>{},["prevent"])),onClick:un=>Rn(pt)},[_("span",nCe,[Z(Le,{name:pt.icon,size:"sm"},null,8,["name"])]),_("span",oCe,I(y(i)(pt.nameKey)),1),pt.descKey?(g(),S("span",sCe,I(y(i)(pt.descKey)),1)):J("",!0)],40,tCe))),128))],544),je.value?(g(),S("div",{key:0,class:"scroll-thumb",style:Wt({top:`${je.value.top}px`,height:`${je.value.height}px`})},null,4)):J("",!0)],544)):J("",!0)]),_:1}),_("div",rCe,[Ut.value?(g(),S("span",{key:0,ref_key:"workModePillRef",ref:dn,class:"wm-pill"},[Z(Le,{name:Ut.value==="goal"?"target":"file-edit",size:"sm"},null,8,["name"]),_("span",null,I(Ut.value==="goal"?y(i)("status.goalLabel"):y(i)("status.planLabel")),1),Z(Zt,{class:"wm-x",size:"sm",label:y(i)("status.workModeDismiss"),onMousedown:it[6]||(it[6]=xt(()=>{},["prevent"])),onClick:Qo},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],512)):J("",!0),Zn(_("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":it[7]||(it[7]=pt=>rs(c)?c.value=pt:null),class:"ph",style:Wt(So.value),placeholder:s.value,disabled:e.starting,autocomplete:"off",spellcheck:"false",rows:"1",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!co.value,"aria-controls":co.value,"aria-activedescendant":oo.value,onKeydown:no,onCompositionstart:sn,onCompositionend:Yn,onInput:Y,onBlur:it[8]||(it[8]=pt=>{y(a)||(z.value=!1,C.value=!1)})},null,44,iCe),[[Fs,y(c)]]),Z(Cn,{text:k.value?y(i)("composer.collapseTitle"):y(i)("composer.expandTitle")},{default:ue(()=>[k.value||b.value?(g(),S("button",{key:0,class:"expand-btn",type:"button","aria-label":k.value?y(i)("composer.collapseTitle"):y(i)("composer.expandTitle"),onClick:x},[k.value?(g(),ce(Le,{key:0,name:"collapse",size:"sm"})):(g(),ce(Le,{key:1,name:"expand",size:"sm"}))],8,lCe)):J("",!0)]),_:1},8,["text"])])]),ys.value?(g(),S("input",{key:1,ref_key:"fileInputRef",ref:X,type:"file",multiple:"",class:"file-input-hidden",onChange:it[9]||(it[9]=(...pt)=>y(ye)&&y(ye)(...pt))},null,544)):J("",!0),_("div",{ref_key:"toolbarRef",ref:Pn,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Ls,class:"menu-measure","aria-hidden":"true"},[...it[29]||(it[29]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",aCe,[Z(Zt,{size:"md",class:"composer-attach",label:y(i)("composer.addMenu"),"aria-haspopup":"menu","aria-expanded":is.value,onMousedown:it[10]||(it[10]=xt(()=>{},["prevent"])),onClick:xt(cn,["stop"])},{default:ue(()=>[Z(Le,{name:"plus"})]),_:1},8,["label","aria-expanded"]),Z(jSe,{ref_key:"capMenuRef",ref:es,"session-id":e.sessionId,triggerless:""},null,8,["session-id"]),e.status?(g(),S("span",{key:0,ref_key:"permissionPillRef",ref:js,class:Be(["perm-pill",["perm-"+e.status.permission,{open:Bn.value}]]),role:"button",tabindex:"0","aria-label":x1.value,onClick:xt(Mt,["stop"]),onKeydown:[Eo(Mt,["enter"]),Eo(xt(Mt,["prevent"]),["space"])]},[Z(Le,{class:"perm-pill-icon",name:o6.value,size:"md"},null,8,["name"]),_("span",uCe,I(x1.value),1)],42,cCe)):J("",!0),Z(gi,{name:"composer-menu-pop"},{default:ue(()=>[Bn.value&&e.status?(g(),S("div",{key:0,ref_key:"permDropdownRef",ref:Ze,class:"perm-dropdown",style:Wt(bu.value),role:"menu",onClick:it[11]||(it[11]=xt(()=>{},["stop"]))},[(g(),S(Me,null,rt(ri,pt=>_("button",{key:pt.mode,class:Be(["pd-row",{"is-current":pt.mode===e.status.permission}]),role:"menuitem",onClick:un=>fa(pt.mode)},[_("span",{class:"pd-icon",style:Wt({color:pt.color})},[Z(Le,{name:pt.icon,size:"md"},null,8,["name"])],4),_("span",fCe,[_("span",{class:"pd-name",style:Wt({color:pt.color})},I(y(i)(pt.labelKey)),5),_("span",pCe,I(y(i)(pt.descKey)),1)]),_("span",hCe,[pt.mode===e.status.permission?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)])],10,dCe)),64))],4)):J("",!0)]),_:1}),Ee.value?(g(),S("span",mCe,[Z(Le,{class:"workflow-ic",name:"sparkles",size:"md"}),_("span",gCe,I(y(i)("status.dynamicWorkflowLabel")),1),Z(Zt,{class:"workflow-x",size:"sm",label:y(i)("status.dynamicWorkflowDismiss"),onMousedown:it[12]||(it[12]=xt(()=>{},["prevent"])),onClick:it[13]||(it[13]=xt(pt=>r("toggleWorkflow"),["stop"]))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])])):J("",!0)]),_("div",vCe,[Hs.value?(g(),S("button",{key:0,class:"compact-chip",onClick:it[14]||(it[14]=xt(pt=>r("compact"),["stop"]))},"/compact")):J("",!0),Z(Cn,{text:vn.value},{default:ue(()=>[e.status&&!e.hideContext?(g(),S("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":vn.value},[Z(kye,{pct:uo.value},null,8,["pct"])],8,wCe)):J("",!0)]),_:1},8,["text"]),Z(Cn,{text:Ai.value?e.status?.model:null},{default:ue(()=>[e.status?(g(),S("button",{key:0,ref_key:"modelPillRef",ref:Os,type:"button",class:Be(["model-pill",{open:Ct.value,"icon-only":Ai.value}]),"aria-haspopup":"menu","aria-expanded":Ct.value,"aria-label":Ai.value?e.status.model:void 0,onClick:xt(Ps,["stop"])},[Ai.value?(g(),ce(Le,{key:0,name:"cute-bot",size:"md"})):(g(),S(Me,{key:1},[_("span",{ref_key:"modelNameRef",ref:ks,class:"mp-name"},I(e.status.model),513),Z(Le,{class:"cv",name:"chevron-down",size:"sm"})],64))],10,yCe)):J("",!0)]),_:1},8,["text"]),e.status&&Ci.value!=="unsupported"?(g(),ce(Cn,{key:1,text:yr.value},{default:ue(()=>[_("button",{ref_key:"thinkingPillRef",ref:Ts,type:"button",class:Be(["thinking-pill",{open:so.value}]),disabled:io.value,"aria-haspopup":"dialog","aria-expanded":so.value,"aria-label":yr.value,onClick:xt(Je,["stop"]),onKeydown:Eo(xt(ze,["prevent"]),["escape"])},[Z(Le,{name:"thinking",size:"sm"}),_("span",bCe,I(Io.value),1),io.value?J("",!0):(g(),ce(Le,{key:0,class:"cv",name:"chevron-down",size:"sm"}))],42,kCe)]),_:1},8,["text"])):J("",!0),e.working?(g(),ce(Cn,{key:2,text:y(i)("composer.interruptTitle")},{default:ue(()=>[_("button",{class:"stop","aria-label":y(i)("composer.interrupt"),onClick:it[15]||(it[15]=pt=>r("interrupt"))},[...it[30]||(it[30]=[_("span",{class:"stop-square","aria-hidden":"true"},null,-1)])],8,_Ce)]),_:1},8,["text"])):J("",!0),_("button",{class:Be(["send",{"is-starting":e.starting}]),"aria-label":As.value,disabled:e.starting||!ao.value,onClick:it[16]||(it[16]=pt=>ht())},[e.starting?(g(),ce(Go,{key:0,size:"sm"})):(g(),ce(Le,{key:1,name:"send",size:"sm"}))],10,xCe)]),Z(gi,{name:"composer-menu-pop"},{default:ue(()=>[Ct.value&&e.status?(g(),S("div",{key:0,ref_key:"modelDropdownRef",ref:Lo,class:Be(["composer-dropdown model-dropdown",{"flip-down":Un.value}]),style:Wt(da.value),role:"menu",onClick:it[18]||(it[18]=xt(()=>{},["stop"])),onKeydown:wf},[_("div",SCe,[Qi.value.length>0?(g(),S("div",CCe,I(y(i)("status.starredModels")),1)):J("",!0),(g(!0),S(Me,null,rt(Qi.value,pt=>(g(),S("button",{key:pt.id,class:Be(["md-row",{"is-current":pt.id===e.status.modelId}]),role:"menuitem",onClick:un=>Tu(pt.id)},[_("span",ACe,[pt.id===e.status.modelId?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",TCe,I(pt.displayName??pt.model),1),_("span",ECe,I(pt.provider),1),Z(Le,{class:"md-star",name:"star",size:"sm"})],10,MCe))),128)),Qi.value.length>0?(g(),S("div",ICe)):J("",!0),Su.value.length>0?(g(),S("div",LCe,I(z0.value),1)):J("",!0),(g(!0),S(Me,null,rt(Su.value,pt=>(g(),S("button",{key:pt.id,class:Be(["md-row",{"is-current":pt.id===e.status.modelId}]),role:"menuitem",onClick:un=>Tu(pt.id)},[_("span",NCe,[pt.id===e.status.modelId?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",zCe,I(pt.displayName??pt.model),1),Cu(pt.id)?(g(),ce(Le,{key:0,class:"md-star",name:"star",size:"sm"})):J("",!0)],10,$Ce))),128))]),Su.value.length>0?(g(),S("div",BCe)):J("",!0),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:it[17]||(it[17]=pt=>{wt(),r("pickModel")})},[_("span",RCe,[Z(Le,{name:"list",size:"sm"})]),_("span",FCe,I(y(i)("status.moreModels")),1),Z(Le,{class:"md-more-arrow",name:"chevron-right",size:"sm"})])],38)):J("",!0)]),_:1}),Z(gi,{name:"composer-menu-pop"},{default:ue(()=>[so.value&&e.status?(g(),S("div",{key:0,ref_key:"thinkingDropdownRef",ref:Ro,class:"composer-dropdown thinking-dropdown",style:Wt(n6.value),role:"dialog","aria-label":y(i)("composer.thinkingMenuTitle"),onClick:it[19]||(it[19]=xt(()=>{},["stop"])),onKeydown:Eo(xt(ze,["prevent"]),["escape"])},[_("div",OCe,[Z(Le,{name:"thinking",size:"sm"}),_("span",null,I(y(i)("composer.thinkingMenuTitle")),1)]),Z(nr,{"model-value":Ys.value,options:Or.value,size:"sm","onUpdate:modelValue":kr},null,8,["model-value","options"]),_("div",PCe,I(y(i)("status.cacheNote")),1)],44,jCe)):J("",!0)]),_:1})],512)],2),_("div",{class:Be(["drop-overlay",{show:y(ve)}]),"aria-hidden":"true"},[_("div",HCe,[Z(Le,{name:"file-plus",size:"lg"}),_("span",null,I(y(i)("composer.dropToAttach")),1)])],2),(g(),ce(Gi,{to:"body"},[Z(Kc,{"model-value":y(a)&&y(z),title:y(i)("composer.slashSheetTitle"),"onUpdate:modelValue":xe},{default:ue(()=>[_("div",DCe,[Z(os,{ref_key:"slashSheetSearchRef",ref:W,modelValue:oe.value,"onUpdate:modelValue":it[20]||(it[20]=pt=>oe.value=pt),placeholder:y(i)("composer.slashSearchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:no},null,8,["modelValue","placeholder"])]),Z(SC,{id:"composer-slash-menu",layout:"sheet",items:y($),"active-index":y(T),query:oe.value,onSelect:y(N),onHover:it[21]||(it[21]=pt=>T.value=pt)},null,8,["items","active-index","query","onSelect"])]),_:1},8,["model-value","title"]),Z(Kc,{"model-value":y(a)&&y(C),title:y(i)("composer.mentionSheetTitle"),"onUpdate:modelValue":et},{default:ue(()=>[_("div",VCe,[Z(os,{ref_key:"mentionSheetSearchRef",ref:G,modelValue:Q.value,"onUpdate:modelValue":it[22]||(it[22]=pt=>Q.value=pt),placeholder:y(i)("composer.mentionSearchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:no},null,8,["modelValue","placeholder"])]),Z(CC,{id:"composer-mention-menu",layout:"sheet",items:y(O),"active-index":y(H),loading:y(V),stale:y(A),onSelect:y(j),onHover:it[23]||(it[23]=pt=>H.value=pt)},null,8,["items","active-index","loading","stale","onSelect"])]),_:1},8,["model-value","title"]),Z(Kc,{"model-value":y(a)&&is.value,"onUpdate:modelValue":Ln},{default:ue(()=>[_("div",{ref_key:"mobileModesMenuRef",ref:_e,class:"msheet-add",role:"menu",onClick:it[25]||(it[25]=xt(()=>{},["stop"])),onKeydown:wo},[(g(!0),S(Me,null,rt(kt.value,pt=>(g(),S("button",{key:pt.id,type:"button",class:"am-row",role:"menuitem",onMousedown:it[24]||(it[24]=xt(()=>{},["prevent"])),onClick:un=>Rn(pt)},[_("span",qCe,[Z(Le,{name:pt.icon,size:"sm"},null,8,["name"])]),_("span",UCe,I(y(i)(pt.nameKey)),1),pt.descKey?(g(),S("span",ZCe,I(y(i)(pt.descKey)),1)):J("",!0)],40,WCe))),128))],544)]),_:1},8,["model-value"])]))],34))}}),bz=mt(KCe,[["__scopeId","data-v-6e11f929"]]),GCe={class:"ah"},YCe={class:"akind"},XCe={class:"apath"},JCe={class:"ah-path"},QCe={class:"dg"},eMe={class:"dc"},tMe={key:2,class:"body-shell"},nMe={class:"shell-cmd"},oMe={key:0,class:"shell-cwd"},sMe={key:1,class:"shell-danger"},rMe={class:"file-bar"},iMe={class:"file-lang"},lMe={class:"file-ln"},aMe={class:"file-text"},cMe={key:4,class:"body-chip"},uMe={class:"chip-label"},dMe={class:"chip-value"},fMe={key:0,class:"chip-detail"},pMe={key:5,class:"body-chip"},hMe={key:0,class:"chip-label"},mMe={class:"chip-value"},gMe={key:6,class:"body-chip"},vMe={class:"chip-label"},wMe={class:"chip-value"},yMe={key:0,class:"chip-detail"},kMe={key:7,class:"body-chip"},bMe={class:"chip-label"},_Me={class:"chip-value"},xMe={key:0,class:"chip-detail"},SMe={key:8,class:"body-todo"},CMe={class:"todo-glyph"},MMe={key:10,class:"body-generic"},AMe={class:"gen-text"},TMe={key:11,class:"feedback-wrap"},EMe=["placeholder"],IMe={class:"feedback-hint"},LMe={key:0,class:"plan-actions"},$Me={key:1,class:"abtn"},NMe=.4,zMe=Ge({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=B(()=>{const ne=n.block;return ne.kind!=="plan_review"?null:{plan:ne.plan,path:ne.path,options:ne.options??[]}}),i=U(!1),l=U(!1),a=B(()=>["plan_review","diff","file"].includes(n.block.kind)),c=U(null),u=U(null),d=U(null),f=U({top:!1,bottom:!1}),p=U({top:!1,bottom:!1}),h=U({top:!1,bottom:!1});function m(ne){return D=>{const X=D.currentTarget;X instanceof HTMLElement&&(ne.value={top:X.scrollTop>0,bottom:X.scrollTop+X.clientHeight{const{top:D,bottom:X}=ne.value;if(!D&&!X)return;const ve="var(--menu-scroll-fade)",fe=D&&X?`linear-gradient(to bottom, transparent 0, black ${ve}, black calc(100% - ${ve}), transparent 100%)`:D?`linear-gradient(to bottom, transparent, black ${ve})`:`linear-gradient(to top, transparent, black ${ve})`;return{maskImage:fe,WebkitMaskImage:fe}})}const b=v(f),M=v(p),R=v(h);function z(){const ne=[[c.value,f],[u.value,p],[d.value,h]];for(const[D,X]of ne)D&&(X.value={top:D.scrollTop>0,bottom:D.scrollTop+D.clientHeightvoid vt(z)),Ue(i,()=>void vt(z)),Ue(()=>n.block,()=>void vt(z));const $=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function T(){const ne=$.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${ne}`)}const E=U(!1),N=U(""),C=U(null);function O(){const ne=C.value;if(!ne)return;ne.style.height="auto";const X=(window.visualViewport?.height??window.innerHeight)*NMe,ve=Math.min(ne.scrollHeight,X);ne.style.height=`${ve}px`,ne.style.overflowY=ne.scrollHeight>X?"auto":"hidden"}let H=null,V=0;function A(){if(H?.disconnect(),H=null,typeof ResizeObserver>"u")return;const ne=C.value;ne&&(H=new ResizeObserver(D=>{const X=D[0]?.contentRect.width??0;X!==V&&(V=X,O())}),H.observe(ne))}Ue(N,()=>void vt(O)),Ue(E,ne=>{if(!ne){H?.disconnect(),H=null;return}vt(()=>{O(),A()})}),Ue(i,ne=>{ne||vt(O)});const{uiFontSize:F}=d9();Ue(F,()=>void vt(O));function j(){n.busy||(E.value=!0,N.value="",setTimeout(()=>C.value?.focus(),0))}function q(){if(n.busy)return;const ne=N.value.trim();r.value?ee("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:ne||void 0}):ee("feedback",{decision:"rejected",feedback:ne||void 0}),E.value=!1,N.value=""}function P(){E.value=!1,N.value=""}function W(ne){ne.key==="Enter"&&!ne.shiftKey?(ne.preventDefault(),q()):ne.key==="Escape"&&(ne.preventDefault(),P())}const G=U(null);Ue(()=>n.busy,ne=>{ne||(G.value=null)});function ee(ne,D){n.busy||(G.value=ne,o("decide",D))}function se(){ee("approve",{decision:"approved"})}function oe(){ee("approveSession",{decision:"approved",scope:"session"})}function Q(){ee("reject",{decision:"rejected"})}function ge(){ee("approvePlan",{decision:"approved"})}function xe(ne){ee(`option:${ne}`,{decision:"approved",selectedLabel:ne})}function Ke(){n.busy||j()}function et(){ee("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function Y(ne){const D=(document.activeElement?.tagName??"").toLowerCase();if(D==="input"||D==="textarea"||n.busy||i.value)return;const X=r.value;if(X){if(X.options.length===0){ne.key==="1"?(ne.preventDefault(),ge()):ne.key==="2"?(ne.preventDefault(),Ke()):ne.key==="3"&&(ne.preventDefault(),et());return}ne.key==="1"&&X.options[0]?(ne.preventDefault(),xe(X.options[0].label)):ne.key==="2"&&X.options[1]?(ne.preventDefault(),xe(X.options[1].label)):ne.key==="3"&&X.options[2]&&(ne.preventDefault(),xe(X.options[2].label));return}ne.key==="1"?(ne.preventDefault(),se()):ne.key==="2"?(ne.preventDefault(),oe()):ne.key==="3"?(ne.preventDefault(),Q()):ne.key==="4"&&(ne.preventDefault(),j())}return xn(()=>{document.addEventListener("keydown",Y),window.addEventListener("resize",O),window.visualViewport?.addEventListener("resize",O)}),An(()=>{document.removeEventListener("keydown",Y),window.removeEventListener("resize",O),window.visualViewport?.removeEventListener("resize",O),H?.disconnect(),H=null}),(ne,D)=>(g(),ce(Gv,{class:Be(["appr",{minimized:i.value}])},dd({head:ue(()=>[_("div",GCe,[D[6]||(D[6]=_("span",{class:"ah-ic"},"!",-1)),_("span",YCe,I(T()),1),_("span",XCe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(g(),S(Me,{key:0},[He(I(e.block.path),1)],64)):e.block.kind==="shell"?(g(),S(Me,{key:1},[He(I(e.block.command),1)],64)):e.block.kind==="url"?(g(),S(Me,{key:2},[He(I(e.block.url),1)],64)):e.block.kind==="search"?(g(),S(Me,{key:3},[He(I(e.block.query),1)],64)):e.block.kind==="invocation"?(g(),S(Me,{key:4},[He(I(e.block.name),1)],64)):e.block.kind==="generic"?(g(),S(Me,{key:5},[He(I(e.block.summary),1)],64)):J("",!0)]),e.agentName&&!i.value?(g(),ce(wi,{key:0,variant:"neutral",size:"sm"},{default:ue(()=>[He(I(y(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):J("",!0),i.value?J("",!0):(g(),ce(wi,{key:1,variant:"warning",size:"sm",class:"aw"},{default:ue(()=>[He(I(y(s)("approval.required")),1)]),_:1})),a.value&&!i.value?(g(),ce(Zt,{key:2,class:"aexpand",size:"sm",label:l.value?y(s)("approval.collapsePlan"):y(s)("approval.expandPlan"),tooltip:l.value?y(s)("approval.collapsePlan"):y(s)("approval.expandPlan"),onClick:D[0]||(D[0]=X=>l.value=!l.value)},{default:ue(()=>[Z(Le,{name:l.value?"collapse":"expand",size:"md"},null,8,["name"])]),_:1},8,["label","tooltip"])):J("",!0),Z(Zt,{class:"amin",size:"sm",label:i.value?y(s)("question.expand"):y(s)("question.minimize"),onClick:D[1]||(D[1]=X=>i.value=!i.value)},{default:ue(()=>[i.value?(g(),ce(Le,{key:0,name:"chevron-up",size:"md"})):(g(),ce(Le,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[i.value?void 0:{name:"default",fn:ue(()=>[e.block.kind==="plan_review"&&e.block.path?(g(),ce(Cn,{key:0,text:e.block.path},{default:ue(()=>[_("div",JCe,I(e.block.path),1)]),_:1},8,["text"])):J("",!0),e.block.kind==="diff"?(g(),S("div",{key:1,ref_key:"diffBodyRef",ref:c,class:Be(["diff",{expanded:l.value}]),style:Wt(y(b)),onScroll:D[2]||(D[2]=(...X)=>y(k)&&y(k)(...X))},[(g(!0),S(Me,null,rt(e.block.diff,(X,ve)=>(g(),S("div",{key:ve,class:Be(["dl",X.kind==="add"?"add":X.kind==="rem"?"del":""])},[_("span",QCe,I(X.gutter),1),_("span",eMe,I(X.text),1)],2))),128))],38)):e.block.kind==="shell"?(g(),S("div",tMe,[_("div",nMe,[D[7]||(D[7]=_("span",{class:"shell-dollar"},"$",-1)),He(" "+I(e.block.command),1)]),e.block.cwd?(g(),S("div",oMe,"cwd: "+I(e.block.cwd),1)):J("",!0),e.block.danger?(g(),S("div",sMe,I(y(s)("approval.danger",{detail:e.block.danger})),1)):J("",!0)])):e.block.kind==="file"?(g(),S("div",{key:3,class:Be(["body-file",{expanded:l.value}])},[_("div",rMe,[_("span",iMe,I(e.block.language??""),1)]),_("div",{class:"file-content",ref_key:"fileBodyRef",ref:u,style:Wt(y(M)),onScroll:D[3]||(D[3]=(...X)=>y(x)&&y(x)(...X))},[(g(!0),S(Me,null,rt(e.block.content.split(` -`),(X,ve)=>(g(),S("div",{key:ve,class:"file-line"},[_("span",lMe,I(ve+1),1),_("span",aMe,I(X),1)]))),128))],36)],2)):e.block.kind==="fileop"?(g(),S("div",cMe,[_("span",uMe,I(e.block.op),1),_("span",dMe,I(e.block.path),1),e.block.detail?(g(),S("span",fMe,I(e.block.detail),1)):J("",!0)])):e.block.kind==="url"?(g(),S("div",pMe,[e.block.method?(g(),S("span",hMe,I(e.block.method),1)):J("",!0),_("span",mMe,I(e.block.url),1)])):e.block.kind==="search"?(g(),S("div",gMe,[_("span",vMe,I(y(s)("approval.searchQueryLabel")),1),_("span",wMe,I(e.block.query),1),e.block.scope?(g(),S("span",yMe,I(y(s)("approval.searchScope",{scope:e.block.scope})),1)):J("",!0)])):e.block.kind==="invocation"?(g(),S("div",kMe,[_("span",bMe,I(e.block.kind2),1),_("span",_Me,I(e.block.name),1),e.block.description?(g(),S("span",xMe,I(e.block.description),1)):J("",!0)])):e.block.kind==="todo"?(g(),S("div",SMe,[(g(!0),S(Me,null,rt(e.block.items,(X,ve)=>(g(),S("div",{key:ve,class:"todo-item"},[_("span",CMe,I(X.status==="done"||X.status==="completed"?"✓":"○"),1),_("span",{class:Be(["todo-title",{"todo-done":X.status==="done"||X.status==="completed"}])},I(X.title),3)]))),128))])):e.block.kind==="plan_review"?(g(),S("div",{key:9,ref_key:"planBodyRef",ref:d,class:Be(["body-plan",{expanded:l.value}]),style:Wt(y(R)),onScroll:D[4]||(D[4]=(...X)=>y(w)&&y(w)(...X))},[Z(sa,{text:e.block.plan},null,8,["text"])],38)):(g(),S("div",MMe,[_("span",AMe,I(e.block.summary),1)])),E.value?(g(),S("div",TMe,[Zn(_("textarea",{ref_key:"feedbackRef",ref:C,"onUpdate:modelValue":D[5]||(D[5]=X=>N.value=X),class:"feedback-ta",placeholder:y(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:W},null,40,EMe),[[Fs,N.value]]),_("div",IMe,I(y(s)("approval.feedbackHint")),1)])):J("",!0)]),key:"0"},i.value?void 0:{name:"foot",fn:ue(()=>[r.value?(g(),S("div",LMe,[r.value.options.length>0?(g(!0),S(Me,{key:0},rt(r.value.options,(X,ve)=>(g(),ce(Cn,{key:ve,text:X.description},{default:ue(()=>[Z(It,{class:"kbtn",size:"sm",variant:"primary",loading:G.value===`option:${X.label}`,disabled:e.busy,onClick:fe=>xe(X.label)},{default:ue(()=>[He(I(X.label),1),Z(Il,{class:"k",keys:[String(ve+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(g(),ce(It,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:G.value==="approvePlan",disabled:e.busy,onClick:ge},{default:ue(()=>[He(I(y(s)("approval.approvePlan")),1),Z(Il,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),Z(It,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:Ke},{default:ue(()=>[He(I(y(s)("approval.revise")),1),r.value.options.length===0?(g(),ce(Il,{key:0,class:"k",keys:["2"]})):J("",!0)]),_:1},8,["disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"danger-soft",loading:G.value==="rejectAndExit",disabled:e.busy,onClick:et},{default:ue(()=>[He(I(y(s)("approval.rejectAndExit")),1),r.value.options.length===0?(g(),ce(Il,{key:0,class:"k",keys:["3"]})):J("",!0)]),_:1},8,["loading","disabled"])])):(g(),S("div",$Me,[Z(It,{class:"kbtn",size:"sm",variant:"primary",loading:G.value==="approve",disabled:e.busy,onClick:se},{default:ue(()=>[He(I(y(s)("approval.approve")),1),Z(Il,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",loading:G.value==="approveSession",disabled:e.busy,onClick:oe},{default:ue(()=>[He(I(y(s)("approval.approveSession")),1),Z(Il,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",loading:G.value==="reject",disabled:e.busy,onClick:Q},{default:ue(()=>[He(I(y(s)("approval.reject")),1),Z(Il,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:j},{default:ue(()=>[He(I(y(s)("approval.feedback")),1),Z(Il,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),BMe=mt(zMe,[["__scopeId","data-v-f7485122"]]),RMe={class:"goal-panel"},FMe={key:0,class:"goal-criterion"},jMe={class:"goal-criterion-label"},OMe=Ge({__name:"GoalPanel",props:{goal:{},openFile:{type:Function}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",RMe,[Z(sa,{text:e.goal.objective,"open-file":e.openFile},null,8,["text","open-file"]),e.goal.completionCriterion?(g(),S("div",FMe,[_("div",jMe,[Z(Le,{name:"check-list",size:"md"}),_("span",null,I(y(t)("status.goalDoneWhen")),1)]),Z(sa,{text:e.goal.completionCriterion,"open-file":e.openFile},null,8,["text","open-file"])])):J("",!0)]))}}),PMe=mt(OMe,[["__scopeId","data-v-81a928ba"]]),HMe={class:"plan-panel"},DMe={key:0,class:"plan-review-row"},VMe={class:"plan-review-label"},WMe={key:1,class:"plan-review-row plan-review-feedback"},qMe={class:"plan-review-label"},UMe={key:3,class:"plan-path-only"},ZMe={class:"plan-path-hint"},KMe={class:"plan-path"},GMe={key:4,class:"plan-empty"},YMe=Ge({__name:"PlanPanel",props:{plan:{},planModeOn:{type:Boolean},openFile:{type:Function},revealSavedPlan:{type:Function}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",HMe,[e.plan?.selectedOption?(g(),S("div",DMe,[_("span",VMe,I(y(t)("tools.plan.selectedOption")),1),_("span",null,I(e.plan.selectedOption),1)])):J("",!0),e.plan?.feedback?(g(),S("div",WMe,[_("span",qMe,I(y(t)("tools.plan.feedback")),1),_("span",null,I(e.plan.feedback),1)])):J("",!0),e.plan?.plan?(g(),ce(sa,{key:2,text:e.plan.plan,"open-file":e.openFile},null,8,["text","open-file"])):e.plan?.path?(g(),S("div",UMe,[_("span",ZMe,I(y(t)("tools.plan.pathOnlyHint")),1),_("span",KMe,I(e.plan.path),1),e.revealSavedPlan?(g(),ce(It,{key:0,variant:"ghost",size:"sm",onClick:o[0]||(o[0]=s=>void e.revealSavedPlan(e.plan.agentId,e.plan.toolCallId))},{default:ue(()=>[Z(Le,{name:"external-link",size:"sm"}),He(" "+I(y(t)("tools.plan.revealInFileManager")),1)]),_:1})):J("",!0)])):(g(),S("div",GMe,[Z(Le,{class:"plan-empty-ico",name:"file-edit",size:"lg"}),_("span",null,I(y(t)(e.planModeOn?"status.planEmptyArmed":"status.planEmptyIdle")),1)]))]))}}),XMe=mt(YMe,[["__scopeId","data-v-2883948d"]]),JMe={class:"qh"},QMe={class:"qtitle"},eAe={key:0,class:"qstep"},tAe={key:1,class:"qmin-peek"},nAe={class:"qbody"},oAe=["aria-label"],sAe=["aria-selected","aria-label","onClick"],rAe={class:"qstep-num"},iAe={key:1,class:"qheader-chip"},lAe={class:"qtext"},aAe={class:"qopts"},cAe=["onClick"],uAe={class:"qopt-key"},dAe={class:"qopt-glyph"},fAe={key:0,class:"chk"},pAe={key:1,class:"rad"},hAe={class:"qopt-text"},mAe={class:"qopt-label"},gAe={key:0,class:"qopt-desc"},vAe={class:"qopt-glyph"},wAe={key:0,class:"chk"},yAe={key:1,class:"rad"},kAe={class:"qopt-label"},bAe=["placeholder"],_Ae={class:"qfoot"},xAe=Ge({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Lt(),s=t,r=U(0),i=U(!1),l=B(()=>n.question.questions[r.value]),a=B(()=>n.question.questions.length);function c(){r.value>0&&r.value--}function u(){r.value=0&&A0:F.kind==="multiWithOther"?F.optionIds.length>0||F.otherText.trim().length>0:F.kind==="other"?F.text.trim().length>0:!0:!1}function p(){return f(l.value.id)}const h=U({});function m(A){return A.recommended===!0?!0:/\b(?:recommended|recommend)\b/.test(`${A.label} ${A.description??""}`.toLowerCase())}function k(){const A={...h.value};let F=!1;for(const j of n.question.questions){if(A[j.id])continue;const q=j.options.filter(m);q.length!==0&&(A[j.id]=j.multiSelect?{kind:"multi",optionIds:q.map(P=>P.id)}:{kind:"single",optionId:q[0].id},F=!0)}F&&(h.value=A)}Ue(()=>n.question.questionId,()=>{r.value=0,i.value=!1,h.value={},v.value={}}),Ue(()=>n.question,()=>{r.value>=n.question.questions.length&&(r.value=0),k()},{immediate:!0,deep:!0});function x(A,F){const j=h.value[A];if(j&&j.kind==="single"&&j.optionId===F){const q={...h.value};delete q[A],h.value=q}else h.value={...h.value,[A]:{kind:"single",optionId:F}}}function w(A,F){const j=h.value[A],q=j&&(j.kind==="multi"||j.kind==="multiWithOther")?j.kind==="multi"?[...j.optionIds]:[...j.optionIds]:[],P=q.indexOf(F);P>=0?q.splice(P,1):q.push(F);const W=h.value[A],G=W&&W.kind==="multiWithOther"?W.otherText:"";G?h.value={...h.value,[A]:{kind:"multiWithOther",optionIds:q,otherText:G}}:h.value={...h.value,[A]:{kind:"multi",optionIds:q}}}const v=U({}),b=U(null);function M(A){const F=n.question.questions.find(q=>q.id===A),j=v.value[A]??"";if(F.multiSelect){const q=h.value[A],P=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[];h.value={...h.value,[A]:{kind:"multiWithOther",optionIds:P,otherText:j}}}else h.value={...h.value,[A]:{kind:"other",text:j}}}function R(A){M(A),vt(()=>b.value?.focus())}function z(A,F){const j=h.value[A];return j?j.kind==="single"?j.optionId===F:j.kind==="multi"||j.kind==="multiWithOther"?j.optionIds.includes(F):!1:!1}function $(A){const F=h.value[A];return!!(F&&(F.kind==="other"||F.kind==="multiWithOther"))}function T(){return n.question.questions.every(A=>f(A.id))}const E=B(()=>n.busyKind==="answer"),N=B(()=>n.busyKind==="dismiss"),C=B(()=>!!n.busyKind);function O(){if(C.value||!T())return;const A={answers:h.value,method:"click"};s("answer",n.question.questionId,A)}function H(){C.value||s("dismiss",n.question.questionId)}function V(A){const F=(document.activeElement?.tagName??"").toLowerCase(),j=F==="input"||F==="textarea";if(C.value)return;if(A.key==="Enter"){if(A.preventDefault(),i.value)return;r.value=1&&q<=9){A.preventDefault();const P=l.value,W=q-1,G=P.options[W];G&&(P.multiSelect?w(P.id,G.id):x(P.id,G.id))}}return xn(()=>document.addEventListener("keydown",V)),An(()=>document.removeEventListener("keydown",V)),(A,F)=>(g(),ce(Gv,{class:Be(["qcard",{minimized:i.value}])},dd({head:ue(()=>[_("div",JMe,[F[5]||(F[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",QMe,I(y(o)("question.title")),1),a.value>1&&!i.value?(g(),S("span",eAe,I(y(o)("question.step",{current:r.value+1,total:a.value})),1)):J("",!0),i.value?(g(),S("span",tAe,I(l.value.question),1)):J("",!0),Z(Zt,{class:"qmin",size:"sm",label:i.value?y(o)("question.expand"):y(o)("question.minimize"),onClick:F[0]||(F[0]=j=>i.value=!i.value)},{default:ue(()=>[i.value?(g(),ce(Le,{key:0,name:"chevron-up",size:"md"})):(g(),ce(Le,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[i.value?void 0:{name:"default",fn:ue(()=>[_("div",nAe,[a.value>1?(g(),S("div",{key:0,class:"qsteps",role:"tablist","aria-label":y(o)("question.step",{current:r.value+1,total:a.value})},[(g(!0),S(Me,null,rt(n.question.questions,(j,q)=>(g(),S("button",{key:j.id,type:"button",class:Be(["qstep-dot",{active:q===r.value,answered:f(j.id)}]),"aria-selected":q===r.value,"aria-label":y(o)("question.step",{current:q+1,total:a.value}),onClick:P=>d(q)},[_("span",rAe,I(q+1),1)],10,sAe))),128))],8,oAe)):J("",!0),l.value.header?(g(),S("div",iAe,[Z(wi,{variant:"neutral",size:"sm"},{default:ue(()=>[He(I(l.value.header),1)]),_:1})])):J("",!0),_("div",lAe,I(l.value.question),1),l.value.body?(g(),ce(sa,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):J("",!0),_("div",aAe,[(g(!0),S(Me,null,rt(l.value.options,(j,q)=>(g(),S("label",{key:j.id,class:Be(["qopt",{selected:z(l.value.id,j.id)}]),onClick:xt(P=>l.value.multiSelect?w(l.value.id,j.id):x(l.value.id,j.id),["prevent"])},[_("span",uAe,I(q+1),1),_("span",dAe,[l.value.multiSelect?(g(),S("span",fAe,I(z(l.value.id,j.id)?"■":"□"),1)):(g(),S("span",pAe,I(z(l.value.id,j.id)?"●":"○"),1))]),_("span",hAe,[_("span",mAe,I(j.label),1),j.description?(g(),S("span",gAe,I(j.description),1)):J("",!0)])],10,cAe))),128)),l.value.allowOther?(g(),S("label",{key:0,class:Be(["qopt",{selected:$(l.value.id)}]),onClick:F[4]||(F[4]=xt(j=>R(l.value.id),["prevent"]))},[F[6]||(F[6]=_("span",{class:"qopt-key"},null,-1)),_("span",vAe,[l.value.multiSelect?(g(),S("span",wAe,I($(l.value.id)?"■":"□"),1)):(g(),S("span",yAe,I($(l.value.id)?"●":"○"),1))]),_("span",kAe,I(l.value.otherLabel??y(o)("question.otherDefault")),1),Zn(_("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":F[1]||(F[1]=j=>v.value[l.value.id]=j),class:"other-input",type:"text",placeholder:l.value.otherLabel??y(o)("question.otherDefault"),onInput:F[2]||(F[2]=j=>M(l.value.id)),onFocus:F[3]||(F[3]=j=>M(l.value.id))},null,40,bAe),[[Fs,v.value[l.value.id]]])],2)):J("",!0)])])]),key:"0"},i.value?void 0:{name:"foot",fn:ue(()=>[_("div",_Ae,[r.value[He(I(y(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(g(),ce(It,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!T(),loading:E.value,onClick:O},{default:ue(()=>[He(I(y(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(g(),ce(It,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:r.value===0||C.value,onClick:c},{default:ue(()=>[He(I(y(o)("question.back")),1)]),_:1},8,["disabled"])):J("",!0),Z(It,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:N.value,disabled:C.value,onClick:H},{default:ue(()=>[He(I(y(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),SAe=mt(xAe,[["__scopeId","data-v-29d475ec"]]),CAe=Ge({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(g(),S("span",{class:Be(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},I(n[t.status]),3))}}),K5=mt(CAe,[["__scopeId","data-v-f870866a"]]),MAe={key:0,class:"sg-empty"},AAe={key:1,class:"sg-grid"},TAe=["aria-label","onClick"],EAe={class:"sg-top"},IAe={class:"sg-num"},LAe={class:"sg-name"},$Ae={key:1,class:"sg-desc"},NAe={class:"sg-foot"},zAe={key:0,class:"sg-model"},BAe={class:"sg-status"},RAe={class:"sg-state"},FAe={key:0,class:"sg-time"},jAe=Ge({__name:"SubagentGrid",props:{tasks:{},filter:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Lt();function s(f){return f}function r(f){return f==="running"?"tasks.emptyRunning":f==="done"?"tasks.emptyDone":f==="active"?"tasks.emptyRecent":"tasks.emptyTasks"}const i=pn("modelDisplay"),l=pn("subagentEffort");function a(f){const{model:p,thinkingEffort:h}=f;return[i?.(p)??p,l?.(h)].filter(Boolean).join(" · ")||void 0}function c(f){const p=f.state;return o(p==="done"?"tasks.stateDone":p==="fail"?"tasks.stateFail":p==="cancelled"?"tasks.stateCancelled":"tasks.running")}function u(f,p){return String(f.dynamicWorkflowIndex??p+1).padStart(2,"0")}function d(f){return!!(f.agentId||f.output?.length)}return(f,p)=>e.tasks.length===0?(g(),S("div",MAe,I(y(o)(r(e.filter))),1)):(g(),S("div",AAe,[(g(!0),S(Me,null,rt(e.tasks,(h,m)=>(g(),S("article",{key:h.id,class:Be(["sg-card",[`s-${h.state}`,{openable:d(h)}]])},[d(h)?(g(),S("button",{key:0,class:"sg-open",type:"button","aria-label":h.name,onClick:k=>n("open",h.agentId??h.id)},null,8,TAe)):J("",!0),_("div",EAe,[_("span",IAe,I(u(h,m)),1),_("span",LAe,I(h.name),1)]),h.meta?(g(),S("div",$Ae,I(h.meta),1)):J("",!0),_("div",NAe,[a(h)?(g(),S("div",zAe,[_("span",null,I(a(h)),1)])):J("",!0),_("div",BAe,[_("span",RAe,[h.state==="run"?(g(),ce(K5,{key:0,status:"run"})):h.state==="done"?(g(),ce(Le,{key:1,class:"sg-ic-done",name:"check",size:"sm"})):(g(),ce(Le,{key:2,name:"close",size:"sm"})),He(" "+I(c(h)),1)]),h.timing?(g(),S("span",FAe,[Z(Le,{name:"clock",size:"sm"}),He(" "+I(h.timing),1)])):J("",!0)])]),h.state==="run"?(g(),ce(Zt,{key:2,class:"sg-cancel",size:"sm",label:y(o)("tasks.stop"),onClick:xt(k=>n("cancel",h.id),["stop"])},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label","onClick"])):J("",!0)],2))),128))]))}}),OAe=mt(jAe,[["__scopeId","data-v-5945b343"]]),PAe={class:"taskspane"},HAe={class:"tp-list"},DAe={key:0,class:"tp-empty"},VAe={class:"tp-main"},WAe=["aria-label","onClick"],qAe=["aria-label"],UAe={class:"tp-name"},ZAe={key:1,class:"tp-meta"},KAe={key:2,class:"tp-model"},GAe={key:3,class:"tp-model"},YAe={key:4,class:"tp-time"},XAe=Ge({__name:"TasksPane",props:{tasks:{},filter:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Lt();function s(p){return p}function r(p){return p==="running"?"tasks.emptyRunning":p==="done"?"tasks.emptyDone":p==="active"?"tasks.emptyRecent":"tasks.emptyTasks"}function i(p){return p.kind==="subagent"||!!(p.output?.length||p.meta)}function l(p){i(p)&&n("open",p.agentId??p.id)}function a(p){const h=p.state;return o(h==="done"?"tasks.stateDone":h==="fail"?"tasks.stateFail":h==="cancelled"?"tasks.stateCancelled":"tasks.running")}const c=pn("modelDisplay"),u=pn("subagentEffort");function d(p){if(p.kind!=="subagent")return;const h=p.model;return c?.(h)??h}function f(p){if(p.kind==="subagent")return u?.(p.thinkingEffort)}return(p,h)=>(g(),S("div",PAe,[_("div",HAe,[e.tasks.length===0?(g(),S("div",DAe,I(y(o)(r(e.filter))),1)):(g(!0),S(Me,{key:1},rt(e.tasks,m=>(g(),S("div",{key:m.id,class:Be(["tp-row",{fail:m.state==="fail",expandable:i(m)}])},[_("div",VAe,[i(m)?(g(),S("button",{key:0,class:"tp-open",type:"button","aria-label":m.name,onClick:k=>l(m)},null,8,WAe)):J("",!0),_("span",{class:"tp-glyph",role:"img","aria-label":a(m)},[m.state==="run"?(g(),ce(K5,{key:0,status:"run"})):m.state==="done"?(g(),ce(Le,{key:1,class:"tp-done",name:"check",size:"sm"})):m.state==="cancelled"?(g(),ce(Le,{key:2,class:"tp-cancelled",name:"close",size:"sm"})):(g(),ce(Le,{key:3,class:"tp-fail",name:"close",size:"sm"}))],8,qAe),_("span",UAe,I(m.name),1),m.meta?(g(),S("span",ZAe,I(m.meta),1)):J("",!0),d(m)?(g(),S("span",KAe,I(d(m)),1)):J("",!0),f(m)?(g(),S("span",GAe,I(f(m)),1)):J("",!0),m.timing?(g(),S("span",YAe,I(m.timing),1)):J("",!0),m.state==="run"?(g(),ce(Zt,{key:5,class:"tp-stop",size:"sm",label:y(o)("tasks.stop"),onClick:xt(k=>n("cancel",m.id),["stop"])},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label","onClick"])):J("",!0),i(m)?(g(),ce(Le,{key:6,class:"tp-chevron",name:"chevron-right",size:"sm"})):J("",!0)])],2))),128))])]))}}),JAe=mt(XAe,[["__scopeId","data-v-f4589f0b"]]),QAe={class:"todo-card"},eTe={key:0,class:"tc-empty"},tTe={class:"tc-name"},nTe=Ge({__name:"TodoCard",props:{todos:{}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",QAe,[e.todos.length===0?(g(),S("div",eTe,[Z(Le,{class:"tc-empty-ico",name:"list",size:"lg"}),_("span",null,I(y(t)("tasks.emptyTodo")),1)])):(g(!0),S(Me,{key:1},rt(e.todos,(s,r)=>(g(),S("div",{key:r,class:Be(["tc-row",`s-${s.status}`])},[_("span",{class:Be(["tc-glyph",`g-${s.status}`])},[s.status==="done"?(g(),ce(Le,{key:0,name:"check",size:"md"})):s.status==="in_progress"?(g(),ce(Go,{key:1,class:"tc-spin",size:"sm"})):J("",!0)],2),_("span",tTe,I(s.title),1)],2))),128))]))}}),oTe=mt(nTe,[["__scopeId","data-v-4e4d0054"]]),sTe=["disabled","aria-pressed"],rTe=Ge({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(g(),S("button",{key:0,class:Be(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[Tn(t.$slots,"default",{},void 0,!0)],10,sTe)):(g(),S("span",{key:1,class:Be(["ui-pill",{"is-active":e.active}])},[Tn(t.$slots,"default",{},void 0,!0)],2))}}),_z=mt(rTe,[["__scopeId","data-v-0fb1a50d"]]),iTe={class:"fc-label"},lTe=Ge({__name:"FilterControl",props:{modelValue:{},options:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>n.options.find(E=>E.value===n.modelValue)),r=typeof window<"u"&&window.matchMedia?.("(hover: none)").matches?"lg":"md",i=U(null),l=U(!1);let a=0,c=null;async function u(){const E=i.value?.closest(".dock-work-head");if(!E)return;const N=E.querySelector(".wp-head-tab"),C=getComputedStyle(E),O=(Number.parseFloat(C.columnGap)||0)*2,H=E.clientWidth-Number.parseFloat(C.paddingLeft)-Number.parseFloat(C.paddingRight)-O,V=N?.scrollWidth??0;if(!l.value){const F=i.value?.querySelector(".ui-seg");F&&F.offsetWidth>0&&(a=F.offsetWidth)}const A=V+a>H;if(l.value=A,!A){await vt();const F=i.value?.querySelector(".ui-seg");F&&F.offsetWidth>0&&(a=F.offsetWidth),l.value=V+a>H}}const d=U(!1),f=U(null),p=U(null),h=U({left:"0px",top:"0px"});function m(){return f.value?.$el??null}async function k(){if(d.value){x();return}d.value=!0,await vt(),w(),v(),window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",z,!0),window.addEventListener("resize",w),window.addEventListener("scroll",w,!0)}function x(E){d.value=!1,window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",z,!0),window.removeEventListener("resize",w),window.removeEventListener("scroll",w,!0),E?.refocus&&m()?.focus()}function w(){const E=m();if(!E)return;const N=E.getBoundingClientRect(),C=p.value?.offsetHeight??0,O=getComputedStyle(document.documentElement),H=Number.parseFloat(O.getPropertyValue("--space-2"))||0,V=Number.parseFloat(O.getPropertyValue("--space-1"))||0,A=p.value?.offsetWidth??0,F=Math.min(N.left,Math.max(H,window.innerWidth-A-H));N.bottom+V+C<=window.innerHeight-H?h.value={left:`${F}px`,top:`${N.bottom+V}px`}:h.value={left:`${F}px`,bottom:`${window.innerHeight-N.top+V}px`}}function v(){const E=p.value;if(!E)return;(E.querySelector(".ui-menu-item.is-active")??E.querySelector(".ui-menu-item"))?.focus()}function b(){d.value||k()}function M(E){const N=E.relatedTarget;N&&(p.value?.contains(N)||m()?.contains(N))||x()}function R(E){const N=E.target;if(N){if(p.value?.contains(N)){E.stopImmediatePropagation();return}m()?.contains(N)||x()}}function z(E){E.key==="Escape"&&(E.preventDefault(),E.stopImmediatePropagation(),x({refocus:!0}))}function $(E){if(E.key!=="ArrowDown"&&E.key!=="ArrowUp")return;E.preventDefault();const N=Array.from(p.value?.querySelectorAll(".ui-menu-item")??[]);if(N.length===0)return;const C=N.indexOf(document.activeElement),O=E.key==="ArrowDown"?(C+1)%N.length:(C-1+N.length)%N.length;N[O]?.focus()}function T(E){o("update:modelValue",E),x({refocus:!0})}return xn(()=>{const E=i.value?.closest(".dock-work-head");!E||typeof ResizeObserver!="function"||(c=new ResizeObserver(()=>void u()),c.observe(E),u())}),Ue(l,E=>{!E&&d.value&&x()}),Ue(()=>n.options,async()=>{a=0,await vt(),await u()},{flush:"post"}),vo(()=>{c?.disconnect(),d.value&&x()}),(E,N)=>(g(),S("span",{ref_key:"root",ref:i,class:"filter-control"},[l.value?(g(),S(Me,{key:0},[Z(_z,{ref_key:"triggerRef",ref:f,class:"fc-trigger","aria-haspopup":"menu","aria-expanded":d.value,onClick:k,onKeydown:[Eo(xt(b,["prevent"]),["down"]),Eo(xt(b,["prevent"]),["up"])],onFocusout:M},{default:ue(()=>[s.value?.icon?(g(),ce(Le,{key:0,name:s.value.icon,size:"sm"},null,8,["name"])):J("",!0),_("span",null,I(s.value?.label),1),Z(Le,{class:"fc-chevron",name:"chevron-down",size:"sm"})]),_:1},8,["aria-expanded","onKeydown"]),(g(),ce(Gi,{to:"body"},[d.value?(g(),S("div",{key:0,ref_key:"menuBoxRef",ref:p,class:"fc-menu",style:Wt(h.value),onKeydown:$,onFocusout:M},[Z(qi,null,{default:ue(()=>[(g(!0),S(Me,null,rt(e.options,C=>(g(),ce(yn,{key:C.value,role:"menuitemradio",active:C.value===e.modelValue,"aria-checked":C.value===e.modelValue,size:y(r),onClick:O=>T(C.value)},{default:ue(()=>[C.icon?(g(),ce(Le,{key:0,name:C.icon,size:"sm","data-icon":C.icon},null,8,["name","data-icon"])):J("",!0),_("span",iTe,I(C.label),1),C.value===e.modelValue?(g(),ce(Le,{key:1,class:"fc-check",name:"check",size:"sm"})):J("",!0)]),_:2},1032,["active","aria-checked","size","onClick"]))),128))]),_:1})],36)):J("",!0)]))],64)):(g(),ce(nr,{key:1,"model-value":e.modelValue,options:e.options,size:"md","onUpdate:modelValue":N[0]||(N[0]=C=>o("update:modelValue",C))},null,8,["model-value","options"]))],512))}}),qC=mt(lTe,[["__scopeId","data-v-658870b5"]]),aTe={class:"wp-head-tab"},cTe={key:0,class:"wp-head-meta"},uTe={key:0,class:"wp-head-actions"},dTe=Ge({__name:"WorkPanelHead",props:{icon:{},title:{},meta:{}},setup(e){return(t,n)=>(g(),S(Me,null,[_("span",aTe,[Z(Le,{name:e.icon,size:"md"},null,8,["name"]),_("span",null,I(e.title),1),e.meta?(g(),S("span",cTe,I(e.meta),1)):J("",!0)]),t.$slots.actions?(g(),S("span",uTe,[Tn(t.$slots,"actions",{},void 0,!0)])):J("",!0)],64))}}),m2=mt(dTe,[["__scopeId","data-v-408c4b07"]]),g2=Ge({__name:"WorkPill",props:{icon:{},active:{type:Boolean},label:{}},emits:["click"],setup(e){return(t,n)=>(g(),ce(_z,{active:e.active,"aria-pressed":e.active,"aria-label":e.label,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},{default:ue(()=>[Z(Le,{name:e.icon,size:"md"},null,8,["name"]),_("span",null,[Tn(t.$slots,"default")]),Tn(t.$slots,"meta")]),_:3},8,["active","aria-pressed","aria-label"]))}}),fTe={class:"dock-work-head"},pTe={key:0,class:"dock-workbar"},hTe={class:"dw-running"},mTe={class:"dw-running"},gTe={class:"dw-count"},vTe=Ge({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},working:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},goalMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},sessionPlans:{},dockPanel:{},overlayOpen:{type:Boolean},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean},openFile:{type:Function},revealSavedPlan:{type:Function}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:r}=Lt(),{confirm:i,current:l}=y1(),a=U(null),c=U(null),u=U(null),d=U(null),f=U(!1),p=U(!1),h=U("50% 100%"),m=U("active"),k=U("active"),x=B(()=>Object.values(o.sessionPlans??{}).at(-1)),w=B(()=>a.value?.anyPopupOpen??!1),v=B(()=>[{value:"active",label:r("tasks.filterRecent"),icon:"clock"},{value:"running",label:r("tasks.filterRunning"),icon:"play"},{value:"done",label:r("tasks.filterDone"),icon:"circle-check"},{value:"all",label:r("tasks.filterAll"),icon:"list"}]),b=B(()=>(o.todos?.length??0)>0&&o.todoDoneCount===(o.todos?.length??0)),M=B(()=>o.goal?r(`status.goalStatus${o.goal.status[0].toUpperCase()}${o.goal.status.slice(1)}`):""),R=B(()=>{const W=Math.max(0,Math.round((o.goal?.wallClockMs??0)/1e3)),G=Math.floor(W/3600),ee=Math.floor(W%3600/60);return G?`${G}${r("status.timeUnitHour")} ${ee}${r("status.timeUnitMinute")}`:ee?`${ee}${r("status.timeUnitMinute")} ${W%60}${r("status.timeUnitSecond")}`:`${W}${r("status.timeUnitSecond")}`}),z=B(()=>o.bashTasks.some(W=>W.kind==="tool")?r("tasks.dockTasks"):r("tasks.dockBash"));function $(W,G){if(G==="all")return W;if(G==="running")return W.filter(oe=>oe.state==="run");if(G==="done")return W.filter(oe=>oe.state!=="run");const ee=W.filter(oe=>oe.state==="run"),se=W.filter(oe=>oe.state!=="run").toSorted((oe,Q)=>Date.parse(Q.completedAt??Q.createdAt??"")-Date.parse(oe.completedAt??oe.createdAt??"")).slice(0,5);return[...ee,...se]}const T=B(()=>$(o.bashTasks,m.value)),E=B(()=>$(o.subagentTasks,k.value));function N(W,G){const ee=G.currentTarget,se=c.value;if(ee&&se){const oe=ee.getBoundingClientRect(),Q=se.getBoundingClientRect();h.value=`${oe.left+oe.width/2-Q.left}px 100%`}s("toggle-dock-panel",W)}function C(){p.value=(d.value?.scrollTop??0)>0}function O(W){if(!o.dockPanel)return;const G=W.target;!G||u.value?.contains(G)||G.closest(".ui-pill")||s("close-dock-panel")}function H(W){o.dockPanel&&(W.key!=="Escape"||W.repeat||W.isComposing||W.defaultPrevented||w.value||l.value||o.overlayOpen||(W.preventDefault(),W.stopImmediatePropagation(),s("close-dock-panel")))}async function V(){await i({title:r("status.goalCancel"),message:r("status.goalCancelConfirm"),confirmLabel:r("status.goalCancelConfirmYes"),cancelLabel:r("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}function A(){const W=c.value;if(!W)return;document.documentElement.style.setProperty("--dock-h",`${W.offsetHeight}px`);const G=Number.parseFloat(getComputedStyle(W).getPropertyValue("--p-bp-sm"))||640;f.value=W.offsetWidth{document.addEventListener("mousedown",O,!0),document.addEventListener("keydown",H,!0),typeof ResizeObserver=="function"&&c.value&&(F=new ResizeObserver(()=>{A(),C()}),F.observe(c.value),A())}),An(()=>{document.removeEventListener("mousedown",O,!0),document.removeEventListener("keydown",H,!0),F?.disconnect()}),Ue(()=>o.dockPanel,()=>{p.value=!1,vt(C)});function j(W){return a.value?.loadForEdit(W)??!1}function q(W){a.value?.loadAttachmentsForEdit(W)}function P(){a.value?.focus()}return t({loadForEdit:j,loadAttachmentsForEdit:q,focus:P,anyPopupOpen:w,isEmpty:B(()=>a.value?.isEmpty??!0)}),(W,G)=>(g(),S("div",{ref_key:"dockRef",ref:c,class:Be(["chat-dock",[e.mobile?"align-mobile":"align-center",{"has-popup":w.value||e.dockPanel,"has-approval":!!e.pendingApproval&&!e.pendingQuestion,"pills-compact":f.value}]]),onClick:G[36]||(G[36]=xt(()=>{},["stop"]))},[Z(gi,{name:"dock-panel"},{default:ue(()=>[e.dockPanel?(g(),S("div",{key:e.dockPanel,ref_key:"workPanelRef",ref:u,class:Be(["dock-work-panel",[`panel-${e.dockPanel}`,{"body-scrolled-up":p.value}]]),style:Wt({transformOrigin:h.value})},[_("div",fTe,[e.dockPanel==="bash"?(g(),ce(m2,{key:0,icon:"terminal",title:z.value,meta:`${e.bashRunning} ${y(r)("tasks.running")}`},{actions:ue(()=>[Z(qC,{modelValue:m.value,"onUpdate:modelValue":G[0]||(G[0]=ee=>m.value=ee),options:v.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="subagent"?(g(),ce(m2,{key:1,icon:"sparkles",title:y(r)("tasks.dockSubagent"),meta:`${e.subagentRunning} ${y(r)("tasks.running")}`},{actions:ue(()=>[Z(qC,{modelValue:k.value,"onUpdate:modelValue":G[1]||(G[1]=ee=>k.value=ee),options:v.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="todos"?(g(),ce(m2,{key:2,icon:b.value?"check-list":"list",title:y(r)("tasks.todoProgressTitle"),meta:`${e.todoDoneCount}/${e.todos?.length??0}`},null,8,["icon","title","meta"])):e.dockPanel==="goal"?(g(),ce(m2,{key:3,icon:"target",title:y(r)("status.goalLabel"),meta:R.value},{actions:ue(()=>[e.goal?.status==="active"?(g(),ce(Zt,{key:0,size:"sm",label:y(r)("status.goalPause"),onClick:G[2]||(G[2]=ee=>s("controlGoal","pause"))},{default:ue(()=>[Z(Le,{name:"pause",size:"sm"})]),_:1},8,["label"])):J("",!0),e.goal?.status==="paused"||e.goal?.status==="blocked"?(g(),ce(Zt,{key:1,size:"sm",label:y(r)("status.goalResume"),onClick:G[3]||(G[3]=ee=>s("controlGoal","resume"))},{default:ue(()=>[Z(Le,{name:"play",size:"sm"})]),_:1},8,["label"])):J("",!0),Z(Zt,{size:"sm",label:y(r)("status.goalCancel"),onClick:V},{default:ue(()=>[Z(Le,{name:"power",size:"sm"})]),_:1},8,["label"]),Z(Zt,{size:"sm",label:y(r)("tasks.closePanel"),onClick:G[4]||(G[4]=ee=>s("close-dock-panel"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])]),_:1},8,["title","meta"])):(g(),ce(m2,{key:4,icon:"file-edit",title:y(r)("status.planLabel"),meta:x.value?.reviewState?y(r)(`tools.plan.review.${x.value.reviewState}`):""},{actions:ue(()=>[x.value?.path?(g(),ce(Zt,{key:0,size:"sm",label:y(r)("tools.plan.revealInFileManager"),onClick:G[5]||(G[5]=ee=>void e.revealSavedPlan?.(x.value.agentId,x.value.toolCallId))},{default:ue(()=>[Z(Le,{name:"external-link",size:"sm"})]),_:1},8,["label"])):J("",!0),e.planArmed||e.planMode?(g(),ce(Zt,{key:1,size:"sm",label:y(r)("status.workModeDismiss"),onClick:G[6]||(G[6]=ee=>s("togglePlan"))},{default:ue(()=>[Z(Le,{name:"power",size:"sm"})]),_:1},8,["label"])):J("",!0),Z(Zt,{size:"sm",label:y(r)("tasks.closePanel"),onClick:G[7]||(G[7]=ee=>s("close-dock-panel"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])]),_:1},8,["title","meta"]))]),_("div",{ref_key:"workBodyRef",ref:d,class:"dock-work-body",onScroll:C},[e.dockPanel==="bash"?(g(),ce(JAe,{key:0,tasks:T.value,filter:m.value,onCancel:G[8]||(G[8]=ee=>s("cancelTask",ee)),onOpen:G[9]||(G[9]=ee=>s("openAgent",ee))},null,8,["tasks","filter"])):e.dockPanel==="subagent"?(g(),ce(OAe,{key:1,tasks:E.value,filter:k.value,onCancel:G[10]||(G[10]=ee=>s("cancelTask",ee)),onOpen:G[11]||(G[11]=ee=>s("openAgent",ee))},null,8,["tasks","filter"])):e.dockPanel==="todos"?(g(),ce(oTe,{key:2,todos:e.todos??[]},null,8,["todos"])):e.dockPanel==="goal"&&e.goal?(g(),ce(PMe,{key:3,goal:e.goal,"open-file":e.openFile},null,8,["goal","open-file"])):(g(),ce(XMe,{key:4,plan:x.value,"plan-mode-on":e.planMode,"open-file":e.openFile,"reveal-saved-plan":e.revealSavedPlan},null,8,["plan","plan-mode-on","open-file","reveal-saved-plan"]))],544)],6)):J("",!0)]),_:1}),e.hasDockWork||e.planMode||x.value?(g(),S("div",pTe,[e.goal?(g(),ce(g2,{key:0,icon:"target",active:e.dockPanel==="goal",label:`${y(r)("status.goalLabel")} ${M.value}`,onClick:G[12]||(G[12]=ee=>N("goal",ee))},{meta:ue(()=>[_("span",{class:Be(["dw-goal-status",`dw-goal-status--${e.goal.status}`])},I(M.value),3)]),default:ue(()=>[He(I(y(r)("status.goalLabel"))+" ",1)]),_:1},8,["active","label"])):J("",!0),e.planMode||x.value?(g(),ce(g2,{key:1,icon:"file-edit",active:e.dockPanel==="plan",label:y(r)("status.planLabel"),onClick:G[13]||(G[13]=ee=>N("plan",ee))},{default:ue(()=>[He(I(y(r)("status.planLabel")),1)]),_:1},8,["active","label"])):J("",!0),e.bashTasks.length?(g(),ce(g2,{key:2,icon:"terminal",active:e.dockPanel==="bash",label:z.value,onClick:G[14]||(G[14]=ee=>N("bash",ee))},dd({default:ue(()=>[He(I(z.value)+" ",1)]),_:2},[e.bashRunning?{name:"meta",fn:ue(()=>[_("span",hTe,[Z(K5,{status:"run"}),He(I(e.bashRunning),1)])]),key:"0"}:void 0]),1032,["active","label"])):J("",!0),e.subagentTasks.length?(g(),ce(g2,{key:3,icon:"sparkles",active:e.dockPanel==="subagent",label:y(r)("tasks.dockSubagent"),onClick:G[15]||(G[15]=ee=>N("subagent",ee))},dd({default:ue(()=>[He(I(y(r)("tasks.dockSubagent"))+" ",1)]),_:2},[e.subagentRunning?{name:"meta",fn:ue(()=>[_("span",mTe,[Z(K5,{status:"run"}),He(I(e.subagentRunning),1)])]),key:"0"}:void 0]),1032,["active","label"])):J("",!0),e.todos?.length?(g(),ce(g2,{key:4,icon:b.value?"check-list":"list",active:e.dockPanel==="todos",label:y(r)("tasks.todoProgressTitle"),onClick:G[16]||(G[16]=ee=>N("todos",ee))},{meta:ue(()=>[_("span",gTe,I(e.todoDoneCount)+"/"+I(e.todos?.length),1)]),default:ue(()=>[He(I(y(r)("tasks.todoProgressTitle"))+" ",1)]),_:1},8,["icon","active","label"])):J("",!0)])):J("",!0),e.pendingQuestion?(g(),ce(SAe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:G[17]||(G[17]=(ee,se)=>s("answer",ee,se)),onDismiss:G[18]||(G[18]=ee=>s("dismiss",ee))},null,8,["question","busy-kind"])):e.pendingApproval?(g(),ce(BMe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:G[19]||(G[19]=ee=>s("approval",e.pendingApproval.approvalId,ee))},null,8,["block","agent-name","busy"])):(g(),ce(bz,{key:3,ref_key:"composerRef",ref:a,"session-id":e.sessionId,running:e.running,working:e.working,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"goal-mode":e.goalMode,"workflow-active":e.dynamicWorkflowMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:G[20]||(G[20]=ee=>s("submit",ee)),onSteer:G[21]||(G[21]=ee=>s("steer",ee)),onCommand:G[22]||(G[22]=ee=>s("command",ee)),onInterrupt:G[23]||(G[23]=ee=>s("interrupt")),onSetPermission:G[24]||(G[24]=ee=>s("setPermission",ee)),onSetThinking:G[25]||(G[25]=ee=>s("setThinking",ee)),onTogglePlan:G[26]||(G[26]=ee=>s("togglePlan")),onToggleWorkflow:G[27]||(G[27]=ee=>s("toggleWorkflow")),onToggleGoal:G[28]||(G[28]=ee=>s("toggleGoal")),onOpenBtw:G[29]||(G[29]=ee=>s("openBtw")),onCreateGoal:G[30]||(G[30]=ee=>s("createGoal",ee)),onControlGoal:G[31]||(G[31]=ee=>s("controlGoal",ee)),onFocusGoal:G[32]||(G[32]=ee=>s("focusGoal")),onCompact:G[33]||(G[33]=ee=>s("compact")),onPickModel:G[34]||(G[34]=ee=>s("pickModel")),onSelectModel:G[35]||(G[35]=ee=>s("selectModel",ee))},null,8,["session-id","running","working","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","goal-mode","workflow-active","goal","activation-badges","models","starred-ids","skills"]))],2))}}),wTe=mt(vTe,[["__scopeId","data-v-72059270"]]),yTe=["aria-label","aria-hidden"],kTe=["data-turn-id","tabindex","aria-current","aria-label","onMouseenter","onFocus","onKeydown","onClick"],bTe=["aria-label"],_Te={class:"toc-preview__prompt"},xTe={key:0,class:"toc-preview__response"},STe=80,CTe=Ge({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=U(null),i=U(null),l=U(null),a=U(!0);let c=null;function u(){const E=r.value,N=E?.offsetParent;if(!E||!N)return;const C=E.getBoundingClientRect(),O=N.getBoundingClientRect();a.value=C.left>=O.left&&C.right<=O.right}const d=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),f=B(()=>i.value!==null&&n.items.some(E=>E.id===i.value)?i.value:n.activeTurnId!==null&&n.items.some(E=>E.id===n.activeTurnId)?n.activeTurnId:n.items[0]?.id??null),p=B(()=>l.value??i.value??n.activeTurnId),h=B(()=>{const E=l.value??i.value;return E===null?void 0:n.items.find(N=>N.id===E)}),m=U(0);let k=null;function x(){k!==null&&clearTimeout(k),k=null}function w(){x(),k=setTimeout(()=>{l.value=null,k=null},STe)}function v(){return r.value===null?[]:Array.from(r.value.querySelectorAll(".toc-row"))}function b(E,N){let C=E;if(N.key==="ArrowDown")C=Math.min(n.items.length-1,E+1);else if(N.key==="ArrowUp")C=Math.max(0,E-1);else if(N.key==="Home")C=0;else if(N.key==="End")C=n.items.length-1;else return;N.preventDefault(),v()[C]?.focus()}function M(E){const N=E??v().find(O=>O.dataset.turnId===h.value?.id),C=N?.parentElement;!N||!C||(m.value=N.offsetTop-C.scrollTop+N.offsetHeight/2)}function R(E,N){x(),l.value=E,M(N.currentTarget)}function z(E,N){x(),i.value=E,M(N.currentTarget)}function $(E){x();const N=document.activeElement;N instanceof HTMLElement&&r.value?.contains(N)&&N.blur(),l.value=null,i.value=null,o("select",E)}function T(E){const N=E.relatedTarget;(!(N instanceof Node)||!r.value?.contains(N))&&(i.value=null)}return Ue(d,E=>{c?.disconnect(),c=null,E&&vt(()=>{const N=r.value,C=N?.offsetParent;!N||!C||(typeof ResizeObserver<"u"&&(c=new ResizeObserver(u),c.observe(C)),u())})},{immediate:!0}),Ue([()=>n.activeTurnId,d],([E,N])=>{!N||E===null||vt(()=>{const C=v().find(O=>O.dataset.turnId===E);typeof C?.scrollIntoView=="function"&&C.scrollIntoView({block:"nearest"})})},{immediate:!0}),vo(()=>{x(),c?.disconnect(),c=null}),(E,N)=>d.value?(g(),S("nav",{key:0,ref_key:"navRef",ref:r,class:Be(["conversation-toc",{"toc-clipped":!a.value||e.occluded}]),"aria-label":y(s)("conversation.toc"),"aria-hidden":a.value&&!e.occluded?void 0:!0,onMouseenter:x,onMouseleave:w,onFocusout:T},[_("div",{class:"toc-scroll",onScroll:N[0]||(N[0]=C=>M())},[(g(!0),S(Me,null,rt(e.items,(C,O)=>(g(),S("button",{key:C.id,type:"button",class:Be(["toc-row",{active:e.activeTurnId===C.id,highlighted:p.value===C.id,previewing:l.value===C.id||i.value===C.id}]),"data-turn-id":C.id,tabindex:f.value===C.id?0:-1,"aria-current":e.activeTurnId===C.id?"location":void 0,"aria-label":C.title,onMouseenter:H=>R(C.id,H),onFocus:H=>z(C.id,H),onKeydown:H=>b(O,H),onClick:H=>$(C.id)},[...N[2]||(N[2]=[_("span",{class:"toc-marker","aria-hidden":"true"},null,-1)])],42,kTe))),128))],32),h.value?(g(),S("button",{key:0,type:"button",class:"toc-preview",style:Wt({top:`${m.value}px`}),"aria-label":h.value.title,tabindex:"-1",onMouseenter:x,onClick:N[1]||(N[1]=C=>$(h.value.id))},[_("span",_Te,I(h.value.title),1),h.value.preview?(g(),S("span",xTe,I(h.value.preview),1)):J("",!0)],44,bTe)):J("",!0)],42,yTe)):J("",!0)}}),MTe=mt(CTe,[["__scopeId","data-v-8a1c40d2"]]),UC="script, style, noscript, template, [inert], .top-sentinel",xz="pythinker-transcript-search",P7="pythinker-transcript-search-current",ATe=1e3;function TTe(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function ETe(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(i,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let o="";const s=[];let r=!1;for(let i=0;iZC(c.text)),o=[];let s="";for(let c=0;c0&&e[c].gapBefore&&(s+="\0"),o[c]=s.length,s+=n[c].folded;const r=LTe(ZC(t).folded);if(r===null)return;const i=new RegExp(r,"g");function l(c){let u=0,d=o.length-1,f=0;for(;u<=d;){const p=u+d>>1;o[p]<=c?(f=p,u=p+1):d=p-1}return f}let a;for(;;){const c=i.exec(s);if(c===null)return;const u=c.index,d=u+c[0].length-1,f=l(u),p=l(d),h=n[f].map[u-o[f]],m=n[p].map[d-o[p]],k={startSegment:f,startOffset:h.start,endSegment:p,endOffset:m.start+m.length};(a?.startSegment!==k.startSegment||a.startOffset!==k.startOffset||a.endSegment!==k.endSegment||a.endOffset!==k.endOffset)&&(a=k,yield k)}}const NTe=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BR","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"]),zTe=new Set(["inline","inline-block","inline-flex","inline-grid","inline-table","contents","ruby"]);function BTe(e,t){const n=t.get(e);if(n!==void 0)return n;const o=NTe.has(e.tagName)||!zTe.has(getComputedStyle(e).display);return t.set(e,o),o}function RTe(e,t,n){let o=e.parentElement;for(;o!==null&&o!==t&&!BTe(o,n);)o=o.parentElement;return o??t}function FTe(e){const t=e.ownerDocument,n=t.defaultView?.NodeFilter??NodeFilter,o=t.createTreeWalker(e,n.SHOW_ELEMENT|n.SHOW_TEXT,{acceptNode(a){if(a.nodeType!==Node.ELEMENT_NODE)return n.FILTER_ACCEPT;const c=a;return c.matches(UC)?n.FILTER_REJECT:c.matches("br, hr, wbr")&&!c.closest(UC)?n.FILTER_ACCEPT:n.FILTER_SKIP}}),s=new WeakMap,r=new WeakMap,i=[];let l=!1;for(let a=o.nextNode();a!==null;a=o.nextNode()){if(a.nodeType===Node.ELEMENT_NODE){l=!0;continue}const c=a.nodeValue??"";if(c.length===0)continue;const u=a.parentElement;if(u===null)continue;let d=r.get(u);d===void 0&&(d=TTe(getComputedStyle(u).whiteSpace),r.set(u,d));let{text:f,map:p}=ETe(c,d);if(f.length===0)continue;const h=RTe(a,e,s),m=i.at(-1),k=l||m===void 0||m.block!==h;!k&&m.text.endsWith(" ")&&f.startsWith(" ")&&(f=f.slice(1),p=p.slice(1),f.length===0)||(i.push({text:f,gapBefore:k,node:a,block:h,whitespaceMap:p}),l=!1)}return i}function jTe(e,t){if(t.length===0)return[];const n=FTe(e),o=[];for(const s of $Te(n,t)){const r=n[s.startSegment],i=n[s.endSegment],l=e.ownerDocument.createRange();l.setStart(r.node,r.whitespaceMap[s.startOffset]),l.setEnd(i.node,i.whitespaceMap[s.endOffset-1]+1),o.push(l)}return o}function OTe(e,t,n=o=>o.getClientRects().length!==0){const o=[];for(const s of jTe(e,t))if(n(s)){if(o.length>=ATe)return{ranges:o,truncated:!0};o.push(s)}return{ranges:o,truncated:!1}}function Sz(){return globalThis.CSS?.highlights??null}function KC(e,t){const n=Sz(),o=globalThis.Highlight;if(!n||!o)return;if(e.length===0){_4();return}const s=new o;for(const i of e)s.add(i);n.set(xz,s);const r=e[t];if(r){const i=new o;i.add(r),n.set(P7,i)}else n.delete(P7)}function _4(){const e=Sz();e?.delete(xz),e?.delete(P7)}const PTe={class:"tsearch-main"},HTe=["placeholder"],DTe=["inert"],VTe={class:"tsearch-foot"},WTe={class:"tsearch-count","aria-live":"polite"},qTe={class:"tsearch-rings"},UTe=Ge({__name:"TranscriptSearch",props:{pane:{},mobile:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=G3("input"),i=jo(""),l=jo(!1),a=jo([]),c=jo(0),u=jo(!1),d=jo(!1),f=jo([]),p=B(()=>a.value.length),h=B(()=>i.value.trim()!==""),m=B(()=>{if(l.value)return s("conversation.search.searching");if(!h.value)return"";if(p.value===0)return s("conversation.search.noResults");const j={current:c.value+1,total:p.value};return u.value?s("conversation.search.resultsCapped",j):s("conversation.search.results",j)});let k=null,x=null,w=null,v=null,b=null;function M(){return n.pane.querySelector(".chat")}function R(){const j=a.value[c.value];if(!j){f.value=[];return}const q=n.pane.getBoundingClientRect();f.value=Array.from(j.getClientRects(),P=>({top:`${P.top-q.top+n.pane.scrollTop}px`,left:`${P.left-q.left}px`,width:`${P.width}px`,height:`${P.height}px`}))}function z(){f.value.length!==0&&(w!==null&&clearTimeout(w),w=setTimeout(()=>{w=null,R()},120))}function $(j){const q=n.pane.getBoundingClientRect().top,P=j.findIndex(W=>{const G=W.getClientRects(),ee=G[G.length-1];return ee!==void 0&&ee.bottom>=q});return P===-1?0:P}function T(){const j=a.value[c.value];KC(a.value,c.value),(j?.startContainer instanceof Element?j.startContainer:j?.startContainer.parentElement)?.scrollIntoView({block:"center"}),R()}function E(j="first"){k!==null&&(clearTimeout(k),k=null),l.value=!1;const q=M(),P=i.value.trim();if(!q||P===""){a.value=[],u.value=!1,c.value=0,_4(),R();return}const W=a.value[c.value],G=W?.startContainer,ee=W?.startOffset,se=OTe(q,P);if(a.value=se.ranges,u.value=se.truncated,se.ranges.length===0){c.value=0,_4(),R();return}if(j!==!1){const Q=$(se.ranges);c.value=j==="backward"?(Q-1+se.ranges.length)%se.ranges.length:Q,T();return}const oe=se.ranges.findIndex(Q=>Q.startContainer===G&&Q.startOffset===ee);c.value=oe>=0?oe:$(se.ranges),KC(se.ranges,c.value),R()}function N(){if(k!==null&&clearTimeout(k),i.value.trim()===""){l.value=!1,E();return}l.value=!0,k=setTimeout(()=>E(),150)}function C(j){p.value!==0&&(c.value=(c.value+j+p.value)%p.value,T())}function O(j){if(!(j.key!=="Enter"||d.value||j.isComposing)){if(j.preventDefault(),k!==null){E(j.shiftKey?"backward":"first");return}C(j.shiftKey?-1:1)}}function H(j){j.key!=="Escape"||d.value||j.isComposing||(j.preventDefault(),j.stopPropagation(),o("close"))}function V(j){return j instanceof Element&&(j.classList.contains("tsearch-rings")||j.closest(".tsearch-rings")!==null)}function A(j){if(j.type==="attributes"&&j.target===n.pane||V(j.target))return!0;if(j.type!=="childList")return!1;const q=[...j.addedNodes,...j.removedNodes];return q.length>0&&q.every(V)}function F(j){i.value.trim()===""||j.every(A)||k!==null||(x!==null&&clearTimeout(x),x=setTimeout(()=>{x=null,k===null&&E(!1)},150))}return xn(()=>{if(vt(()=>r.value?.focus()),typeof MutationObserver=="function"&&(v=new MutationObserver(F),v.observe(n.pane,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["inert","style","class"]})),n.pane.addEventListener("scroll",z,{passive:!0}),window.addEventListener("resize",z,{passive:!0}),typeof ResizeObserver=="function"){b=new ResizeObserver(R),b.observe(n.pane);const j=n.pane.querySelector(".content-wrap");j&&b.observe(j)}}),An(()=>{k!==null&&clearTimeout(k),x!==null&&clearTimeout(x),w!==null&&clearTimeout(w),v?.disconnect(),b?.disconnect(),n.pane.removeEventListener("scroll",z),window.removeEventListener("resize",z),_4()}),(j,q)=>(g(),S("div",{class:Be(["tsearch",{mobile:e.mobile}]),role:"search",onKeydown:H},[_("div",PTe,[Z(Le,{class:"tsearch-icon",name:"search",size:"sm","aria-hidden":"true"}),Zn(_("input",{ref:"input","onUpdate:modelValue":q[0]||(q[0]=P=>i.value=P),type:"text",class:"tsearch-input",placeholder:y(s)("conversation.search.placeholder"),autocapitalize:"off",autocomplete:"off",spellcheck:"false",onInput:N,onKeydown:O,onCompositionstart:q[1]||(q[1]=P=>d.value=!0),onCompositionend:q[2]||(q[2]=P=>d.value=!1)},null,40,HTe),[[Fs,i.value]]),l.value?(g(),ce(Go,{key:0,class:"tsearch-spin",size:"sm",label:y(s)("conversation.search.searching")},null,8,["label"])):J("",!0),q[6]||(q[6]=_("span",{class:"tsearch-sep","aria-hidden":"true"},null,-1)),Z(Zt,{class:"tsearch-close",size:"sm",label:y(s)("conversation.search.close"),onClick:q[3]||(q[3]=P=>o("close"))},{default:ue(()=>[Z(Le,{name:"close"})]),_:1},8,["label"])]),_("div",{class:Be(["tsearch-foot-wrap",{open:h.value}]),inert:!h.value},[_("div",VTe,[Z(Zt,{size:"sm",label:y(s)("conversation.search.previous"),disabled:p.value===0,onClick:q[4]||(q[4]=P=>C(-1))},{default:ue(()=>[Z(Le,{name:"arrow-up"})]),_:1},8,["label","disabled"]),Z(Zt,{size:"sm",label:y(s)("conversation.search.next"),disabled:p.value===0,onClick:q[5]||(q[5]=P=>C(1))},{default:ue(()=>[Z(Le,{name:"arrow-down"})]),_:1},8,["label","disabled"]),_("span",WTe,I(m.value),1)])],10,DTe),(g(),ce(Gi,{to:e.pane},[_("div",qTe,[(g(!0),S(Me,null,rt(f.value,(P,W)=>(g(),S("div",{key:W,class:"tsearch-ring",style:Wt(P)},null,4))),128))])],8,["to"]))],34))}}),ZTe=mt(UTe,[["__scopeId","data-v-d7187e08"]]);function KTe(e,t=2e4){const n=U(`${e}?r=0`);let o=0;const s=setInterval(()=>{o+=1,n.value=`${e}?r=${o}`},t);return An(()=>clearInterval(s)),n}const GTe=["src","alt","role"],YTe=Ge({__name:"PythinkerLogo",props:{size:{default:"sm"},animated:{type:Boolean,default:!0},label:{default:"Pythinker Code"},interactive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=KTe("/brand/mascot-waving.png"),o=e,s=t;function r(){o.interactive&&s("click")}return(i,l)=>(g(),S("img",{src:e.animated?y(n):"/brand/icon.svg",class:Be(["pythinker-logo",[`size-${e.size}`,{interactive:e.interactive}]]),alt:e.label,role:e.interactive?"button":"img",onClick:r},null,10,GTe))}}),Dd=mt(YTe,[["__scopeId","data-v-58c4fde0"]]),XTe=5;function JTe(e,t,n,o=XTe){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(r=>r.id===t)){const r=e.find(i=>i.id===t);r&&(s[o-1]=r)}return s}const QTe={key:0,class:"recent"},eEe={class:"recent-caption"},tEe=["onClick"],nEe={class:"recent-title"},oEe={class:"recent-time"},sEe={class:"recent-foot"},rEe=Ge({__name:"WorkspaceRecentSessions",props:{sessions:{}},emits:["select","openSessionAdmin"],setup(e,{emit:t}){const n=t,{t:o}=Lt();return(s,r)=>e.sessions.length?(g(),S("section",QTe,[_("h2",eEe,I(y(o)("sessions.recentSessions")),1),(g(!0),S(Me,null,rt(e.sessions,i=>(g(),S("button",{key:i.id,type:"button",class:"recent-row",onClick:l=>n("select",i.id)},[_("span",{class:Be(["recent-ico",i.archived?"recent-ico--done":"recent-ico--open"])},[Z(Le,{name:i.archived?"circle-check":"circle-dashed",size:"sm"},null,8,["name"])],2),_("span",nEe,I(i.title),1),_("span",oEe,I(i.time),1)],8,tEe))),128)),_("div",sEe,[Z(Cn,{text:y(o)("conversation.sessionAdminTooltip")},{default:ue(()=>[_("button",{type:"button",class:"recent-more",onClick:r[0]||(r[0]=i=>n("openSessionAdmin"))},[He(I(y(o)("conversation.viewMoreSessions"))+" ",1),Z(Le,{name:"chevron-down",size:"sm"})])]),_:1},8,["text"])])])):J("",!0)}}),iEe=mt(rEe,[["__scopeId","data-v-cd5a729d"]]),lEe={class:"chat-layout"},aEe={class:"empty-hint"},cEe={key:0,class:"empty-hint-text"},uEe={key:1,class:"ws-pick"},dEe={class:"ws-pick-name"},fEe={key:1,class:"ws-pick-menu"},pEe=["onClick"],hEe={class:"ws-pick-item-name"},mEe={class:"ws-pick-item-path"},gEe=["aria-label"],vEe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},wEe={class:"abort-toast-text"},yEe=48,Hm=80,GC=1e3,kEe=420,bEe=3e3,_Ee=Ge({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},sessionPlans:{},overlayOpen:{type:Boolean},goalMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean},lastTurnReason:{},turnErrorKind:{},turnErrorMessage:{},sessionDone:{type:Boolean},pinned:{type:Boolean},recentSessions:{},revealSavedPlan:{type:Function}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","steerQueued","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openCompaction","openAgent","openToolDiff","openTurnDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","restoreSession","selectSession","exportSession","togglePin","openSessionAdmin"],setup(e,{expose:t,emit:n}){const{t:o}=Lt(),s=e,r=n,i=U(!1),l=U(!1),a=B(()=>s.workspaces?.find(Ae=>Ae.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=B(()=>(s.workspaces?.length??0)>0),u=B(()=>JTe(s.workspaces??[],s.activeWorkspaceId,l.value)),d=B(()=>(s.workspaces?.length??0)-u.value.length);Ue(i,Ee=>{Ee||(l.value=!1)});function f(Ee){i.value=!1,Ee!==s.activeWorkspaceId&&r("selectWorkspace",Ee)}w0(ln.contentAlign);const p=U(null),h=U(null),m=U(null),k=U(!1);let x=null;function w(Ee,Ae){const De=m.value??h.value;return!De||De.loadForEdit(Ee)===!1?!1:(De.loadAttachmentsForEdit(Ae??[]),!0)}function v(){k.value=!0,x!==null&&clearTimeout(x),x=setTimeout(()=>{x=null,k.value=!1},2e3)}function b(){s.goal&&(V.value="goal")}const M=B(()=>s.tasks.filter(Ee=>Ee.kind==="bash"||Ee.kind==="tool"&&!Ee.id.startsWith("question-"))),R=B(()=>s.tasks.filter(Ee=>Ee.kind==="subagent"&&Ee.runInBackground)),z=B(()=>M.value.filter(Ee=>Ee.state==="run").length),$=B(()=>R.value.filter(Ee=>Ee.state==="run").length);function T(Ee){const Ae=s.tasks,De=Ae.find(dn=>dn.id===Ee)??Ae.find(dn=>dn.parentToolCallId===Ee);if(De)return De.id;const Ut=Ae.filter(dn=>dn.kind==="subagent"&&!dn.parentToolCallId);if(Ut.length===1)return Ut[0].id}jn("resolveAgentTaskId",T);const E=pn("modelDisplay"),N=pn("subagentEffort");function C(Ee){const Ae=T(Ee);if(Ae===void 0)return;const De=s.tasks.find(zn=>zn.id===Ae||zn.agentId===Ae),Ut=E?.(De?.model),dn=N?.(De?.thinkingEffort);if(!(Ut===void 0&&dn===void 0))return{display:Ut,effort:dn}}jn("resolveAgentModel",C),jn("resolvePlan",Ee=>s.sessionPlans?.[Ee]),jn("revealSavedPlan",(Ee,Ae)=>s.revealSavedPlan?.(Ee,Ae)??Promise.resolve(!1)),jn("pinScroll",ao);const O=B(()=>(s.todos??[]).filter(Ee=>Ee.status==="done").length),H=B(()=>s.goal!==null&&s.goal!==void 0||M.value.length>0||R.value.length>0||(s.todos?.length??0)>0),V=U(null),A=B(()=>s.gitInfo?s.changes?.length??0:0);function F(Ee){V.value=V.value===Ee?null:Ee}function j(){V.value=null}Ue([V,()=>s.goal,M,R,()=>s.todos,()=>s.planMode,()=>s.sessionPlans],()=>{(V.value==="goal"&&!s.goal||V.value==="bash"&&M.value.length===0||V.value==="subagent"&&R.value.length===0||V.value==="todos"&&(s.todos?.length??0)===0||V.value==="plan"&&!s.planMode&&Object.keys(s.sessionPlans??{}).length===0)&&j()});function q(Ee){if(Ee.role==="compaction")return o("conversation.compactedPlain");if(Ee.role==="user"){if(Ee.skillActivation)return`/${Ee.skillActivation.name}`;if(Ee.pluginCommand)return`/${Ee.pluginCommand.pluginId}:${Ee.pluginCommand.commandName}`;const De=Ee.text.trim().replaceAll(/\s+/g," ");return De.length>0?De:"user"}const Ae=(Ee.text||Ee.thinking||"").trim().replaceAll(/\s+/g," ");return Ae.length>0?Ae:(Ee.tools?.length??0)>0?`${Ee.tools.length} tools`:"pythinker"}function P(Ee){for(let Ae=Ee+1;Ae0)return Ut}return""}const W=B(()=>{let Ee=0;return s.turns.flatMap((Ae,De)=>Ae.role!=="user"?[]:(Ee+=1,[{id:Ae.id,role:Ae.role,no:Ee,title:q(Ae),preview:P(De)}]))}),G=U(null);function ee(){const Ee=ne.value;if(!Ee)return;const Ae=Ee.querySelectorAll(".turn-anchor[data-turn-id]");if(Ae.length===0)return;const De=W.value;if(De.length===0)return;const Ut=new Set(De.map(Jo=>Jo.id));if(be.value&&ke()<=Hm){G.value=De[De.length-1].id;return}const dn=Ee.getBoundingClientRect(),zn=dn.height/2;let So=null;Ae.forEach(Jo=>{const Qo=Jo.dataset.turnId;if(!Qo||!Ut.has(Qo))return;Jo.getBoundingClientRect().top-dn.top<=zn&&(So=Qo)}),G.value=So??De[0].id}const se=U(!1);let oe=0;function Q(){oe||(oe=an(()=>{oe=0,ge()}))}function ge(){const Ee=ne.value,Ae=!s.mobile&&s.conversationToc&&Ee?Ee.closest(".con")?.querySelector(".conversation-toc"):null,De=Ae?.querySelector(".toc-marker");let Ut=!1;if(Ee&&Ae&&De){const dn=De.getBoundingClientRect(),zn=Ae.getBoundingClientRect(),So=dn.left+dn.width/2;Ut=Array.from(Ee.querySelectorAll(".table-node-wrapper")).some(Jo=>{const Qo=Jo.getBoundingClientRect();return Qo.left<=So&&So<=Qo.right&&Qo.topzn.top})}se.value!==Ut&&(se.value=Ut)}const xe=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),Ke=B(()=>{const Ee=xe.value;if(Ee)return s.pendingQuestionActions?.[Ee.questionId]}),et=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Y=B(()=>{const Ee=et.value;return Ee?!!s.pendingApprovalActions?.[Ee.approvalId]:!1}),ne=U(null),D=U(!1),X=U(null),ve=U(0),fe=U(0),pe=B(()=>({"--panes-scrollbar-width":`${ve.value}px`})),te=B(()=>({"--chat-dock-height":`${fe.value+yEe}px`}));function de(Ee){return Ee instanceof HTMLElement?Ee:Ee&&"$el"in Ee&&Ee.$el instanceof HTMLElement?Ee.$el:null}function ye(){const Ee=ne.value;ve.value=Ee?Math.max(0,Ee.offsetWidth-Ee.clientWidth):0,fe.value=X.value?.offsetHeight??0}function Ce(Ee){const Ae=de(Ee);ne.value=Ae,Ae&&Ci()}function me(Ee){const Ae=de(Ee);X.value=Ae??null,Ee&&"loadForEdit"in Ee&&typeof Ee.loadForEdit=="function"&&"focus"in Ee&&typeof Ee.focus=="function"?m.value={loadForEdit:Ee.loadForEdit.bind(Ee),loadAttachmentsForEdit:"loadAttachmentsForEdit"in Ee&&typeof Ee.loadAttachmentsForEdit=="function"?Ee.loadAttachmentsForEdit.bind(Ee):()=>{},focus:Ee.focus.bind(Ee)}:m.value=null,bs()}const be=U(!0),re=U(!1);function ke(){const Ee=ne.value;return Ee?Ee.scrollHeight-Ee.scrollTop-Ee.clientHeight:0}let Fe=0,at=0,dt=0,$t=0,Tt=0,Qt=0;function Dt(){return Date.now()1?(be.value=!1,re.value=!0):De<=Hm&&Ae>Fe+1&&(be.value=!0,re.value=!1),Fe=Ae,ee()}function kn(Ee=!1){const Ae=ne.value;be.value=!0,re.value=!1,Ae&&(!Ee&&performance.now()<$t||(Ee&&typeof Ae.scrollTo=="function"?(dt=performance.now(),$t=performance.now()+kEe,Ae.scrollTo({top:Ae.scrollHeight,behavior:"smooth"})):Ae.scrollTop=Ae.scrollHeight,Fe=Ae.scrollTop))}function In(Ee,Ae){return(Ae.closest("[inert]")?.closest(".tool-group")??Ae).getBoundingClientRect().top-Ee.getBoundingClientRect().top+Ee.scrollTop}function Mn(Ee,Ae){const De=Array.from(Ee.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(zn=>({node:zn,top:In(Ee,zn)})),Ut=De.findIndex(zn=>zn.top>=Ae),dn=Ut<0?Math.max(0,De.length-1):Ut;return De.slice(dn,dn+2).flatMap(zn=>{const So=zn.node.dataset.scrollAnchorId,Jo=So??zn.node.dataset.turnId;return Jo?[{kind:So?"tool":"turn",id:Jo,top:zn.top}]:[]})}const Re=new Map;function lt(Ee,Ae){for(const De of Ae.anchors){const Ut=De.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",dn=Ee.querySelector(`[${Ut}="${bt(De.id)}"]`);if(dn)return In(Ee,dn)-De.top}return Ee.scrollHeight-Ae.oldHeight}function tt(Ee,Ae,De=Ee.scrollTop){return Ee.scrollTop=De+lt(Ee,Ae),Fe=Ee.scrollTop,Ee.scrollTop}async function ht(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Je.value||!s.hasMoreMessages)return;const Ee=s.sessionId,Ae=ne.value,De=Ae?.scrollTop??0,Ut={anchors:Ae?Mn(Ae,De):[],oldHeight:Ae?.scrollHeight??0};ze(Ee,!0),Mt();try{if(await vt(),await s.loadOlderMessages(Ee),await vt(),s.sessionId!==Ee){Re.set(Ee,Ut);return}const dn=ne.value;if(!dn)return;tt(dn,Ut),Re.delete(Ee)}finally{ze(Ee,!1)}}function bt(Ee){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Ee):Ee.replaceAll(/["\\]/g,"\\$&")}function Rt(Ee){const Ae=ne.value;if(!Ae)return;const De=Ae.querySelector(`.turn-anchor[data-turn-id="${bt(Ee)}"]`);De&&(tn(),be.value=!1,G.value=Ee,re.value=ke()>Hm,De.scrollIntoView({behavior:"smooth",block:"center"}))}function on(){const Ee=ne.value;if(!Ee)return"none";const Ae=Ee.firstElementChild,De=Ae instanceof HTMLElement?Ae.offsetHeight:0,Ut=X.value?.offsetHeight??0;return`${Ee.scrollHeight}:${Ee.clientHeight}:${De}:${Ut}`}function an(Ee){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Ee):setTimeout(Ee,16)}function sn(Ee){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Ee):clearTimeout(Ee)}let Yn=0,Kt=0,no=null,As=0;function ys(){return performance.now(){if(Kt=0,performance.now()>=Yn||!no){no=null;return}const dn=no.getBoundingClientRect().top-As;dn&&(De.scrollTop+=dn),Kt=an(Ut)};Kt=an(Ut)}function co(Ee=36){if(!be.value&&!Dt())return;const Ae=++Qt;let De="",Ut=0,dn=0;Tt&&(sn(Tt),Tt=0);const zn=()=>{if(Tt=0,Ae!==Qt||!be.value&&!Dt())return;kn(!1);const So=on();Ut=So===De?Ut+1:0,De=So,dn++,Ut<3&&dn0&&Ae.length>=Ee.length&&Ee.firstId!==Ae.firstId&&Ee.lastId===Ae.lastId&&Ee.lastTextLen===Ae.lastTextLen&&Ee.lastThinkingLen===Ae.lastThinkingLen&&Ee.lastToolsLen===Ae.lastToolsLen&&Ee.approvalIds===Ae.approvalIds}const Ct=B(()=>{const Ee=(s.approvals??[]).map(zn=>zn.approvalId).join(","),Ae=s.turns,De=Ae.at(-1),Ut=De?.thinking?.length??0,dn=De?.tools?.reduce((zn,So)=>zn+So.name.length+(So.arg?.length??0)+(So.output?.join("").length??0),0)??0;return{length:Ae.length,firstId:Ae[0]?.id??"",lastId:De?.id??"",lastTextLen:De?.text.length??0,lastThinkingLen:Ut,lastToolsLen:dn,approvalIds:Ee}});Ue(Ct,async(Ee,Ae)=>{if(Je.value&&oo(Ae,Ee)){ee();return}await vt(),be.value||Dt()?kn(Ee.length{bs()}),Ue(()=>s.mobile,async()=>{await vt(),ye()});const so=new Map;Ue(()=>s.fileReloadKey,async(Ee,Ae)=>{const De=ne.value;Ae&&De&&so.set(String(Ae),{top:De.scrollTop,following:be.value}),tn(),await vt();const Ut=ne.value,dn=Ee?so.get(String(Ee)):void 0;if(dn&&Ut){const zn=Re.get(String(Ee)),So=zn?tt(Ut,zn,dn.top):dn.top;zn&&Re.delete(String(Ee)),be.value=dn.following,Ut.scrollTop=So,Fe=Ut.scrollTop,re.value=!dn.following&&ke()>1,dn.following&&co()}else be.value=!0,Fe=0,kn(!1),co();ee()}),Ue(()=>s.sessionLoading,async(Ee,Ae)=>{Ee||!Ae||(be.value=!0,await vt(),co(),ee())}),Ue(()=>s.turnActive,async(Ee,Ae)=>{Ee||!Ae||!be.value&&!Dt()||(await vt(),co(48),ee())});function Bn(){be.value=!0,re.value=!1,at=Date.now()+GC,vt(()=>{kn(!0),co(16)})}function Pn(Ee){Bn(),r("submit",Ee)}function js(Ee){be.value=!0,re.value=!1,at=Date.now()+GC,r("editMessage",Ee)}function Os(Ee){const Ae=s.queued?.[Ee],De=Ae?.text??"";w(De,Ae?.attachments)&&r("editQueued",Ee)}function Ts(Ee){r("reorderQueue",Ee)}function ks(Ee,Ae){Bn(),r("answer",Ee,Ae)}function Lo(Ee,Ae){!Ee||!Ae||r("approval",Ee,Ae)}let Ro=null,Ze=null,Qe=null,ct=null,mn=0,_o=0,Un=0;const Ps=U(new Set),Je=B(()=>!!s.sessionId&&Ps.value.has(s.sessionId));function ze(Ee,Ae){const De=new Set(Ps.value);Ae?De.add(Ee):De.delete(Ee),Ps.value=De}function wt(){Je.value||Un||(Un=an(()=>{Un=0,!Je.value&&(ys()||(be.value||Dt())&&kn(!1))}))}function Mt(){Qt++,Tt&&(sn(Tt),Tt=0),Un&&(sn(Un),Un=0)}function tn(){const Ee=ne.value;if(at=0,Mt(),Yn=0,no=null,Ee){const Ae=Ee.scrollTop;typeof Ee.scrollTo=="function"?Ee.scrollTo({top:Ae,behavior:"auto"}):Ee.scrollTop=Ae}$t=0,dt=Number.NEGATIVE_INFINITY,Ee&&(Fe=Ee.scrollTop)}function Xn(){const Ee=ne.value;!Ee||Ee.scrollHeight-Ee.clientHeight<=1&&!s.hasMoreMessages||(be.value=!1,tn(),Ee.scrollHeight-Ee.clientHeight>1&&(re.value=!0))}function Jn(Ee){const Ae=ne.value;if(!Ae)return!1;for(const De of Ee.composedPath()){if(De===Ae)return!1;if(De instanceof HTMLElement&&De.scrollHeight>De.clientHeight+1&&De.scrollTop>1)return!0}return!1}function Es(Ee){Ee.defaultPrevented||Ee.ctrlKey||Ee.shiftKey||Ee.deltaY>=0||Jn(Ee)||Xn()}function Xo(Ee){const Ae=ne.value;if(!Ae||Ee.defaultPrevented||Ee.button!==0||Ee.pointerType==="touch")return;const De=Ae.getBoundingClientRect(),Ut=Ae.offsetWidth-Ae.clientWidth,dn=Ut>0?Ut:12;Ee.target===Ae&&Ee.clientX>=De.right-dn&&Xn()}let ro=null;function uo(Ee){ro=Ee.touches.length===1?Ee.touches[0].clientY:null}function vn(Ee){const Ae=Ee.touches.length===1?Ee.touches[0].clientY:null;Ae!==null&&ro!==null&&Ae>ro+2&&!Jn(Ee)&&Xn(),ro=Ae}function Hs(){if(!Ze)return;const Ee=ne.value?.firstElementChild??null;Ee!==Qe&&(Qe&&Ze.unobserve(Qe),Qe=Ee,Ee&&Ze.observe(Ee))}function bs(){if(!Ze)return;const Ee=X.value;Ee!==ct&&(ct&&Ze.unobserve(ct),ct=Ee,Ee&&Ze.observe(Ee))}function Ci(){const Ee=ne.value;ye(),Ro&&(Ro.disconnect(),Ee&&Ro.observe(Ee,{childList:!0,subtree:!0,characterData:!0})),Ze&&(Ze.disconnect(),Qe=null,ct=null,Ee&&Ze.observe(Ee),Hs(),bs()),mn=Ee?.scrollHeight??0,_o=Ee?.clientHeight??0,Q()}function ir(){Hs(),wt(),Q()}function Is(){typeof document>"u"||document.visibilityState==="visible"&&be.value&&co()}const Ys=U(!1);let io=null;function Io(){Ys.value=!0,io!==null&&clearTimeout(io),io=setTimeout(()=>{Ys.value=!1},bEe)}function yr(){Io(),r("interrupt")}function kr(Ee){if((Ee.metaKey||Ee.ctrlKey)&&Ee.key.toLowerCase()==="f"){if(s.overlayOpen)return;Ee.preventDefault(),D.value=!0,vt(()=>{ne.value?.closest(".con")?.querySelector(".tsearch-input")?.focus()});return}Ee.key==="Escape"&&(s.running||s.working)&&(Ee.preventDefault(),yr())}function si(){D.value=!1,vt(()=>ne.value?.focus({preventScroll:!0}))}function Or(){be.value&&wt()}xn(()=>{vt(()=>{typeof MutationObserver=="function"&&(Ro=new MutationObserver(ir)),typeof ResizeObserver=="function"&&(Ze=new ResizeObserver(()=>{Q(),ye();const Ee=ne.value;if(!Ee)return;const{scrollHeight:Ae,clientHeight:De}=Ee,Ut=Ae>mn+1,dn=De<_o-1;mn=Ae,_o=De,!ys()&&(Ut||dn)&&wt()})),Ci(),co(48),ee(),typeof document<"u"&&(document.addEventListener("visibilitychange",Is),document.addEventListener("keydown",kr)),window.visualViewport?.addEventListener("resize",Or)})}),An(()=>{Ro&&Ro.disconnect(),Ze&&Ze.disconnect(),Un&&sn(Un),Tt&&sn(Tt),Kt&&sn(Kt),oe&&sn(oe),io!==null&&clearTimeout(io),x!==null&&(clearTimeout(x),x=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Is),document.removeEventListener("keydown",kr)),window.visualViewport?.removeEventListener("resize",Or)});function Pr(){(m.value??h.value)?.focus()}return t({loadComposerForEdit:w,focusComposer:Pr}),(Ee,Ae)=>(g(),S("section",{class:Be(["con",{mobile:e.mobile,"toc-enabled":e.conversationToc}]),style:Wt(te.value)},[D.value&&ne.value?(g(),ce(ZTe,{key:0,pane:ne.value,mobile:e.mobile,onClose:si},null,8,["pane","mobile"])):J("",!0),!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(g(),ce(Zve,{key:1,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":A.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:k.value,"session-done":e.sessionDone,pinned:e.pinned,onOpenChanges:Ae[0]||(Ae[0]=De=>r("openChanges")),onCopyAll:Ae[1]||(Ae[1]=De=>p.value?.copyConversation()),onCopyFinalSummary:Ae[2]||(Ae[2]=De=>p.value?.copyFinalSummary()),onOpenPr:Ae[3]||(Ae[3]=De=>e.pr&&r("openPr",e.pr.url)),onRenameSession:Ae[4]||(Ae[4]=(De,Ut)=>r("renameSession",De,Ut)),onForkSession:Ae[5]||(Ae[5]=De=>r("forkSession",De)),onTogglePin:Ae[6]||(Ae[6]=De=>r("togglePin",De)),onArchiveSession:Ae[7]||(Ae[7]=De=>r("archiveSession",De)),onRestoreSession:Ae[8]||(Ae[8]=De=>r("restoreSession",De)),onExportSession:Ae[9]||(Ae[9]=De=>r("exportSession",De))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied","session-done","pinned"])):J("",!0),e.conversationToc?(g(),ce(MTe,{key:2,items:W.value,"active-turn-id":G.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:se.value,onSelect:Rt},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):J("",!0),_("div",lEe,[_("div",{ref:Ce,class:Be(["panes chat-scroll",{"is-following":be.value,"history-prepending":Je.value}]),tabindex:"-1",onScrollPassive:en,onWheelPassive:Es,onPointerdownPassive:Xo,onTouchstartPassive:uo,onTouchmovePassive:vn},[_("div",{class:Be(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(g(),S(Me,{key:0},[Ae[61]||(Ae[61]=_("div",{class:"empty-spacer"},null,-1)),_("div",aEe,[_("span",{class:Be(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(g(),ce(Go,{key:0,size:"sm"})):(g(),ce(Dd,{key:1,size:"md",label:"","aria-hidden":"true"})),_("span",null,I(e.starting?y(o)("conversation.starting"):y(o)("composer.emptyConversationTitle")),1)],2),e.starting?J("",!0):(g(),S("span",cEe,I(y(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(g(),S("div",uEe,[Z(Cn,{text:y(o)("conversation.switchWorkspace")},{default:ue(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:Ae[10]||(Ae[10]=xt(De=>i.value=!i.value,["stop"]))},[Z(Le,{name:"folder",size:"sm"}),_("span",dEe,I(a.value),1),Z(Le,{class:Be(["ws-pick-chev",{open:i.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),i.value?(g(),S("div",{key:0,class:"ws-pick-backdrop",onClick:Ae[11]||(Ae[11]=De=>i.value=!1)})):J("",!0),i.value?(g(),S("div",fEe,[(g(!0),S(Me,null,rt(u.value,De=>(g(),S("button",{key:De.id,type:"button",class:Be(["ws-pick-item",{on:De.id===e.activeWorkspaceId}]),onClick:xt(Ut=>f(De.id),["stop"])},[_("span",hEe,I(De.name),1),_("span",mEe,I(De.shortPath),1)],10,pEe))),128)),d.value>0?(g(),S("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Ae[12]||(Ae[12]=xt(De=>l.value=!l.value,["stop"]))},[_("span",null,I(y(o)("conversation.moreWorkspaces",{count:d.value})),1)])):J("",!0),Ae[60]||(Ae[60]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:Ae[13]||(Ae[13]=xt(De=>{i.value=!1,r("addWorkspace")},["stop"]))},[Z(Le,{name:"plus",size:"sm"}),_("span",null,I(y(o)("conversation.addWorkspace")),1)])])):J("",!0)])):e.starting?J("",!0):(g(),S("button",{key:2,type:"button",class:"empty-add-workspace",onClick:Ae[14]||(Ae[14]=De=>r("addWorkspace"))},[Z(Le,{name:"folder-plus",size:"sm"}),_("span",null,I(y(o)("conversation.addWorkspace")),1)]))]),e.sessionId?J("",!0):(g(),ce(iEe,{key:0,sessions:e.recentSessions??[],onSelect:Ae[15]||(Ae[15]=De=>r("selectSession",De)),onOpenSessionAdmin:Ae[16]||(Ae[16]=De=>r("openSessionAdmin"))},null,8,["sessions"])),Z(bz,{ref_key:"emptyComposerRef",ref:h,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"goal-mode":e.goalMode,"workflow-active":e.dynamicWorkflowMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Pn,onSteer:Ae[17]||(Ae[17]=De=>r("steer",De)),onCommand:Ae[18]||(Ae[18]=De=>r("command",De)),onInterrupt:yr,onUnqueue:Ae[19]||(Ae[19]=De=>r("unqueue",De)),onEditQueued:Ae[20]||(Ae[20]=De=>r("editQueued",De)),onSetPermission:Ae[21]||(Ae[21]=De=>r("setPermission",De)),onSetThinking:Ae[22]||(Ae[22]=De=>r("setThinking",De)),onTogglePlan:Ae[23]||(Ae[23]=De=>r("togglePlan")),onToggleWorkflow:Ae[24]||(Ae[24]=De=>r("toggleWorkflow")),onToggleGoal:Ae[25]||(Ae[25]=De=>r("toggleGoal")),onOpenBtw:Ae[26]||(Ae[26]=De=>r("command","/btw")),onCreateGoal:Ae[27]||(Ae[27]=De=>r("createGoal",De)),onControlGoal:Ae[28]||(Ae[28]=De=>r("controlGoal",De)),onFocusGoal:b,onCompact:Ae[29]||(Ae[29]=De=>r("compact")),onPickModel:Ae[30]||(Ae[30]=De=>r("pickModel")),onSelectModel:Ae[31]||(Ae[31]=De=>r("selectModel",De))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","goal-mode","workflow-active","goal","activation-badges","models","starred-ids","skills","starting"]),Ae[62]||(Ae[62]=_("div",{class:"empty-spacer"},null,-1))],64)):(g(),ce(Xv,{ref_key:"chatPaneRef",ref:p,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,questions:e.questions,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":be.value,"tool-diff-panel":!0,"last-turn-reason":e.lastTurnReason,"turn-error-kind":e.turnErrorKind,"turn-error-message":e.turnErrorMessage,cwd:e.workspaceRoot,queued:e.queued,onOpenFile:Ae[32]||(Ae[32]=De=>r("openFile",De)),onOpenMedia:Ae[33]||(Ae[33]=De=>r("openMedia",De)),onCopyConversationCopied:v,onOpenCompaction:Ae[34]||(Ae[34]=De=>r("openCompaction",De)),onOpenAgent:Ae[35]||(Ae[35]=De=>r("openAgent",De)),onOpenToolDiff:Ae[36]||(Ae[36]=De=>r("openToolDiff",De)),onOpenTurnDiff:Ae[37]||(Ae[37]=De=>r("openTurnDiff",De)),onEditMessage:js,onLoadOlderMessages:ht,onUnqueue:Ae[38]||(Ae[38]=De=>r("unqueue",De)),onEditQueued:Os,onReorderQueue:Ts,onSteerQueued:Ae[39]||(Ae[39]=De=>r("steerQueued",De)),onContinueTurn:Ae[40]||(Ae[40]=De=>Pn({text:De,attachments:[]}))},null,8,["turns","approvals","questions","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","last-turn-reason","turn-error-kind","turn-error-message","cwd","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?J("",!0):(g(),ce(wTe,{key:0,ref:me,style:Wt(pe.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,working:e.working,"goal-mode":e.goalMode,"dynamic-workflow-mode":e.dynamicWorkflowMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"session-plans":e.sessionPlans,"overlay-open":e.overlayOpen,"open-file":De=>r("openFile",De),"reveal-saved-plan":e.revealSavedPlan,"dock-panel":V.value,"bash-tasks":M.value,"subagent-tasks":R.value,"bash-running":z.value,"subagent-running":$.value,"todo-done-count":O.value,"has-dock-work":H.value,todos:e.todos,"pending-question":xe.value,"question-busy-kind":Ke.value,"pending-approval":et.value,"approval-busy":Y.value,mobile:e.mobile,onToggleDockPanel:Ae[41]||(Ae[41]=De=>F(De)),onCloseDockPanel:Ae[42]||(Ae[42]=De=>j()),onOpenAgent:Ae[43]||(Ae[43]=De=>r("openAgent",De)),onAnswer:ks,onDismiss:Ae[44]||(Ae[44]=De=>r("dismiss",De)),onApproval:Lo,onCancelTask:Ae[45]||(Ae[45]=De=>r("cancelTask",De)),onControlGoal:Ae[46]||(Ae[46]=De=>r("controlGoal",De)),onSubmit:Pn,onSteer:Ae[47]||(Ae[47]=De=>r("steer",De)),onCommand:Ae[48]||(Ae[48]=De=>r("command",De)),onInterrupt:yr,onSetPermission:Ae[49]||(Ae[49]=De=>r("setPermission",De)),onSetThinking:Ae[50]||(Ae[50]=De=>r("setThinking",De)),onTogglePlan:Ae[51]||(Ae[51]=De=>r("togglePlan")),onToggleWorkflow:Ae[52]||(Ae[52]=De=>r("toggleWorkflow")),onToggleGoal:Ae[53]||(Ae[53]=De=>r("toggleGoal")),onOpenBtw:Ae[54]||(Ae[54]=De=>r("command","/btw")),onCreateGoal:Ae[55]||(Ae[55]=De=>r("createGoal",De)),onFocusGoal:b,onCompact:Ae[56]||(Ae[56]=De=>r("compact")),onPickModel:Ae[57]||(Ae[57]=De=>r("pickModel")),onSelectModel:Ae[58]||(Ae[58]=De=>r("selectModel",De))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","working","goal-mode","dynamic-workflow-mode","activation-badges","models","starred-ids","skills","goal","session-plans","overlay-open","open-file","reveal-saved-plan","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),Z(gi,{name:"pill"},{default:ue(()=>[re.value?(g(),S("button",{key:0,class:"newmsg-pill",style:Wt({bottom:`${fe.value+12}px`}),"aria-label":y(o)("conversation.jumpToLatestAria"),onClick:Ae[59]||(Ae[59]=De=>kn(!0))},[Z(Le,{class:"pill-chevron",name:"chevron-down",size:"md"}),He(" "+I(y(o)("conversation.newMessages")),1)],12,gEe)):J("",!0)]),_:1}),Z(gi,{name:"abort-toast"},{default:ue(()=>[Ys.value?(g(),S("div",vEe,[_("span",wEe,I(y(o)("conversation.manuallyAborted")),1)])):J("",!0)]),_:1})],6))}}),xEe=mt(_Ee,[["__scopeId","data-v-51854882"]]),SEe=["aria-label"],CEe={class:"media-lightbox-card"},MEe=["src","alt"],AEe=["src"],TEe={key:0,class:"media-preview-caption"},EEe=Ge({__name:"MediaLightbox",props:{media:{},src:{},originImg:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,s=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),r=G3("overlay"),i=G3("close"),l=G3("image"),a=B(()=>n.media.kind==="image"),c=B(()=>n.media.path??(a.value?"Image preview":"Video preview")),u=jo(1),d=jo(0),f=jo(0),p=jo(!1),h=B(()=>({transform:`translate(${d.value}px, ${f.value}px) scale(${u.value})`,cursor:u.value>1?p.value?"grabbing":"grab":"zoom-in"}));let m=null,k=null,x=0,w=0,v=0,b=0;const{lock:M,unlock:R}=kz();function z(){u.value=1,d.value=0,f.value=0}function $(H){if(!a.value)return;H.preventDefault();const V=Math.min(8,Math.max(1,u.value*(H.deltaY<0?1.1:.9)));u.value=V,V===1&&(d.value=0,f.value=0)}function T(){if(u.value!==1){z();return}const H=l.value;H&&(u.value=Math.min(8,Math.max(1,H.naturalWidth/H.clientWidth)))}function E(H){u.value<=1||(k=H.pointerId,x=H.clientX,w=H.clientY,v=d.value,b=f.value,p.value=!0,l.value?.setPointerCapture(H.pointerId))}function N(H){k===H.pointerId&&(d.value=v+H.clientX-x,f.value=b+H.clientY-w)}function C(H){k===H.pointerId&&(l.value?.releasePointerCapture(H.pointerId),k=null,p.value=!1)}function O(H){if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),o("close");return}if(H.key!=="Tab"||!r.value)return;const V=r.value.querySelectorAll(s),A=V[0],F=V[V.length-1];!A||!F||(r.value.contains(document.activeElement)?H.shiftKey&&document.activeElement===A?(H.preventDefault(),F.focus()):!H.shiftKey&&document.activeElement===F&&(H.preventDefault(),A.focus()):(H.preventDefault(),(H.shiftKey?F:A).focus()))}return xn(()=>{M(),m=document.activeElement instanceof HTMLElement?document.activeElement:n.originImg??null,window.addEventListener("keydown",O),i.value?.focus()}),An(()=>{R(),window.removeEventListener("keydown",O),m?.focus()}),(H,V)=>(g(),ce(Gi,{to:"body"},[_("div",{ref:"overlay",class:"media-lightbox",role:"dialog","aria-modal":"true","aria-label":c.value,onMousedown:V[1]||(V[1]=xt(A=>o("close"),["self"]))},[_("button",{ref:"close",type:"button",class:"media-lightbox-close","aria-label":"Close",onClick:V[0]||(V[0]=A=>o("close"))},[Z(Le,{name:"close",size:"sm"})],512),_("div",CEe,[_("div",{class:"media-lightbox-frame",onWheel:$},[a.value?(g(),S("img",{key:0,ref:"image",class:"media-lightbox-media",src:e.src,alt:e.media.path??"",draggable:"false",style:Wt(h.value),onDblclick:T,onPointerdown:E,onPointermove:N,onPointerup:C,onPointercancel:C},null,44,MEe)):(g(),S("video",{key:1,class:"media-lightbox-media",src:e.src,controls:"",autoplay:""},null,8,AEe))],32)]),e.media.path?(g(),S("div",TEe,I(e.media.path),1)):J("",!0)],40,SEe)]))}}),IEe=mt(EEe,[["__scopeId","data-v-a5036dce"]]),LEe={class:"ui-panel-header__main"},$Ee={class:"ui-panel-header__title"},NEe={key:0,class:"ui-panel-header__sub"},zEe=Ge({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-panel-header",{wrap:e.wrap}])},[_("div",LEe,[_("span",$Ee,I(e.title),1),Z(Cn,{text:e.subtitle},{default:ue(()=>[e.subtitle?(g(),S("span",NEe,I(e.subtitle),1)):J("",!0)]),_:1},8,["text"]),Tn(t.$slots,"default",{},void 0,!0)]),e.closable?(g(),ce(Zt,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])):J("",!0)],2))}}),la=mt(zEe,[["__scopeId","data-v-47211810"]]),BEe={key:0,class:"fp-empty fp-error"},REe={key:1,class:"fp-empty"},FEe={key:2,class:"fp-loading"},jEe={class:"fp-path"},OEe={class:"fp-meta"},PEe={key:0,class:"fp-lines"},HEe={class:"fp-size"},DEe={key:3,class:"fp-search"},VEe=["placeholder"],WEe={key:0,class:"fp-search-count"},qEe={key:1,class:"fp-code"},UEe={class:"fp-line-table"},ZEe=["data-line"],KEe={class:"fp-gutter"},GEe=["innerHTML"],YEe={key:1,class:"fp-body fp-code"},XEe={class:"fp-line-table"},JEe=["data-line"],QEe={class:"fp-gutter"},eIe=["innerHTML"],tIe={key:2,class:"fp-body"},nIe=["srcdoc","title"],oIe={key:1,class:"fp-code"},sIe={class:"fp-line-table"},rIe=["data-line"],iIe={class:"fp-gutter"},lIe=["innerHTML"],aIe={key:3,class:"fp-body fp-pdf-wrap"},cIe=["src","title"],uIe={key:1,class:"fp-binary-card"},dIe={class:"fp-binary-label"},fIe={key:4,class:"fp-body fp-table-wrap"},pIe={class:"fp-table"},hIe=["data-line"],mIe={key:5,class:"fp-body fp-image-wrap"},gIe=["src","alt"],vIe={key:1,class:"fp-binary-card"},wIe={class:"fp-binary-icon"},yIe={class:"fp-binary-label"},kIe={key:6,class:"fp-body fp-image-wrap"},bIe=["src"],_Ie={key:1,class:"fp-binary-card"},xIe={class:"fp-binary-icon"},SIe={class:"fp-binary-label"},CIe={key:7,class:"fp-body fp-code"},MIe={class:"fp-line-table"},AIe=["data-line"],TIe={class:"fp-gutter"},EIe=["innerHTML"],IIe={key:8,class:"fp-body fp-binary-wrap"},LIe={class:"fp-binary-card"},$Ie={class:"fp-binary-icon"},NIe={class:"fp-binary-label"},zIe=Ge({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},editable:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal","openEditor"],setup(e,{emit:t}){const{t:n}=Lt();function o(Y,ne){const D=ne?ne.split("/").filter(Boolean):[];for(const X of Y.split("/"))X===""||X==="."||(X===".."?D.pop():D.push(X));return D.join("/")}const s=pn("resolveImage",async Y=>Y),r=B(()=>{const Y=c.file?.path??"",ne=Y.lastIndexOf("/");return ne>0?Y.slice(0,ne):""});function i(Y){if(/^(https?:|data:|blob:)/i.test(Y)||Y.startsWith("/"))return Y;const ne=r.value;return ne?o(Y,ne):Y}async function l(Y){const ne=i(Y);return s?s(ne):ne}jn("resolveImage",l);function a(Y){let ne=Y.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ne)||ne.startsWith("/"))return Y;for(const X of["#","?"]){const ve=ne.indexOf(X);ve!==-1&&(ne=ne.slice(0,ve))}const D=r.value;return{...Y,path:o(ne,D)}}const c=e,u=B(()=>{const Y=c.file;return Y!==null&&!Y.isBinary}),d=t;function f(Y){c.openFile?.(a(Y))}const p=U(null),h=B(()=>{const Y=c.file;if(!Y)return"binary";const ne=Y.mime??"",D=Y.languageId??"",X=Y.path.toLowerCase();return ne==="text/markdown"||D==="markdown"||D==="md"||X.endsWith(".mdx")?"markdown":ne==="application/json"||D==="json"?"json":ne==="text/html"||D==="html"||X.endsWith(".html")||X.endsWith(".htm")?"html":ne==="application/pdf"||X.endsWith(".pdf")?"pdf":ne==="text/csv"||D==="csv"||X.endsWith(".csv")?"csv":ne.startsWith("image/")?"image":ne.startsWith("video/")?"video":Y.isBinary?"binary":ne.startsWith("text/")||D!==""?"text":"binary"});function m(Y){const ne=atob(Y),D=Uint8Array.from(ne,X=>X.charCodeAt(0));return new TextDecoder().decode(D)}const k=B(()=>{const Y=c.file;if(!Y)return"";if(Y.encoding==="base64")try{return m(Y.content)}catch{return Y.content}return Y.content}),x=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(k.value),null,2)}catch{return k.value}}),w=B(()=>c.file?(h.value==="json"?x.value:k.value).split(` -`):[]),v=B(()=>c.file?h.value==="json"?x.value:k.value:""),b=U(""),M=U(0),R=B(()=>{const Y=b.value.trim().toLowerCase();if(!Y)return[];const ne=[];return w.value.forEach((D,X)=>{D.toLowerCase().includes(Y)&&ne.push(X+1)}),ne});Ue(b,()=>{M.value=0});function z(Y,ne=!1){Y&&vt(()=>{const D=p.value?.querySelector(".fp-body"),X=D?.querySelector(`[data-line="${Y}"]`);if(!D||!X)return;ne&&(D.scrollTop=0);const ve=D.getBoundingClientRect(),fe=X.getBoundingClientRect(),pe=fe.top-ve.top+D.scrollTop;D.scrollTop=pe-D.clientHeight/2+fe.height/2})}Ue(()=>[c.file?.path,c.line],()=>z(c.line,!0),{immediate:!0});function $(Y){const ne=R.value;ne.length!==0&&(M.value=(M.value+Y+ne.length)%ne.length,z(ne[M.value]))}function T(Y){const ne=R.value;return{target:c.line===Y,hit:ne.includes(Y),active:ne[M.value]===Y}}function E(Y){return Y<1024?`${Y} B`:Y<1024*1024?`${(Y/1024).toFixed(1)} KB`:`${(Y/(1024*1024)).toFixed(1)} MB`}const N=U(!1),C=U(!1);function O(){c.file&&ss(v.value).then(Y=>{Y&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function H(){c.file&&ss(c.file.path).then(Y=>{Y&&(C.value=!0,setTimeout(()=>{C.value=!1},1400))})}const V=U("preview"),A=U("preview"),F=U("fit");function j(Y){V.value=Y}function q(Y){A.value=Y}function P(Y){F.value=Y}Ue(h,Y=>{V.value=Y==="html"?"preview":"source",A.value="preview",F.value="fit"});const W=B(()=>{const Y=c.file;return!Y||h.value!=="image"?null:Y.sourceUrl?Y.sourceUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:Y.mime==="image/svg+xml"?`data:${Y.mime};charset=utf-8,${encodeURIComponent(Y.content)}`:null}),G=B(()=>{const Y=c.file;return!Y||h.value!=="video"?null:Y.sourceUrl?Y.sourceUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:null}),ee=B(()=>{const Y=c.file;return!Y||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:null}),se=B(()=>c.file?["",'',``,k.value].join(""):"");function oe(Y){const ne=[];let D="",X=!1;for(let ve=0;vew.value.slice(0,200).map(oe));function ge(Y){return Y.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function xe(){const Y=c.file;if(!Y)return"";const ne=Y.languageId?.toLowerCase();return ne||(Y.path.split(".").pop()?.toLowerCase()??"")}function Ke(Y){const ne=xe();let D=ge(Y);return h.value==="json"||ne==="json"||ne==="jsonc"?(D=D.replace(/("[^&]*?")(\s*:)/g,'$1$2'),D=D.replace(/(:\s*)("[^&]*?")/g,'$1$2'),D=D.replace(/\b(true|false|null)\b/g,'$1'),D=D.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1$2'),D):h.value==="html"||ne==="html"||ne==="xml"||ne==="svg"?(D=D.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' $1$2'),D=D.replace(/(".*?")/g,'$1'),D=D.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1$2'),D):(D=D.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'$1'),D=D.replace(/(".*?"|'.*?')/g,'$1'),D=D.replace(/(\/\/.*)$/g,'$1'),D)}function et(Y,ne=55){return!Y||Y.length<=ne?Y:"…"+Y.slice(Y.length-ne+1)}return(Y,ne)=>(g(),S("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(g(),S("div",BEe,[_("span",null,I(e.error),1),e.closable?(g(),ce(It,{key:0,variant:"secondary",size:"sm",onClick:ne[0]||(ne[0]=D=>d("close"))},{default:ue(()=>[He(I(y(n)("filePreview.close")),1)]),_:1})):J("",!0)])):!e.file&&!e.loading?(g(),S("div",REe,I(y(n)("filePreview.empty")),1)):e.loading?(g(),S("div",FEe,[ne[8]||(ne[8]=_("span",{class:"spinner"},null,-1)),_("span",null,I(y(n)("filePreview.loading")),1)])):e.file?(g(),S(Me,{key:3},[Z(la,{wrap:"",title:y(n)("common.preview"),closable:e.closable,"close-label":y(n)("filePreview.close"),onClose:ne[7]||(ne[7]=D=>d("close"))},{default:ue(()=>[Z(Cn,{text:e.file.path},{default:ue(()=>[_("span",jEe,I(et(e.file.path)),1)]),_:1},8,["text"]),_("span",OEe,[e.file.lineCount?(g(),S("span",PEe,I(y(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):J("",!0),_("span",HEe,I(E(e.file.size)),1)]),h.value==="html"?(g(),ce(nr,{key:0,"model-value":V.value,size:"sm",options:[{value:"preview",label:y(n)("filePreview.preview")},{value:"source",label:y(n)("filePreview.source")}],"onUpdate:modelValue":j},null,8,["model-value","options"])):J("",!0),h.value==="markdown"?(g(),ce(nr,{key:1,"model-value":A.value,size:"sm",options:[{value:"preview",label:y(n)("filePreview.preview")},{value:"source",label:y(n)("filePreview.source")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):J("",!0),h.value==="image"?(g(),ce(nr,{key:2,"model-value":F.value,size:"sm",options:[{value:"fit",label:y(n)("filePreview.fit")},{value:"actual",label:y(n)("filePreview.actual")}],"onUpdate:modelValue":P},null,8,["model-value","options"])):J("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(g(),S("div",DEe,[Zn(_("input",{"onUpdate:modelValue":ne[1]||(ne[1]=D=>b.value=D),class:"fp-search-input",type:"search",placeholder:y(n)("filePreview.search")},null,8,VEe),[[Fs,b.value]]),b.value.trim()?(g(),S("span",WEe,I(R.value.length),1)):J("",!0),Z(Zt,{size:"sm",disabled:R.value.length===0,label:y(n)("filePreview.prevMatch"),onClick:ne[2]||(ne[2]=D=>$(-1))},{default:ue(()=>[Z(Le,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),Z(Zt,{size:"sm",disabled:R.value.length===0,label:y(n)("filePreview.nextMatch"),onClick:ne[3]||(ne[3]=D=>$(1))},{default:ue(()=>[Z(Le,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):J("",!0),Z(Zt,{size:"sm",class:Be({copied:C.value}),label:C.value?y(n)("filePreview.copied"):y(n)("filePreview.copyPath"),onClick:H},{default:ue(()=>[C.value?(g(),ce(Le,{key:1,class:"fp-check",name:"check",size:"md"})):(g(),ce(Le,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.editable&&u.value&&e.file!==null?(g(),ce(Zt,{key:4,size:"sm",label:y(n)("editor.title"),onClick:ne[4]||(ne[4]=D=>d("openEditor",e.file.path))},{default:ue(()=>[Z(Le,{name:"pencil",size:"md"})]),_:1},8,["label"])):J("",!0),e.externalActions?(g(),ce(Zt,{key:5,size:"sm",label:y(n)("filePreview.openInEditor"),onClick:ne[5]||(ne[5]=D=>d("openExternal"))},{default:ue(()=>[Z(Le,{name:"external-link",size:"md"})]),_:1},8,["label"])):J("",!0),e.externalActions?(g(),ce(Zt,{key:6,size:"sm",label:y(n)("filePreview.reveal"),onClick:ne[6]||(ne[6]=D=>d("reveal"))},{default:ue(()=>[Z(Le,{name:"folder",size:"md"})]),_:1},8,["label"])):J("",!0),!e.file.isBinary&&h.value!=="image"?(g(),ce(Zt,{key:7,size:"sm",class:Be({copied:N.value}),label:N.value?y(n)("filePreview.copied"):y(n)("filePreview.copy"),onClick:O},{default:ue(()=>[N.value?(g(),ce(Le,{key:1,class:"fp-check",name:"check",size:"md"})):(g(),ce(Le,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):J("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(g(),S("div",{key:0,class:Be(["fp-body",{"fp-markdown":A.value==="preview"}])},[A.value==="preview"?(g(),ce(sa,{key:0,text:k.value,"open-file":c.openFile?f:void 0},null,8,["text","open-file"])):(g(),S("div",qEe,[_("div",UEe,[(g(!0),S(Me,null,rt(w.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",T(X+1)]),"data-line":X+1},[_("span",KEe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,GEe)],10,ZEe))),128))])]))],2)):h.value==="json"?(g(),S("div",YEe,[_("div",XEe,[(g(!0),S(Me,null,rt(w.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",T(X+1)]),"data-line":X+1},[_("span",QEe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,eIe)],10,JEe))),128))])])):h.value==="html"?(g(),S("div",tIe,[V.value==="preview"?(g(),S("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:se.value,title:e.file.path},null,8,nIe)):(g(),S("div",oIe,[_("div",sIe,[(g(!0),S(Me,null,rt(w.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",T(X+1)]),"data-line":X+1},[_("span",iIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,lIe)],10,rIe))),128))])]))])):h.value==="pdf"?(g(),S("div",aIe,[ee.value?(g(),S("iframe",{key:0,class:"fp-pdf-frame",src:ee.value,title:e.file.path},null,8,cIe)):(g(),S("div",uIe,[_("span",dIe,I(y(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(g(),S("div",fIe,[_("table",pIe,[_("tbody",null,[(g(!0),S(Me,null,rt(Q.value,(D,X)=>(g(),S("tr",{key:X,class:Be(T(X+1)),"data-line":X+1},[_("th",null,I(X+1),1),(g(!0),S(Me,null,rt(D,(ve,fe)=>(g(),S("td",{key:fe},I(ve),1))),128))],10,hIe))),128))])])])):h.value==="image"?(g(),S("div",mIe,[W.value?(g(),S("img",{key:0,src:W.value,alt:e.file.path,class:Be(["fp-image",{actual:F.value==="actual"}])},null,10,gIe)):(g(),S("div",vIe,[_("span",wIe,[Z(Le,{name:"image-off",size:"lg"})]),_("span",yIe,I(y(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="video"?(g(),S("div",kIe,[G.value?(g(),S("video",{key:0,src:G.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,bIe)):(g(),S("div",_Ie,[_("span",xIe,[Z(Le,{name:"image-off",size:"lg"})]),_("span",SIe,I(y(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:E(e.file.size)})),1)]))])):h.value==="text"?(g(),S("div",CIe,[_("div",MIe,[(g(!0),S(Me,null,rt(w.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",T(X+1)]),"data-line":X+1},[_("span",TIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,EIe)],10,AIe))),128))])])):(g(),S("div",IIe,[_("div",LIe,[_("span",$Ie,[Z(Le,{name:"file-off",size:"lg"})]),_("span",NIe,I(y(n)("filePreview.binaryNoPreview",{mime:e.file.mime||y(n)("filePreview.unknownType"),size:E(e.file.size)})),1)])]))],64)):J("",!0)],512))}}),BIe=mt(zIe,[["__scopeId","data-v-97c52e24"]]),RIe={class:"ui-banner__icon","aria-hidden":"true"},FIe={class:"ui-banner__text"},jIe=Ge({__name:"Banner",props:{variant:{default:"info"}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-banner",`ui-banner--${e.variant}`]),role:"status"},[_("span",RIe,[Tn(t.$slots,"icon",{},()=>[e.variant==="info"?(g(),ce(Le,{key:0,name:"info",size:"md"})):(g(),ce(Le,{key:1,name:"alert-triangle",size:"md"}))],!0)]),_("span",FIe,[Tn(t.$slots,"default",{},void 0,!0)])],2))}}),z9=mt(jIe,[["__scopeId","data-v-566a0ac8"]]),x4=yo.global.t,OIe=40928,PIe=10485760,fn=Rs({open:!1,path:null,loading:!1,saving:!1,loadError:null,savingError:null,conflict:!1,dirty:!1,savedAt:null,languageId:void 0});let qa=null,ql=0,G5=null;const Cz={getContent:null};function YC(e){Cz.getContent=e}function HIe(){return fn}function DIe(){ql+=1,fn.path=null,fn.loading=!1,fn.saving=!1,fn.loadError=null,fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,qa=null,G5=null}async function Mz(e){const t=ZIe();if(!t){ql+=1,fn.open=!0,fn.path=e.path,fn.loading=!1,fn.loadError=x4("editor.readOnlyWhileMissingSession"),fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,fn.saving=!1,qa=null,G5=null;return}const n=++ql;fn.open=!0,fn.path=e.path,fn.loading=!0,fn.saving=!1,fn.loadError=null,fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,qa=null,G5=t;try{const o=await At().readFile(t,{path:e.path,length:PIe,encoding:"utf-8"});if(n!==ql)return;if(o.isBinary||o.encoding!=="utf-8"){fn.loadError=x4("editor.binaryNotEditable");return}qa=o.etag,fn.languageId=o.languageId,S4=o.content,H7=e.line,Az+=1}catch(o){if(n!==ql)return;qa=null,fn.loadError=o instanceof Error&&o.message.length>0?o.message:x4("editor.loadFailed")}finally{n===ql&&(fn.loading=!1)}}let S4,H7,Az=0;function VIe(){if(S4===void 0)return null;const e={content:S4,line:H7,revision:Az};return S4=void 0,H7=void 0,e}function WIe(){fn.dirty||(fn.dirty=!0,fn.savedAt=null),fn.savingError!==null&&(fn.savingError=null)}function Tz(){DIe(),fn.open=!1}async function qIe(){fn.path!==null&&await Mz({path:fn.path})}async function D7(e){const t=G5,n=fn.path;if(!t||!n||fn.saving||fn.loading||fn.conflict)return;const o=Cz.getContent;if(!o)return;const s=++ql;fn.saving=!0,fn.savingError=null;try{const r=await At().writeFile(t,{path:n,content:o(),...e?.force===!0||qa===null?{}:{baseEtag:qa}});if(s!==ql)return;qa=r.etag,fn.dirty=!1,fn.conflict=!1,fn.savedAt=Date.now()}catch(r){if(s!==ql)return;if(Ur(r)&&r.code===OIe){fn.conflict=!0;return}fn.savingError=r instanceof Error&&r.message.length>0?r.message:x4("editor.loadFailed")}finally{fn.saving=!1}}async function UIe(){fn.conflict=!1,await D7({force:!0})}function ZIe(){return Ez?.()??null}let Ez=null;function KIe(e){Ez=e}const B9="pythinker-light",R9="pythinker-dark";function GIe(e,t){const n=e.trim();if(/^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(n))return n;if(/^#[0-9a-f]{3,4}$/i.test(n))return`#${Array.from(n.slice(1),a=>a+a).join("")}`;const o=/^rgba?\(([^)]*)\)$/i.exec(n);if(o===null)return t;const s=o[1].split(/[\s,/]+/).filter(a=>a.length>0);if(s.length<3||s.length>4)return t;const r=s.slice(0,3).map(a=>XC(a,255)),i=s.length===4?XC(s[3],1):255;return r.some(a=>a===null)||i===null?t:`#${[...r,i===255?null:i].filter(a=>a!==null).map(a=>a.toString(16).padStart(2,"0")).join("")}`}function XC(e,t){const n=e.endsWith("%"),o=Number(n?e.slice(0,-1):e);if(!Number.isFinite(o))return null;const s=n?o/100:o/t;return Math.max(0,Math.min(255,Math.round(s*255)))}function zi(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return GIe(n.length>0?n:t,t)}function YIe(){return{bg:zi("--p-bg","#ffffff"),surface:zi("--color-surface","#fafbfc"),text:zi("--color-text","#14171c"),textMuted:zi("--color-text-muted","#6b7280"),line:zi("--color-line","#e7eaee"),accent:zi("--color-accent","#1783ff"),accentSoft:zi("--p-accent-soft","#1783ff24"),selection:zi("--p-selection","#1783ff2e"),danger:zi("--color-danger","#c0392b"),warning:zi("--color-warning","#a9610a"),success:zi("--color-success","#0e7a38")}}function v2(e){return e.slice(1,7)}function XIe(e,t){const n=YIe();e.editor.defineTheme(t?R9:B9,{base:t?"vs-dark":"vs",inherit:!0,rules:[{token:"comment",foreground:v2(n.textMuted),fontStyle:"italic"},{token:"string",foreground:v2(n.success)},{token:"keyword",foreground:v2(n.accent)},{token:"number",foreground:v2(n.warning)},{token:"type",foreground:v2(n.accent)}],colors:{"editor.background":n.bg,"editor.foreground":n.text,"editorLineNumber.foreground":n.textMuted,"editorLineNumber.activeForeground":n.text,"editor.selectionBackground":n.selection,"editor.lineHighlightBackground":n.surface,"editorCursor.foreground":n.accent,"editorIndentGuide.background1":n.line,"editorIndentGuide.activeBackground1":n.textMuted,"editorWidget.background":n.surface,"editorWidget.border":n.line,"editorError.foreground":n.danger,"editorWarning.foreground":n.warning,"scrollbarSlider.background":n.accentSoft,"scrollbarSlider.hoverBackground":n.accentSoft,"scrollbarSlider.activeBackground":n.accent}})}function JC(e,t){XIe(e,t),e.editor.setTheme(t?R9:B9)}const C4=vp();let QC=null;function JIe(){return QC??=ps(()=>import("./editor.main-1e103Orc.js").then(e=>e.b),__vite__mapDeps([10,5,11])).then(e=>{JC(e,C4.value),Ue(C4,()=>JC(e,C4.value))}),QC}function QIe(){return C4.value?R9:B9}function eLe(){return JIe()}const tLe={class:"monaco-pane"},nLe={key:0,class:"monaco-pane__boot"},oLe=Ge({__name:"MonacoPane",props:{path:{},languageId:{}},setup(e){const t=U(null),n=U(!0);let o=null,s=null,r=null,i=null;function l(){window.MonacoEnvironment===void 0&&ps(()=>import("./editor.worker-CNGv4jKH.js"),[]).then(d=>{window.MonacoEnvironment={getWorker:()=>new d.default}})}function a(d){if(d!==void 0&&new Set(["typescript","javascript","json","css","html","markdown","python","rust","go","yaml"]).has(d))return d;if(d==="typescriptreact"||d==="javascriptreact")return d.replace("react","");if(d==="shellscript")return"shell"}async function c(){if(o===null||s===null)return;const d=VIe(),f=u.path;if(f===null)return;const p=o.Uri.parse(`pythinker://session/${encodeURIComponent(f)}`),h=o.editor.getModel(p);if(i?.dispose(),i=null,r!==null&&r!==h&&r.dispose(),h===null)r=o.editor.createModel(d?.content??"",a(u.languageId),p);else{r=h,d!==null&&r.setValue(d.content);const m=a(u.languageId);m!==void 0&&o.editor.setModelLanguage(r,m)}i=r.onDidChangeContent(()=>WIe()),s.setModel(r),YC(()=>r?.getValue()??""),d?.line!==void 0&&d.line>0&&(s.revealLineInCenter(d.line),s.setPosition({lineNumber:d.line,column:1}))}xn(async()=>{l(),await eLe(),t.value!==null&&(o=await ps(()=>import("./editor.main-1e103Orc.js").then(d=>d.b),__vite__mapDeps([10,5,11])),t.value!==null&&(s=o.editor.create(t.value,{model:null,theme:QIe(),automaticLayout:!0,fontSize:12.5,fontFamily:'"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace',minimap:{enabled:!1},scrollBeyondLastLine:!1,renderLineHighlight:"line",padding:{top:8}}),n.value=!1,await c()))}),An(()=>{YC(null),i?.dispose(),r?.dispose(),s?.dispose(),r=null,i=null,s=null,o=null});const u=e;return Ue(()=>[u.path,u.languageId],async()=>{s!==null&&await c()}),(d,f)=>(g(),S("div",tLe,[n.value?(g(),S("div",nLe,[Z(Go,{size:"sm"})])):J("",!0),_("div",{ref_key:"rootRef",ref:t,class:"monaco-pane__host"},null,512)]))}}),sLe=mt(oLe,[["__scopeId","data-v-cb5f64f3"]]),rLe={class:"editor-panel"},iLe={class:"ed-path"},lLe={key:1,class:"ed-saved"},aLe={key:1,class:"ed-saving"},cLe={key:0,class:"editor-panel__empty"},uLe={class:"editor-panel__conflict-actions"},dLe={key:1,class:"editor-panel__save-error"},fLe=Ge({__name:"EditorPanel",emits:["close"],setup(e,{emit:t}){const{t:n}=Lt(),o=HIe(),s=t;function r(){Tz(),s("close")}function i(c){const u=c.split("/").at(-1)??c;return u.length>0?u:c}const l=B(()=>o.savedAt===null||o.dirty?!1:Date.now()-o.savedAt<2e3);function a(c){(c.metaKey||c.ctrlKey)&&c.key.toLowerCase()==="s"&&(c.preventDefault(),D7())}return window.addEventListener("keydown",a),An(()=>window.removeEventListener("keydown",a)),Ue(()=>o.open,c=>{c||s("close")}),(c,u)=>(g(),S("div",rLe,[Z(la,{wrap:"",title:y(n)("editor.title"),closable:"","close-label":y(n)("editor.closeEditor"),onClose:r},{default:ue(()=>[y(o).path!==null?(g(),S(Me,{key:0},[Z(Cn,{text:y(o).path},{default:ue(()=>[_("span",iLe,I(i(y(o).path)),1)]),_:1},8,["text"]),y(o).dirty?(g(),ce(Cn,{key:0,text:y(n)("editor.unsavedDot")},{default:ue(()=>[...u[3]||(u[3]=[_("span",{class:"ed-dirty"},null,-1)])]),_:1},8,["text"])):J("",!0),l.value?(g(),S("span",lLe,I(y(n)("editor.saved")),1)):J("",!0)],64)):J("",!0),y(o).path!==null&&y(o).loadError===null?(g(),S(Me,{key:1},[y(o).conflict?J("",!0):(g(),ce(Zt,{key:0,size:"sm",label:y(n)("editor.save"),disabled:!y(o).dirty||y(o).saving,onClick:u[0]||(u[0]=d=>y(D7)())},{default:ue(()=>[Z(Le,{name:"check",size:"sm"})]),_:1},8,["label","disabled"])),y(o).saving?(g(),S("span",aLe,[Z(Go,{size:"sm"})])):J("",!0)],64)):J("",!0)]),_:1},8,["title","close-label"]),y(o).loadError!==null?(g(),S("div",cLe,[Z(Sg,null,{default:ue(()=>[_("span",null,I(y(o).loadError),1),Z(It,{variant:"secondary",size:"sm",onClick:r},{default:ue(()=>[He(I(y(n)("filePreview.close")),1)]),_:1})]),_:1})])):(g(),S(Me,{key:1},[y(o).conflict?(g(),ce(z9,{key:0,variant:"warning",class:"editor-panel__conflict"},{default:ue(()=>[_("span",null,I(y(n)("editor.conflictText")),1),_("span",uLe,[Z(It,{variant:"secondary",size:"sm",onClick:u[1]||(u[1]=d=>y(qIe)())},{default:ue(()=>[He(I(y(n)("editor.conflictReload")),1)]),_:1}),Z(It,{variant:"danger",size:"sm",disabled:y(o).saving,onClick:u[2]||(u[2]=d=>y(UIe)())},{default:ue(()=>[He(I(y(n)("editor.conflictOverwrite")),1)]),_:1},8,["disabled"])])]),_:1})):J("",!0),y(o).savingError!==null?(g(),S("p",dLe,I(y(o).savingError),1)):J("",!0),y(o).path!==null?(g(),ce(sLe,{key:2,path:y(o).path,"language-id":y(o).languageId},null,8,["path","language-id"])):J("",!0)],64))]))}}),pLe=mt(fLe,[["__scopeId","data-v-579cb4a1"]]),hLe={class:"tp"},mLe=Ge({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=U(null);return Ue(()=>n.text,()=>{const i=r.value;!i||!(i.scrollHeight-i.scrollTop-i.clientHeight<24)||vt(()=>{r.value&&(r.value.scrollTop=r.value.scrollHeight)})},{immediate:!0}),(i,l)=>(g(),S("div",hLe,[Z(la,{title:y(s)("common.preview"),subtitle:e.subtitle??y(s)("thinking.panelTitle"),"close-label":y(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:r,class:"tp-body"},I(e.text),513)]))}}),gLe=mt(mLe,[["__scopeId","data-v-e1ad626c"]]),vLe={class:"agent-panel"},wLe={key:0,class:"agent-fallback"},yLe={key:0,class:"agent-error"},kLe={key:1,class:"fallback-lines"},bLe=Ge({__name:"AgentDetailPanel",props:{member:{},turns:{},running:{type:Boolean},loading:{type:Boolean},loadError:{type:Boolean},hasMore:{type:Boolean},loadingMore:{type:Boolean},loadMoreError:{type:Boolean}},emits:["close","loadOlderMessages","openAgent","openFile","openMedia","openTurnDiff"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=Kp(),i=B(()=>r.value?"lg":"md"),l=B(()=>r.value?"lg":"sm"),a=U(null),c=U(!0),u=U(!1),d=U(null),f=U(null),p=U({}),h=U(null);let m=null,k=0;const x=B(()=>{const q=new Set,P=[],W=n.member.prompt?.trim(),G=W?`$ ${W}`:void 0;for(const ee of[n.member.prompt,n.member.suspendedReason,n.member.text,n.member.outputLines?.join(` -`),n.member.summary]){const se=ee?.trim();!se||q.has(se)||se===G||(q.add(se),P.push(se))}return P}),w=B(()=>x.value.filter(q=>q!==n.member.prompt?.trim()).join(` -`)),v=pn("modelDisplay"),b=pn("subagentEffort"),M=B(()=>[n.member.subagentType,v?.(n.member.model),b?.(n.member.thinkingEffort)].filter(Boolean).join(" · ")||void 0);function R(){const q=a.value;q&&(c.value=q.scrollHeight-q.scrollTop-q.clientHeight<24)}function z(){vt(()=>{const q=a.value;q&&(q.scrollTop=q.scrollHeight)})}jn("pinScroll",q=>{const P=a.value;if(!P)return;const W=q.getBoundingClientRect().top;requestAnimationFrame(()=>{P.scrollTop+=q.getBoundingClientRect().top-W})}),Ue(()=>{const q=n.turns.at(-1);return`${n.member.id}:${n.turns.length}:${q?.text.length??0}:${q?.tools?.length??0}`},()=>{c.value&&z()},{immediate:!0});function $(q){const P=q[0].toUpperCase()+q.slice(1);return s(`tools.dynamic_workflow.phase${P}`)}function T(){const q=d.value?.el,P=f.value?.el;if(!q||!P)return;const W=q.getBoundingClientRect(),G=8,ee=8,se=Math.max(ee,Math.min(W.right-P.offsetWidth,window.innerWidth-P.offsetWidth-ee));W.bottom+G+P.offsetHeight<=window.innerHeight-ee?p.value={left:`${se}px`,top:`${W.bottom+G}px`}:p.value={left:`${se}px`,bottom:`${window.innerHeight-W.top+G}px`}}function E(){f.value?.el?.querySelector(".ui-menu-item:not(:disabled)")?.focus()}function N(q=!1){u.value&&(u.value=!1,window.removeEventListener("mousedown",H,!0),window.removeEventListener("keydown",V,!0),window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0),q&&d.value?.el?.focus())}async function C(){if(u.value){N(!0);return}u.value=!0,await vt(),u.value&&(T(),E(),window.addEventListener("mousedown",H,!0),window.addEventListener("keydown",V,!0),window.addEventListener("resize",T),window.addEventListener("scroll",T,!0))}function O(q){q.preventDefault(),C()}function H(q){const P=q.target;P&&(f.value?.el?.contains(P)||d.value?.el?.contains(P)||N())}function V(q){q.key==="Escape"&&(q.preventDefault(),q.stopImmediatePropagation(),N(!0))}function A(q){if(q.key!=="ArrowDown"&&q.key!=="ArrowUp")return;q.preventDefault();const P=Array.from(f.value?.el?.querySelectorAll(".ui-menu-item:not(:disabled)")??[]);if(P.length===0)return;const W=P.indexOf(document.activeElement),G=q.key==="ArrowDown"?(W+1)%P.length:(W-1+P.length)%P.length;P[G]?.focus()}function F(q){const P=q.relatedTarget;P&&(f.value?.el?.contains(P)||d.value?.el?.contains(P))||N()}async function j(q){const P=q==="command"?n.member.prompt:q==="output"?w.value:[n.member.prompt?.trim(),w.value].filter(Boolean).join(` - -`);if(!P)return;const W=++k;!await ss(P)||W!==k||(m!==null&&clearTimeout(m),h.value=q,m=setTimeout(()=>{m=null,h.value=null},1400),N(!0))}return Ue(()=>n.member.id,()=>{k+=1,m!==null&&clearTimeout(m),m=null,h.value=null,N()}),An(()=>{m!==null&&clearTimeout(m),N()}),(q,P)=>(g(),S("div",vLe,[Z(la,{title:e.member.name,subtitle:M.value,"close-label":y(s)("thinking.close"),onClose:P[0]||(P[0]=W=>o("close"))},{default:ue(()=>[Z(wi,{variant:"neutral",size:"sm"},{default:ue(()=>[He(I($(e.member.phase)),1)]),_:1}),e.member.prompt||w.value?(g(),ce(Zt,{key:0,ref_key:"copyTriggerRef",ref:d,size:l.value,class:Be({"copy-menu-open":u.value}),label:y(s)("tasks.copy"),tooltip:y(s)("tasks.copy"),"aria-haspopup":"menu","aria-expanded":u.value,onClick:C,onKeydown:[Eo(xt(O,["prevent"]),["down"]),Eo(xt(O,["prevent"]),["up"])],onFocusout:F},{default:ue(()=>[Z(Le,{name:h.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["size","class","label","tooltip","aria-expanded","onKeydown"])):J("",!0)]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:a,class:"agent-transcript",onScrollPassive:R},[e.turns.length===0&&!e.loading&&(e.loadError||x.value.length>0)?(g(),S("div",wLe,[e.loadError?(g(),S("div",yLe,I(y(s)("tasks.transcriptLoadError")),1)):J("",!0),x.value.length>0?(g(),S("pre",kLe,I(x.value.join(` -`)),1)):J("",!0)])):(g(),ce(Xv,{key:1,turns:e.turns,"turn-active":e.running,"session-loading":e.loading&&e.turns.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":c.value,"read-only":"",inspector:"",onLoadOlderMessages:P[1]||(P[1]=W=>o("loadOlderMessages")),onOpenAgent:P[2]||(P[2]=W=>o("openAgent",W)),onOpenFile:P[3]||(P[3]=W=>o("openFile",W)),onOpenMedia:P[4]||(P[4]=W=>o("openMedia",W)),onOpenTurnDiff:P[5]||(P[5]=W=>o("openTurnDiff",W))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following"]))],544),(g(),ce(Gi,{to:"body"},[u.value?(g(),ce(qi,{key:0,ref_key:"copyMenuRef",ref:f,class:"copy-menu",style:Wt(p.value),onKeydown:A,onFocusout:F},{default:ue(()=>[e.member.prompt?(g(),ce(yn,{key:0,size:i.value,onClick:P[6]||(P[6]=W=>j("command"))},{default:ue(()=>[Z(Le,{name:"terminal",size:"sm"}),_("span",null,I(y(s)("tasks.copyCommand")),1)]),_:1},8,["size"])):J("",!0),Z(yn,{size:i.value,disabled:!w.value,onClick:P[7]||(P[7]=W=>j("output"))},{default:ue(()=>[Z(Le,{name:"file-text",size:"sm"}),_("span",null,I(y(s)("tasks.copyOutput")),1)]),_:1},8,["size","disabled"]),Z(yn,{separator:""}),Z(yn,{size:i.value,onClick:P[8]||(P[8]=W=>j("all"))},{default:ue(()=>[Z(Le,{name:"copy",size:"sm"}),_("span",null,I(y(s)("tasks.copyAll")),1)]),_:1},8,["size"])]),_:1},8,["style"])):J("",!0)]))]))}}),_Le=mt(bLe,[["__scopeId","data-v-469ea882"]]),xLe={class:"tdp"},SLe={class:"tdp-body"},CLe={key:1,class:"tdp-output"},MLe={key:2,class:"tdp-empty"},ALe=Ge({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Lt();return(s,r)=>(g(),S("div",xLe,[Z(la,{title:e.target.title,subtitle:e.target.path,"close-label":y(o)("thinking.close"),onClose:r[0]||(r[0]=i=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",SLe,[e.target.lines&&e.target.lines.length>0?(g(),ce(OT,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(g(),S("div",CLe,[(g(!0),S(Me,null,rt(e.target.output,(i,l)=>(g(),S("div",{key:l},I(i),1))),128))])):(g(),S("div",MLe,I(y(o)("diff.noDiff")),1))])]))}}),TLe=mt(ALe,[["__scopeId","data-v-8b9af3ab"]]),ELe={class:"hl-body"},ILe={key:0,class:"hl-gutter"},LLe={class:"hl-sign"},$Le={class:"hl-text"},NLe=["data-line"],zLe={key:0,class:"hl-gutter"},BLe={class:"hl-text"},RLe=200,FLe=Ge({__name:"HighlightedCode",props:{code:{},lines:{},path:{},lineNumbers:{type:[Boolean,Array],default:!1},framed:{type:Boolean,default:!0},fullTexts:{default:null},lineClass:{},responsiveWrap:{type:Boolean,default:!1}},setup(e){const t={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",vue:"vue",svelte:"svelte",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",kt:"kt",kts:"kts",scala:"scala",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"cs",php:"php",sh:"sh",bash:"bash",zsh:"zsh",fish:"fish",ps1:"ps1",bat:"bat",cmd:"bat",sql:"sql",graphql:"graphql",prisma:"prisma",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yml",toml:"toml",ini:"ini",md:"md",markdown:"markdown",mdx:"mdx",lua:"lua",r:"r",dart:"dart",zig:"zig",mk:"makefile",cmake:"cmake",diff:"diff",proto:"proto"},n={dockerfile:"dockerfile",makefile:"makefile","cmakelists.txt":"cmake"};function o(V){const A=V?.split(/[\\/]/).pop()?.toLowerCase()??"";if(!A)return;const F=n[A];if(F)return F;const j=A.lastIndexOf(".");if(!(j<=0))return t[A.slice(j+1)]}function s(V){return V.split(/\r?\n/)}function r(V){const A={};V.color&&(A.color=V.color);const F=V.fontStyle??0;return F&1&&(A.fontStyle="italic"),F&2&&(A.fontWeight="var(--weight-semibold)"),F&4&&(A.textDecoration="underline"),A}const i=e,l=vp(),a=B(()=>i.lines!==void 0),c=B(()=>(i.lines??[]).some(V=>V.oldNo!==void 0)),u=B(()=>(i.lines??[]).some(V=>V.newNo!==void 0)),d=B(()=>i.lineNumbers===!0&&a.value),f=B(()=>Array.isArray(i.lineNumbers)?i.lineNumbers:null),p=B(()=>d.value?Number(c.value)+Number(u.value):f.value===null?0:1),h=B(()=>Array.isArray(i.code)?i.code:s(i.code??"")),m=B(()=>{const V=i.lines;return V?i.fullTexts?i.fullTexts:{before:V.filter(A=>A.oldNo!==void 0).map(A=>A.text).join(` +`),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function vxe(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:gxe(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function wxe(e){return{questionId:e.questionId,sessionId:e.sessionId,toolCallId:e.toolCallId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function yxe(e){const t=Ee.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function kxe(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":e.status==="cancelled"?t="cancelled":t="fail";let n="",o;if(e.status==="running"&&e.startedAt){o=Date.now()-new Date(e.startedAt).getTime();const l=Math.round(o/1e3),a=Math.floor(l/60),c=l%60;n=yo.global.t("tasks.timingRunning",{time:`${a}:${String(c).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){o=new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime();const l=Math.round(o/1e3);n=yo.global.t("tasks.timingDone",{sec:l})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,i=e.command??yxe(e),r=e.kind==="bash"&&i?`$ ${i}`:void 0;return{id:e.id,agentId:e.agentId,backgroundTaskId:e.backgroundTaskId,name:e.description,kind:e.kind,state:t,timing:n,durationMs:o,meta:r,output:s,subagentType:e.subagentType,phase:e.subagentPhase,model:e.model,thinkingEffort:e.thinkingEffort,dynamicWorkflowIndex:e.dynamicWorkflowIndex,swarmIndex:e.swarmIndex,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId,createdAt:e.createdAt,completedAt:e.completedAt}}const bxe=B(()=>{const e=Ee.sessions.find(n=>n.id===Ee.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:Ee.workspaceName,branch:t}}),_xe=B(()=>(Dd.value,Ee.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:T9(e.updatedAt),busy:E9(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),xxe=B(()=>Ee.activeSessionId??""),Sxe=B(()=>{const e=Ee.activeSessionId;if(e)return xo.skillsBySession.value[e]??[];const t=n6.value;return t?xo.skillsByWorkspace.value[t]??[]:[]}),R2=U({}),R7=U([]),F7=U(!1),Ha=U([]),j7=U(!1),wc=U({}),Cxe=B(()=>{const e=Ee.activeSessionId;return e?wc.value[e]??{}:{}});async function Mxe(e){R2.value={...R2.value,[e]:!0};try{await xo.loadSkillsForSession(e)}finally{R2.value={...R2.value,[e]:!1}}}async function Axe(){F7.value=!0;try{R7.value=await At().listConnectors()}catch{R7.value=[]}finally{F7.value=!1}}async function vz(){j7.value=!0;try{Ha.value=await At().listPlugins()}catch{Ha.value=[]}finally{j7.value=!1}}async function Exe(e,t){const n=Ha.value.find(o=>o.id===e)?.enabled;Ha.value=Ha.value.map(o=>o.id===e?{...o,enabled:t}:o);try{await At().setPluginEnabled(e,t)}catch(o){n!==void 0&&(Ha.value=Ha.value.map(s=>s.id===e?{...s,enabled:n}:s)),L0("setPluginEnabled",o);return}await vz()}async function Txe(e){await Promise.all([Mxe(e),Axe(),vz()])}async function Ixe(e){const t=Ee.activeSessionId;if(!t)return;const n=wc.value[t]??{};wc.value={...wc.value,[t]:{...n,...e}};try{await At().updateSession(t,e)}catch(o){throw wc.value={...wc.value,[t]:n},L0("updateCapabilities",o,{sessionId:t}),o}}const I9=B(()=>{const e=Ee.activeSessionId;return e?Ee.inFlightBySession[e]??!1:!1}),Lxe=B(()=>zt.isStartingFirstPrompt()),ui=o_e(Ee,{pushOperationFailure:L0,nextOptimisticMsgId:hz,connectEventsIfNeeded:C9,getEventConn:()=>Ji,resolveThinkingForPrompt:(e,t)=>xo.resolveThinkingForPrompt(e,t)}),au=B(()=>{const e=Ee.activeSessionId;if(!e)return[];const t=ui.sideChatTargetBySession.value[e]?.agentId;return(Ee.tasksBySession[e]??[]).filter(n=>n.id!==t)}),wz=Qke(Ee,au),$xe=B(()=>{const e=Ee.activeSessionId;if(!e)return[];const t=new Set(Ee.sideChatUserMessageIdsBySession[e]??[]),n=(Ee.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=Ee.approvalsBySession[e]??[];return _9(n,o,s=>At().getFileUrl(s),t6.value,Ee.planReviewByToolCallId)}),t6=B(()=>{const e=Ee.activeSessionId;return e?(Ee.turnActiveBySession[e]??!1)||(Ee.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),Nxe=B(()=>I9.value||t6.value),UC=new Map,zxe=B(()=>{wz.taskClock.value;const e=au.value.filter(o=>o.kind==="subagent"&&o.runInBackground).toSorted((o,s)=>Date.parse(o.createdAt)-Date.parse(s.createdAt)),t=Ee.activeSessionId??"__draft__",n=UC.get(t)??{indexes:new Map,next:1};UC.set(t,n);for(const o of e){const i=n.indexes.get(o.id)??(o.backgroundTaskId?n.indexes.get(o.backgroundTaskId):void 0)??n.next++;n.indexes.set(o.id,i),o.backgroundTaskId&&n.indexes.set(o.backgroundTaskId,i)}return au.value.map(o=>{const s=kxe(o);return o.kind==="subagent"&&o.runInBackground&&(s.dynamicWorkflowIndex=o.dynamicWorkflowIndex??n.indexes.get(o.id)),s})}),Bxe=B(()=>{const e=Ee.activeSessionId;if(!e)return{};const t={};for(const n of Ee.messagesBySession[e]??[])for(const o of n.content){if(o.type!=="toolUse"||o.toolName!=="ExitPlanMode")continue;const s=o.input&&typeof o.input=="object"?o.input:{},i=Ee.planReviewByToolCallId[o.toolCallId],r=i?.plan??(typeof s.plan=="string"?s.plan:void 0),l=i?.path??(typeof s.path=="string"?s.path:void 0)??(typeof s.planPath=="string"?s.planPath:void 0);t[o.toolCallId]={agentId:"main",toolCallId:o.toolCallId,turnId:n.id,source:"interaction",plan:r,path:l}}return t}),yz=B(()=>C_e(au.value)),Rxe=B(()=>A_e(au.value)),yc=B(()=>{const e=Ee.activeSessionId;return e?Ee.goalBySession[e]??null:null}),Fxe=B(()=>{const e=Ee.activeSessionId;return e?__e(Ee.messagesBySession[e]??[]):[]}),jxe=B(()=>{const e=Ee.activeSessionId;return e?Ee.compactionBySession[e]??null:null}),Oxe=B(()=>Ee.connection),Pxe=B(()=>Ee.loading),Hxe=B(()=>Ee.sessionLoading),Dxe=B(()=>{const e=Ee.activeSessionId;return e?Ee.messagesLoadingMoreBySession[e]??!1:!1}),Vxe=B(()=>{const e=Ee.activeSessionId;return e?Ee.messagesHasMoreBySession[e]??!1:!1}),Wxe=B(()=>{const e=Ee.activeSessionId;return e?Ee.messagesLoadMoreErrorBySession[e]??!1:!1}),qxe=B(()=>Ee.serverVersion),Uxe=B(()=>Ee.backend),Zxe=B(()=>Ee.experimentalFlagStates);function Kxe(e){return Ee.experimentalFlagStates.find(t=>t.id===e)}const Gxe=B(()=>Ee.dangerousBypassAuth);function Yxe(){Ee.dangerousBypassAuth=!1}const Xxe=B(()=>Ee.permission),Jxe=B(()=>Ee.thinking),kz=B(()=>{const e=Ee.activeSessionId;return e?Ee.planModeBySession[e]??!1:uf.planMode}),Qxe=B(()=>{const e=Ee.activeSessionId;return e?Ee.planArmedBySession[e]??!1:uf.planMode}),eSe=B(()=>{const e=Ee.activeSessionId;return e?Ee.dynamicWorkflowModeBySession[e]??!1:uf.dynamicWorkflowMode}),tSe=B(()=>{const e=Ee.activeSessionId;return e?Ee.goalModeBySession[e]??!1:uf.goalMode}),nSe=B(()=>{const e=M_e(yz.value);return{plan:kz.value,goal:yc.value&&yc.value.status!=="complete"?{status:yc.value.status,turnsUsed:yc.value.turnsUsed,elapsedMs:yc.value.wallClockMs}:null,dynamicWorkflow:e.total>0?e:null}}),oSe=B(()=>{const e=Ee.activeSessionId;if(!e)return[];const t=At();return(Ee.queuedBySession[e]??[]).map(n=>({id:n.id??n.text,text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),sSe=B(()=>Ee.warnings),iSe=B(()=>{const e=Ee.activeSessionId;return e?(Ee.questionsBySession[e]??[]).map(wxe):[]}),rSe=B(()=>{const e=Ee.activeSessionId;return e?(Ee.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:vxe(t),agentName:t.agentName,toolCallId:t.toolCallId})):[]}),L9=B(()=>{const e=Ee.activeSessionId;return e?(Ee.approvalsBySession[e]??[]).length>0?"awaiting-approval":(Ee.questionsBySession[e]??[]).length>0?"awaiting-question":I9.value||t6.value?"running":"idle":"idle"}),xo=kbe(Ee,{pushOperationFailure:L0,refreshSessionStatus:df,persistSessionProfile:dz,activity:L9,updateSession:Qp,updateSessionMessages:iz}),O7=B(()=>{const e=Ee.activeSessionId;if(!e)return null;const t=Ee.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),lSe=B(()=>{const e=Ee.activeSessionId;return e?Ee.gitStatusBySession[e]?.pullRequest??null:null}),aSe=B(()=>{const e=Ee.activeSessionId;if(!e)return[];const t=Ee.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).toSorted((n,o)=>n.path.localeCompare(o.path)):[]}),cSe=B(()=>{const e=Ee.activeSessionId;if(!e)return null;const t=Ee.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),bz=B(()=>{const e=Ee.sessions.find(r=>r.id===Ee.activeSessionId),t=O7.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?xo.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??Ee.defaultModel)??"—",s=xo.models.value.find(r=>r.id===o)??xo.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:Ee.permission,branch:t,cwd:e?.cwd??"",isGitRepo:O7.value!==null}}),uSe=B(()=>az.value),dSe=B(()=>Ee.sessions.find(t=>t.id===Ee.activeSessionId)?.usage.totalCostUsd??0),$9=B(()=>Ee.authReady),P7=U(null);Ue(e6,e=>{e&&P7.value===null&&(P7.value=$9.value)},{immediate:!0});const _z=B(()=>Yye(S9.value,P7.value??!1)),fSe=B(()=>Gye({initialized:e6.value,onboardingCompleted:_z.value,authReady:$9.value})),pSe=B(()=>Ee.defaultModel),hSe=B(()=>Ee.config),mSe=B(()=>{const e=Ee.activeSessionId;if(!e)return{};const t=Ee.gitStatusBySession[e];return t?{...t.entries}:{}});function cu(e){const t=Vr(e.cwd);return Ee.workspaces.find(n=>Vr(n.root)===t)?.id??e.workspaceId??e.cwd}const N9=B(()=>eke({workspaces:Ee.workspaces,sessions:Ee.sessions,hiddenWorkspaceRoots:Ee.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:Ee.sessionsHasMoreByWorkspace})),K5=U(qP()),uu=U(UP()==="manual"?"manual":"recent");function gSe(e){const t=mu(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}const pl=U(gSe(ln.pinnedSessions)),_4=U(Yo(ln.pinnedCollapsed)==="true");function vSe(e){pl.value=pl.value.includes(e)?pl.value.filter(t=>t!==e):[...pl.value,e],p1(ln.pinnedSessions,pl.value)}function wSe(e){const t=new Set(pl.value),n=e.filter(o=>t.has(o));pl.value=[...n,...pl.value.filter(o=>!n.includes(o))],p1(ln.pinnedSessions,pl.value)}function ySe(){_4.value=!_4.value,vs(ln.pinnedCollapsed,String(_4.value))}Ue(()=>[N9.value.map(e=>e.id).join("\0"),Ee.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=ZP(n,K5.value);o!==null&&(K5.value=o,xE(o))});const M0=B(()=>{const e=N9.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:z_e(t.root,Ee.fsHome),sessionCount:t.sessionCount}));if(uu.value==="recent"){const t=new Map;for(const n of Ee.sessions){if(n.parentSessionId)continue;const o=cu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return YP(e,t)}return KP(e,K5.value)}),n6=B(()=>{const e=Ee.activeWorkspaceId,t=M0.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Ue(n6,e=>{e&&(Object.prototype.hasOwnProperty.call(xo.skillsByWorkspace.value,e)||xo.loadSkillsForWorkspace(e))},{immediate:!0});const kSe=B(()=>{const e=n6.value;return e?M0.value.find(t=>t.id===e)??null:null}),bSe=B(()=>{Dd.value;const e=new Set(M0.value.map(n=>n.id)),t=new Map(M0.value.map(n=>[n.id,n.name]));return Ee.sessions.filter(n=>!n.parentSessionId&&e.has(cu(n))).map(n=>{const o=cu(n);return{id:n.id,title:n.title,time:T9(n.updatedAt),busy:E9(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),_Se=B(()=>{Dd.value;const e=new Map;for(const t of Ee.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=cu(t),o={id:t.id,title:t.title,time:T9(t.updatedAt),busy:E9(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return M0.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:Ee.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:Ee.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:Ee.sessionsInitialCountByWorkspace[t.id]??I7}))});function xSe(e){K5.value=e,xE(e),uu.value!=="manual"&&(uu.value="manual",SE("manual"))}function SSe(e){uu.value!==e&&(uu.value=e,SE(e))}const xz=B(()=>{const e={};for(const[t,n]of Object.entries(Ee.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(Ee.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),CSe=B(()=>{const e={};for(const[t,n]of Object.entries(Ee.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(Ee.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),MSe=B(()=>{const e={};for(const[t,n]of Object.entries(Ee.unreadBySession))n&&(e[t]=!0);return e}),ASe=B(()=>{const e={},t=xz.value;for(const n of Ee.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=cu(n);e[s]=(e[s]??0)+o}return e}),ESe=B(()=>Ee.recentRoots),TSe=B(()=>Ee.availableOpenInApps),ISe=B(()=>Ee.serverCapabilities.fs_write===!0),zt=vbe(Ee,{taskPoller:wz,sideChat:ui,modelProvider:xo,pushOperationFailure:L0,activity:L9,sessionsKnownEmpty:mz,setSessions:oz,updateSession:Qp,upsertSessionFront:F_e,appendSession:j_e,forgetSession:rz,setActiveSessionId:x9,updateSessionMessages:iz,nextOptimisticMsgId:hz,getEventConn:()=>Ji,syncSessionFromSnapshot:A9,reopenSession:pxe,hasLoadedMessages:cxe,refreshSessionStatus:df,refreshSessionGoal:V_e,persistSessionProfile:dz,mergedWorkspaces:N9,workspacesView:M0,status:bz,workspaceIdForSession:cu,savePermissionToStorage:E_e,seedPermissionFromDaemonDefault:R_e,savePlanModeToStorage:QN,saveDynamicWorkflowModeToStorage:ez,saveGoalModeToStorage:tz,draftModes:uf,saveUnread:xg,saveActiveWorkspaceToStorage:N_e,saveHiddenWorkspacesToStorage:$_e,goalErrorMessage:rxe,resetFastMoon:Rl.resetFastMoon,initialized:e6,connectIssue:uz,selectedDiffPath:lz,fileDiffLines:az,fileDiffLoading:cz});async function LSe(){await zt.loadConfig(),await Promise.all([zt.checkAuth(),xo.loadModels(),xo.loadProviders()])}function $Se(e,t){const n=Ee.sessions.find(o=>o.id===e);return n?zt.renameSession(e,LE(t,n.title)):Promise.resolve()}function z9(e){return e===Ee.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function NSe(e){if(Ee.turnActiveBySession[e]){const t={...Ee.turnActiveBySession};delete t[e],Ee.turnActiveBySession=t}Ee.inFlightBySession[e]&&(Ee.inFlightBySession={...Ee.inFlightBySession,[e]:!1})}function zSe(e,t,n){const o=Ee.promptIdBySession[e];zt.finishPromptLocal(e,{turnWasActive:n}),e===Ee.activeSessionId?(zt.loadGitStatus(e),df(e)):t==="idle"&&(Ee.unreadBySession={...Ee.unreadBySession,[e]:!0},xg({[e]:!0}));const s=(Ee.approvalsBySession[e]??[]).length>0,i=(Ee.questionsBySession[e]??[]).length>0;Lke(t,s,i)&&ul.maybeNotifyCompletion(e,{isUserWatching:z9(e),sessionTitle:Ee.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{zt.selectSession(e)}}),t==="idle"&&Hd.maybePlayCompletionSound()}function BSe(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;ul.maybeNotifyQuestion({isUserWatching:z9(e),sessionTitle:Ee.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{zt.selectSession(e)}}),Hd.maybePlayQuestionSound()}function RSe(e,t){ul.maybeNotifyApproval({isUserWatching:z9(e),sessionTitle:Ee.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{zt.selectSession(e)}}),Hd.maybePlayApprovalSound()}function b1(){return mxe(),{workspace:bxe,sessions:_xe,activeSessionId:xxe,workspacesView:M0,workspaceSortMode:uu,pinnedSessionIds:pl,pinnedCollapsed:_4,visibleWorkspace:kSe,activeWorkspaceId:n6,sessionsForView:bSe,workspaceGroups:_Se,attentionBySession:xz,pendingBySession:CSe,attentionByWorkspace:ASe,unreadBySession:MSe,recentRoots:ESe,turns:$xe,tasks:zxe,activeAppTasks:au,auxiliaryTranscripts:z7,todos:Fxe,goal:yc,dynamicWorkflows:yz,dynamicWorkflowMembersByToolCallId:Rxe,activationBadges:nSe,compaction:jxe,status:bz,sessionCost:dSe,fileDiff:uSe,selectedDiffPath:lz,fileDiffLoading:cz,changes:aSe,gitInfo:O7,gitDiffStats:cSe,activePullRequest:lSe,changesByPath:mSe,pendingApprovals:rSe,availableOpenInApps:TSe,fsWriteSupported:ISe,connection:Oxe,loading:Pxe,sessionLoading:Hxe,loadingMoreMessages:Dxe,hasMoreMessages:Vxe,loadMoreMessagesError:Wxe,serverVersion:qxe,backend:Uxe,experimentalFlagStates:Zxe,experimentalFlagState:Kxe,dangerousBypassAuth:Gxe,clearDangerousBypassAuth:Yxe,initialized:e6,connectIssue:uz,permission:Xxe,thinking:Jxe,planMode:kz,planArmed:Qxe,sessionPlans:Bxe,dynamicWorkflowMode:eSe,goalMode:tSe,queued:oSe,warnings:sSe,questions:iSe,activity:L9,turnActive:t6,inFlight:I9,working:Nxe,isStartingFirstPrompt:Lxe,fastMoon:Rl.fastMoon,models:xo.models,starredModelIds:xo.starredModelIds,providers:xo.providers,uiFontSize:Rl.uiFontSize,setUiFontSize:Rl.setUiFontSize,conversationToc:pz,setConversationToc:U_e,colorScheme:Rl.colorScheme,setColorScheme:Rl.setColorScheme,accent:Rl.accent,setAccent:Rl.setAccent,notifyOnComplete:ul.notifyOnComplete,notifyOnQuestion:ul.notifyOnQuestion,notifyOnApproval:ul.notifyOnApproval,notifyPermission:ul.notifyPermission,setNotifyOnComplete:ul.setNotifyOnComplete,setNotifyOnQuestion:ul.setNotifyOnQuestion,setNotifyOnApproval:ul.setNotifyOnApproval,soundOnComplete:Hd.soundOnComplete,setSoundOnComplete:Hd.setSoundOnComplete,onboarded:S9,setOnboarded:K_e,onboardingCompleted:_z,appState:fSe,load:zt.load,selectSession:zt.selectSession,clearActiveSession:zt.clearActiveSession,loadOlderMessages:zt.loadOlderMessages,loadWorkspaces:zt.loadWorkspaces,loadMoreSessions:zt.loadMoreSessions,loadAllSessions:zt.loadAllSessions,selectWorkspace:zt.selectWorkspace,openWorkspace:zt.openWorkspace,openWorkspaceDraft:zt.openWorkspaceDraft,startSessionAndSendPrompt:zt.startSessionAndSendPrompt,startSessionAndActivateSkill:zt.startSessionAndActivateSkill,startSessionAndOpenSideChat:zt.startSessionAndOpenSideChat,addWorkspaceByPath:zt.addWorkspaceByPath,browseFs:zt.browseFs,getFsHome:zt.getFsHome,sendPrompt:zt.sendPrompt,steerPrompt:zt.steerPrompt,steerQueued:zt.steerQueued,sideChatVisible:ui.sideChatVisible,sideChatSessionId:ui.sideChatSessionId,sideChatTurns:ui.sideChatTurns,sideChatRunning:ui.sideChatRunning,sideChatSending:ui.sideChatSending,openSideChat:ui.openSideChat,closeSideChat:ui.closeSideChat,sendSideChatPrompt:ui.sendSideChatPrompt,uploadImage:zt.uploadImage,abortCurrentPrompt:zt.abortCurrentPrompt,respondApproval:zt.respondApproval,respondQuestion:zt.respondQuestion,dismissQuestion:zt.dismissQuestion,pendingQuestionActions:zt.pendingQuestionActions,pendingApprovalActions:zt.pendingApprovalActions,cancelTask:zt.cancelTask,setPermission:zt.setPermission,setThinking:xo.setThinking,setPlanMode:zt.setPlanMode,togglePlanMode:zt.togglePlanMode,setDynamicWorkflowMode:zt.setDynamicWorkflowMode,toggleDynamicWorkflowMode:zt.toggleDynamicWorkflowMode,setGoalMode:zt.setGoalMode,toggleGoalMode:zt.toggleGoalMode,createGoal:zt.createGoal,controlGoal:zt.controlGoal,enqueue:zt.enqueue,dismissWarning:zt.dismissWarning,renameSession:zt.renameSession,renameWorkspace:zt.renameWorkspace,deleteWorkspace:zt.deleteWorkspace,reorderWorkspaces:xSe,setWorkspaceSortMode:SSe,togglePinnedSession:vSe,reorderPinnedSessions:wSe,togglePinnedCollapsed:ySe,setSessionEmoji:$Se,archiveSession:zt.archiveSession,exportSession:zt.exportSession,restoreSession:zt.restoreSession,loadArchivedSessions:zt.loadArchivedSessions,compact:zt.compact,forkSession:zt.forkSession,generateSessionTitle:zt.generateSessionTitle,undo:zt.undo,unqueue:zt.unqueue,reorderQueue:zt.reorderQueue,searchFiles:zt.searchFiles,loadGitStatus:zt.loadGitStatus,loadFileDiff:zt.loadFileDiff,clearFileDiff:zt.clearFileDiff,listDir:zt.listDir,readFileContent:zt.readFileContent,getFileDownloadUrl:zt.getFileDownloadUrl,openWorkspaceFile:zt.openWorkspaceFile,openInApp:zt.openInApp,revealWorkspaceFile:zt.revealWorkspaceFile,revealSavedPlan:zt.revealSavedPlan,resolveImageUrl:zt.resolveImageUrl,getFileUrl:e=>At().getFileUrl(e),loadModels:xo.loadModels,loadProviders:xo.loadProviders,skills:Sxe,skillsLoadingBySession:R2,connectors:R7,connectorsLoading:F7,plugins:Ha,pluginsLoading:j7,activeSessionCapabilities:Cxe,loadCapabilityData:Txe,updateCapabilities:Ixe,setPluginEnabled:Exe,activateSkill:xo.activateSkill,setModel:xo.setModel,toggleStarModel:xo.toggleStarModel,addProvider:xo.addProvider,deleteProvider:xo.deleteProvider,refreshProvider:xo.refreshProvider,refreshAllProviders:xo.refreshAllProviders,authReady:$9,defaultModel:pSe,config:hSe,updateConfig:zt.updateConfig,refreshServerMeta:zt.refreshServerMeta,checkAuth:zt.checkAuth,refreshRuntimeState:LSe}}const FSe=["aria-expanded","aria-label"],jSe={class:"capability-trigger-label"},OSe={class:"capability-panel"},PSe={class:"capability-viewport"},HSe={class:"capability-view"},DSe={key:1,class:"capability-group"},VSe={class:"capability-group-title"},WSe={class:"capability-caption"},qSe={key:0,class:"capability-loading"},USe={class:"capability-view capability-view-secondary"},ZSe={class:"capability-caption"},KSe={key:0,class:"capability-loading"},GSe={class:"capability-caption"},YSe={key:0,class:"capability-loading"},XSe=Ge({__name:"CapabilityMenu",props:{sessionId:{},triggerless:{type:Boolean}},setup(e,{expose:t}){const n=e,{t:o}=Lt(),s=b1(),i=U(null),r=U(null),l=U(!1),a=U("root"),c=U([]),u=B(()=>n.sessionId===s.activeSessionId.value?s.skills.value:[]),d=B(()=>{const H=n.sessionId;return H?s.skillsLoadingBySession.value[H]===!0:!1}),f=B(()=>s.connectors.value),p=B(()=>s.connectorsLoading.value),h=B(()=>s.plugins.value),m=B(()=>s.pluginsLoading.value),k=B(()=>n.sessionId===s.activeSessionId.value?s.activeSessionCapabilities.value:{}),x=B(()=>d.value||u.value.length>0),v=B(()=>p.value||f.value.length>0),w=B(()=>m.value||h.value.length>0),b=B(()=>{switch(a.value){case"skills":return o("capabilityMenu.skills.title");case"plugins":return o("capabilityMenu.plugins.title");case"root":return""}}),M=B(()=>{switch(a.value){case"skills":return u.value.length;case"plugins":return h.value.length;case"root":return 0}});function R(){c.value=k.value.mcpServers!==void 0?[...k.value.mcpServers]:f.value.map(H=>H.id)}Ue([()=>n.sessionId,f,k],R,{immediate:!0}),Ue([u,d,h,m],()=>{a.value==="skills"&&!d.value&&u.value.length===0&&(a.value="root"),a.value==="plugins"&&!m.value&&h.value.length===0&&(a.value="root")});function z(){if(l.value=!l.value,!l.value){a.value="root";return}n.sessionId&&s.loadCapabilityData(n.sessionId)}t({toggleOpen:z});function $(){l.value=!1,a.value="root"}const E={tools:Promise.resolve(),mcpServers:Promise.resolve()},T={tools:0,mcpServers:0};function N(H,V,A){const F=++T[H],j=n.sessionId,q=E[H].then(async()=>{if(n.sessionId===j)try{await s.updateCapabilities({[H]:[...V.value]})}catch{F===T[H]&&n.sessionId===j&&(V.value=A)}});return E[H]=q,q}function C(H,V){const A=[...c.value],F=new Set(A);return V?F.add(H):F.delete(H),c.value=[...F],N("mcpServers",c,A)}function O(H,V){s.setPluginEnabled(H,V)}return(H,V)=>(g(),S("div",{ref_key:"rootRef",ref:i,class:"capability-control"},[n.triggerless?J("",!0):(g(),S("button",{key:0,ref_key:"triggerRef",ref:r,type:"button",class:Be(["capability-trigger",{open:l.value}]),"aria-expanded":l.value,"aria-haspopup":"dialog","aria-label":y(o)("capabilityMenu.triggerLabel"),onClick:xt(z,["stop"])},[V[5]||(V[5]=H2('',1)),_("span",jSe,I(y(o)("capabilityMenu.trigger")),1)],10,FSe)),Z(zE,{anchor:n.triggerless?i.value:r.value,open:l.value,label:y(o)("capabilityMenu.triggerLabel"),onClose:$},{default:ue(()=>[_("div",OSe,[_("div",PSe,[_("div",{class:Be(["capability-track",{"is-drilled":a.value!=="root"}])},[_("div",HSe,[x.value?(g(),ce(dc,{key:0,count:u.value.length,onClick:V[0]||(V[0]=A=>a.value="skills")},{label:ue(()=>[He(I(y(o)("capabilityMenu.skills.title")),1)]),trailing:ue(()=>[...V[6]||(V[6]=[_("svg",{class:"chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m6 3 5 5-5 5"})],-1)])]),_:1},8,["count"])):J("",!0),v.value?(g(),S("div",DSe,[_("div",VSe,I(y(o)("capabilityMenu.mcp.title")),1),_("p",WSe,I(y(o)("capabilityMenu.mcp.caption")),1),p.value?(g(),S("div",qSe,[Z(Bm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},it(f.value,A=>(g(),ce(dc,{key:A.id,class:"mcp-row",selected:c.value.includes(A.id),title:A.name,onClick:F=>void C(A.id,!c.value.includes(A.id))},{label:ue(()=>[He(I(A.name),1)]),trailing:ue(()=>[Z(TC,{"model-value":c.value.includes(A.id),"aria-label":y(o)("capabilityMenu.mcp.toggle",{name:A.name}),onClick:V[1]||(V[1]=xt(()=>{},["stop"])),"onUpdate:modelValue":F=>void C(A.id,F)},null,8,["model-value","aria-label","onUpdate:modelValue"])]),_:2},1032,["selected","title","onClick"]))),128))])):J("",!0),w.value?(g(),ce(dc,{key:2,count:h.value.length,onClick:V[2]||(V[2]=A=>a.value="plugins")},{label:ue(()=>[He(I(y(o)("capabilityMenu.plugins.title")),1)]),trailing:ue(()=>[...V[7]||(V[7]=[_("svg",{class:"chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m6 3 5 5-5 5"})],-1)])]),_:1},8,["count"])):J("",!0)]),_("div",USe,[a.value!=="root"?(g(),ce(dc,{key:0,class:"capability-back",count:M.value,onClick:V[3]||(V[3]=A=>a.value="root")},{leading:ue(()=>[...V[8]||(V[8]=[_("svg",{class:"back-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"m10 3-5 5 5 5"})],-1)])]),label:ue(()=>[He(I(b.value||y(o)("capabilityMenu.back")),1)]),_:1},8,["count"])):J("",!0),a.value==="skills"?(g(),S(Me,{key:1},[_("p",ZSe,I(y(o)("capabilityMenu.skills.caption")),1),d.value?(g(),S("div",KSe,[Z(Bm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},it(u.value,A=>(g(),ce(dc,{key:A.name,class:"skill-row",disabled:"",title:A.description},{label:ue(()=>[He(I(A.name),1)]),_:2},1032,["title"]))),128))],64)):a.value==="plugins"?(g(),S(Me,{key:2},[_("p",GSe,I(y(o)("capabilityMenu.plugins.caption")),1),m.value?(g(),S("div",YSe,[Z(Bm,{label:y(o)("capabilityMenu.loading")},null,8,["label"])])):(g(!0),S(Me,{key:1},it(h.value,A=>(g(),ce(dc,{key:A.id,class:"plugin-row",selected:A.enabled,title:A.displayName,onClick:F=>O(A.id,!A.enabled)},{label:ue(()=>[He(I(A.displayName),1)]),trailing:ue(()=>[Z(TC,{"model-value":A.enabled,"aria-label":y(o)("capabilityMenu.plugins.toggle",{name:A.displayName}),onClick:V[4]||(V[4]=xt(()=>{},["stop"])),"onUpdate:modelValue":F=>O(A.id,F)},null,8,["model-value","aria-label","onUpdate:modelValue"])]),_:2},1032,["selected","title","onClick"]))),128))],64)):J("",!0)])],2)])])]),_:1},8,["anchor","open","label"])],512))}}),JSe=mt(XSe,[["__scopeId","data-v-ff3a96c4"]]);let m2=0,Hm=null;function Sz(){function e(){typeof document>"u"||(m2+=1,m2===1&&(Hm=document.body.style.overflow,document.body.style.overflow="hidden"))}function t(){m2<=0||(m2-=1,m2===0&&typeof document<"u"&&(document.body.style.overflow=Hm??"",Hm=null))}return{lock:e,unlock:t}}const QSe={key:0,class:"sheet-root"},eCe=["aria-label"],tCe=["aria-label"],nCe={key:0,class:"sheet-head"},oCe={class:"sheet-title"},sCe={class:"sheet-body"},iCe=Ge({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,{lock:i,unlock:r}=Sz();function l(){s("update:modelValue",!1),s("close")}function a(c){c.key==="Escape"&&o.closeOnEsc&&l()}return Ue(()=>o.modelValue,c=>{typeof document>"u"||(c?(i(),document.addEventListener("keydown",a)):(r(),document.removeEventListener("keydown",a)))},{immediate:!0}),An(()=>{typeof document<"u"&&(r(),document.removeEventListener("keydown",a))}),(c,u)=>(g(),ce(gr,{name:"sheet"},{default:ue(()=>[e.modelValue?(g(),S("div",QSe,[_("div",{class:"sheet-scrim",onClick:l}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||y(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":y(n)("mobile.closeSheet"),onClick:l},null,8,tCe),e.title?(g(),S("div",nCe,[_("span",oCe,I(e.title),1)])):J("",!0),_("div",sCe,[En(c.$slots,"default",{},void 0,!0)])],8,eCe)])):J("",!0)]),_:3}))}}),Gc=mt(iCe,[["__scopeId","data-v-92ecd88c"]]),rCe={class:"att-lightbox-card"},lCe=["src"],aCe=["src","alt"],cCe={class:"att-lightbox-name"},uCe={key:0,class:"att-strip"},dCe={class:"att-scroll-content"},fCe={key:1,class:"att-row"},pCe={key:0,class:"att-more"},hCe={class:"cin-wrap"},mCe=["onClick"],gCe={class:"am-icon"},vCe={class:"am-name"},wCe={key:0,class:"am-desc"},yCe={class:"input-row"},kCe=["placeholder","disabled","aria-expanded","aria-controls","aria-activedescendant"],bCe=["aria-label"],_Ce={class:"toolbar-left"},xCe=["aria-label","onKeydown"],SCe={class:"perm-pill-label"},CCe=["onClick"],MCe={class:"pd-info"},ACe={class:"pd-desc"},ECe={class:"pd-check"},TCe={key:1,class:"workflow-chip"},ICe={class:"workflow-label"},LCe={class:"toolbar-right"},$Ce=["aria-label"],NCe=["aria-expanded","aria-label"],zCe=["disabled","aria-expanded","aria-label","onKeydown"],BCe={class:"thinking-pill-label"},RCe=["aria-label"],FCe=["aria-label","disabled"],jCe={class:"md-list"},OCe={key:0,class:"md-section"},PCe=["onClick"],HCe={class:"md-check"},DCe={class:"md-name"},VCe={class:"md-provider"},WCe={key:1,class:"md-divider"},qCe={key:2,class:"md-section"},UCe=["onClick"],ZCe={class:"md-check"},KCe={class:"md-name"},GCe={key:0,class:"md-divider"},YCe={class:"md-check md-more-icon"},XCe={class:"md-name"},JCe=["aria-label","onKeydown"],QCe={class:"thinking-dropdown-title"},eMe={class:"thinking-cache-note"},tMe={class:"drop-card"},nMe={class:"msheet-search"},oMe={class:"msheet-search"},sMe=["onClick"],iMe={class:"am-icon"},rMe={class:"am-name"},lMe={key:0,class:"am-desc"},ZC=36,aMe=Ge({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},working:{type:Boolean,default:!1},goalMode:{type:Boolean},workflowActive:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean,default:!1}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=B(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):o.planArmed||o.planMode?r("status.planPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Lt(),a=Gp(),{text:c,textareaRef:u,autosize:d,loadForEdit:f,clearDraft:p}=Aye({sessionId:()=>o.sessionId});function h(){o.planArmed||o.planMode||(o.goalMode&&i("toggleGoal"),i("togglePlan"))}function m(){if(De.value){i("focusGoal");return}o.goalMode||((o.planArmed||o.planMode)&&i("togglePlan"),i("toggleGoal"))}const k=U(!1);function x(){k.value=!k.value,vt(()=>{d(),M(),u.value?.focus()})}function v(){k.value&&(k.value=!1,vt(d))}function w(Se){if(typeof getComputedStyle>"u")return ZC;const rt=Number.parseFloat(getComputedStyle(Se).minHeight);return Number.isFinite(rt)&&rt>0?rt:ZC}const b=U(!1);function M(){const Se=u.value;b.value=!!Se&&Se.scrollHeight>w(Se)}Ue(c,()=>{vt(M)}),Ue(()=>o.sessionId,()=>{k.value=!1,z.value=!1,C.value=!1});const R=Sye({text:c,textareaRef:u,autosize:d,sessionId:()=>o.sessionId}),{open:z,items:$,active:E,update:T,select:N}=Cye({text:c,textareaRef:u,autosize:d,skills:()=>o.skills,emitCommand:Se=>{if(Se==="/plan"){h();return}if(Se==="/goal"){m();return}i("command",Se)},historyPush:Se=>R.push(Se),clearDraft:p}),{open:C,items:O,active:H,loading:V,stale:A,update:F,select:j,close:q,getMentionToken:P}=Mye({text:c,textareaRef:u,autosize:d,searchFiles:()=>o.searchFiles}),W=U(null),G=U(null),ee=U(null);function se(Se){u.value?.setSelectionRange(Se,Se)}const oe=B({get:()=>c.value.startsWith("/")?c.value.slice(1):c.value,set:Se=>{c.value=`/${Se}`,vt(()=>{se(c.value.length),T()})}}),Q=B({get:()=>{const Se=ee.value;return Se?c.value.slice(Se.start+1,Se.end):""},set:Se=>{const rt=ee.value;if(!rt)return;c.value=`${c.value.slice(0,rt.start)}@${Se}${c.value.slice(rt.end)}`;const pt=rt.start+Se.length+1;ee.value={start:rt.start,end:pt},vt(()=>{se(pt),F()})}});Ue([z,a],async([Se,rt])=>{!Se||!rt||(await vt(),W.value?.focus())}),Ue([C,a],async([Se,rt])=>{!Se||!rt||(ee.value=P(),await vt(),G.value?.focus())});function ge(){z.value=!1,u.value?.focus()}function xe(Se){Se||ge()}function Ke(){q(),ee.value=null,u.value?.focus()}function et(Se){Se||Ke()}function Y(){R.resetBrowsing(),T(),F()}const{attachments:ne,previewAttachment:D,fileInputRef:X,isDragOver:ve,removeAttachment:fe,openAttachmentPreview:pe,closeAttachmentPreview:te,openFilePicker:de,handleFileInputChange:ye,handleDragOver:Ce,handleDragLeave:me,handleDrop:be,clearAfterSubmit:ie,loadAttachments:ke}=Eye({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});function Fe(){const Se=ne.value.map(rt=>rt.localId);for(const rt of Se)fe(rt)}const at=B(()=>ne.value.filter(Se=>Se.kind!=="file")),dt=B(()=>ne.value.filter(Se=>Se.kind==="file")),$t=U(null),Et=U(null),Qt=U(!1);let Dt=null;function en(){const Se=$t.value;Qt.value=Se!==null&&Se.scrollHeight>Se.clientHeight+1}Ue($t,Se=>{Dt?.disconnect(),Dt=null,Se&&typeof ResizeObserver=="function"&&(Dt=new ResizeObserver(en),Dt.observe(Se)),en()},{immediate:!0}),Ue(ne,()=>void vt(en),{deep:!0}),Ue(()=>[at.value.length,dt.value.length],([Se,rt],[pt,un])=>{Se<=pt&&rt<=un||vt(()=>{const Co=$t.value;Co&&(Co.scrollTop=Se>pt&&Et.value?Et.value.offsetHeight-Co.clientHeight:Co.scrollHeight)})}),xn(()=>{c.value&&vt(()=>{d(),M()})}),An(()=>{document.removeEventListener("click",Jn,!0),Dt?.disconnect(),nt?.disconnect(),Jo?.disconnect(),an()});function kn(){u.value?.focus({preventScroll:!0})}function In(Se){ke(Se)}const Mn=B(()=>z.value||C.value||Ct.value||so.value||Bn.value||rs.value),Re=B(()=>c.value.trim().length===0&&ne.value.length===0);t({loadForEdit:f,loadAttachmentsForEdit:In,focus:kn,anyPopupOpen:Mn,isEmpty:Re});function lt(Se){return{fileId:Se.fileId,kind:Se.kind,name:Se.name,mediaType:Se.mediaType,size:Se.size}}function tt(Se){if(Se.kind==="file"){Se.fileId!==void 0&&bN(Se.fileId,Se.name,Se.mediaType);return}pe(Se)}function ht(){const Se=c.value.trim();if(ne.value.some(un=>un.uploading))return;const rt=ne.value.filter(un=>!un.uploading&&!un.error&&un.fileId);if(!Se&&rt.length===0)return;if(R.push(Se),Se==="/plan"){c.value="",p(),z.value=!1,v(),h();return}if(Se==="/goal"){c.value="",p(),z.value=!1,v(),m();return}if(Se){const un=gye(Se),Co=un?IN(o.skills).some(Vo=>Vo.name===un.cmd||Vo.name===`/${O5}${un.cmd.slice(1)}`):!1;if(un&&Co){c.value="",p(),z.value=!1,v(),i("command",un.arg?`${un.cmd} ${un.arg}`:un.cmd);return}}const pt={text:Se,attachments:rt.map(un=>lt(un))};D.value=null,ie(),c.value="",p(),z.value=!1,C.value=!1,v(),i("submit",pt)}function bt(){if(!o.running||ne.value.some(un=>un.uploading))return;const Se=c.value.trim(),rt=ne.value.filter(un=>!un.uploading&&!un.error&&un.fileId);if(!Se&&rt.length===0&&o.queued.length===0)return;const pt={text:Se,attachments:rt.map(un=>lt(un))};ie(),R.push(Se),c.value="",p(),z.value=!1,C.value=!1,v(),i("steer",pt)}let Rt=!1,on=null;function an(){on!==null&&(clearTimeout(on),on=null)}function sn(){an(),Rt=!0}function Yn(){an(),on=setTimeout(()=>{on=null,Rt=!1},0)}function Kt(Se){return Rt||Se.isComposing||Se.keyCode===229}function no(Se){if(!Kt(Se)){if(Ut.value&&Se.key==="Backspace"&&!Se.shiftKey&&!Se.altKey&&!Se.metaKey&&!Se.ctrlKey){const rt=u.value;if(rt&&rt.selectionStart===0&&rt.selectionEnd===0){Se.preventDefault(),Qo();return}}if(Se.key==="Escape"){if(rs.value){Se.preventDefault(),jt();return}if(Ct.value){Se.preventDefault(),wt();return}if(so.value){Se.preventDefault(),ze();return}if(Bn.value){Se.preventDefault(),tn();return}}if(z.value){if(Se.key==="Escape"){Se.preventDefault(),z.value=!1;return}if(Se.key==="Tab"&&$.value.length===0){z.value=!1;return}if(Se.key==="ArrowDown"){Se.preventDefault(),E.value=(E.value+1)%$.value.length;return}if(Se.key==="ArrowUp"){Se.preventDefault(),E.value=(E.value-1+$.value.length)%$.value.length;return}if(Se.key==="Enter"||Se.key==="Tab"){Se.preventDefault();const rt=$.value[E.value];rt&&N(rt);return}}if(C.value&&!V.value){if(Se.key==="ArrowDown"){Se.preventDefault(),H.value=(H.value+1)%Math.max(1,O.value.length);return}if(Se.key==="ArrowUp"){Se.preventDefault(),H.value=(H.value-1+Math.max(1,O.value.length))%Math.max(1,O.value.length);return}if(Se.key==="Enter"||Se.key==="Tab"){Se.preventDefault();const rt=O.value[H.value];rt&&j(rt);return}if(Se.key==="Escape"){Se.preventDefault(),C.value=!1;return}}if(Se.key==="s"&&(Se.ctrlKey||Se.metaKey)&&!Se.shiftKey&&!Se.altKey){o.running&&(Se.preventDefault(),bt());return}if(!k.value&&!z.value&&!C.value&&!Se.shiftKey&&!Se.altKey&&!Se.metaKey&&!Se.ctrlKey){const rt=R.isBrowsing();if(Se.key==="ArrowUp"&&R.hasHistory()&&(rt||R.caretAtTextStart())){Se.preventDefault(),R.recallOlder(),z.value=!1;return}if(Se.key==="ArrowDown"&&rt){Se.preventDefault(),R.recallNewer(),z.value=!1;return}}if(Se.key==="Enter"&&!Se.shiftKey){if(k.value&&!(Se.metaKey||Se.ctrlKey))return;Se.preventDefault(),ht()}}}const As=B(()=>r("composer.send")),ys=B(()=>!!o.uploadImage),ao=B(()=>!ne.value.some(Se=>Se.uploading)&&(c.value.trim()!==""||ne.value.some(Se=>!Se.error&&Se.fileId))),co=B(()=>{if(z.value)return"composer-slash-menu";if(C.value)return"composer-mention-menu"}),oo=B(()=>{if(z.value&&$.value.length>0)return`composer-slash-option-${E.value}`;if(C.value&&O.value.length>0)return`composer-mention-option-${H.value}`}),Ct=U(!1),so=U(!1),Bn=U(!1),Pn=U(null),js=U(null),Os=U(null),Es=U(null),ks=U(null),Lo=U(null),Ro=U(null),Ze=U(null);Vl(Lo),Vl(Ro),Vl(Ze);const Qe=U(""),ct=U(""),mn=U(""),_o=U(""),Un=U(!1);function Ps(){Ct.value=!Ct.value,Ct.value&&(Xo(),so.value=!1,Bn.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0))}function Je(){ro.value||(so.value=!so.value,so.value&&(io(),Ct.value=!1,Bn.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0)))}function ze(){so.value=!1,Xn()}function wt(){Ct.value=!1,Xn()}function Mt(){Bn.value=!Bn.value,Bn.value&&(Ts(),Ct.value=!1,so.value=!1,jt(),z.value=!1,C.value=!1,document.addEventListener("click",Jn,!0))}function tn(){Bn.value=!1,Xn()}function Xn(){!Ct.value&&!so.value&&!Bn.value&&!rs.value&&document.removeEventListener("click",Jn,!0)}function Jn(Se){const rt=Se.target;Pn.value?.contains(rt)||re.value?.contains(rt)||_e.value?.contains(rt)||(wt(),ze(),tn(),jt())}function Ts(){const Se=js.value,rt=Pn.value;Qe.value=Se&&rt?`${Math.round(Se.getBoundingClientRect().left-rt.getBoundingClientRect().left)}px`:""}function Xo(){const Se=Os.value,rt=Pn.value;ct.value=Se&&rt?`${Math.round(rt.getBoundingClientRect().right-Se.getBoundingClientRect().right)}px`:""}function io(){const Se=Es.value,rt=Pn.value;mn.value=Se&&rt?`${Math.round(rt.getBoundingClientRect().right-Se.getBoundingClientRect().right)}px`:""}const uo=B(()=>{const Se=o.status?.ctxMax??0;return Se<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Se*100)))}),vn=B(()=>{const Se=na(o.status?.ctxUsed??0),rt=na(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Se,max:rt,pct:uo.value})}),Hs=B(()=>uo.value>=80),bs=B(()=>o.models?.find(Se=>Se.id===o.status?.modelId)),Cr=B(()=>Zp(bs.value)),ri=B(()=>Kp(bs.value)),Is=B(()=>r9(bs.value,o.thinking)),Ys=B(()=>ri.value.includes(Is.value)?Is.value:""),ro=B(()=>Cr.value==="unsupported"||ri.value.length<=1),Io=B(()=>{const Se=(bs.value?.supportEfforts?.length??0)>0,rt=Is.value;return Se&&rt!=="on"&&rt!=="off"?Pd(rt):sr(rt)}),yi=B(()=>r("composer.thinkingControl",{level:Io.value}));function ki(Se){ro.value||(i("setThinking",$N(bs.value,Se)),ze())}function sr(Se){return Se==="on"?r("status.thinkingOn"):Se==="off"?r("status.thinkingOff"):Pd(Se)}const Oi=B(()=>ri.value.map(Se=>({value:Se,label:sr(Se)}))),Pi=B(()=>o.planArmed===!0||o.planMode===!0),Te=B(()=>o.workflowActive===!0),Ae=B(()=>o.goal?.status??o.activationBadges?.goal?.status??null),De=B(()=>Ae.value!==null&&Ae.value!=="complete"),Ut=B(()=>o.goalMode?"goal":o.planArmed?"plan":null),dn=U(null),zn=U(""),So=B(()=>zn.value?{textIndent:zn.value}:void 0);let Jo=null;function Qo(){Ut.value==="goal"?i("toggleGoal"):Ut.value==="plan"&&i("togglePlan")}function Mr(){const Se=dn.value;zn.value=Se?`calc(${Se.offsetWidth}px + var(--space-1-5) - var(--space-05))`:""}Ue(Ut,async Se=>{if(Jo?.disconnect(),Jo=null,!Se){zn.value="";return}await vt(),Mr(),typeof ResizeObserver=="function"&&dn.value&&(Jo=new ResizeObserver(Mr),Jo.observe(dn.value))},{immediate:!0});const es=U(null),rs=U(!1),re=U(null),_e=U(null);Vl(re),Vl(_e);const Ie=U(null),je=U(null);let nt=null;const kt=B(()=>{const Se=[];return ys.value&&Se.push({id:"files",icon:"attachment",nameKey:"composer.addFiles",action:qt}),a.value&&Se.push({id:"slash",icon:"terminal",nameKey:"composer.addSlash",descKey:"composer.addSlashDesc",action:$n},{id:"mention",icon:"link",nameKey:"composer.addMention",descKey:"composer.addMentionDesc",action:Nn}),Se.push({id:"capabilities",icon:"sliders",nameKey:"capabilityMenu.trigger",action:qe},{id:"goal",icon:"target",nameKey:"status.goalLabel",descKey:"composer.addGoalDesc",action:he},{id:"plan",icon:"file-edit",nameKey:"status.planLabel",descKey:"composer.addPlanDesc",action:$e},{id:"workflow",icon:"sparkles",nameKey:"status.dynamicWorkflowLabel",descKey:"composer.addWorkflowDesc",action:bn}),Se});function Pt(){const Se=Ie.value;if(!Se||Se.scrollHeight<=Se.clientHeight+1){je.value=null;return}const rt=getComputedStyle(Se),pt=Number.parseFloat(rt.getPropertyValue("--menu-scrollbar-track-inset"))||0,un=Number.parseFloat(rt.getPropertyValue("--menu-scrollbar-thumb-min"))||24,Co=Se.clientHeight-pt*2,Vo=Math.max(un,Se.clientHeight/Se.scrollHeight*Co),Wo=Se.scrollHeight-Se.clientHeight;je.value={top:Se.offsetTop+pt+Se.scrollTop/Wo*(Co-Vo),height:Vo}}Ue(rs,async Se=>{nt?.disconnect(),nt=null,je.value=null,Se&&(await vt(),Pt(),typeof ResizeObserver=="function"&&Ie.value&&(nt=new ResizeObserver(Pt),nt.observe(Ie.value)))});function jt(){rs.value=!1,Xn()}function Ln(Se){Se||jt()}function cn(){if(rs.value){jt();return}wt(),ze(),tn(),z.value=!1,C.value=!1,rs.value=!0,document.addEventListener("click",Jn,!0),vt(()=>{(a.value?_e.value:re.value)?.querySelector(".am-row")?.focus()})}function Rn(Se){Se.action(),a.value&&Se.id==="files"||u.value?.focus()}function wo(Se){if(Se.key==="Escape"){Se.preventDefault(),jt(),u.value?.focus();return}if(Se.key==="Tab"){jt();return}if(Se.key!=="ArrowDown"&&Se.key!=="ArrowUp")return;Se.preventDefault();const rt=a.value?_e.value:re.value,pt=Array.from(rt?.querySelectorAll(".am-row")??[]);if(pt.length===0)return;const un=pt.indexOf(document.activeElement),Co=Se.key==="ArrowDown"?(un+1)%pt.length:(un-1+pt.length)%pt.length;pt[Co]?.focus()}function qt(){jt(),de()}function $n(){jt(),c.value="/",vt(()=>{se(1),T()})}function Nn(){jt(),c.value="@",vt(()=>{se(1),F()})}function qe(){jt(),es.value?.toggleOpen()}function he(){jt(),o.goalMode||m()}function $e(){jt(),Pi.value||h()}function bn(){jt(),Te.value||i("toggleWorkflow")}const ir=[{mode:"manual",icon:"fingerprint",color:"var(--color-text)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",icon:"shield-question",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",icon:"full-access",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Ls=U(null),$0=U("");function ua(Se){const rt={};return Se&&(rt["--composer-menu-desc-width"]=Se),rt}const _u=B(()=>{const Se=ua($0.value);return Qe.value&&(Se.left=Qe.value),Se}),da=B(()=>{const Se={};return ct.value&&(Se.right=ct.value),_o.value&&(Se.maxHeight=_o.value),Se}),o6=B(()=>{const Se={};return mn.value&&(Se.right=mn.value),Se});let kl=null;function xu(Se){const rt=Number.parseFloat(Se);return Number.isFinite(rt)?rt:0}function N0(Se){return`${Se.fontStyle||"normal"} ${Se.fontWeight||"400"} ${Se.fontSize} ${Se.fontFamily}`}function _1(Se){return Se.letterSpacing==="normal"?0:xu(Se.letterSpacing)}function ff(Se,rt){if(!Se)return 0;const pt=Wwe(Se,N0(rt),{letterSpacing:_1(rt)});return qwe(pt)}function pf(){const Se=Ls.value?.querySelector(".pd-desc");if(!Se)return;const rt=getComputedStyle(Se),pt=Math.max(0,...ir.map(un=>ff(r(un.descKey),rt)));$0.value=pt>0?`${Math.ceil(pt)}px`:""}function Su(){typeof window>"u"||(kl!==null&&window.cancelAnimationFrame(kl),vt(()=>{kl=window.requestAnimationFrame(()=>{kl=null,pf()})}))}Ue(l,Su,{immediate:!0}),xn(()=>{Su(),document.fonts?.ready.then(Su)}),An(()=>{kl!==null&&(window.cancelAnimationFrame(kl),kl=null)});function fa(Se){i("setPermission",Se),tn()}const Xs=B(()=>ir.find(Se=>Se.mode===o.status?.permission)),x1=B(()=>Xs.value?r(Xs.value.labelKey):""),s6=B(()=>Xs.value?.icon??"fingerprint"),pa=U(!1),Ar=U(!1);let hf=0,mf=0,bl=null;function gf(Se,rt,pt){const un=Se.getPropertyValue(rt).trim(),Co=Number.parseFloat(un);return Number.isFinite(Co)?un.endsWith("em")?Co*Number.parseFloat(Se.fontSize):Co:pt}function i6(Se){return Se.scrollWidth>Se.clientWidth+1||Se.clientWidth===0&&(Se.textContent?.length??0)>0}function ha(){const Se=Pn.value;if(!Se)return;const rt=getComputedStyle(Se),pt=gf(rt,"--composer-valve-floor",56),un=gf(rt,"--composer-valve-expand-margin",48),Co=Se.getBoundingClientRect().width;if(Ar.value){Co>mf+un&&(Ar.value=!1,vt(ha));return}if(pa.value&&Co>hf+un){pa.value=!1,vt(ha);return}const Vo=ks.value;!Vo||!i6(Vo)||Vo.getBoundingClientRect().width>=pt||(pa.value?(mf=Co,Ar.value=!0):(hf=Co,pa.value=!0),vt(ha))}xn(()=>{typeof ResizeObserver=="function"&&Pn.value&&(bl=new ResizeObserver(ha),bl.observe(Pn.value)),document.fonts?.ready.then(ha)}),Ue([x1,Te,Hs,Io,()=>o.status?.model,()=>o.working,l],()=>{pa.value=!1,Ar.value=!1,vt(ha)}),An(()=>{bl?.disconnect(),bl=null});const z0=B(()=>bs.value?.provider??""),Cu=B(()=>!z0.value||!o.models?.length?[]:o.models.filter(Se=>Se.provider===z0.value)),vf=B(()=>new Set(o.starredIds??[]));function Mu(Se){return vf.value.has(Se)}const Qr=B(()=>o.models?.length?o.models.filter(Se=>Mu(Se.id)&&Se.provider!==z0.value):[]);function Au(){const Se=Lo.value,rt=Pn.value;if(!Se||!rt)return;const pt=getComputedStyle(Se),un=xu(pt.getPropertyValue("--space-1"))||4,Co=xu(pt.getPropertyValue("--space-2"))||8,Vo=window.visualViewport,Wo=Vo?.offsetTop??0,S1=Wo+(Vo?.height??window.innerHeight),Hi=rt.getBoundingClientRect(),Tr=Hi.top-Wo-un-Co,Ir=S1-Hi.bottom-un-Co;Se.offsetHeight>Tr&&Ir>Tr?(Un.value=!0,_o.value=`${Math.max(Math.floor(Ir),0)}px`):(Un.value=!1,_o.value=`${Math.max(Math.floor(Tr),0)}px`)}function Er(){wt()}function wf(){window.addEventListener("resize",Er),window.visualViewport?.addEventListener("resize",Er),window.visualViewport?.addEventListener("scroll",Er)}function Eu(){window.removeEventListener("resize",Er),window.visualViewport?.removeEventListener("resize",Er),window.visualViewport?.removeEventListener("scroll",Er)}Ue(Ct,async Se=>{if(!Se){Eu();return}wf(),Un.value=!1,_o.value="",await vt(),Au(),(Lo.value?.querySelector(".md-row.is-current")??Lo.value?.querySelector(".md-row"))?.focus()}),An(Eu);function yf(Se){if(Se.key!=="ArrowDown"&&Se.key!=="ArrowUp")return;const rt=Array.from(Lo.value?.querySelectorAll(".md-row:not(:disabled)")??[]);if(rt.length===0)return;Se.preventDefault();const pt=rt.indexOf(document.activeElement),un=Se.key==="ArrowDown"?(pt+1)%rt.length:(pt-1+rt.length)%rt.length;rt[un]?.focus()}function Tu(Se){i("selectModel",Se),wt()}return(Se,rt)=>(g(),S("div",{class:Be(["composer",{"drag-over":y(ve),expanded:k.value}]),onDragover:rt[26]||(rt[26]=(...pt)=>y(Ce)&&y(Ce)(...pt)),onDragleave:rt[27]||(rt[27]=(...pt)=>y(me)&&y(me)(...pt)),onDrop:rt[28]||(rt[28]=(...pt)=>y(be)&&y(be)(...pt))},[y(D)?(g(),S("div",{key:0,class:"att-lightbox",onClick:rt[1]||(rt[1]=xt((...pt)=>y(te)&&y(te)(...pt),["self"]))},[_("div",rCe,[Z(Cn,{text:y(r)("model.close")},{default:ue(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:rt[0]||(rt[0]=(...pt)=>y(te)&&y(te)(...pt))},"✕")]),_:1},8,["text"]),y(D).kind==="video"?(g(),S("video",{key:0,class:"att-lightbox-media",src:y(D).previewUrl,controls:"",playsinline:""},null,8,lCe)):(g(),S("img",{key:1,class:"att-lightbox-media",src:y(D).previewUrl,alt:y(D).name},null,8,aCe)),_("div",cCe,I(y(D).name),1)])])):J("",!0),_("div",{class:Be(["composer-card",{"labels-collapsed":pa.value}])},[y(ne).length>0?(g(),S("div",uCe,[_("div",{ref_key:"attachmentScrollRef",ref:$t,class:Be(["att-scroll",{"is-overflowing":Qt.value}])},[_("div",dCe,[at.value.length>0?(g(),S("div",{key:0,ref_key:"attachmentMediaRowRef",ref:Et,class:"att-row att-row-media"},[(g(!0),S(Me,null,it(at.value,pt=>(g(),ce(S7,{key:pt.localId,kind:pt.kind,name:pt.name,url:pt.previewUrl,"file-id":pt.fileId,"media-type":pt.mediaType,size:pt.size,uploading:pt.uploading,error:pt.error,removable:"","remove-label":y(r)("composer.removeNamed",{name:pt.name}),onActivate:un=>tt(pt),onRemove:un=>y(fe)(pt.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))],512)):J("",!0),dt.value.length>0?(g(),S("div",fCe,[(g(!0),S(Me,null,it(dt.value,pt=>(g(),ce(S7,{key:pt.localId,kind:"file",name:pt.name,"media-type":pt.mediaType,size:pt.size,uploading:pt.uploading,error:pt.error,removable:"","remove-label":y(r)("composer.removeNamed",{name:pt.name}),onActivate:un=>tt(pt),onRemove:un=>y(fe)(pt.localId)},null,8,["name","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):J("",!0)])],2),Qt.value?(g(),S("span",pCe,I(y(r)("composer.attachmentCount",{n:y(ne).length})),1)):J("",!0),y(ne).length>=2?(g(),ce(Cn,{key:1,text:y(r)("composer.clearAll")},{default:ue(()=>[Z(Zt,{class:"att-clear",size:"sm",label:y(r)("composer.clearAll"),onClick:Fe},{default:ue(()=>[Z(Le,{name:"trash"})]),_:1},8,["label"])]),_:1},8,["text"])):J("",!0)])):J("",!0),_("div",hCe,[y(z)&&!y(a)?(g(),ce(AC,{key:0,id:"composer-slash-menu",items:y($),"active-index":y(E),onSelect:y(N),onHover:rt[2]||(rt[2]=pt=>E.value=pt)},null,8,["items","active-index","onSelect"])):J("",!0),y(C)&&!y(a)?(g(),ce(EC,{key:1,id:"composer-mention-menu",items:y(O),"active-index":y(H),loading:y(V),stale:y(A),onSelect:y(j),onHover:rt[3]||(rt[3]=pt=>H.value=pt)},null,8,["items","active-index","loading","stale","onSelect"])):J("",!0),Z(gr,{name:"composer-menu-pop"},{default:ue(()=>[rs.value&&!y(a)?(g(),S("div",{key:0,ref_key:"modesMenuRef",ref:re,class:"add-menu",onClick:rt[5]||(rt[5]=xt(()=>{},["stop"])),onKeydown:wo},[_("div",{ref_key:"addMenuScrollRef",ref:Ie,class:"am-scroll",role:"menu",onScroll:Pt},[(g(!0),S(Me,null,it(kt.value,pt=>(g(),S("button",{key:pt.id,type:"button",class:"am-row",role:"menuitem",onMousedown:rt[4]||(rt[4]=xt(()=>{},["prevent"])),onClick:un=>Rn(pt)},[_("span",gCe,[Z(Le,{name:pt.icon,size:"sm"},null,8,["name"])]),_("span",vCe,I(y(r)(pt.nameKey)),1),pt.descKey?(g(),S("span",wCe,I(y(r)(pt.descKey)),1)):J("",!0)],40,mCe))),128))],544),je.value?(g(),S("div",{key:0,class:"scroll-thumb",style:Wt({top:`${je.value.top}px`,height:`${je.value.height}px`})},null,4)):J("",!0)],544)):J("",!0)]),_:1}),_("div",yCe,[Ut.value?(g(),S("span",{key:0,ref_key:"workModePillRef",ref:dn,class:"wm-pill"},[Z(Le,{name:Ut.value==="goal"?"target":"file-edit",size:"sm"},null,8,["name"]),_("span",null,I(Ut.value==="goal"?y(r)("status.goalLabel"):y(r)("status.planLabel")),1),Z(Zt,{class:"wm-x",size:"sm",label:y(r)("status.workModeDismiss"),onMousedown:rt[6]||(rt[6]=xt(()=>{},["prevent"])),onClick:Qo},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],512)):J("",!0),Zn(_("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":rt[7]||(rt[7]=pt=>is(c)?c.value=pt:null),class:"ph",style:Wt(So.value),placeholder:s.value,disabled:e.starting,autocomplete:"off",spellcheck:"false",rows:"1",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":!!co.value,"aria-controls":co.value,"aria-activedescendant":oo.value,onKeydown:no,onCompositionstart:sn,onCompositionend:Yn,onInput:Y,onBlur:rt[8]||(rt[8]=pt=>{y(a)||(z.value=!1,C.value=!1)})},null,44,kCe),[[Fs,y(c)]]),Z(Cn,{text:k.value?y(r)("composer.collapseTitle"):y(r)("composer.expandTitle")},{default:ue(()=>[k.value||b.value?(g(),S("button",{key:0,class:"expand-btn",type:"button","aria-label":k.value?y(r)("composer.collapseTitle"):y(r)("composer.expandTitle"),onClick:x},[k.value?(g(),ce(Le,{key:0,name:"collapse",size:"sm"})):(g(),ce(Le,{key:1,name:"expand",size:"sm"}))],8,bCe)):J("",!0)]),_:1},8,["text"])])]),ys.value?(g(),S("input",{key:1,ref_key:"fileInputRef",ref:X,type:"file",multiple:"",class:"file-input-hidden",onChange:rt[9]||(rt[9]=(...pt)=>y(ye)&&y(ye)(...pt))},null,544)):J("",!0),_("div",{ref_key:"toolbarRef",ref:Pn,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Ls,class:"menu-measure","aria-hidden":"true"},[...rt[29]||(rt[29]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",_Ce,[Z(Zt,{size:"md",class:"composer-attach",label:y(r)("composer.addMenu"),"aria-haspopup":"menu","aria-expanded":rs.value,onMousedown:rt[10]||(rt[10]=xt(()=>{},["prevent"])),onClick:xt(cn,["stop"])},{default:ue(()=>[Z(Le,{name:"plus"})]),_:1},8,["label","aria-expanded"]),Z(JSe,{ref_key:"capMenuRef",ref:es,"session-id":e.sessionId,triggerless:""},null,8,["session-id"]),e.status?(g(),S("span",{key:0,ref_key:"permissionPillRef",ref:js,class:Be(["perm-pill",["perm-"+e.status.permission,{open:Bn.value}]]),role:"button",tabindex:"0","aria-label":x1.value,onClick:xt(Mt,["stop"]),onKeydown:[To(Mt,["enter"]),To(xt(Mt,["prevent"]),["space"])]},[Z(Le,{class:"perm-pill-icon",name:s6.value,size:"md"},null,8,["name"]),_("span",SCe,I(x1.value),1)],42,xCe)):J("",!0),Z(gr,{name:"composer-menu-pop"},{default:ue(()=>[Bn.value&&e.status?(g(),S("div",{key:0,ref_key:"permDropdownRef",ref:Ze,class:"perm-dropdown",style:Wt(_u.value),role:"menu",onClick:rt[11]||(rt[11]=xt(()=>{},["stop"]))},[(g(),S(Me,null,it(ir,pt=>_("button",{key:pt.mode,class:Be(["pd-row",{"is-current":pt.mode===e.status.permission}]),role:"menuitem",onClick:un=>fa(pt.mode)},[_("span",{class:"pd-icon",style:Wt({color:pt.color})},[Z(Le,{name:pt.icon,size:"md"},null,8,["name"])],4),_("span",MCe,[_("span",{class:"pd-name",style:Wt({color:pt.color})},I(y(r)(pt.labelKey)),5),_("span",ACe,I(y(r)(pt.descKey)),1)]),_("span",ECe,[pt.mode===e.status.permission?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)])],10,CCe)),64))],4)):J("",!0)]),_:1}),Te.value?(g(),S("span",TCe,[Z(Le,{class:"workflow-ic",name:"sparkles",size:"md"}),_("span",ICe,I(y(r)("status.dynamicWorkflowLabel")),1),Z(Zt,{class:"workflow-x",size:"sm",label:y(r)("status.dynamicWorkflowDismiss"),onMousedown:rt[12]||(rt[12]=xt(()=>{},["prevent"])),onClick:rt[13]||(rt[13]=xt(pt=>i("toggleWorkflow"),["stop"]))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])])):J("",!0)]),_("div",LCe,[Hs.value?(g(),S("button",{key:0,class:"compact-chip",onClick:rt[14]||(rt[14]=xt(pt=>i("compact"),["stop"]))},"/compact")):J("",!0),Z(Cn,{text:vn.value},{default:ue(()=>[e.status&&!e.hideContext?(g(),S("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":vn.value},[Z(zye,{pct:uo.value},null,8,["pct"])],8,$Ce)):J("",!0)]),_:1},8,["text"]),Z(Cn,{text:Ar.value?e.status?.model:null},{default:ue(()=>[e.status?(g(),S("button",{key:0,ref_key:"modelPillRef",ref:Os,type:"button",class:Be(["model-pill",{open:Ct.value,"icon-only":Ar.value}]),"aria-haspopup":"menu","aria-expanded":Ct.value,"aria-label":Ar.value?e.status.model:void 0,onClick:xt(Ps,["stop"])},[Ar.value?(g(),ce(Le,{key:0,name:"cute-bot",size:"md"})):(g(),S(Me,{key:1},[_("span",{ref_key:"modelNameRef",ref:ks,class:"mp-name"},I(e.status.model),513),Z(Le,{class:"cv",name:"chevron-down",size:"sm"})],64))],10,NCe)):J("",!0)]),_:1},8,["text"]),e.status&&Cr.value!=="unsupported"?(g(),ce(Cn,{key:1,text:yi.value},{default:ue(()=>[_("button",{ref_key:"thinkingPillRef",ref:Es,type:"button",class:Be(["thinking-pill",{open:so.value}]),disabled:ro.value,"aria-haspopup":"dialog","aria-expanded":so.value,"aria-label":yi.value,onClick:xt(Je,["stop"]),onKeydown:To(xt(ze,["prevent"]),["escape"])},[Z(Le,{name:"thinking",size:"sm"}),_("span",BCe,I(Io.value),1),ro.value?J("",!0):(g(),ce(Le,{key:0,class:"cv",name:"chevron-down",size:"sm"}))],42,zCe)]),_:1},8,["text"])):J("",!0),e.working?(g(),ce(Cn,{key:2,text:y(r)("composer.interruptTitle")},{default:ue(()=>[_("button",{class:"stop","aria-label":y(r)("composer.interrupt"),onClick:rt[15]||(rt[15]=pt=>i("interrupt"))},[...rt[30]||(rt[30]=[_("span",{class:"stop-square","aria-hidden":"true"},null,-1)])],8,RCe)]),_:1},8,["text"])):J("",!0),_("button",{class:Be(["send",{"is-starting":e.starting}]),"aria-label":As.value,disabled:e.starting||!ao.value,onClick:rt[16]||(rt[16]=pt=>ht())},[e.starting?(g(),ce(Go,{key:0,size:"sm"})):(g(),ce(Le,{key:1,name:"send",size:"sm"}))],10,FCe)]),Z(gr,{name:"composer-menu-pop"},{default:ue(()=>[Ct.value&&e.status?(g(),S("div",{key:0,ref_key:"modelDropdownRef",ref:Lo,class:Be(["composer-dropdown model-dropdown",{"flip-down":Un.value}]),style:Wt(da.value),role:"menu",onClick:rt[18]||(rt[18]=xt(()=>{},["stop"])),onKeydown:yf},[_("div",jCe,[Qr.value.length>0?(g(),S("div",OCe,I(y(r)("status.starredModels")),1)):J("",!0),(g(!0),S(Me,null,it(Qr.value,pt=>(g(),S("button",{key:pt.id,class:Be(["md-row",{"is-current":pt.id===e.status.modelId}]),role:"menuitem",onClick:un=>Tu(pt.id)},[_("span",HCe,[pt.id===e.status.modelId?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",DCe,I(pt.displayName??pt.model),1),_("span",VCe,I(pt.provider),1),Z(Le,{class:"md-star",name:"star",size:"sm"})],10,PCe))),128)),Qr.value.length>0?(g(),S("div",WCe)):J("",!0),Cu.value.length>0?(g(),S("div",qCe,I(z0.value),1)):J("",!0),(g(!0),S(Me,null,it(Cu.value,pt=>(g(),S("button",{key:pt.id,class:Be(["md-row",{"is-current":pt.id===e.status.modelId}]),role:"menuitem",onClick:un=>Tu(pt.id)},[_("span",ZCe,[pt.id===e.status.modelId?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",KCe,I(pt.displayName??pt.model),1),Mu(pt.id)?(g(),ce(Le,{key:0,class:"md-star",name:"star",size:"sm"})):J("",!0)],10,UCe))),128))]),Cu.value.length>0?(g(),S("div",GCe)):J("",!0),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:rt[17]||(rt[17]=pt=>{wt(),i("pickModel")})},[_("span",YCe,[Z(Le,{name:"list",size:"sm"})]),_("span",XCe,I(y(r)("status.moreModels")),1),Z(Le,{class:"md-more-arrow",name:"chevron-right",size:"sm"})])],38)):J("",!0)]),_:1}),Z(gr,{name:"composer-menu-pop"},{default:ue(()=>[so.value&&e.status?(g(),S("div",{key:0,ref_key:"thinkingDropdownRef",ref:Ro,class:"composer-dropdown thinking-dropdown",style:Wt(o6.value),role:"dialog","aria-label":y(r)("composer.thinkingMenuTitle"),onClick:rt[19]||(rt[19]=xt(()=>{},["stop"])),onKeydown:To(xt(ze,["prevent"]),["escape"])},[_("div",QCe,[Z(Le,{name:"thinking",size:"sm"}),_("span",null,I(y(r)("composer.thinkingMenuTitle")),1)]),Z(ni,{"model-value":Ys.value,options:Oi.value,size:"sm","onUpdate:modelValue":ki},null,8,["model-value","options"]),_("div",eMe,I(y(r)("status.cacheNote")),1)],44,JCe)):J("",!0)]),_:1})],512)],2),_("div",{class:Be(["drop-overlay",{show:y(ve)}]),"aria-hidden":"true"},[_("div",tMe,[Z(Le,{name:"file-plus",size:"lg"}),_("span",null,I(y(r)("composer.dropToAttach")),1)])],2),(g(),ce(Gr,{to:"body"},[Z(Gc,{"model-value":y(a)&&y(z),title:y(r)("composer.slashSheetTitle"),"onUpdate:modelValue":xe},{default:ue(()=>[_("div",nMe,[Z(os,{ref_key:"slashSheetSearchRef",ref:W,modelValue:oe.value,"onUpdate:modelValue":rt[20]||(rt[20]=pt=>oe.value=pt),placeholder:y(r)("composer.slashSearchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:no},null,8,["modelValue","placeholder"])]),Z(AC,{id:"composer-slash-menu",layout:"sheet",items:y($),"active-index":y(E),query:oe.value,onSelect:y(N),onHover:rt[21]||(rt[21]=pt=>E.value=pt)},null,8,["items","active-index","query","onSelect"])]),_:1},8,["model-value","title"]),Z(Gc,{"model-value":y(a)&&y(C),title:y(r)("composer.mentionSheetTitle"),"onUpdate:modelValue":et},{default:ue(()=>[_("div",oMe,[Z(os,{ref_key:"mentionSheetSearchRef",ref:G,modelValue:Q.value,"onUpdate:modelValue":rt[22]||(rt[22]=pt=>Q.value=pt),placeholder:y(r)("composer.mentionSearchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:no},null,8,["modelValue","placeholder"])]),Z(EC,{id:"composer-mention-menu",layout:"sheet",items:y(O),"active-index":y(H),loading:y(V),stale:y(A),onSelect:y(j),onHover:rt[23]||(rt[23]=pt=>H.value=pt)},null,8,["items","active-index","loading","stale","onSelect"])]),_:1},8,["model-value","title"]),Z(Gc,{"model-value":y(a)&&rs.value,"onUpdate:modelValue":Ln},{default:ue(()=>[_("div",{ref_key:"mobileModesMenuRef",ref:_e,class:"msheet-add",role:"menu",onClick:rt[25]||(rt[25]=xt(()=>{},["stop"])),onKeydown:wo},[(g(!0),S(Me,null,it(kt.value,pt=>(g(),S("button",{key:pt.id,type:"button",class:"am-row",role:"menuitem",onMousedown:rt[24]||(rt[24]=xt(()=>{},["prevent"])),onClick:un=>Rn(pt)},[_("span",iMe,[Z(Le,{name:pt.icon,size:"sm"},null,8,["name"])]),_("span",rMe,I(y(r)(pt.nameKey)),1),pt.descKey?(g(),S("span",lMe,I(y(r)(pt.descKey)),1)):J("",!0)],40,sMe))),128))],544)]),_:1},8,["model-value"])]))],34))}}),Cz=mt(aMe,[["__scopeId","data-v-6e11f929"]]),cMe={class:"ah"},uMe={class:"akind"},dMe={class:"apath"},fMe={class:"ah-path"},pMe={class:"dg"},hMe={class:"dc"},mMe={key:2,class:"body-shell"},gMe={class:"shell-cmd"},vMe={key:0,class:"shell-cwd"},wMe={key:1,class:"shell-danger"},yMe={class:"file-bar"},kMe={class:"file-lang"},bMe={class:"file-ln"},_Me={class:"file-text"},xMe={key:4,class:"body-chip"},SMe={class:"chip-label"},CMe={class:"chip-value"},MMe={key:0,class:"chip-detail"},AMe={key:5,class:"body-chip"},EMe={key:0,class:"chip-label"},TMe={class:"chip-value"},IMe={key:6,class:"body-chip"},LMe={class:"chip-label"},$Me={class:"chip-value"},NMe={key:0,class:"chip-detail"},zMe={key:7,class:"body-chip"},BMe={class:"chip-label"},RMe={class:"chip-value"},FMe={key:0,class:"chip-detail"},jMe={key:8,class:"body-todo"},OMe={class:"todo-glyph"},PMe={key:10,class:"body-generic"},HMe={class:"gen-text"},DMe={key:11,class:"feedback-wrap"},VMe=["placeholder"],WMe={class:"feedback-hint"},qMe={key:0,class:"plan-actions"},UMe={key:1,class:"abtn"},ZMe=.4,KMe=Ge({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=B(()=>{const ne=n.block;return ne.kind!=="plan_review"?null:{plan:ne.plan,path:ne.path,options:ne.options??[]}}),r=U(!1),l=U(!1),a=B(()=>["plan_review","diff","file"].includes(n.block.kind)),c=U(null),u=U(null),d=U(null),f=U({top:!1,bottom:!1}),p=U({top:!1,bottom:!1}),h=U({top:!1,bottom:!1});function m(ne){return D=>{const X=D.currentTarget;X instanceof HTMLElement&&(ne.value={top:X.scrollTop>0,bottom:X.scrollTop+X.clientHeight{const{top:D,bottom:X}=ne.value;if(!D&&!X)return;const ve="var(--menu-scroll-fade)",fe=D&&X?`linear-gradient(to bottom, transparent 0, black ${ve}, black calc(100% - ${ve}), transparent 100%)`:D?`linear-gradient(to bottom, transparent, black ${ve})`:`linear-gradient(to top, transparent, black ${ve})`;return{maskImage:fe,WebkitMaskImage:fe}})}const b=w(f),M=w(p),R=w(h);function z(){const ne=[[c.value,f],[u.value,p],[d.value,h]];for(const[D,X]of ne)D&&(X.value={top:D.scrollTop>0,bottom:D.scrollTop+D.clientHeightvoid vt(z)),Ue(r,()=>void vt(z)),Ue(()=>n.block,()=>void vt(z));const $=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function E(){const ne=$.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${ne}`)}const T=U(!1),N=U(""),C=U(null);function O(){const ne=C.value;if(!ne)return;ne.style.height="auto";const X=(window.visualViewport?.height??window.innerHeight)*ZMe,ve=Math.min(ne.scrollHeight,X);ne.style.height=`${ve}px`,ne.style.overflowY=ne.scrollHeight>X?"auto":"hidden"}let H=null,V=0;function A(){if(H?.disconnect(),H=null,typeof ResizeObserver>"u")return;const ne=C.value;ne&&(H=new ResizeObserver(D=>{const X=D[0]?.contentRect.width??0;X!==V&&(V=X,O())}),H.observe(ne))}Ue(N,()=>void vt(O)),Ue(T,ne=>{if(!ne){H?.disconnect(),H=null;return}vt(()=>{O(),A()})}),Ue(r,ne=>{ne||vt(O)});const{uiFontSize:F}=f9();Ue(F,()=>void vt(O));function j(){n.busy||(T.value=!0,N.value="",setTimeout(()=>C.value?.focus(),0))}function q(){if(n.busy)return;const ne=N.value.trim();i.value?ee("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:ne||void 0}):ee("feedback",{decision:"rejected",feedback:ne||void 0}),T.value=!1,N.value=""}function P(){T.value=!1,N.value=""}function W(ne){ne.key==="Enter"&&!ne.shiftKey?(ne.preventDefault(),q()):ne.key==="Escape"&&(ne.preventDefault(),P())}const G=U(null);Ue(()=>n.busy,ne=>{ne||(G.value=null)});function ee(ne,D){n.busy||(G.value=ne,o("decide",D))}function se(){ee("approve",{decision:"approved"})}function oe(){ee("approveSession",{decision:"approved",scope:"session"})}function Q(){ee("reject",{decision:"rejected"})}function ge(){ee("approvePlan",{decision:"approved"})}function xe(ne){ee(`option:${ne}`,{decision:"approved",selectedLabel:ne})}function Ke(){n.busy||j()}function et(){ee("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function Y(ne){const D=(document.activeElement?.tagName??"").toLowerCase();if(D==="input"||D==="textarea"||n.busy||r.value)return;const X=i.value;if(X){if(X.options.length===0){ne.key==="1"?(ne.preventDefault(),ge()):ne.key==="2"?(ne.preventDefault(),Ke()):ne.key==="3"&&(ne.preventDefault(),et());return}ne.key==="1"&&X.options[0]?(ne.preventDefault(),xe(X.options[0].label)):ne.key==="2"&&X.options[1]?(ne.preventDefault(),xe(X.options[1].label)):ne.key==="3"&&X.options[2]&&(ne.preventDefault(),xe(X.options[2].label));return}ne.key==="1"?(ne.preventDefault(),se()):ne.key==="2"?(ne.preventDefault(),oe()):ne.key==="3"?(ne.preventDefault(),Q()):ne.key==="4"&&(ne.preventDefault(),j())}return xn(()=>{document.addEventListener("keydown",Y),window.addEventListener("resize",O),window.visualViewport?.addEventListener("resize",O)}),An(()=>{document.removeEventListener("keydown",Y),window.removeEventListener("resize",O),window.visualViewport?.removeEventListener("resize",O),H?.disconnect(),H=null}),(ne,D)=>(g(),ce(Yv,{class:Be(["appr",{minimized:r.value}])},fd({head:ue(()=>[_("div",cMe,[D[6]||(D[6]=_("span",{class:"ah-ic"},"!",-1)),_("span",uMe,I(E()),1),_("span",dMe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(g(),S(Me,{key:0},[He(I(e.block.path),1)],64)):e.block.kind==="shell"?(g(),S(Me,{key:1},[He(I(e.block.command),1)],64)):e.block.kind==="url"?(g(),S(Me,{key:2},[He(I(e.block.url),1)],64)):e.block.kind==="search"?(g(),S(Me,{key:3},[He(I(e.block.query),1)],64)):e.block.kind==="invocation"?(g(),S(Me,{key:4},[He(I(e.block.name),1)],64)):e.block.kind==="generic"?(g(),S(Me,{key:5},[He(I(e.block.summary),1)],64)):J("",!0)]),e.agentName&&!r.value?(g(),ce(wr,{key:0,variant:"neutral",size:"sm"},{default:ue(()=>[He(I(y(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):J("",!0),r.value?J("",!0):(g(),ce(wr,{key:1,variant:"warning",size:"sm",class:"aw"},{default:ue(()=>[He(I(y(s)("approval.required")),1)]),_:1})),a.value&&!r.value?(g(),ce(Zt,{key:2,class:"aexpand",size:"sm",label:l.value?y(s)("approval.collapsePlan"):y(s)("approval.expandPlan"),tooltip:l.value?y(s)("approval.collapsePlan"):y(s)("approval.expandPlan"),onClick:D[0]||(D[0]=X=>l.value=!l.value)},{default:ue(()=>[Z(Le,{name:l.value?"collapse":"expand",size:"md"},null,8,["name"])]),_:1},8,["label","tooltip"])):J("",!0),Z(Zt,{class:"amin",size:"sm",label:r.value?y(s)("question.expand"):y(s)("question.minimize"),onClick:D[1]||(D[1]=X=>r.value=!r.value)},{default:ue(()=>[r.value?(g(),ce(Le,{key:0,name:"chevron-up",size:"md"})):(g(),ce(Le,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ue(()=>[e.block.kind==="plan_review"&&e.block.path?(g(),ce(Cn,{key:0,text:e.block.path},{default:ue(()=>[_("div",fMe,I(e.block.path),1)]),_:1},8,["text"])):J("",!0),e.block.kind==="diff"?(g(),S("div",{key:1,ref_key:"diffBodyRef",ref:c,class:Be(["diff",{expanded:l.value}]),style:Wt(y(b)),onScroll:D[2]||(D[2]=(...X)=>y(k)&&y(k)(...X))},[(g(!0),S(Me,null,it(e.block.diff,(X,ve)=>(g(),S("div",{key:ve,class:Be(["dl",X.kind==="add"?"add":X.kind==="rem"?"del":""])},[_("span",pMe,I(X.gutter),1),_("span",hMe,I(X.text),1)],2))),128))],38)):e.block.kind==="shell"?(g(),S("div",mMe,[_("div",gMe,[D[7]||(D[7]=_("span",{class:"shell-dollar"},"$",-1)),He(" "+I(e.block.command),1)]),e.block.cwd?(g(),S("div",vMe,"cwd: "+I(e.block.cwd),1)):J("",!0),e.block.danger?(g(),S("div",wMe,I(y(s)("approval.danger",{detail:e.block.danger})),1)):J("",!0)])):e.block.kind==="file"?(g(),S("div",{key:3,class:Be(["body-file",{expanded:l.value}])},[_("div",yMe,[_("span",kMe,I(e.block.language??""),1)]),_("div",{class:"file-content",ref_key:"fileBodyRef",ref:u,style:Wt(y(M)),onScroll:D[3]||(D[3]=(...X)=>y(x)&&y(x)(...X))},[(g(!0),S(Me,null,it(e.block.content.split(` +`),(X,ve)=>(g(),S("div",{key:ve,class:"file-line"},[_("span",bMe,I(ve+1),1),_("span",_Me,I(X),1)]))),128))],36)],2)):e.block.kind==="fileop"?(g(),S("div",xMe,[_("span",SMe,I(e.block.op),1),_("span",CMe,I(e.block.path),1),e.block.detail?(g(),S("span",MMe,I(e.block.detail),1)):J("",!0)])):e.block.kind==="url"?(g(),S("div",AMe,[e.block.method?(g(),S("span",EMe,I(e.block.method),1)):J("",!0),_("span",TMe,I(e.block.url),1)])):e.block.kind==="search"?(g(),S("div",IMe,[_("span",LMe,I(y(s)("approval.searchQueryLabel")),1),_("span",$Me,I(e.block.query),1),e.block.scope?(g(),S("span",NMe,I(y(s)("approval.searchScope",{scope:e.block.scope})),1)):J("",!0)])):e.block.kind==="invocation"?(g(),S("div",zMe,[_("span",BMe,I(e.block.kind2),1),_("span",RMe,I(e.block.name),1),e.block.description?(g(),S("span",FMe,I(e.block.description),1)):J("",!0)])):e.block.kind==="todo"?(g(),S("div",jMe,[(g(!0),S(Me,null,it(e.block.items,(X,ve)=>(g(),S("div",{key:ve,class:"todo-item"},[_("span",OMe,I(X.status==="done"||X.status==="completed"?"✓":"○"),1),_("span",{class:Be(["todo-title",{"todo-done":X.status==="done"||X.status==="completed"}])},I(X.title),3)]))),128))])):e.block.kind==="plan_review"?(g(),S("div",{key:9,ref_key:"planBodyRef",ref:d,class:Be(["body-plan",{expanded:l.value}]),style:Wt(y(R)),onScroll:D[4]||(D[4]=(...X)=>y(v)&&y(v)(...X))},[Z(sa,{text:e.block.plan},null,8,["text"])],38)):(g(),S("div",PMe,[_("span",HMe,I(e.block.summary),1)])),T.value?(g(),S("div",DMe,[Zn(_("textarea",{ref_key:"feedbackRef",ref:C,"onUpdate:modelValue":D[5]||(D[5]=X=>N.value=X),class:"feedback-ta",placeholder:y(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:W},null,40,VMe),[[Fs,N.value]]),_("div",WMe,I(y(s)("approval.feedbackHint")),1)])):J("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:ue(()=>[i.value?(g(),S("div",qMe,[i.value.options.length>0?(g(!0),S(Me,{key:0},it(i.value.options,(X,ve)=>(g(),ce(Cn,{key:ve,text:X.description},{default:ue(()=>[Z(It,{class:"kbtn",size:"sm",variant:"primary",loading:G.value===`option:${X.label}`,disabled:e.busy,onClick:fe=>xe(X.label)},{default:ue(()=>[He(I(X.label),1),Z(Il,{class:"k",keys:[String(ve+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(g(),ce(It,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:G.value==="approvePlan",disabled:e.busy,onClick:ge},{default:ue(()=>[He(I(y(s)("approval.approvePlan")),1),Z(Il,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),Z(It,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:Ke},{default:ue(()=>[He(I(y(s)("approval.revise")),1),i.value.options.length===0?(g(),ce(Il,{key:0,class:"k",keys:["2"]})):J("",!0)]),_:1},8,["disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"danger-soft",loading:G.value==="rejectAndExit",disabled:e.busy,onClick:et},{default:ue(()=>[He(I(y(s)("approval.rejectAndExit")),1),i.value.options.length===0?(g(),ce(Il,{key:0,class:"k",keys:["3"]})):J("",!0)]),_:1},8,["loading","disabled"])])):(g(),S("div",UMe,[Z(It,{class:"kbtn",size:"sm",variant:"primary",loading:G.value==="approve",disabled:e.busy,onClick:se},{default:ue(()=>[He(I(y(s)("approval.approve")),1),Z(Il,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",loading:G.value==="approveSession",disabled:e.busy,onClick:oe},{default:ue(()=>[He(I(y(s)("approval.approveSession")),1),Z(Il,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",loading:G.value==="reject",disabled:e.busy,onClick:Q},{default:ue(()=>[He(I(y(s)("approval.reject")),1),Z(Il,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),Z(It,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:j},{default:ue(()=>[He(I(y(s)("approval.feedback")),1),Z(Il,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),GMe=mt(KMe,[["__scopeId","data-v-f7485122"]]),YMe={class:"goal-panel"},XMe={key:0,class:"goal-criterion"},JMe={class:"goal-criterion-label"},QMe=Ge({__name:"GoalPanel",props:{goal:{},openFile:{type:Function}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",YMe,[Z(sa,{text:e.goal.objective,"open-file":e.openFile},null,8,["text","open-file"]),e.goal.completionCriterion?(g(),S("div",XMe,[_("div",JMe,[Z(Le,{name:"check-list",size:"md"}),_("span",null,I(y(t)("status.goalDoneWhen")),1)]),Z(sa,{text:e.goal.completionCriterion,"open-file":e.openFile},null,8,["text","open-file"])])):J("",!0)]))}}),eAe=mt(QMe,[["__scopeId","data-v-81a928ba"]]),tAe={class:"plan-panel"},nAe={key:0,class:"plan-review-row"},oAe={class:"plan-review-label"},sAe={key:1,class:"plan-review-row plan-review-feedback"},iAe={class:"plan-review-label"},rAe={key:3,class:"plan-path-only"},lAe={class:"plan-path-hint"},aAe={class:"plan-path"},cAe={key:4,class:"plan-empty"},uAe=Ge({__name:"PlanPanel",props:{plan:{},planModeOn:{type:Boolean},openFile:{type:Function},revealSavedPlan:{type:Function}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",tAe,[e.plan?.selectedOption?(g(),S("div",nAe,[_("span",oAe,I(y(t)("tools.plan.selectedOption")),1),_("span",null,I(e.plan.selectedOption),1)])):J("",!0),e.plan?.feedback?(g(),S("div",sAe,[_("span",iAe,I(y(t)("tools.plan.feedback")),1),_("span",null,I(e.plan.feedback),1)])):J("",!0),e.plan?.plan?(g(),ce(sa,{key:2,text:e.plan.plan,"open-file":e.openFile},null,8,["text","open-file"])):e.plan?.path?(g(),S("div",rAe,[_("span",lAe,I(y(t)("tools.plan.pathOnlyHint")),1),_("span",aAe,I(e.plan.path),1),e.revealSavedPlan?(g(),ce(It,{key:0,variant:"ghost",size:"sm",onClick:o[0]||(o[0]=s=>void e.revealSavedPlan(e.plan.agentId,e.plan.toolCallId))},{default:ue(()=>[Z(Le,{name:"external-link",size:"sm"}),He(" "+I(y(t)("tools.plan.revealInFileManager")),1)]),_:1})):J("",!0)])):(g(),S("div",cAe,[Z(Le,{class:"plan-empty-ico",name:"file-edit",size:"lg"}),_("span",null,I(y(t)(e.planModeOn?"status.planEmptyArmed":"status.planEmptyIdle")),1)]))]))}}),dAe=mt(uAe,[["__scopeId","data-v-2883948d"]]),fAe={class:"qh"},pAe={class:"qtitle"},hAe={key:0,class:"qstep"},mAe={key:1,class:"qmin-peek"},gAe={class:"qbody"},vAe=["aria-label"],wAe=["aria-selected","aria-label","onClick"],yAe={class:"qstep-num"},kAe={key:1,class:"qheader-chip"},bAe={class:"qtext"},_Ae={class:"qopts"},xAe=["onClick"],SAe={class:"qopt-key"},CAe={class:"qopt-glyph"},MAe={key:0,class:"chk"},AAe={key:1,class:"rad"},EAe={class:"qopt-text"},TAe={class:"qopt-label"},IAe={key:0,class:"qopt-desc"},LAe={class:"qopt-glyph"},$Ae={key:0,class:"chk"},NAe={key:1,class:"rad"},zAe={class:"qopt-label"},BAe=["placeholder"],RAe={class:"qfoot"},FAe=Ge({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Lt(),s=t,i=U(0),r=U(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value=0&&A0:F.kind==="multiWithOther"?F.optionIds.length>0||F.otherText.trim().length>0:F.kind==="other"?F.text.trim().length>0:!0:!1}function p(){return f(l.value.id)}const h=U({});function m(A){return A.recommended===!0?!0:/\b(?:recommended|recommend)\b/.test(`${A.label} ${A.description??""}`.toLowerCase())}function k(){const A={...h.value};let F=!1;for(const j of n.question.questions){if(A[j.id])continue;const q=j.options.filter(m);q.length!==0&&(A[j.id]=j.multiSelect?{kind:"multi",optionIds:q.map(P=>P.id)}:{kind:"single",optionId:q[0].id},F=!0)}F&&(h.value=A)}Ue(()=>n.question.questionId,()=>{i.value=0,r.value=!1,h.value={},w.value={}}),Ue(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),k()},{immediate:!0,deep:!0});function x(A,F){const j=h.value[A];if(j&&j.kind==="single"&&j.optionId===F){const q={...h.value};delete q[A],h.value=q}else h.value={...h.value,[A]:{kind:"single",optionId:F}}}function v(A,F){const j=h.value[A],q=j&&(j.kind==="multi"||j.kind==="multiWithOther")?j.kind==="multi"?[...j.optionIds]:[...j.optionIds]:[],P=q.indexOf(F);P>=0?q.splice(P,1):q.push(F);const W=h.value[A],G=W&&W.kind==="multiWithOther"?W.otherText:"";G?h.value={...h.value,[A]:{kind:"multiWithOther",optionIds:q,otherText:G}}:h.value={...h.value,[A]:{kind:"multi",optionIds:q}}}const w=U({}),b=U(null);function M(A){const F=n.question.questions.find(q=>q.id===A),j=w.value[A]??"";if(F.multiSelect){const q=h.value[A],P=q&&(q.kind==="multi"||q.kind==="multiWithOther")?q.kind==="multi"?[...q.optionIds]:[...q.optionIds]:[];h.value={...h.value,[A]:{kind:"multiWithOther",optionIds:P,otherText:j}}}else h.value={...h.value,[A]:{kind:"other",text:j}}}function R(A){M(A),vt(()=>b.value?.focus())}function z(A,F){const j=h.value[A];return j?j.kind==="single"?j.optionId===F:j.kind==="multi"||j.kind==="multiWithOther"?j.optionIds.includes(F):!1:!1}function $(A){const F=h.value[A];return!!(F&&(F.kind==="other"||F.kind==="multiWithOther"))}function E(){return n.question.questions.every(A=>f(A.id))}const T=B(()=>n.busyKind==="answer"),N=B(()=>n.busyKind==="dismiss"),C=B(()=>!!n.busyKind);function O(){if(C.value||!E())return;const A={answers:h.value,method:"click"};s("answer",n.question.questionId,A)}function H(){C.value||s("dismiss",n.question.questionId)}function V(A){const F=(document.activeElement?.tagName??"").toLowerCase(),j=F==="input"||F==="textarea";if(C.value)return;if(A.key==="Enter"){if(A.preventDefault(),r.value)return;i.value=1&&q<=9){A.preventDefault();const P=l.value,W=q-1,G=P.options[W];G&&(P.multiSelect?v(P.id,G.id):x(P.id,G.id))}}return xn(()=>document.addEventListener("keydown",V)),An(()=>document.removeEventListener("keydown",V)),(A,F)=>(g(),ce(Yv,{class:Be(["qcard",{minimized:r.value}])},fd({head:ue(()=>[_("div",fAe,[F[5]||(F[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",pAe,I(y(o)("question.title")),1),a.value>1&&!r.value?(g(),S("span",hAe,I(y(o)("question.step",{current:i.value+1,total:a.value})),1)):J("",!0),r.value?(g(),S("span",mAe,I(l.value.question),1)):J("",!0),Z(Zt,{class:"qmin",size:"sm",label:r.value?y(o)("question.expand"):y(o)("question.minimize"),onClick:F[0]||(F[0]=j=>r.value=!r.value)},{default:ue(()=>[r.value?(g(),ce(Le,{key:0,name:"chevron-up",size:"md"})):(g(),ce(Le,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:ue(()=>[_("div",gAe,[a.value>1?(g(),S("div",{key:0,class:"qsteps",role:"tablist","aria-label":y(o)("question.step",{current:i.value+1,total:a.value})},[(g(!0),S(Me,null,it(n.question.questions,(j,q)=>(g(),S("button",{key:j.id,type:"button",class:Be(["qstep-dot",{active:q===i.value,answered:f(j.id)}]),"aria-selected":q===i.value,"aria-label":y(o)("question.step",{current:q+1,total:a.value}),onClick:P=>d(q)},[_("span",yAe,I(q+1),1)],10,wAe))),128))],8,vAe)):J("",!0),l.value.header?(g(),S("div",kAe,[Z(wr,{variant:"neutral",size:"sm"},{default:ue(()=>[He(I(l.value.header),1)]),_:1})])):J("",!0),_("div",bAe,I(l.value.question),1),l.value.body?(g(),ce(sa,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):J("",!0),_("div",_Ae,[(g(!0),S(Me,null,it(l.value.options,(j,q)=>(g(),S("label",{key:j.id,class:Be(["qopt",{selected:z(l.value.id,j.id)}]),onClick:xt(P=>l.value.multiSelect?v(l.value.id,j.id):x(l.value.id,j.id),["prevent"])},[_("span",SAe,I(q+1),1),_("span",CAe,[l.value.multiSelect?(g(),S("span",MAe,I(z(l.value.id,j.id)?"■":"□"),1)):(g(),S("span",AAe,I(z(l.value.id,j.id)?"●":"○"),1))]),_("span",EAe,[_("span",TAe,I(j.label),1),j.description?(g(),S("span",IAe,I(j.description),1)):J("",!0)])],10,xAe))),128)),l.value.allowOther?(g(),S("label",{key:0,class:Be(["qopt",{selected:$(l.value.id)}]),onClick:F[4]||(F[4]=xt(j=>R(l.value.id),["prevent"]))},[F[6]||(F[6]=_("span",{class:"qopt-key"},null,-1)),_("span",LAe,[l.value.multiSelect?(g(),S("span",$Ae,I($(l.value.id)?"■":"□"),1)):(g(),S("span",NAe,I($(l.value.id)?"●":"○"),1))]),_("span",zAe,I(l.value.otherLabel??y(o)("question.otherDefault")),1),Zn(_("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":F[1]||(F[1]=j=>w.value[l.value.id]=j),class:"other-input",type:"text",placeholder:l.value.otherLabel??y(o)("question.otherDefault"),onInput:F[2]||(F[2]=j=>M(l.value.id)),onFocus:F[3]||(F[3]=j=>M(l.value.id))},null,40,BAe),[[Fs,w.value[l.value.id]]])],2)):J("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:ue(()=>[_("div",RAe,[i.value[He(I(y(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(g(),ce(It,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!E(),loading:T.value,onClick:O},{default:ue(()=>[He(I(y(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(g(),ce(It,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||C.value,onClick:c},{default:ue(()=>[He(I(y(o)("question.back")),1)]),_:1},8,["disabled"])):J("",!0),Z(It,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:N.value,disabled:C.value,onClick:H},{default:ue(()=>[He(I(y(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),jAe=mt(FAe,[["__scopeId","data-v-29d475ec"]]),OAe=Ge({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(g(),S("span",{class:Be(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},I(n[t.status]),3))}}),G5=mt(OAe,[["__scopeId","data-v-f870866a"]]),PAe={key:0,class:"sg-empty"},HAe={key:1,class:"sg-grid"},DAe=["aria-label","onClick"],VAe={class:"sg-top"},WAe={class:"sg-num"},qAe={class:"sg-name"},UAe={key:1,class:"sg-desc"},ZAe={class:"sg-foot"},KAe={key:0,class:"sg-model"},GAe={class:"sg-status"},YAe={class:"sg-state"},XAe={key:0,class:"sg-time"},JAe=Ge({__name:"SubagentGrid",props:{tasks:{},filter:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Lt();function s(f){return f}function i(f){return f==="running"?"tasks.emptyRunning":f==="done"?"tasks.emptyDone":f==="active"?"tasks.emptyRecent":"tasks.emptyTasks"}const r=pn("modelDisplay"),l=pn("subagentEffort");function a(f){const{model:p,thinkingEffort:h}=f;return[r?.(p)??p,l?.(h)].filter(Boolean).join(" · ")||void 0}function c(f){const p=f.state;return o(p==="done"?"tasks.stateDone":p==="fail"?"tasks.stateFail":p==="cancelled"?"tasks.stateCancelled":"tasks.running")}function u(f,p){return String(f.dynamicWorkflowIndex??p+1).padStart(2,"0")}function d(f){return!!(f.agentId||f.output?.length)}return(f,p)=>e.tasks.length===0?(g(),S("div",PAe,I(y(o)(i(e.filter))),1)):(g(),S("div",HAe,[(g(!0),S(Me,null,it(e.tasks,(h,m)=>(g(),S("article",{key:h.id,class:Be(["sg-card",[`s-${h.state}`,{openable:d(h)}]])},[d(h)?(g(),S("button",{key:0,class:"sg-open",type:"button","aria-label":h.name,onClick:k=>n("open",h.agentId??h.id)},null,8,DAe)):J("",!0),_("div",VAe,[_("span",WAe,I(u(h,m)),1),_("span",qAe,I(h.name),1)]),h.meta?(g(),S("div",UAe,I(h.meta),1)):J("",!0),_("div",ZAe,[a(h)?(g(),S("div",KAe,[_("span",null,I(a(h)),1)])):J("",!0),_("div",GAe,[_("span",YAe,[h.state==="run"?(g(),ce(G5,{key:0,status:"run"})):h.state==="done"?(g(),ce(Le,{key:1,class:"sg-ic-done",name:"check",size:"sm"})):(g(),ce(Le,{key:2,name:"close",size:"sm"})),He(" "+I(c(h)),1)]),h.timing?(g(),S("span",XAe,[Z(Le,{name:"clock",size:"sm"}),He(" "+I(h.timing),1)])):J("",!0)])]),h.state==="run"?(g(),ce(Zt,{key:2,class:"sg-cancel",size:"sm",label:y(o)("tasks.stop"),onClick:xt(k=>n("cancel",h.id),["stop"])},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label","onClick"])):J("",!0)],2))),128))]))}}),QAe=mt(JAe,[["__scopeId","data-v-5945b343"]]),eEe={class:"taskspane"},tEe={class:"tp-list"},nEe={key:0,class:"tp-empty"},oEe={class:"tp-main"},sEe=["aria-label","onClick"],iEe=["aria-label"],rEe={class:"tp-name"},lEe={key:1,class:"tp-meta"},aEe={key:2,class:"tp-model"},cEe={key:3,class:"tp-model"},uEe={key:4,class:"tp-time"},dEe=Ge({__name:"TasksPane",props:{tasks:{},filter:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Lt();function s(p){return p}function i(p){return p==="running"?"tasks.emptyRunning":p==="done"?"tasks.emptyDone":p==="active"?"tasks.emptyRecent":"tasks.emptyTasks"}function r(p){return p.kind==="subagent"||!!(p.output?.length||p.meta)}function l(p){r(p)&&n("open",p.agentId??p.id)}function a(p){const h=p.state;return o(h==="done"?"tasks.stateDone":h==="fail"?"tasks.stateFail":h==="cancelled"?"tasks.stateCancelled":"tasks.running")}const c=pn("modelDisplay"),u=pn("subagentEffort");function d(p){if(p.kind!=="subagent")return;const h=p.model;return c?.(h)??h}function f(p){if(p.kind==="subagent")return u?.(p.thinkingEffort)}return(p,h)=>(g(),S("div",eEe,[_("div",tEe,[e.tasks.length===0?(g(),S("div",nEe,I(y(o)(i(e.filter))),1)):(g(!0),S(Me,{key:1},it(e.tasks,m=>(g(),S("div",{key:m.id,class:Be(["tp-row",{fail:m.state==="fail",expandable:r(m)}])},[_("div",oEe,[r(m)?(g(),S("button",{key:0,class:"tp-open",type:"button","aria-label":m.name,onClick:k=>l(m)},null,8,sEe)):J("",!0),_("span",{class:"tp-glyph",role:"img","aria-label":a(m)},[m.state==="run"?(g(),ce(G5,{key:0,status:"run"})):m.state==="done"?(g(),ce(Le,{key:1,class:"tp-done",name:"check",size:"sm"})):m.state==="cancelled"?(g(),ce(Le,{key:2,class:"tp-cancelled",name:"close",size:"sm"})):(g(),ce(Le,{key:3,class:"tp-fail",name:"close",size:"sm"}))],8,iEe),_("span",rEe,I(m.name),1),m.meta?(g(),S("span",lEe,I(m.meta),1)):J("",!0),d(m)?(g(),S("span",aEe,I(d(m)),1)):J("",!0),f(m)?(g(),S("span",cEe,I(f(m)),1)):J("",!0),m.timing?(g(),S("span",uEe,I(m.timing),1)):J("",!0),m.state==="run"?(g(),ce(Zt,{key:5,class:"tp-stop",size:"sm",label:y(o)("tasks.stop"),onClick:xt(k=>n("cancel",m.id),["stop"])},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label","onClick"])):J("",!0),r(m)?(g(),ce(Le,{key:6,class:"tp-chevron",name:"chevron-right",size:"sm"})):J("",!0)])],2))),128))])]))}}),fEe=mt(dEe,[["__scopeId","data-v-f4589f0b"]]),pEe={class:"todo-card"},hEe={key:0,class:"tc-empty"},mEe={class:"tc-name"},gEe=Ge({__name:"TodoCard",props:{todos:{}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",pEe,[e.todos.length===0?(g(),S("div",hEe,[Z(Le,{class:"tc-empty-ico",name:"list",size:"lg"}),_("span",null,I(y(t)("tasks.emptyTodo")),1)])):(g(!0),S(Me,{key:1},it(e.todos,(s,i)=>(g(),S("div",{key:i,class:Be(["tc-row",`s-${s.status}`])},[_("span",{class:Be(["tc-glyph",`g-${s.status}`])},[s.status==="done"?(g(),ce(Le,{key:0,name:"check",size:"md"})):s.status==="in_progress"?(g(),ce(Go,{key:1,class:"tc-spin",size:"sm"})):J("",!0)],2),_("span",mEe,I(s.title),1)],2))),128))]))}}),vEe=mt(gEe,[["__scopeId","data-v-4e4d0054"]]),wEe=["disabled","aria-pressed"],yEe=Ge({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(g(),S("button",{key:0,class:Be(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[En(t.$slots,"default",{},void 0,!0)],10,wEe)):(g(),S("span",{key:1,class:Be(["ui-pill",{"is-active":e.active}])},[En(t.$slots,"default",{},void 0,!0)],2))}}),Mz=mt(yEe,[["__scopeId","data-v-0fb1a50d"]]),kEe={class:"fc-label"},bEe=Ge({__name:"FilterControl",props:{modelValue:{},options:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>n.options.find(T=>T.value===n.modelValue)),i=typeof window<"u"&&window.matchMedia?.("(hover: none)").matches?"lg":"md",r=U(null),l=U(!1);let a=0,c=null;async function u(){const T=r.value?.closest(".dock-work-head");if(!T)return;const N=T.querySelector(".wp-head-tab"),C=getComputedStyle(T),O=(Number.parseFloat(C.columnGap)||0)*2,H=T.clientWidth-Number.parseFloat(C.paddingLeft)-Number.parseFloat(C.paddingRight)-O,V=N?.scrollWidth??0;if(!l.value){const F=r.value?.querySelector(".ui-seg");F&&F.offsetWidth>0&&(a=F.offsetWidth)}const A=V+a>H;if(l.value=A,!A){await vt();const F=r.value?.querySelector(".ui-seg");F&&F.offsetWidth>0&&(a=F.offsetWidth),l.value=V+a>H}}const d=U(!1),f=U(null),p=U(null),h=U({left:"0px",top:"0px"});function m(){return f.value?.$el??null}async function k(){if(d.value){x();return}d.value=!0,await vt(),v(),w(),window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",z,!0),window.addEventListener("resize",v),window.addEventListener("scroll",v,!0)}function x(T){d.value=!1,window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",z,!0),window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0),T?.refocus&&m()?.focus()}function v(){const T=m();if(!T)return;const N=T.getBoundingClientRect(),C=p.value?.offsetHeight??0,O=getComputedStyle(document.documentElement),H=Number.parseFloat(O.getPropertyValue("--space-2"))||0,V=Number.parseFloat(O.getPropertyValue("--space-1"))||0,A=p.value?.offsetWidth??0,F=Math.min(N.left,Math.max(H,window.innerWidth-A-H));N.bottom+V+C<=window.innerHeight-H?h.value={left:`${F}px`,top:`${N.bottom+V}px`}:h.value={left:`${F}px`,bottom:`${window.innerHeight-N.top+V}px`}}function w(){const T=p.value;if(!T)return;(T.querySelector(".ui-menu-item.is-active")??T.querySelector(".ui-menu-item"))?.focus()}function b(){d.value||k()}function M(T){const N=T.relatedTarget;N&&(p.value?.contains(N)||m()?.contains(N))||x()}function R(T){const N=T.target;if(N){if(p.value?.contains(N)){T.stopImmediatePropagation();return}m()?.contains(N)||x()}}function z(T){T.key==="Escape"&&(T.preventDefault(),T.stopImmediatePropagation(),x({refocus:!0}))}function $(T){if(T.key!=="ArrowDown"&&T.key!=="ArrowUp")return;T.preventDefault();const N=Array.from(p.value?.querySelectorAll(".ui-menu-item")??[]);if(N.length===0)return;const C=N.indexOf(document.activeElement),O=T.key==="ArrowDown"?(C+1)%N.length:(C-1+N.length)%N.length;N[O]?.focus()}function E(T){o("update:modelValue",T),x({refocus:!0})}return xn(()=>{const T=r.value?.closest(".dock-work-head");!T||typeof ResizeObserver!="function"||(c=new ResizeObserver(()=>void u()),c.observe(T),u())}),Ue(l,T=>{!T&&d.value&&x()}),Ue(()=>n.options,async()=>{a=0,await vt(),await u()},{flush:"post"}),vo(()=>{c?.disconnect(),d.value&&x()}),(T,N)=>(g(),S("span",{ref_key:"root",ref:r,class:"filter-control"},[l.value?(g(),S(Me,{key:0},[Z(Mz,{ref_key:"triggerRef",ref:f,class:"fc-trigger","aria-haspopup":"menu","aria-expanded":d.value,onClick:k,onKeydown:[To(xt(b,["prevent"]),["down"]),To(xt(b,["prevent"]),["up"])],onFocusout:M},{default:ue(()=>[s.value?.icon?(g(),ce(Le,{key:0,name:s.value.icon,size:"sm"},null,8,["name"])):J("",!0),_("span",null,I(s.value?.label),1),Z(Le,{class:"fc-chevron",name:"chevron-down",size:"sm"})]),_:1},8,["aria-expanded","onKeydown"]),(g(),ce(Gr,{to:"body"},[d.value?(g(),S("div",{key:0,ref_key:"menuBoxRef",ref:p,class:"fc-menu",style:Wt(h.value),onKeydown:$,onFocusout:M},[Z(qr,null,{default:ue(()=>[(g(!0),S(Me,null,it(e.options,C=>(g(),ce(yn,{key:C.value,role:"menuitemradio",active:C.value===e.modelValue,"aria-checked":C.value===e.modelValue,size:y(i),onClick:O=>E(C.value)},{default:ue(()=>[C.icon?(g(),ce(Le,{key:0,name:C.icon,size:"sm","data-icon":C.icon},null,8,["name","data-icon"])):J("",!0),_("span",kEe,I(C.label),1),C.value===e.modelValue?(g(),ce(Le,{key:1,class:"fc-check",name:"check",size:"sm"})):J("",!0)]),_:2},1032,["active","aria-checked","size","onClick"]))),128))]),_:1})],36)):J("",!0)]))],64)):(g(),ce(ni,{key:1,"model-value":e.modelValue,options:e.options,size:"md","onUpdate:modelValue":N[0]||(N[0]=C=>o("update:modelValue",C))},null,8,["model-value","options"]))],512))}}),KC=mt(bEe,[["__scopeId","data-v-658870b5"]]),_Ee={class:"wp-head-tab"},xEe={key:0,class:"wp-head-meta"},SEe={key:0,class:"wp-head-actions"},CEe=Ge({__name:"WorkPanelHead",props:{icon:{},title:{},meta:{}},setup(e){return(t,n)=>(g(),S(Me,null,[_("span",_Ee,[Z(Le,{name:e.icon,size:"md"},null,8,["name"]),_("span",null,I(e.title),1),e.meta?(g(),S("span",xEe,I(e.meta),1)):J("",!0)]),t.$slots.actions?(g(),S("span",SEe,[En(t.$slots,"actions",{},void 0,!0)])):J("",!0)],64))}}),g2=mt(CEe,[["__scopeId","data-v-408c4b07"]]),v2=Ge({__name:"WorkPill",props:{icon:{},active:{type:Boolean},label:{}},emits:["click"],setup(e){return(t,n)=>(g(),ce(Mz,{active:e.active,"aria-pressed":e.active,"aria-label":e.label,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},{default:ue(()=>[Z(Le,{name:e.icon,size:"md"},null,8,["name"]),_("span",null,[En(t.$slots,"default")]),En(t.$slots,"meta")]),_:3},8,["active","aria-pressed","aria-label"]))}}),MEe={class:"dock-work-head"},AEe={key:0,class:"dock-workbar"},EEe={class:"dw-running"},TEe={class:"dw-running"},IEe={class:"dw-count"},LEe=Ge({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},working:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},goalMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},sessionPlans:{},dockPanel:{},overlayOpen:{type:Boolean},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean},openFile:{type:Function},revealSavedPlan:{type:Function}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Lt(),{confirm:r,current:l}=y1(),a=U(null),c=U(null),u=U(null),d=U(null),f=U(!1),p=U(!1),h=U("50% 100%"),m=U("active"),k=U("active"),x=B(()=>Object.values(o.sessionPlans??{}).at(-1)),v=B(()=>a.value?.anyPopupOpen??!1),w=B(()=>[{value:"active",label:i("tasks.filterRecent"),icon:"clock"},{value:"running",label:i("tasks.filterRunning"),icon:"play"},{value:"done",label:i("tasks.filterDone"),icon:"circle-check"},{value:"all",label:i("tasks.filterAll"),icon:"list"}]),b=B(()=>(o.todos?.length??0)>0&&o.todoDoneCount===(o.todos?.length??0)),M=B(()=>o.goal?i(`status.goalStatus${o.goal.status[0].toUpperCase()}${o.goal.status.slice(1)}`):""),R=B(()=>{const W=Math.max(0,Math.round((o.goal?.wallClockMs??0)/1e3)),G=Math.floor(W/3600),ee=Math.floor(W%3600/60);return G?`${G}${i("status.timeUnitHour")} ${ee}${i("status.timeUnitMinute")}`:ee?`${ee}${i("status.timeUnitMinute")} ${W%60}${i("status.timeUnitSecond")}`:`${W}${i("status.timeUnitSecond")}`}),z=B(()=>o.bashTasks.some(W=>W.kind==="tool")?i("tasks.dockTasks"):i("tasks.dockBash"));function $(W,G){if(G==="all")return W;if(G==="running")return W.filter(oe=>oe.state==="run");if(G==="done")return W.filter(oe=>oe.state!=="run");const ee=W.filter(oe=>oe.state==="run"),se=W.filter(oe=>oe.state!=="run").toSorted((oe,Q)=>Date.parse(Q.completedAt??Q.createdAt??"")-Date.parse(oe.completedAt??oe.createdAt??"")).slice(0,5);return[...ee,...se]}const E=B(()=>$(o.bashTasks,m.value)),T=B(()=>$(o.subagentTasks,k.value));function N(W,G){const ee=G.currentTarget,se=c.value;if(ee&&se){const oe=ee.getBoundingClientRect(),Q=se.getBoundingClientRect();h.value=`${oe.left+oe.width/2-Q.left}px 100%`}s("toggle-dock-panel",W)}function C(){p.value=(d.value?.scrollTop??0)>0}function O(W){if(!o.dockPanel)return;const G=W.target;!G||u.value?.contains(G)||G.closest(".ui-pill")||s("close-dock-panel")}function H(W){o.dockPanel&&(W.key!=="Escape"||W.repeat||W.isComposing||W.defaultPrevented||v.value||l.value||o.overlayOpen||(W.preventDefault(),W.stopImmediatePropagation(),s("close-dock-panel")))}async function V(){await r({title:i("status.goalCancel"),message:i("status.goalCancelConfirm"),confirmLabel:i("status.goalCancelConfirmYes"),cancelLabel:i("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}function A(){const W=c.value;if(!W)return;document.documentElement.style.setProperty("--dock-h",`${W.offsetHeight}px`);const G=Number.parseFloat(getComputedStyle(W).getPropertyValue("--p-bp-sm"))||640;f.value=W.offsetWidth{document.addEventListener("mousedown",O,!0),document.addEventListener("keydown",H,!0),typeof ResizeObserver=="function"&&c.value&&(F=new ResizeObserver(()=>{A(),C()}),F.observe(c.value),A())}),An(()=>{document.removeEventListener("mousedown",O,!0),document.removeEventListener("keydown",H,!0),F?.disconnect()}),Ue(()=>o.dockPanel,()=>{p.value=!1,vt(C)});function j(W){return a.value?.loadForEdit(W)??!1}function q(W){a.value?.loadAttachmentsForEdit(W)}function P(){a.value?.focus()}return t({loadForEdit:j,loadAttachmentsForEdit:q,focus:P,anyPopupOpen:v,isEmpty:B(()=>a.value?.isEmpty??!0)}),(W,G)=>(g(),S("div",{ref_key:"dockRef",ref:c,class:Be(["chat-dock",[e.mobile?"align-mobile":"align-center",{"has-popup":v.value||e.dockPanel,"has-approval":!!e.pendingApproval&&!e.pendingQuestion,"pills-compact":f.value}]]),onClick:G[36]||(G[36]=xt(()=>{},["stop"]))},[Z(gr,{name:"dock-panel"},{default:ue(()=>[e.dockPanel?(g(),S("div",{key:e.dockPanel,ref_key:"workPanelRef",ref:u,class:Be(["dock-work-panel",[`panel-${e.dockPanel}`,{"body-scrolled-up":p.value}]]),style:Wt({transformOrigin:h.value})},[_("div",MEe,[e.dockPanel==="bash"?(g(),ce(g2,{key:0,icon:"terminal",title:z.value,meta:`${e.bashRunning} ${y(i)("tasks.running")}`},{actions:ue(()=>[Z(KC,{modelValue:m.value,"onUpdate:modelValue":G[0]||(G[0]=ee=>m.value=ee),options:w.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="subagent"?(g(),ce(g2,{key:1,icon:"sparkles",title:y(i)("tasks.dockSubagent"),meta:`${e.subagentRunning} ${y(i)("tasks.running")}`},{actions:ue(()=>[Z(KC,{modelValue:k.value,"onUpdate:modelValue":G[1]||(G[1]=ee=>k.value=ee),options:w.value},null,8,["modelValue","options"])]),_:1},8,["title","meta"])):e.dockPanel==="todos"?(g(),ce(g2,{key:2,icon:b.value?"check-list":"list",title:y(i)("tasks.todoProgressTitle"),meta:`${e.todoDoneCount}/${e.todos?.length??0}`},null,8,["icon","title","meta"])):e.dockPanel==="goal"?(g(),ce(g2,{key:3,icon:"target",title:y(i)("status.goalLabel"),meta:R.value},{actions:ue(()=>[e.goal?.status==="active"?(g(),ce(Zt,{key:0,size:"sm",label:y(i)("status.goalPause"),onClick:G[2]||(G[2]=ee=>s("controlGoal","pause"))},{default:ue(()=>[Z(Le,{name:"pause",size:"sm"})]),_:1},8,["label"])):J("",!0),e.goal?.status==="paused"||e.goal?.status==="blocked"?(g(),ce(Zt,{key:1,size:"sm",label:y(i)("status.goalResume"),onClick:G[3]||(G[3]=ee=>s("controlGoal","resume"))},{default:ue(()=>[Z(Le,{name:"play",size:"sm"})]),_:1},8,["label"])):J("",!0),Z(Zt,{size:"sm",label:y(i)("status.goalCancel"),onClick:V},{default:ue(()=>[Z(Le,{name:"power",size:"sm"})]),_:1},8,["label"]),Z(Zt,{size:"sm",label:y(i)("tasks.closePanel"),onClick:G[4]||(G[4]=ee=>s("close-dock-panel"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])]),_:1},8,["title","meta"])):(g(),ce(g2,{key:4,icon:"file-edit",title:y(i)("status.planLabel"),meta:x.value?.reviewState?y(i)(`tools.plan.review.${x.value.reviewState}`):""},{actions:ue(()=>[x.value?.path?(g(),ce(Zt,{key:0,size:"sm",label:y(i)("tools.plan.revealInFileManager"),onClick:G[5]||(G[5]=ee=>void e.revealSavedPlan?.(x.value.agentId,x.value.toolCallId))},{default:ue(()=>[Z(Le,{name:"external-link",size:"sm"})]),_:1},8,["label"])):J("",!0),e.planArmed||e.planMode?(g(),ce(Zt,{key:1,size:"sm",label:y(i)("status.workModeDismiss"),onClick:G[6]||(G[6]=ee=>s("togglePlan"))},{default:ue(()=>[Z(Le,{name:"power",size:"sm"})]),_:1},8,["label"])):J("",!0),Z(Zt,{size:"sm",label:y(i)("tasks.closePanel"),onClick:G[7]||(G[7]=ee=>s("close-dock-panel"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])]),_:1},8,["title","meta"]))]),_("div",{ref_key:"workBodyRef",ref:d,class:"dock-work-body",onScroll:C},[e.dockPanel==="bash"?(g(),ce(fEe,{key:0,tasks:E.value,filter:m.value,onCancel:G[8]||(G[8]=ee=>s("cancelTask",ee)),onOpen:G[9]||(G[9]=ee=>s("openAgent",ee))},null,8,["tasks","filter"])):e.dockPanel==="subagent"?(g(),ce(QAe,{key:1,tasks:T.value,filter:k.value,onCancel:G[10]||(G[10]=ee=>s("cancelTask",ee)),onOpen:G[11]||(G[11]=ee=>s("openAgent",ee))},null,8,["tasks","filter"])):e.dockPanel==="todos"?(g(),ce(vEe,{key:2,todos:e.todos??[]},null,8,["todos"])):e.dockPanel==="goal"&&e.goal?(g(),ce(eAe,{key:3,goal:e.goal,"open-file":e.openFile},null,8,["goal","open-file"])):(g(),ce(dAe,{key:4,plan:x.value,"plan-mode-on":e.planMode,"open-file":e.openFile,"reveal-saved-plan":e.revealSavedPlan},null,8,["plan","plan-mode-on","open-file","reveal-saved-plan"]))],544)],6)):J("",!0)]),_:1}),e.hasDockWork||e.planMode||x.value?(g(),S("div",AEe,[e.goal?(g(),ce(v2,{key:0,icon:"target",active:e.dockPanel==="goal",label:`${y(i)("status.goalLabel")} ${M.value}`,onClick:G[12]||(G[12]=ee=>N("goal",ee))},{meta:ue(()=>[_("span",{class:Be(["dw-goal-status",`dw-goal-status--${e.goal.status}`])},I(M.value),3)]),default:ue(()=>[He(I(y(i)("status.goalLabel"))+" ",1)]),_:1},8,["active","label"])):J("",!0),e.planMode||x.value?(g(),ce(v2,{key:1,icon:"file-edit",active:e.dockPanel==="plan",label:y(i)("status.planLabel"),onClick:G[13]||(G[13]=ee=>N("plan",ee))},{default:ue(()=>[He(I(y(i)("status.planLabel")),1)]),_:1},8,["active","label"])):J("",!0),e.bashTasks.length?(g(),ce(v2,{key:2,icon:"terminal",active:e.dockPanel==="bash",label:z.value,onClick:G[14]||(G[14]=ee=>N("bash",ee))},fd({default:ue(()=>[He(I(z.value)+" ",1)]),_:2},[e.bashRunning?{name:"meta",fn:ue(()=>[_("span",EEe,[Z(G5,{status:"run"}),He(I(e.bashRunning),1)])]),key:"0"}:void 0]),1032,["active","label"])):J("",!0),e.subagentTasks.length?(g(),ce(v2,{key:3,icon:"sparkles",active:e.dockPanel==="subagent",label:y(i)("tasks.dockSubagent"),onClick:G[15]||(G[15]=ee=>N("subagent",ee))},fd({default:ue(()=>[He(I(y(i)("tasks.dockSubagent"))+" ",1)]),_:2},[e.subagentRunning?{name:"meta",fn:ue(()=>[_("span",TEe,[Z(G5,{status:"run"}),He(I(e.subagentRunning),1)])]),key:"0"}:void 0]),1032,["active","label"])):J("",!0),e.todos?.length?(g(),ce(v2,{key:4,icon:b.value?"check-list":"list",active:e.dockPanel==="todos",label:y(i)("tasks.todoProgressTitle"),onClick:G[16]||(G[16]=ee=>N("todos",ee))},{meta:ue(()=>[_("span",IEe,I(e.todoDoneCount)+"/"+I(e.todos?.length),1)]),default:ue(()=>[He(I(y(i)("tasks.todoProgressTitle"))+" ",1)]),_:1},8,["icon","active","label"])):J("",!0)])):J("",!0),e.pendingQuestion?(g(),ce(jAe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:G[17]||(G[17]=(ee,se)=>s("answer",ee,se)),onDismiss:G[18]||(G[18]=ee=>s("dismiss",ee))},null,8,["question","busy-kind"])):e.pendingApproval?(g(),ce(GMe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:G[19]||(G[19]=ee=>s("approval",e.pendingApproval.approvalId,ee))},null,8,["block","agent-name","busy"])):(g(),ce(Cz,{key:3,ref_key:"composerRef",ref:a,"session-id":e.sessionId,running:e.running,working:e.working,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,"goal-mode":e.goalMode,"workflow-active":e.dynamicWorkflowMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:G[20]||(G[20]=ee=>s("submit",ee)),onSteer:G[21]||(G[21]=ee=>s("steer",ee)),onCommand:G[22]||(G[22]=ee=>s("command",ee)),onInterrupt:G[23]||(G[23]=ee=>s("interrupt")),onSetPermission:G[24]||(G[24]=ee=>s("setPermission",ee)),onSetThinking:G[25]||(G[25]=ee=>s("setThinking",ee)),onTogglePlan:G[26]||(G[26]=ee=>s("togglePlan")),onToggleWorkflow:G[27]||(G[27]=ee=>s("toggleWorkflow")),onToggleGoal:G[28]||(G[28]=ee=>s("toggleGoal")),onOpenBtw:G[29]||(G[29]=ee=>s("openBtw")),onCreateGoal:G[30]||(G[30]=ee=>s("createGoal",ee)),onControlGoal:G[31]||(G[31]=ee=>s("controlGoal",ee)),onFocusGoal:G[32]||(G[32]=ee=>s("focusGoal")),onCompact:G[33]||(G[33]=ee=>s("compact")),onPickModel:G[34]||(G[34]=ee=>s("pickModel")),onSelectModel:G[35]||(G[35]=ee=>s("selectModel",ee))},null,8,["session-id","running","working","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","goal-mode","workflow-active","goal","activation-badges","models","starred-ids","skills"]))],2))}}),$Ee=mt(LEe,[["__scopeId","data-v-72059270"]]),NEe=["aria-label","aria-hidden"],zEe=["data-turn-id","tabindex","aria-current","aria-label","onMouseenter","onFocus","onKeydown","onClick"],BEe=["aria-label"],REe={class:"toc-preview__prompt"},FEe={key:0,class:"toc-preview__response"},jEe=80,OEe=Ge({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=U(null),r=U(null),l=U(null),a=U(!0);let c=null;function u(){const T=i.value,N=T?.offsetParent;if(!T||!N)return;const C=T.getBoundingClientRect(),O=N.getBoundingClientRect();a.value=C.left>=O.left&&C.right<=O.right}const d=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1),f=B(()=>r.value!==null&&n.items.some(T=>T.id===r.value)?r.value:n.activeTurnId!==null&&n.items.some(T=>T.id===n.activeTurnId)?n.activeTurnId:n.items[0]?.id??null),p=B(()=>l.value??r.value??n.activeTurnId),h=B(()=>{const T=l.value??r.value;return T===null?void 0:n.items.find(N=>N.id===T)}),m=U(0);let k=null;function x(){k!==null&&clearTimeout(k),k=null}function v(){x(),k=setTimeout(()=>{l.value=null,k=null},jEe)}function w(){return i.value===null?[]:Array.from(i.value.querySelectorAll(".toc-row"))}function b(T,N){let C=T;if(N.key==="ArrowDown")C=Math.min(n.items.length-1,T+1);else if(N.key==="ArrowUp")C=Math.max(0,T-1);else if(N.key==="Home")C=0;else if(N.key==="End")C=n.items.length-1;else return;N.preventDefault(),w()[C]?.focus()}function M(T){const N=T??w().find(O=>O.dataset.turnId===h.value?.id),C=N?.parentElement;!N||!C||(m.value=N.offsetTop-C.scrollTop+N.offsetHeight/2)}function R(T,N){x(),l.value=T,M(N.currentTarget)}function z(T,N){x(),r.value=T,M(N.currentTarget)}function $(T){x();const N=document.activeElement;N instanceof HTMLElement&&i.value?.contains(N)&&N.blur(),l.value=null,r.value=null,o("select",T)}function E(T){const N=T.relatedTarget;(!(N instanceof Node)||!i.value?.contains(N))&&(r.value=null)}return Ue(d,T=>{c?.disconnect(),c=null,T&&vt(()=>{const N=i.value,C=N?.offsetParent;!N||!C||(typeof ResizeObserver<"u"&&(c=new ResizeObserver(u),c.observe(C)),u())})},{immediate:!0}),Ue([()=>n.activeTurnId,d],([T,N])=>{!N||T===null||vt(()=>{const C=w().find(O=>O.dataset.turnId===T);typeof C?.scrollIntoView=="function"&&C.scrollIntoView({block:"nearest"})})},{immediate:!0}),vo(()=>{x(),c?.disconnect(),c=null}),(T,N)=>d.value?(g(),S("nav",{key:0,ref_key:"navRef",ref:i,class:Be(["conversation-toc",{"toc-clipped":!a.value||e.occluded}]),"aria-label":y(s)("conversation.toc"),"aria-hidden":a.value&&!e.occluded?void 0:!0,onMouseenter:x,onMouseleave:v,onFocusout:E},[_("div",{class:"toc-scroll",onScroll:N[0]||(N[0]=C=>M())},[(g(!0),S(Me,null,it(e.items,(C,O)=>(g(),S("button",{key:C.id,type:"button",class:Be(["toc-row",{active:e.activeTurnId===C.id,highlighted:p.value===C.id,previewing:l.value===C.id||r.value===C.id}]),"data-turn-id":C.id,tabindex:f.value===C.id?0:-1,"aria-current":e.activeTurnId===C.id?"location":void 0,"aria-label":C.title,onMouseenter:H=>R(C.id,H),onFocus:H=>z(C.id,H),onKeydown:H=>b(O,H),onClick:H=>$(C.id)},[...N[2]||(N[2]=[_("span",{class:"toc-marker","aria-hidden":"true"},null,-1)])],42,zEe))),128))],32),h.value?(g(),S("button",{key:0,type:"button",class:"toc-preview",style:Wt({top:`${m.value}px`}),"aria-label":h.value.title,tabindex:"-1",onMouseenter:x,onClick:N[1]||(N[1]=C=>$(h.value.id))},[_("span",REe,I(h.value.title),1),h.value.preview?(g(),S("span",FEe,I(h.value.preview),1)):J("",!0)],44,BEe)):J("",!0)],42,NEe)):J("",!0)}}),PEe=mt(OEe,[["__scopeId","data-v-8a1c40d2"]]),GC="script, style, noscript, template, [inert], .top-sentinel",Az="pythinker-transcript-search",H7="pythinker-transcript-search-current",HEe=1e3;function DEe(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function VEe(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let o="";const s=[];let i=!1;for(let r=0;rYC(c.text)),o=[];let s="";for(let c=0;c0&&e[c].gapBefore&&(s+="\0"),o[c]=s.length,s+=n[c].folded;const i=qEe(YC(t).folded);if(i===null)return;const r=new RegExp(i,"g");function l(c){let u=0,d=o.length-1,f=0;for(;u<=d;){const p=u+d>>1;o[p]<=c?(f=p,u=p+1):d=p-1}return f}let a;for(;;){const c=r.exec(s);if(c===null)return;const u=c.index,d=u+c[0].length-1,f=l(u),p=l(d),h=n[f].map[u-o[f]],m=n[p].map[d-o[p]],k={startSegment:f,startOffset:h.start,endSegment:p,endOffset:m.start+m.length};(a?.startSegment!==k.startSegment||a.startOffset!==k.startOffset||a.endSegment!==k.endSegment||a.endOffset!==k.endOffset)&&(a=k,yield k)}}const ZEe=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BR","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"]),KEe=new Set(["inline","inline-block","inline-flex","inline-grid","inline-table","contents","ruby"]);function GEe(e,t){const n=t.get(e);if(n!==void 0)return n;const o=ZEe.has(e.tagName)||!KEe.has(getComputedStyle(e).display);return t.set(e,o),o}function YEe(e,t,n){let o=e.parentElement;for(;o!==null&&o!==t&&!GEe(o,n);)o=o.parentElement;return o??t}function XEe(e){const t=e.ownerDocument,n=t.defaultView?.NodeFilter??NodeFilter,o=t.createTreeWalker(e,n.SHOW_ELEMENT|n.SHOW_TEXT,{acceptNode(a){if(a.nodeType!==Node.ELEMENT_NODE)return n.FILTER_ACCEPT;const c=a;return c.matches(GC)?n.FILTER_REJECT:c.matches("br, hr, wbr")&&!c.closest(GC)?n.FILTER_ACCEPT:n.FILTER_SKIP}}),s=new WeakMap,i=new WeakMap,r=[];let l=!1;for(let a=o.nextNode();a!==null;a=o.nextNode()){if(a.nodeType===Node.ELEMENT_NODE){l=!0;continue}const c=a.nodeValue??"";if(c.length===0)continue;const u=a.parentElement;if(u===null)continue;let d=i.get(u);d===void 0&&(d=DEe(getComputedStyle(u).whiteSpace),i.set(u,d));let{text:f,map:p}=VEe(c,d);if(f.length===0)continue;const h=YEe(a,e,s),m=r.at(-1),k=l||m===void 0||m.block!==h;!k&&m.text.endsWith(" ")&&f.startsWith(" ")&&(f=f.slice(1),p=p.slice(1),f.length===0)||(r.push({text:f,gapBefore:k,node:a,block:h,whitespaceMap:p}),l=!1)}return r}function JEe(e,t){if(t.length===0)return[];const n=XEe(e),o=[];for(const s of UEe(n,t)){const i=n[s.startSegment],r=n[s.endSegment],l=e.ownerDocument.createRange();l.setStart(i.node,i.whitespaceMap[s.startOffset]),l.setEnd(r.node,r.whitespaceMap[s.endOffset-1]+1),o.push(l)}return o}function QEe(e,t,n=o=>o.getClientRects().length!==0){const o=[];for(const s of JEe(e,t))if(n(s)){if(o.length>=HEe)return{ranges:o,truncated:!0};o.push(s)}return{ranges:o,truncated:!1}}function Ez(){return globalThis.CSS?.highlights??null}function XC(e,t){const n=Ez(),o=globalThis.Highlight;if(!n||!o)return;if(e.length===0){x4();return}const s=new o;for(const r of e)s.add(r);n.set(Az,s);const i=e[t];if(i){const r=new o;r.add(i),n.set(H7,r)}else n.delete(H7)}function x4(){const e=Ez();e?.delete(Az),e?.delete(H7)}const eTe={class:"tsearch-main"},tTe=["placeholder"],nTe=["inert"],oTe={class:"tsearch-foot"},sTe={class:"tsearch-count","aria-live":"polite"},iTe={class:"tsearch-rings"},rTe=Ge({__name:"TranscriptSearch",props:{pane:{},mobile:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=Y3("input"),r=jo(""),l=jo(!1),a=jo([]),c=jo(0),u=jo(!1),d=jo(!1),f=jo([]),p=B(()=>a.value.length),h=B(()=>r.value.trim()!==""),m=B(()=>{if(l.value)return s("conversation.search.searching");if(!h.value)return"";if(p.value===0)return s("conversation.search.noResults");const j={current:c.value+1,total:p.value};return u.value?s("conversation.search.resultsCapped",j):s("conversation.search.results",j)});let k=null,x=null,v=null,w=null,b=null;function M(){return n.pane.querySelector(".chat")}function R(){const j=a.value[c.value];if(!j){f.value=[];return}const q=n.pane.getBoundingClientRect();f.value=Array.from(j.getClientRects(),P=>({top:`${P.top-q.top+n.pane.scrollTop}px`,left:`${P.left-q.left}px`,width:`${P.width}px`,height:`${P.height}px`}))}function z(){f.value.length!==0&&(v!==null&&clearTimeout(v),v=setTimeout(()=>{v=null,R()},120))}function $(j){const q=n.pane.getBoundingClientRect().top,P=j.findIndex(W=>{const G=W.getClientRects(),ee=G[G.length-1];return ee!==void 0&&ee.bottom>=q});return P===-1?0:P}function E(){const j=a.value[c.value];XC(a.value,c.value),(j?.startContainer instanceof Element?j.startContainer:j?.startContainer.parentElement)?.scrollIntoView({block:"center"}),R()}function T(j="first"){k!==null&&(clearTimeout(k),k=null),l.value=!1;const q=M(),P=r.value.trim();if(!q||P===""){a.value=[],u.value=!1,c.value=0,x4(),R();return}const W=a.value[c.value],G=W?.startContainer,ee=W?.startOffset,se=QEe(q,P);if(a.value=se.ranges,u.value=se.truncated,se.ranges.length===0){c.value=0,x4(),R();return}if(j!==!1){const Q=$(se.ranges);c.value=j==="backward"?(Q-1+se.ranges.length)%se.ranges.length:Q,E();return}const oe=se.ranges.findIndex(Q=>Q.startContainer===G&&Q.startOffset===ee);c.value=oe>=0?oe:$(se.ranges),XC(se.ranges,c.value),R()}function N(){if(k!==null&&clearTimeout(k),r.value.trim()===""){l.value=!1,T();return}l.value=!0,k=setTimeout(()=>T(),150)}function C(j){p.value!==0&&(c.value=(c.value+j+p.value)%p.value,E())}function O(j){if(!(j.key!=="Enter"||d.value||j.isComposing)){if(j.preventDefault(),k!==null){T(j.shiftKey?"backward":"first");return}C(j.shiftKey?-1:1)}}function H(j){j.key!=="Escape"||d.value||j.isComposing||(j.preventDefault(),j.stopPropagation(),o("close"))}function V(j){return j instanceof Element&&(j.classList.contains("tsearch-rings")||j.closest(".tsearch-rings")!==null)}function A(j){if(j.type==="attributes"&&j.target===n.pane||V(j.target))return!0;if(j.type!=="childList")return!1;const q=[...j.addedNodes,...j.removedNodes];return q.length>0&&q.every(V)}function F(j){r.value.trim()===""||j.every(A)||k!==null||(x!==null&&clearTimeout(x),x=setTimeout(()=>{x=null,k===null&&T(!1)},150))}return xn(()=>{if(vt(()=>i.value?.focus()),typeof MutationObserver=="function"&&(w=new MutationObserver(F),w.observe(n.pane,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["inert","style","class"]})),n.pane.addEventListener("scroll",z,{passive:!0}),window.addEventListener("resize",z,{passive:!0}),typeof ResizeObserver=="function"){b=new ResizeObserver(R),b.observe(n.pane);const j=n.pane.querySelector(".content-wrap");j&&b.observe(j)}}),An(()=>{k!==null&&clearTimeout(k),x!==null&&clearTimeout(x),v!==null&&clearTimeout(v),w?.disconnect(),b?.disconnect(),n.pane.removeEventListener("scroll",z),window.removeEventListener("resize",z),x4()}),(j,q)=>(g(),S("div",{class:Be(["tsearch",{mobile:e.mobile}]),role:"search",onKeydown:H},[_("div",eTe,[Z(Le,{class:"tsearch-icon",name:"search",size:"sm","aria-hidden":"true"}),Zn(_("input",{ref:"input","onUpdate:modelValue":q[0]||(q[0]=P=>r.value=P),type:"text",class:"tsearch-input",placeholder:y(s)("conversation.search.placeholder"),autocapitalize:"off",autocomplete:"off",spellcheck:"false",onInput:N,onKeydown:O,onCompositionstart:q[1]||(q[1]=P=>d.value=!0),onCompositionend:q[2]||(q[2]=P=>d.value=!1)},null,40,tTe),[[Fs,r.value]]),l.value?(g(),ce(Go,{key:0,class:"tsearch-spin",size:"sm",label:y(s)("conversation.search.searching")},null,8,["label"])):J("",!0),q[6]||(q[6]=_("span",{class:"tsearch-sep","aria-hidden":"true"},null,-1)),Z(Zt,{class:"tsearch-close",size:"sm",label:y(s)("conversation.search.close"),onClick:q[3]||(q[3]=P=>o("close"))},{default:ue(()=>[Z(Le,{name:"close"})]),_:1},8,["label"])]),_("div",{class:Be(["tsearch-foot-wrap",{open:h.value}]),inert:!h.value},[_("div",oTe,[Z(Zt,{size:"sm",label:y(s)("conversation.search.previous"),disabled:p.value===0,onClick:q[4]||(q[4]=P=>C(-1))},{default:ue(()=>[Z(Le,{name:"arrow-up"})]),_:1},8,["label","disabled"]),Z(Zt,{size:"sm",label:y(s)("conversation.search.next"),disabled:p.value===0,onClick:q[5]||(q[5]=P=>C(1))},{default:ue(()=>[Z(Le,{name:"arrow-down"})]),_:1},8,["label","disabled"]),_("span",sTe,I(m.value),1)])],10,nTe),(g(),ce(Gr,{to:e.pane},[_("div",iTe,[(g(!0),S(Me,null,it(f.value,(P,W)=>(g(),S("div",{key:W,class:"tsearch-ring",style:Wt(P)},null,4))),128))])],8,["to"]))],34))}}),lTe=mt(rTe,[["__scopeId","data-v-d7187e08"]]);function aTe(e,t=2e4){const n=U(`${e}?r=0`);let o=0;const s=setInterval(()=>{o+=1,n.value=`${e}?r=${o}`},t);return An(()=>clearInterval(s)),n}const cTe=["src","alt","role"],uTe=Ge({__name:"PythinkerLogo",props:{size:{default:"sm"},animated:{type:Boolean,default:!0},label:{default:"Pythinker Code"},interactive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=aTe("/brand/mascot-waving.png"),o=e,s=t;function i(){o.interactive&&s("click")}return(r,l)=>(g(),S("img",{src:e.animated?y(n):"/brand/icon.svg",class:Be(["pythinker-logo",[`size-${e.size}`,{interactive:e.interactive}]]),alt:e.label,role:e.interactive?"button":"img",onClick:i},null,10,cTe))}}),Vd=mt(uTe,[["__scopeId","data-v-58c4fde0"]]),dTe=5;function fTe(e,t,n,o=dTe){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const pTe={key:0,class:"recent"},hTe={class:"recent-caption"},mTe=["onClick"],gTe={class:"recent-title"},vTe={class:"recent-time"},wTe={class:"recent-foot"},yTe=Ge({__name:"WorkspaceRecentSessions",props:{sessions:{}},emits:["select","openSessionAdmin"],setup(e,{emit:t}){const n=t,{t:o}=Lt();return(s,i)=>e.sessions.length?(g(),S("section",pTe,[_("h2",hTe,I(y(o)("sessions.recentSessions")),1),(g(!0),S(Me,null,it(e.sessions,r=>(g(),S("button",{key:r.id,type:"button",class:"recent-row",onClick:l=>n("select",r.id)},[_("span",{class:Be(["recent-ico",r.archived?"recent-ico--done":"recent-ico--open"])},[Z(Le,{name:r.archived?"circle-check":"circle-dashed",size:"sm"},null,8,["name"])],2),_("span",gTe,I(r.title),1),_("span",vTe,I(r.time),1)],8,mTe))),128)),_("div",wTe,[Z(Cn,{text:y(o)("conversation.sessionAdminTooltip")},{default:ue(()=>[_("button",{type:"button",class:"recent-more",onClick:i[0]||(i[0]=r=>n("openSessionAdmin"))},[He(I(y(o)("conversation.viewMoreSessions"))+" ",1),Z(Le,{name:"chevron-down",size:"sm"})])]),_:1},8,["text"])])])):J("",!0)}}),kTe=mt(yTe,[["__scopeId","data-v-cd5a729d"]]),bTe={class:"chat-layout"},_Te={class:"empty-hint"},xTe={key:0,class:"empty-hint-text"},STe={key:1,class:"ws-pick"},CTe={class:"ws-pick-name"},MTe={key:1,class:"ws-pick-menu"},ATe=["onClick"],ETe={class:"ws-pick-item-name"},TTe={class:"ws-pick-item-path"},ITe=["aria-label"],LTe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},$Te={class:"abort-toast-text"},NTe=48,Dm=80,JC=1e3,zTe=420,BTe=3e3,RTe=Ge({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},planArmed:{type:Boolean},sessionPlans:{},overlayOpen:{type:Boolean},goalMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean},lastTurnReason:{},turnErrorKind:{},turnErrorMessage:{},sessionDone:{type:Boolean},pinned:{type:Boolean},recentSessions:{},revealSavedPlan:{type:Function}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","steerQueued","setPermission","setThinking","togglePlan","toggleWorkflow","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openCompaction","openAgent","openToolDiff","openTurnDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","restoreSession","selectSession","exportSession","togglePin","openSessionAdmin"],setup(e,{expose:t,emit:n}){const{t:o}=Lt(),s=e,i=n,r=U(!1),l=U(!1),a=B(()=>s.workspaces?.find(Ae=>Ae.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=B(()=>(s.workspaces?.length??0)>0),u=B(()=>fTe(s.workspaces??[],s.activeWorkspaceId,l.value)),d=B(()=>(s.workspaces?.length??0)-u.value.length);Ue(r,Te=>{Te||(l.value=!1)});function f(Te){r.value=!1,Te!==s.activeWorkspaceId&&i("selectWorkspace",Te)}w0(ln.contentAlign);const p=U(null),h=U(null),m=U(null),k=U(!1);let x=null;function v(Te,Ae){const De=m.value??h.value;return!De||De.loadForEdit(Te)===!1?!1:(De.loadAttachmentsForEdit(Ae??[]),!0)}function w(){k.value=!0,x!==null&&clearTimeout(x),x=setTimeout(()=>{x=null,k.value=!1},2e3)}function b(){s.goal&&(V.value="goal")}const M=B(()=>s.tasks.filter(Te=>Te.kind==="bash"||Te.kind==="tool"&&!Te.id.startsWith("question-"))),R=B(()=>s.tasks.filter(Te=>Te.kind==="subagent"&&Te.runInBackground)),z=B(()=>M.value.filter(Te=>Te.state==="run").length),$=B(()=>R.value.filter(Te=>Te.state==="run").length);function E(Te){const Ae=s.tasks,De=Ae.find(dn=>dn.id===Te)??Ae.find(dn=>dn.parentToolCallId===Te);if(De)return De.id;const Ut=Ae.filter(dn=>dn.kind==="subagent"&&!dn.parentToolCallId);if(Ut.length===1)return Ut[0].id}jn("resolveAgentTaskId",E);const T=pn("modelDisplay"),N=pn("subagentEffort");function C(Te){const Ae=E(Te);if(Ae===void 0)return;const De=s.tasks.find(zn=>zn.id===Ae||zn.agentId===Ae),Ut=T?.(De?.model),dn=N?.(De?.thinkingEffort);if(!(Ut===void 0&&dn===void 0))return{display:Ut,effort:dn}}jn("resolveAgentModel",C),jn("resolvePlan",Te=>s.sessionPlans?.[Te]),jn("revealSavedPlan",(Te,Ae)=>s.revealSavedPlan?.(Te,Ae)??Promise.resolve(!1)),jn("pinScroll",ao);const O=B(()=>(s.todos??[]).filter(Te=>Te.status==="done").length),H=B(()=>s.goal!==null&&s.goal!==void 0||M.value.length>0||R.value.length>0||(s.todos?.length??0)>0),V=U(null),A=B(()=>s.gitInfo?s.changes?.length??0:0);function F(Te){V.value=V.value===Te?null:Te}function j(){V.value=null}Ue([V,()=>s.goal,M,R,()=>s.todos,()=>s.planMode,()=>s.sessionPlans],()=>{(V.value==="goal"&&!s.goal||V.value==="bash"&&M.value.length===0||V.value==="subagent"&&R.value.length===0||V.value==="todos"&&(s.todos?.length??0)===0||V.value==="plan"&&!s.planMode&&Object.keys(s.sessionPlans??{}).length===0)&&j()});function q(Te){if(Te.role==="compaction")return o("conversation.compactedPlain");if(Te.role==="user"){if(Te.skillActivation)return`/${Te.skillActivation.name}`;if(Te.pluginCommand)return`/${Te.pluginCommand.pluginId}:${Te.pluginCommand.commandName}`;const De=Te.text.trim().replaceAll(/\s+/g," ");return De.length>0?De:"user"}const Ae=(Te.text||Te.thinking||"").trim().replaceAll(/\s+/g," ");return Ae.length>0?Ae:(Te.tools?.length??0)>0?`${Te.tools.length} tools`:"pythinker"}function P(Te){for(let Ae=Te+1;Ae0)return Ut}return""}const W=B(()=>{let Te=0;return s.turns.flatMap((Ae,De)=>Ae.role!=="user"?[]:(Te+=1,[{id:Ae.id,role:Ae.role,no:Te,title:q(Ae),preview:P(De)}]))}),G=U(null);function ee(){const Te=ne.value;if(!Te)return;const Ae=Te.querySelectorAll(".turn-anchor[data-turn-id]");if(Ae.length===0)return;const De=W.value;if(De.length===0)return;const Ut=new Set(De.map(Jo=>Jo.id));if(be.value&&ke()<=Dm){G.value=De[De.length-1].id;return}const dn=Te.getBoundingClientRect(),zn=dn.height/2;let So=null;Ae.forEach(Jo=>{const Qo=Jo.dataset.turnId;if(!Qo||!Ut.has(Qo))return;Jo.getBoundingClientRect().top-dn.top<=zn&&(So=Qo)}),G.value=So??De[0].id}const se=U(!1);let oe=0;function Q(){oe||(oe=an(()=>{oe=0,ge()}))}function ge(){const Te=ne.value,Ae=!s.mobile&&s.conversationToc&&Te?Te.closest(".con")?.querySelector(".conversation-toc"):null,De=Ae?.querySelector(".toc-marker");let Ut=!1;if(Te&&Ae&&De){const dn=De.getBoundingClientRect(),zn=Ae.getBoundingClientRect(),So=dn.left+dn.width/2;Ut=Array.from(Te.querySelectorAll(".table-node-wrapper")).some(Jo=>{const Qo=Jo.getBoundingClientRect();return Qo.left<=So&&So<=Qo.right&&Qo.topzn.top})}se.value!==Ut&&(se.value=Ut)}const xe=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),Ke=B(()=>{const Te=xe.value;if(Te)return s.pendingQuestionActions?.[Te.questionId]}),et=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Y=B(()=>{const Te=et.value;return Te?!!s.pendingApprovalActions?.[Te.approvalId]:!1}),ne=U(null),D=U(!1),X=U(null),ve=U(0),fe=U(0),pe=B(()=>({"--panes-scrollbar-width":`${ve.value}px`})),te=B(()=>({"--chat-dock-height":`${fe.value+NTe}px`}));function de(Te){return Te instanceof HTMLElement?Te:Te&&"$el"in Te&&Te.$el instanceof HTMLElement?Te.$el:null}function ye(){const Te=ne.value;ve.value=Te?Math.max(0,Te.offsetWidth-Te.clientWidth):0,fe.value=X.value?.offsetHeight??0}function Ce(Te){const Ae=de(Te);ne.value=Ae,Ae&&Cr()}function me(Te){const Ae=de(Te);X.value=Ae??null,Te&&"loadForEdit"in Te&&typeof Te.loadForEdit=="function"&&"focus"in Te&&typeof Te.focus=="function"?m.value={loadForEdit:Te.loadForEdit.bind(Te),loadAttachmentsForEdit:"loadAttachmentsForEdit"in Te&&typeof Te.loadAttachmentsForEdit=="function"?Te.loadAttachmentsForEdit.bind(Te):()=>{},focus:Te.focus.bind(Te)}:m.value=null,bs()}const be=U(!0),ie=U(!1);function ke(){const Te=ne.value;return Te?Te.scrollHeight-Te.scrollTop-Te.clientHeight:0}let Fe=0,at=0,dt=0,$t=0,Et=0,Qt=0;function Dt(){return Date.now()1?(be.value=!1,ie.value=!0):De<=Dm&&Ae>Fe+1&&(be.value=!0,ie.value=!1),Fe=Ae,ee()}function kn(Te=!1){const Ae=ne.value;be.value=!0,ie.value=!1,Ae&&(!Te&&performance.now()<$t||(Te&&typeof Ae.scrollTo=="function"?(dt=performance.now(),$t=performance.now()+zTe,Ae.scrollTo({top:Ae.scrollHeight,behavior:"smooth"})):Ae.scrollTop=Ae.scrollHeight,Fe=Ae.scrollTop))}function In(Te,Ae){return(Ae.closest("[inert]")?.closest(".tool-group")??Ae).getBoundingClientRect().top-Te.getBoundingClientRect().top+Te.scrollTop}function Mn(Te,Ae){const De=Array.from(Te.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(zn=>({node:zn,top:In(Te,zn)})),Ut=De.findIndex(zn=>zn.top>=Ae),dn=Ut<0?Math.max(0,De.length-1):Ut;return De.slice(dn,dn+2).flatMap(zn=>{const So=zn.node.dataset.scrollAnchorId,Jo=So??zn.node.dataset.turnId;return Jo?[{kind:So?"tool":"turn",id:Jo,top:zn.top}]:[]})}const Re=new Map;function lt(Te,Ae){for(const De of Ae.anchors){const Ut=De.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",dn=Te.querySelector(`[${Ut}="${bt(De.id)}"]`);if(dn)return In(Te,dn)-De.top}return Te.scrollHeight-Ae.oldHeight}function tt(Te,Ae,De=Te.scrollTop){return Te.scrollTop=De+lt(Te,Ae),Fe=Te.scrollTop,Te.scrollTop}async function ht(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Je.value||!s.hasMoreMessages)return;const Te=s.sessionId,Ae=ne.value,De=Ae?.scrollTop??0,Ut={anchors:Ae?Mn(Ae,De):[],oldHeight:Ae?.scrollHeight??0};ze(Te,!0),Mt();try{if(await vt(),await s.loadOlderMessages(Te),await vt(),s.sessionId!==Te){Re.set(Te,Ut);return}const dn=ne.value;if(!dn)return;tt(dn,Ut),Re.delete(Te)}finally{ze(Te,!1)}}function bt(Te){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Te):Te.replaceAll(/["\\]/g,"\\$&")}function Rt(Te){const Ae=ne.value;if(!Ae)return;const De=Ae.querySelector(`.turn-anchor[data-turn-id="${bt(Te)}"]`);De&&(tn(),be.value=!1,G.value=Te,ie.value=ke()>Dm,De.scrollIntoView({behavior:"smooth",block:"center"}))}function on(){const Te=ne.value;if(!Te)return"none";const Ae=Te.firstElementChild,De=Ae instanceof HTMLElement?Ae.offsetHeight:0,Ut=X.value?.offsetHeight??0;return`${Te.scrollHeight}:${Te.clientHeight}:${De}:${Ut}`}function an(Te){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Te):setTimeout(Te,16)}function sn(Te){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Te):clearTimeout(Te)}let Yn=0,Kt=0,no=null,As=0;function ys(){return performance.now(){if(Kt=0,performance.now()>=Yn||!no){no=null;return}const dn=no.getBoundingClientRect().top-As;dn&&(De.scrollTop+=dn),Kt=an(Ut)};Kt=an(Ut)}function co(Te=36){if(!be.value&&!Dt())return;const Ae=++Qt;let De="",Ut=0,dn=0;Et&&(sn(Et),Et=0);const zn=()=>{if(Et=0,Ae!==Qt||!be.value&&!Dt())return;kn(!1);const So=on();Ut=So===De?Ut+1:0,De=So,dn++,Ut<3&&dn0&&Ae.length>=Te.length&&Te.firstId!==Ae.firstId&&Te.lastId===Ae.lastId&&Te.lastTextLen===Ae.lastTextLen&&Te.lastThinkingLen===Ae.lastThinkingLen&&Te.lastToolsLen===Ae.lastToolsLen&&Te.approvalIds===Ae.approvalIds}const Ct=B(()=>{const Te=(s.approvals??[]).map(zn=>zn.approvalId).join(","),Ae=s.turns,De=Ae.at(-1),Ut=De?.thinking?.length??0,dn=De?.tools?.reduce((zn,So)=>zn+So.name.length+(So.arg?.length??0)+(So.output?.join("").length??0),0)??0;return{length:Ae.length,firstId:Ae[0]?.id??"",lastId:De?.id??"",lastTextLen:De?.text.length??0,lastThinkingLen:Ut,lastToolsLen:dn,approvalIds:Te}});Ue(Ct,async(Te,Ae)=>{if(Je.value&&oo(Ae,Te)){ee();return}await vt(),be.value||Dt()?kn(Te.length{bs()}),Ue(()=>s.mobile,async()=>{await vt(),ye()});const so=new Map;Ue(()=>s.fileReloadKey,async(Te,Ae)=>{const De=ne.value;Ae&&De&&so.set(String(Ae),{top:De.scrollTop,following:be.value}),tn(),await vt();const Ut=ne.value,dn=Te?so.get(String(Te)):void 0;if(dn&&Ut){const zn=Re.get(String(Te)),So=zn?tt(Ut,zn,dn.top):dn.top;zn&&Re.delete(String(Te)),be.value=dn.following,Ut.scrollTop=So,Fe=Ut.scrollTop,ie.value=!dn.following&&ke()>1,dn.following&&co()}else be.value=!0,Fe=0,kn(!1),co();ee()}),Ue(()=>s.sessionLoading,async(Te,Ae)=>{Te||!Ae||(be.value=!0,await vt(),co(),ee())}),Ue(()=>s.turnActive,async(Te,Ae)=>{Te||!Ae||!be.value&&!Dt()||(await vt(),co(48),ee())});function Bn(){be.value=!0,ie.value=!1,at=Date.now()+JC,vt(()=>{kn(!0),co(16)})}function Pn(Te){Bn(),i("submit",Te)}function js(Te){be.value=!0,ie.value=!1,at=Date.now()+JC,i("editMessage",Te)}function Os(Te){const Ae=s.queued?.[Te],De=Ae?.text??"";v(De,Ae?.attachments)&&i("editQueued",Te)}function Es(Te){i("reorderQueue",Te)}function ks(Te,Ae){Bn(),i("answer",Te,Ae)}function Lo(Te,Ae){!Te||!Ae||i("approval",Te,Ae)}let Ro=null,Ze=null,Qe=null,ct=null,mn=0,_o=0,Un=0;const Ps=U(new Set),Je=B(()=>!!s.sessionId&&Ps.value.has(s.sessionId));function ze(Te,Ae){const De=new Set(Ps.value);Ae?De.add(Te):De.delete(Te),Ps.value=De}function wt(){Je.value||Un||(Un=an(()=>{Un=0,!Je.value&&(ys()||(be.value||Dt())&&kn(!1))}))}function Mt(){Qt++,Et&&(sn(Et),Et=0),Un&&(sn(Un),Un=0)}function tn(){const Te=ne.value;if(at=0,Mt(),Yn=0,no=null,Te){const Ae=Te.scrollTop;typeof Te.scrollTo=="function"?Te.scrollTo({top:Ae,behavior:"auto"}):Te.scrollTop=Ae}$t=0,dt=Number.NEGATIVE_INFINITY,Te&&(Fe=Te.scrollTop)}function Xn(){const Te=ne.value;!Te||Te.scrollHeight-Te.clientHeight<=1&&!s.hasMoreMessages||(be.value=!1,tn(),Te.scrollHeight-Te.clientHeight>1&&(ie.value=!0))}function Jn(Te){const Ae=ne.value;if(!Ae)return!1;for(const De of Te.composedPath()){if(De===Ae)return!1;if(De instanceof HTMLElement&&De.scrollHeight>De.clientHeight+1&&De.scrollTop>1)return!0}return!1}function Ts(Te){Te.defaultPrevented||Te.ctrlKey||Te.shiftKey||Te.deltaY>=0||Jn(Te)||Xn()}function Xo(Te){const Ae=ne.value;if(!Ae||Te.defaultPrevented||Te.button!==0||Te.pointerType==="touch")return;const De=Ae.getBoundingClientRect(),Ut=Ae.offsetWidth-Ae.clientWidth,dn=Ut>0?Ut:12;Te.target===Ae&&Te.clientX>=De.right-dn&&Xn()}let io=null;function uo(Te){io=Te.touches.length===1?Te.touches[0].clientY:null}function vn(Te){const Ae=Te.touches.length===1?Te.touches[0].clientY:null;Ae!==null&&io!==null&&Ae>io+2&&!Jn(Te)&&Xn(),io=Ae}function Hs(){if(!Ze)return;const Te=ne.value?.firstElementChild??null;Te!==Qe&&(Qe&&Ze.unobserve(Qe),Qe=Te,Te&&Ze.observe(Te))}function bs(){if(!Ze)return;const Te=X.value;Te!==ct&&(ct&&Ze.unobserve(ct),ct=Te,Te&&Ze.observe(Te))}function Cr(){const Te=ne.value;ye(),Ro&&(Ro.disconnect(),Te&&Ro.observe(Te,{childList:!0,subtree:!0,characterData:!0})),Ze&&(Ze.disconnect(),Qe=null,ct=null,Te&&Ze.observe(Te),Hs(),bs()),mn=Te?.scrollHeight??0,_o=Te?.clientHeight??0,Q()}function ri(){Hs(),wt(),Q()}function Is(){typeof document>"u"||document.visibilityState==="visible"&&be.value&&co()}const Ys=U(!1);let ro=null;function Io(){Ys.value=!0,ro!==null&&clearTimeout(ro),ro=setTimeout(()=>{Ys.value=!1},BTe)}function yi(){Io(),i("interrupt")}function ki(Te){if((Te.metaKey||Te.ctrlKey)&&Te.key.toLowerCase()==="f"){if(s.overlayOpen)return;Te.preventDefault(),D.value=!0,vt(()=>{ne.value?.closest(".con")?.querySelector(".tsearch-input")?.focus()});return}Te.key==="Escape"&&(s.running||s.working)&&(Te.preventDefault(),yi())}function sr(){D.value=!1,vt(()=>ne.value?.focus({preventScroll:!0}))}function Oi(){be.value&&wt()}xn(()=>{vt(()=>{typeof MutationObserver=="function"&&(Ro=new MutationObserver(ri)),typeof ResizeObserver=="function"&&(Ze=new ResizeObserver(()=>{Q(),ye();const Te=ne.value;if(!Te)return;const{scrollHeight:Ae,clientHeight:De}=Te,Ut=Ae>mn+1,dn=De<_o-1;mn=Ae,_o=De,!ys()&&(Ut||dn)&&wt()})),Cr(),co(48),ee(),typeof document<"u"&&(document.addEventListener("visibilitychange",Is),document.addEventListener("keydown",ki)),window.visualViewport?.addEventListener("resize",Oi)})}),An(()=>{Ro&&Ro.disconnect(),Ze&&Ze.disconnect(),Un&&sn(Un),Et&&sn(Et),Kt&&sn(Kt),oe&&sn(oe),ro!==null&&clearTimeout(ro),x!==null&&(clearTimeout(x),x=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Is),document.removeEventListener("keydown",ki)),window.visualViewport?.removeEventListener("resize",Oi)});function Pi(){(m.value??h.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Pi}),(Te,Ae)=>(g(),S("section",{class:Be(["con",{mobile:e.mobile,"toc-enabled":e.conversationToc}]),style:Wt(te.value)},[D.value&&ne.value?(g(),ce(lTe,{key:0,pane:ne.value,mobile:e.mobile,onClose:sr},null,8,["pane","mobile"])):J("",!0),!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(g(),ce(l9e,{key:1,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":A.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:k.value,"session-done":e.sessionDone,pinned:e.pinned,onOpenChanges:Ae[0]||(Ae[0]=De=>i("openChanges")),onCopyAll:Ae[1]||(Ae[1]=De=>p.value?.copyConversation()),onCopyFinalSummary:Ae[2]||(Ae[2]=De=>p.value?.copyFinalSummary()),onOpenPr:Ae[3]||(Ae[3]=De=>e.pr&&i("openPr",e.pr.url)),onRenameSession:Ae[4]||(Ae[4]=(De,Ut)=>i("renameSession",De,Ut)),onForkSession:Ae[5]||(Ae[5]=De=>i("forkSession",De)),onTogglePin:Ae[6]||(Ae[6]=De=>i("togglePin",De)),onArchiveSession:Ae[7]||(Ae[7]=De=>i("archiveSession",De)),onRestoreSession:Ae[8]||(Ae[8]=De=>i("restoreSession",De)),onExportSession:Ae[9]||(Ae[9]=De=>i("exportSession",De))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied","session-done","pinned"])):J("",!0),e.conversationToc?(g(),ce(PEe,{key:2,items:W.value,"active-turn-id":G.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:se.value,onSelect:Rt},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):J("",!0),_("div",bTe,[_("div",{ref:Ce,class:Be(["panes chat-scroll",{"is-following":be.value,"history-prepending":Je.value}]),tabindex:"-1",onScrollPassive:en,onWheelPassive:Ts,onPointerdownPassive:Xo,onTouchstartPassive:uo,onTouchmovePassive:vn},[_("div",{class:Be(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(g(),S(Me,{key:0},[Ae[61]||(Ae[61]=_("div",{class:"empty-spacer"},null,-1)),_("div",_Te,[_("span",{class:Be(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(g(),ce(Go,{key:0,size:"sm"})):(g(),ce(Vd,{key:1,size:"md",label:"","aria-hidden":"true"})),_("span",null,I(e.starting?y(o)("conversation.starting"):y(o)("composer.emptyConversationTitle")),1)],2),e.starting?J("",!0):(g(),S("span",xTe,I(y(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(g(),S("div",STe,[Z(Cn,{text:y(o)("conversation.switchWorkspace")},{default:ue(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:Ae[10]||(Ae[10]=xt(De=>r.value=!r.value,["stop"]))},[Z(Le,{name:"folder",size:"sm"}),_("span",CTe,I(a.value),1),Z(Le,{class:Be(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(g(),S("div",{key:0,class:"ws-pick-backdrop",onClick:Ae[11]||(Ae[11]=De=>r.value=!1)})):J("",!0),r.value?(g(),S("div",MTe,[(g(!0),S(Me,null,it(u.value,De=>(g(),S("button",{key:De.id,type:"button",class:Be(["ws-pick-item",{on:De.id===e.activeWorkspaceId}]),onClick:xt(Ut=>f(De.id),["stop"])},[_("span",ETe,I(De.name),1),_("span",TTe,I(De.shortPath),1)],10,ATe))),128)),d.value>0?(g(),S("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Ae[12]||(Ae[12]=xt(De=>l.value=!l.value,["stop"]))},[_("span",null,I(y(o)("conversation.moreWorkspaces",{count:d.value})),1)])):J("",!0),Ae[60]||(Ae[60]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:Ae[13]||(Ae[13]=xt(De=>{r.value=!1,i("addWorkspace")},["stop"]))},[Z(Le,{name:"plus",size:"sm"}),_("span",null,I(y(o)("conversation.addWorkspace")),1)])])):J("",!0)])):e.starting?J("",!0):(g(),S("button",{key:2,type:"button",class:"empty-add-workspace",onClick:Ae[14]||(Ae[14]=De=>i("addWorkspace"))},[Z(Le,{name:"folder-plus",size:"sm"}),_("span",null,I(y(o)("conversation.addWorkspace")),1)]))]),e.sessionId?J("",!0):(g(),ce(kTe,{key:0,sessions:e.recentSessions??[],onSelect:Ae[15]||(Ae[15]=De=>i("selectSession",De)),onOpenSessionAdmin:Ae[16]||(Ae[16]=De=>i("openSessionAdmin"))},null,8,["sessions"])),Z(Cz,{ref_key:"emptyComposerRef",ref:h,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"goal-mode":e.goalMode,"workflow-active":e.dynamicWorkflowMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Pn,onSteer:Ae[17]||(Ae[17]=De=>i("steer",De)),onCommand:Ae[18]||(Ae[18]=De=>i("command",De)),onInterrupt:yi,onUnqueue:Ae[19]||(Ae[19]=De=>i("unqueue",De)),onEditQueued:Ae[20]||(Ae[20]=De=>i("editQueued",De)),onSetPermission:Ae[21]||(Ae[21]=De=>i("setPermission",De)),onSetThinking:Ae[22]||(Ae[22]=De=>i("setThinking",De)),onTogglePlan:Ae[23]||(Ae[23]=De=>i("togglePlan")),onToggleWorkflow:Ae[24]||(Ae[24]=De=>i("toggleWorkflow")),onToggleGoal:Ae[25]||(Ae[25]=De=>i("toggleGoal")),onOpenBtw:Ae[26]||(Ae[26]=De=>i("command","/btw")),onCreateGoal:Ae[27]||(Ae[27]=De=>i("createGoal",De)),onControlGoal:Ae[28]||(Ae[28]=De=>i("controlGoal",De)),onFocusGoal:b,onCompact:Ae[29]||(Ae[29]=De=>i("compact")),onPickModel:Ae[30]||(Ae[30]=De=>i("pickModel")),onSelectModel:Ae[31]||(Ae[31]=De=>i("selectModel",De))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","goal-mode","workflow-active","goal","activation-badges","models","starred-ids","skills","starting"]),Ae[62]||(Ae[62]=_("div",{class:"empty-spacer"},null,-1))],64)):(g(),ce(Jv,{ref_key:"chatPaneRef",ref:p,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,questions:e.questions,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":be.value,"tool-diff-panel":!0,"last-turn-reason":e.lastTurnReason,"turn-error-kind":e.turnErrorKind,"turn-error-message":e.turnErrorMessage,cwd:e.workspaceRoot,queued:e.queued,onOpenFile:Ae[32]||(Ae[32]=De=>i("openFile",De)),onOpenMedia:Ae[33]||(Ae[33]=De=>i("openMedia",De)),onCopyConversationCopied:w,onOpenCompaction:Ae[34]||(Ae[34]=De=>i("openCompaction",De)),onOpenAgent:Ae[35]||(Ae[35]=De=>i("openAgent",De)),onOpenToolDiff:Ae[36]||(Ae[36]=De=>i("openToolDiff",De)),onOpenTurnDiff:Ae[37]||(Ae[37]=De=>i("openTurnDiff",De)),onEditMessage:js,onLoadOlderMessages:ht,onUnqueue:Ae[38]||(Ae[38]=De=>i("unqueue",De)),onEditQueued:Os,onReorderQueue:Es,onSteerQueued:Ae[39]||(Ae[39]=De=>i("steerQueued",De)),onContinueTurn:Ae[40]||(Ae[40]=De=>Pn({text:De,attachments:[]}))},null,8,["turns","approvals","questions","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","last-turn-reason","turn-error-kind","turn-error-message","cwd","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?J("",!0):(g(),ce($Ee,{key:0,ref:me,style:Wt(pe.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"plan-armed":e.planArmed,working:e.working,"goal-mode":e.goalMode,"dynamic-workflow-mode":e.dynamicWorkflowMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"session-plans":e.sessionPlans,"overlay-open":e.overlayOpen,"open-file":De=>i("openFile",De),"reveal-saved-plan":e.revealSavedPlan,"dock-panel":V.value,"bash-tasks":M.value,"subagent-tasks":R.value,"bash-running":z.value,"subagent-running":$.value,"todo-done-count":O.value,"has-dock-work":H.value,todos:e.todos,"pending-question":xe.value,"question-busy-kind":Ke.value,"pending-approval":et.value,"approval-busy":Y.value,mobile:e.mobile,onToggleDockPanel:Ae[41]||(Ae[41]=De=>F(De)),onCloseDockPanel:Ae[42]||(Ae[42]=De=>j()),onOpenAgent:Ae[43]||(Ae[43]=De=>i("openAgent",De)),onAnswer:ks,onDismiss:Ae[44]||(Ae[44]=De=>i("dismiss",De)),onApproval:Lo,onCancelTask:Ae[45]||(Ae[45]=De=>i("cancelTask",De)),onControlGoal:Ae[46]||(Ae[46]=De=>i("controlGoal",De)),onSubmit:Pn,onSteer:Ae[47]||(Ae[47]=De=>i("steer",De)),onCommand:Ae[48]||(Ae[48]=De=>i("command",De)),onInterrupt:yi,onSetPermission:Ae[49]||(Ae[49]=De=>i("setPermission",De)),onSetThinking:Ae[50]||(Ae[50]=De=>i("setThinking",De)),onTogglePlan:Ae[51]||(Ae[51]=De=>i("togglePlan")),onToggleWorkflow:Ae[52]||(Ae[52]=De=>i("toggleWorkflow")),onToggleGoal:Ae[53]||(Ae[53]=De=>i("toggleGoal")),onOpenBtw:Ae[54]||(Ae[54]=De=>i("command","/btw")),onCreateGoal:Ae[55]||(Ae[55]=De=>i("createGoal",De)),onFocusGoal:b,onCompact:Ae[56]||(Ae[56]=De=>i("compact")),onPickModel:Ae[57]||(Ae[57]=De=>i("pickModel")),onSelectModel:Ae[58]||(Ae[58]=De=>i("selectModel",De))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","plan-armed","working","goal-mode","dynamic-workflow-mode","activation-badges","models","starred-ids","skills","goal","session-plans","overlay-open","open-file","reveal-saved-plan","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),Z(gr,{name:"pill"},{default:ue(()=>[ie.value?(g(),S("button",{key:0,class:"newmsg-pill",style:Wt({bottom:`${fe.value+12}px`}),"aria-label":y(o)("conversation.jumpToLatestAria"),onClick:Ae[59]||(Ae[59]=De=>kn(!0))},[Z(Le,{class:"pill-chevron",name:"chevron-down",size:"md"}),He(" "+I(y(o)("conversation.newMessages")),1)],12,ITe)):J("",!0)]),_:1}),Z(gr,{name:"abort-toast"},{default:ue(()=>[Ys.value?(g(),S("div",LTe,[_("span",$Te,I(y(o)("conversation.manuallyAborted")),1)])):J("",!0)]),_:1})],6))}}),FTe=mt(RTe,[["__scopeId","data-v-51854882"]]),jTe=["aria-label"],OTe={class:"media-lightbox-card"},PTe=["src","alt"],HTe=["src"],DTe={key:0,class:"media-preview-caption"},VTe=Ge({__name:"MediaLightbox",props:{media:{},src:{},originImg:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,s=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),i=Y3("overlay"),r=Y3("close"),l=Y3("image"),a=B(()=>n.media.kind==="image"),c=B(()=>n.media.path??(a.value?"Image preview":"Video preview")),u=jo(1),d=jo(0),f=jo(0),p=jo(!1),h=B(()=>({transform:`translate(${d.value}px, ${f.value}px) scale(${u.value})`,cursor:u.value>1?p.value?"grabbing":"grab":"zoom-in"}));let m=null,k=null,x=0,v=0,w=0,b=0;const{lock:M,unlock:R}=Sz();function z(){u.value=1,d.value=0,f.value=0}function $(H){if(!a.value)return;H.preventDefault();const V=Math.min(8,Math.max(1,u.value*(H.deltaY<0?1.1:.9)));u.value=V,V===1&&(d.value=0,f.value=0)}function E(){if(u.value!==1){z();return}const H=l.value;H&&(u.value=Math.min(8,Math.max(1,H.naturalWidth/H.clientWidth)))}function T(H){u.value<=1||(k=H.pointerId,x=H.clientX,v=H.clientY,w=d.value,b=f.value,p.value=!0,l.value?.setPointerCapture(H.pointerId))}function N(H){k===H.pointerId&&(d.value=w+H.clientX-x,f.value=b+H.clientY-v)}function C(H){k===H.pointerId&&(l.value?.releasePointerCapture(H.pointerId),k=null,p.value=!1)}function O(H){if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),o("close");return}if(H.key!=="Tab"||!i.value)return;const V=i.value.querySelectorAll(s),A=V[0],F=V[V.length-1];!A||!F||(i.value.contains(document.activeElement)?H.shiftKey&&document.activeElement===A?(H.preventDefault(),F.focus()):!H.shiftKey&&document.activeElement===F&&(H.preventDefault(),A.focus()):(H.preventDefault(),(H.shiftKey?F:A).focus()))}return xn(()=>{M(),m=document.activeElement instanceof HTMLElement?document.activeElement:n.originImg??null,window.addEventListener("keydown",O),r.value?.focus()}),An(()=>{R(),window.removeEventListener("keydown",O),m?.focus()}),(H,V)=>(g(),ce(Gr,{to:"body"},[_("div",{ref:"overlay",class:"media-lightbox",role:"dialog","aria-modal":"true","aria-label":c.value,onMousedown:V[1]||(V[1]=xt(A=>o("close"),["self"]))},[_("button",{ref:"close",type:"button",class:"media-lightbox-close","aria-label":"Close",onClick:V[0]||(V[0]=A=>o("close"))},[Z(Le,{name:"close",size:"sm"})],512),_("div",OTe,[_("div",{class:"media-lightbox-frame",onWheel:$},[a.value?(g(),S("img",{key:0,ref:"image",class:"media-lightbox-media",src:e.src,alt:e.media.path??"",draggable:"false",style:Wt(h.value),onDblclick:E,onPointerdown:T,onPointermove:N,onPointerup:C,onPointercancel:C},null,44,PTe)):(g(),S("video",{key:1,class:"media-lightbox-media",src:e.src,controls:"",autoplay:""},null,8,HTe))],32)]),e.media.path?(g(),S("div",DTe,I(e.media.path),1)):J("",!0)],40,jTe)]))}}),WTe=mt(VTe,[["__scopeId","data-v-a5036dce"]]),qTe={class:"ui-panel-header__main"},UTe={class:"ui-panel-header__title"},ZTe={key:0,class:"ui-panel-header__sub"},KTe=Ge({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-panel-header",{wrap:e.wrap}])},[_("div",qTe,[_("span",UTe,I(e.title),1),Z(Cn,{text:e.subtitle},{default:ue(()=>[e.subtitle?(g(),S("span",ZTe,I(e.subtitle),1)):J("",!0)]),_:1},8,["text"]),En(t.$slots,"default",{},void 0,!0)]),e.closable?(g(),ce(Zt,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])):J("",!0)],2))}}),la=mt(KTe,[["__scopeId","data-v-47211810"]]),GTe={key:0,class:"fp-empty fp-error"},YTe={key:1,class:"fp-empty"},XTe={key:2,class:"fp-loading"},JTe={class:"fp-path"},QTe={class:"fp-meta"},eIe={key:0,class:"fp-lines"},tIe={class:"fp-size"},nIe={key:3,class:"fp-search"},oIe=["placeholder"],sIe={key:0,class:"fp-search-count"},iIe={key:1,class:"fp-code"},rIe={class:"fp-line-table"},lIe=["data-line"],aIe={class:"fp-gutter"},cIe=["innerHTML"],uIe={key:1,class:"fp-body fp-code"},dIe={class:"fp-line-table"},fIe=["data-line"],pIe={class:"fp-gutter"},hIe=["innerHTML"],mIe={key:2,class:"fp-body"},gIe=["srcdoc","title"],vIe={key:1,class:"fp-code"},wIe={class:"fp-line-table"},yIe=["data-line"],kIe={class:"fp-gutter"},bIe=["innerHTML"],_Ie={key:3,class:"fp-body fp-pdf-wrap"},xIe=["src","title"],SIe={key:1,class:"fp-binary-card"},CIe={class:"fp-binary-label"},MIe={key:4,class:"fp-body fp-table-wrap"},AIe={class:"fp-table"},EIe=["data-line"],TIe={key:5,class:"fp-body fp-image-wrap"},IIe=["src","alt"],LIe={key:1,class:"fp-binary-card"},$Ie={class:"fp-binary-icon"},NIe={class:"fp-binary-label"},zIe={key:6,class:"fp-body fp-image-wrap"},BIe=["src"],RIe={key:1,class:"fp-binary-card"},FIe={class:"fp-binary-icon"},jIe={class:"fp-binary-label"},OIe={key:7,class:"fp-body fp-code"},PIe={class:"fp-line-table"},HIe=["data-line"],DIe={class:"fp-gutter"},VIe=["innerHTML"],WIe={key:8,class:"fp-body fp-binary-wrap"},qIe={class:"fp-binary-card"},UIe={class:"fp-binary-icon"},ZIe={class:"fp-binary-label"},KIe=Ge({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},editable:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal","openEditor"],setup(e,{emit:t}){const{t:n}=Lt();function o(Y,ne){const D=ne?ne.split("/").filter(Boolean):[];for(const X of Y.split("/"))X===""||X==="."||(X===".."?D.pop():D.push(X));return D.join("/")}const s=pn("resolveImage",async Y=>Y),i=B(()=>{const Y=c.file?.path??"",ne=Y.lastIndexOf("/");return ne>0?Y.slice(0,ne):""});function r(Y){if(/^(https?:|data:|blob:)/i.test(Y)||Y.startsWith("/"))return Y;const ne=i.value;return ne?o(Y,ne):Y}async function l(Y){const ne=r(Y);return s?s(ne):ne}jn("resolveImage",l);function a(Y){let ne=Y.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ne)||ne.startsWith("/"))return Y;for(const X of["#","?"]){const ve=ne.indexOf(X);ve!==-1&&(ne=ne.slice(0,ve))}const D=i.value;return{...Y,path:o(ne,D)}}const c=e,u=B(()=>{const Y=c.file;return Y!==null&&!Y.isBinary}),d=t;function f(Y){c.openFile?.(a(Y))}const p=U(null),h=B(()=>{const Y=c.file;if(!Y)return"binary";const ne=Y.mime??"",D=Y.languageId??"",X=Y.path.toLowerCase();return ne==="text/markdown"||D==="markdown"||D==="md"||X.endsWith(".mdx")?"markdown":ne==="application/json"||D==="json"?"json":ne==="text/html"||D==="html"||X.endsWith(".html")||X.endsWith(".htm")?"html":ne==="application/pdf"||X.endsWith(".pdf")?"pdf":ne==="text/csv"||D==="csv"||X.endsWith(".csv")?"csv":ne.startsWith("image/")?"image":ne.startsWith("video/")?"video":Y.isBinary?"binary":ne.startsWith("text/")||D!==""?"text":"binary"});function m(Y){const ne=atob(Y),D=Uint8Array.from(ne,X=>X.charCodeAt(0));return new TextDecoder().decode(D)}const k=B(()=>{const Y=c.file;if(!Y)return"";if(Y.encoding==="base64")try{return m(Y.content)}catch{return Y.content}return Y.content}),x=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(k.value),null,2)}catch{return k.value}}),v=B(()=>c.file?(h.value==="json"?x.value:k.value).split(` +`):[]),w=B(()=>c.file?h.value==="json"?x.value:k.value:""),b=U(""),M=U(0),R=B(()=>{const Y=b.value.trim().toLowerCase();if(!Y)return[];const ne=[];return v.value.forEach((D,X)=>{D.toLowerCase().includes(Y)&&ne.push(X+1)}),ne});Ue(b,()=>{M.value=0});function z(Y,ne=!1){Y&&vt(()=>{const D=p.value?.querySelector(".fp-body"),X=D?.querySelector(`[data-line="${Y}"]`);if(!D||!X)return;ne&&(D.scrollTop=0);const ve=D.getBoundingClientRect(),fe=X.getBoundingClientRect(),pe=fe.top-ve.top+D.scrollTop;D.scrollTop=pe-D.clientHeight/2+fe.height/2})}Ue(()=>[c.file?.path,c.line],()=>z(c.line,!0),{immediate:!0});function $(Y){const ne=R.value;ne.length!==0&&(M.value=(M.value+Y+ne.length)%ne.length,z(ne[M.value]))}function E(Y){const ne=R.value;return{target:c.line===Y,hit:ne.includes(Y),active:ne[M.value]===Y}}function T(Y){return Y<1024?`${Y} B`:Y<1024*1024?`${(Y/1024).toFixed(1)} KB`:`${(Y/(1024*1024)).toFixed(1)} MB`}const N=U(!1),C=U(!1);function O(){c.file&&ss(w.value).then(Y=>{Y&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function H(){c.file&&ss(c.file.path).then(Y=>{Y&&(C.value=!0,setTimeout(()=>{C.value=!1},1400))})}const V=U("preview"),A=U("preview"),F=U("fit");function j(Y){V.value=Y}function q(Y){A.value=Y}function P(Y){F.value=Y}Ue(h,Y=>{V.value=Y==="html"?"preview":"source",A.value="preview",F.value="fit"});const W=B(()=>{const Y=c.file;return!Y||h.value!=="image"?null:Y.sourceUrl?Y.sourceUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:Y.mime==="image/svg+xml"?`data:${Y.mime};charset=utf-8,${encodeURIComponent(Y.content)}`:null}),G=B(()=>{const Y=c.file;return!Y||h.value!=="video"?null:Y.sourceUrl?Y.sourceUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:null}),ee=B(()=>{const Y=c.file;return!Y||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:Y.encoding==="base64"?`data:${Y.mime};base64,${Y.content}`:null}),se=B(()=>c.file?["",'',``,k.value].join(""):"");function oe(Y){const ne=[];let D="",X=!1;for(let ve=0;vev.value.slice(0,200).map(oe));function ge(Y){return Y.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function xe(){const Y=c.file;if(!Y)return"";const ne=Y.languageId?.toLowerCase();return ne||(Y.path.split(".").pop()?.toLowerCase()??"")}function Ke(Y){const ne=xe();let D=ge(Y);return h.value==="json"||ne==="json"||ne==="jsonc"?(D=D.replace(/("[^&]*?")(\s*:)/g,'$1$2'),D=D.replace(/(:\s*)("[^&]*?")/g,'$1$2'),D=D.replace(/\b(true|false|null)\b/g,'$1'),D=D.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1$2'),D):h.value==="html"||ne==="html"||ne==="xml"||ne==="svg"?(D=D.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' $1$2'),D=D.replace(/(".*?")/g,'$1'),D=D.replace(/(<\/?)([A-Za-z][\w:-]*)/g,'$1$2'),D):(D=D.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'$1'),D=D.replace(/(".*?"|'.*?')/g,'$1'),D=D.replace(/(\/\/.*)$/g,'$1'),D)}function et(Y,ne=55){return!Y||Y.length<=ne?Y:"…"+Y.slice(Y.length-ne+1)}return(Y,ne)=>(g(),S("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(g(),S("div",GTe,[_("span",null,I(e.error),1),e.closable?(g(),ce(It,{key:0,variant:"secondary",size:"sm",onClick:ne[0]||(ne[0]=D=>d("close"))},{default:ue(()=>[He(I(y(n)("filePreview.close")),1)]),_:1})):J("",!0)])):!e.file&&!e.loading?(g(),S("div",YTe,I(y(n)("filePreview.empty")),1)):e.loading?(g(),S("div",XTe,[ne[8]||(ne[8]=_("span",{class:"spinner"},null,-1)),_("span",null,I(y(n)("filePreview.loading")),1)])):e.file?(g(),S(Me,{key:3},[Z(la,{wrap:"",title:y(n)("common.preview"),closable:e.closable,"close-label":y(n)("filePreview.close"),onClose:ne[7]||(ne[7]=D=>d("close"))},{default:ue(()=>[Z(Cn,{text:e.file.path},{default:ue(()=>[_("span",JTe,I(et(e.file.path)),1)]),_:1},8,["text"]),_("span",QTe,[e.file.lineCount?(g(),S("span",eIe,I(y(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):J("",!0),_("span",tIe,I(T(e.file.size)),1)]),h.value==="html"?(g(),ce(ni,{key:0,"model-value":V.value,size:"sm",options:[{value:"preview",label:y(n)("filePreview.preview")},{value:"source",label:y(n)("filePreview.source")}],"onUpdate:modelValue":j},null,8,["model-value","options"])):J("",!0),h.value==="markdown"?(g(),ce(ni,{key:1,"model-value":A.value,size:"sm",options:[{value:"preview",label:y(n)("filePreview.preview")},{value:"source",label:y(n)("filePreview.source")}],"onUpdate:modelValue":q},null,8,["model-value","options"])):J("",!0),h.value==="image"?(g(),ce(ni,{key:2,"model-value":F.value,size:"sm",options:[{value:"fit",label:y(n)("filePreview.fit")},{value:"actual",label:y(n)("filePreview.actual")}],"onUpdate:modelValue":P},null,8,["model-value","options"])):J("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(g(),S("div",nIe,[Zn(_("input",{"onUpdate:modelValue":ne[1]||(ne[1]=D=>b.value=D),class:"fp-search-input",type:"search",placeholder:y(n)("filePreview.search")},null,8,oIe),[[Fs,b.value]]),b.value.trim()?(g(),S("span",sIe,I(R.value.length),1)):J("",!0),Z(Zt,{size:"sm",disabled:R.value.length===0,label:y(n)("filePreview.prevMatch"),onClick:ne[2]||(ne[2]=D=>$(-1))},{default:ue(()=>[Z(Le,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),Z(Zt,{size:"sm",disabled:R.value.length===0,label:y(n)("filePreview.nextMatch"),onClick:ne[3]||(ne[3]=D=>$(1))},{default:ue(()=>[Z(Le,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):J("",!0),Z(Zt,{size:"sm",class:Be({copied:C.value}),label:C.value?y(n)("filePreview.copied"):y(n)("filePreview.copyPath"),onClick:H},{default:ue(()=>[C.value?(g(),ce(Le,{key:1,class:"fp-check",name:"check",size:"md"})):(g(),ce(Le,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.editable&&u.value&&e.file!==null?(g(),ce(Zt,{key:4,size:"sm",label:y(n)("editor.title"),onClick:ne[4]||(ne[4]=D=>d("openEditor",e.file.path))},{default:ue(()=>[Z(Le,{name:"pencil",size:"md"})]),_:1},8,["label"])):J("",!0),e.externalActions?(g(),ce(Zt,{key:5,size:"sm",label:y(n)("filePreview.openInEditor"),onClick:ne[5]||(ne[5]=D=>d("openExternal"))},{default:ue(()=>[Z(Le,{name:"external-link",size:"md"})]),_:1},8,["label"])):J("",!0),e.externalActions?(g(),ce(Zt,{key:6,size:"sm",label:y(n)("filePreview.reveal"),onClick:ne[6]||(ne[6]=D=>d("reveal"))},{default:ue(()=>[Z(Le,{name:"folder",size:"md"})]),_:1},8,["label"])):J("",!0),!e.file.isBinary&&h.value!=="image"?(g(),ce(Zt,{key:7,size:"sm",class:Be({copied:N.value}),label:N.value?y(n)("filePreview.copied"):y(n)("filePreview.copy"),onClick:O},{default:ue(()=>[N.value?(g(),ce(Le,{key:1,class:"fp-check",name:"check",size:"md"})):(g(),ce(Le,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):J("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(g(),S("div",{key:0,class:Be(["fp-body",{"fp-markdown":A.value==="preview"}])},[A.value==="preview"?(g(),ce(sa,{key:0,text:k.value,"open-file":c.openFile?f:void 0},null,8,["text","open-file"])):(g(),S("div",iIe,[_("div",rIe,[(g(!0),S(Me,null,it(v.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",E(X+1)]),"data-line":X+1},[_("span",aIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,cIe)],10,lIe))),128))])]))],2)):h.value==="json"?(g(),S("div",uIe,[_("div",dIe,[(g(!0),S(Me,null,it(v.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",E(X+1)]),"data-line":X+1},[_("span",pIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,hIe)],10,fIe))),128))])])):h.value==="html"?(g(),S("div",mIe,[V.value==="preview"?(g(),S("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:se.value,title:e.file.path},null,8,gIe)):(g(),S("div",vIe,[_("div",wIe,[(g(!0),S(Me,null,it(v.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",E(X+1)]),"data-line":X+1},[_("span",kIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,bIe)],10,yIe))),128))])]))])):h.value==="pdf"?(g(),S("div",_Ie,[ee.value?(g(),S("iframe",{key:0,class:"fp-pdf-frame",src:ee.value,title:e.file.path},null,8,xIe)):(g(),S("div",SIe,[_("span",CIe,I(y(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(g(),S("div",MIe,[_("table",AIe,[_("tbody",null,[(g(!0),S(Me,null,it(Q.value,(D,X)=>(g(),S("tr",{key:X,class:Be(E(X+1)),"data-line":X+1},[_("th",null,I(X+1),1),(g(!0),S(Me,null,it(D,(ve,fe)=>(g(),S("td",{key:fe},I(ve),1))),128))],10,EIe))),128))])])])):h.value==="image"?(g(),S("div",TIe,[W.value?(g(),S("img",{key:0,src:W.value,alt:e.file.path,class:Be(["fp-image",{actual:F.value==="actual"}])},null,10,IIe)):(g(),S("div",LIe,[_("span",$Ie,[Z(Le,{name:"image-off",size:"lg"})]),_("span",NIe,I(y(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):h.value==="video"?(g(),S("div",zIe,[G.value?(g(),S("video",{key:0,src:G.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,BIe)):(g(),S("div",RIe,[_("span",FIe,[Z(Le,{name:"image-off",size:"lg"})]),_("span",jIe,I(y(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):h.value==="text"?(g(),S("div",OIe,[_("div",PIe,[(g(!0),S(Me,null,it(v.value,(D,X)=>(g(),S("div",{key:X,class:Be(["fp-line-row",E(X+1)]),"data-line":X+1},[_("span",DIe,I(X+1),1),_("span",{class:"fp-line-text",innerHTML:Ke(D)},null,8,VIe)],10,HIe))),128))])])):(g(),S("div",WIe,[_("div",qIe,[_("span",UIe,[Z(Le,{name:"file-off",size:"lg"})]),_("span",ZIe,I(y(n)("filePreview.binaryNoPreview",{mime:e.file.mime||y(n)("filePreview.unknownType"),size:T(e.file.size)})),1)])]))],64)):J("",!0)],512))}}),GIe=mt(KIe,[["__scopeId","data-v-97c52e24"]]),YIe={class:"ui-banner__icon","aria-hidden":"true"},XIe={class:"ui-banner__text"},JIe=Ge({__name:"Banner",props:{variant:{default:"info"}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-banner",`ui-banner--${e.variant}`]),role:"status"},[_("span",YIe,[En(t.$slots,"icon",{},()=>[e.variant==="info"?(g(),ce(Le,{key:0,name:"info",size:"md"})):(g(),ce(Le,{key:1,name:"alert-triangle",size:"md"}))],!0)]),_("span",XIe,[En(t.$slots,"default",{},void 0,!0)])],2))}}),B9=mt(JIe,[["__scopeId","data-v-566a0ac8"]]),S4=yo.global.t,QIe=40928,eLe=10485760,fn=Rs({open:!1,path:null,loading:!1,saving:!1,loadError:null,savingError:null,conflict:!1,dirty:!1,savedAt:null,languageId:void 0});let qa=null,ql=0,Y5=null;const Tz={getContent:null};function QC(e){Tz.getContent=e}function tLe(){return fn}function nLe(){ql+=1,fn.path=null,fn.loading=!1,fn.saving=!1,fn.loadError=null,fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,qa=null,Y5=null}async function Iz(e){const t=lLe();if(!t){ql+=1,fn.open=!0,fn.path=e.path,fn.loading=!1,fn.loadError=S4("editor.readOnlyWhileMissingSession"),fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,fn.saving=!1,qa=null,Y5=null;return}const n=++ql;fn.open=!0,fn.path=e.path,fn.loading=!0,fn.saving=!1,fn.loadError=null,fn.savingError=null,fn.conflict=!1,fn.dirty=!1,fn.savedAt=null,fn.languageId=void 0,qa=null,Y5=t;try{const o=await At().readFile(t,{path:e.path,length:eLe,encoding:"utf-8"});if(n!==ql)return;if(o.isBinary||o.encoding!=="utf-8"){fn.loadError=S4("editor.binaryNotEditable");return}qa=o.etag,fn.languageId=o.languageId,C4=o.content,D7=e.line,Lz+=1}catch(o){if(n!==ql)return;qa=null,fn.loadError=o instanceof Error&&o.message.length>0?o.message:S4("editor.loadFailed")}finally{n===ql&&(fn.loading=!1)}}let C4,D7,Lz=0;function oLe(){if(C4===void 0)return null;const e={content:C4,line:D7,revision:Lz};return C4=void 0,D7=void 0,e}function sLe(){fn.dirty||(fn.dirty=!0,fn.savedAt=null),fn.savingError!==null&&(fn.savingError=null)}function $z(){nLe(),fn.open=!1}async function iLe(){fn.path!==null&&await Iz({path:fn.path})}async function V7(e){const t=Y5,n=fn.path;if(!t||!n||fn.saving||fn.loading||fn.conflict)return;const o=Tz.getContent;if(!o)return;const s=++ql;fn.saving=!0,fn.savingError=null;try{const i=await At().writeFile(t,{path:n,content:o(),...e?.force===!0||qa===null?{}:{baseEtag:qa}});if(s!==ql)return;qa=i.etag,fn.dirty=!1,fn.conflict=!1,fn.savedAt=Date.now()}catch(i){if(s!==ql)return;if(Ui(i)&&i.code===QIe){fn.conflict=!0;return}fn.savingError=i instanceof Error&&i.message.length>0?i.message:S4("editor.loadFailed")}finally{fn.saving=!1}}async function rLe(){fn.conflict=!1,await V7({force:!0})}function lLe(){return Nz?.()??null}let Nz=null;function aLe(e){Nz=e}const R9="pythinker-light",F9="pythinker-dark";function cLe(e,t){const n=e.trim();if(/^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(n))return n;if(/^#[0-9a-f]{3,4}$/i.test(n))return`#${Array.from(n.slice(1),a=>a+a).join("")}`;const o=/^rgba?\(([^)]*)\)$/i.exec(n);if(o===null)return t;const s=o[1].split(/[\s,/]+/).filter(a=>a.length>0);if(s.length<3||s.length>4)return t;const i=s.slice(0,3).map(a=>eM(a,255)),r=s.length===4?eM(s[3],1):255;return i.some(a=>a===null)||r===null?t:`#${[...i,r===255?null:r].filter(a=>a!==null).map(a=>a.toString(16).padStart(2,"0")).join("")}`}function eM(e,t){const n=e.endsWith("%"),o=Number(n?e.slice(0,-1):e);if(!Number.isFinite(o))return null;const s=n?o/100:o/t;return Math.max(0,Math.min(255,Math.round(s*255)))}function zr(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return cLe(n.length>0?n:t,t)}function uLe(){return{bg:zr("--p-bg","#ffffff"),surface:zr("--color-surface","#fafbfc"),text:zr("--color-text","#14171c"),textMuted:zr("--color-text-muted","#6b7280"),line:zr("--color-line","#e7eaee"),accent:zr("--color-accent","#1783ff"),accentSoft:zr("--p-accent-soft","#1783ff24"),selection:zr("--p-selection","#1783ff2e"),danger:zr("--color-danger","#c0392b"),warning:zr("--color-warning","#a9610a"),success:zr("--color-success","#0e7a38")}}function w2(e){return e.slice(1,7)}function dLe(e,t){const n=uLe();e.editor.defineTheme(t?F9:R9,{base:t?"vs-dark":"vs",inherit:!0,rules:[{token:"comment",foreground:w2(n.textMuted),fontStyle:"italic"},{token:"string",foreground:w2(n.success)},{token:"keyword",foreground:w2(n.accent)},{token:"number",foreground:w2(n.warning)},{token:"type",foreground:w2(n.accent)}],colors:{"editor.background":n.bg,"editor.foreground":n.text,"editorLineNumber.foreground":n.textMuted,"editorLineNumber.activeForeground":n.text,"editor.selectionBackground":n.selection,"editor.lineHighlightBackground":n.surface,"editorCursor.foreground":n.accent,"editorIndentGuide.background1":n.line,"editorIndentGuide.activeBackground1":n.textMuted,"editorWidget.background":n.surface,"editorWidget.border":n.line,"editorError.foreground":n.danger,"editorWarning.foreground":n.warning,"scrollbarSlider.background":n.accentSoft,"scrollbarSlider.hoverBackground":n.accentSoft,"scrollbarSlider.activeBackground":n.accent}})}function tM(e,t){dLe(e,t),e.editor.setTheme(t?F9:R9)}const M4=wp();let nM=null;function fLe(){return nM??=ps(()=>import("./editor.main-CmoCOdG5.js").then(e=>e.b),__vite__mapDeps([10,5,11])).then(e=>{tM(e,M4.value),Ue(M4,()=>tM(e,M4.value))}),nM}function pLe(){return M4.value?F9:R9}function hLe(){return fLe()}const mLe={class:"monaco-pane"},gLe={key:0,class:"monaco-pane__boot"},vLe=Ge({__name:"MonacoPane",props:{path:{},languageId:{}},setup(e){const t=U(null),n=U(!0);let o=null,s=null,i=null,r=null;function l(){window.MonacoEnvironment===void 0&&ps(()=>import("./editor.worker-CNGv4jKH.js"),[]).then(d=>{window.MonacoEnvironment={getWorker:()=>new d.default}})}function a(d){if(d!==void 0&&new Set(["typescript","javascript","json","css","html","markdown","python","rust","go","yaml"]).has(d))return d;if(d==="typescriptreact"||d==="javascriptreact")return d.replace("react","");if(d==="shellscript")return"shell"}async function c(){if(o===null||s===null)return;const d=oLe(),f=u.path;if(f===null)return;const p=o.Uri.parse(`pythinker://session/${encodeURIComponent(f)}`),h=o.editor.getModel(p);if(r?.dispose(),r=null,i!==null&&i!==h&&i.dispose(),h===null)i=o.editor.createModel(d?.content??"",a(u.languageId),p);else{i=h,d!==null&&i.setValue(d.content);const m=a(u.languageId);m!==void 0&&o.editor.setModelLanguage(i,m)}r=i.onDidChangeContent(()=>sLe()),s.setModel(i),QC(()=>i?.getValue()??""),d?.line!==void 0&&d.line>0&&(s.revealLineInCenter(d.line),s.setPosition({lineNumber:d.line,column:1}))}xn(async()=>{l(),await hLe(),t.value!==null&&(o=await ps(()=>import("./editor.main-CmoCOdG5.js").then(d=>d.b),__vite__mapDeps([10,5,11])),t.value!==null&&(s=o.editor.create(t.value,{model:null,theme:pLe(),automaticLayout:!0,fontSize:12.5,fontFamily:'"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace',minimap:{enabled:!1},scrollBeyondLastLine:!1,renderLineHighlight:"line",padding:{top:8}}),n.value=!1,await c()))}),An(()=>{QC(null),r?.dispose(),i?.dispose(),s?.dispose(),i=null,r=null,s=null,o=null});const u=e;return Ue(()=>[u.path,u.languageId],async()=>{s!==null&&await c()}),(d,f)=>(g(),S("div",mLe,[n.value?(g(),S("div",gLe,[Z(Go,{size:"sm"})])):J("",!0),_("div",{ref_key:"rootRef",ref:t,class:"monaco-pane__host"},null,512)]))}}),wLe=mt(vLe,[["__scopeId","data-v-cb5f64f3"]]),yLe={class:"editor-panel"},kLe={class:"ed-path"},bLe={key:1,class:"ed-saved"},_Le={key:1,class:"ed-saving"},xLe={key:0,class:"editor-panel__empty"},SLe={class:"editor-panel__conflict-actions"},CLe={key:1,class:"editor-panel__save-error"},MLe=Ge({__name:"EditorPanel",emits:["close"],setup(e,{emit:t}){const{t:n}=Lt(),o=tLe(),s=t;function i(){$z(),s("close")}function r(c){const u=c.split("/").at(-1)??c;return u.length>0?u:c}const l=B(()=>o.savedAt===null||o.dirty?!1:Date.now()-o.savedAt<2e3);function a(c){(c.metaKey||c.ctrlKey)&&c.key.toLowerCase()==="s"&&(c.preventDefault(),V7())}return window.addEventListener("keydown",a),An(()=>window.removeEventListener("keydown",a)),Ue(()=>o.open,c=>{c||s("close")}),(c,u)=>(g(),S("div",yLe,[Z(la,{wrap:"",title:y(n)("editor.title"),closable:"","close-label":y(n)("editor.closeEditor"),onClose:i},{default:ue(()=>[y(o).path!==null?(g(),S(Me,{key:0},[Z(Cn,{text:y(o).path},{default:ue(()=>[_("span",kLe,I(r(y(o).path)),1)]),_:1},8,["text"]),y(o).dirty?(g(),ce(Cn,{key:0,text:y(n)("editor.unsavedDot")},{default:ue(()=>[...u[3]||(u[3]=[_("span",{class:"ed-dirty"},null,-1)])]),_:1},8,["text"])):J("",!0),l.value?(g(),S("span",bLe,I(y(n)("editor.saved")),1)):J("",!0)],64)):J("",!0),y(o).path!==null&&y(o).loadError===null?(g(),S(Me,{key:1},[y(o).conflict?J("",!0):(g(),ce(Zt,{key:0,size:"sm",label:y(n)("editor.save"),disabled:!y(o).dirty||y(o).saving,onClick:u[0]||(u[0]=d=>y(V7)())},{default:ue(()=>[Z(Le,{name:"check",size:"sm"})]),_:1},8,["label","disabled"])),y(o).saving?(g(),S("span",_Le,[Z(Go,{size:"sm"})])):J("",!0)],64)):J("",!0)]),_:1},8,["title","close-label"]),y(o).loadError!==null?(g(),S("div",xLe,[Z(Cg,null,{default:ue(()=>[_("span",null,I(y(o).loadError),1),Z(It,{variant:"secondary",size:"sm",onClick:i},{default:ue(()=>[He(I(y(n)("filePreview.close")),1)]),_:1})]),_:1})])):(g(),S(Me,{key:1},[y(o).conflict?(g(),ce(B9,{key:0,variant:"warning",class:"editor-panel__conflict"},{default:ue(()=>[_("span",null,I(y(n)("editor.conflictText")),1),_("span",SLe,[Z(It,{variant:"secondary",size:"sm",onClick:u[1]||(u[1]=d=>y(iLe)())},{default:ue(()=>[He(I(y(n)("editor.conflictReload")),1)]),_:1}),Z(It,{variant:"danger",size:"sm",disabled:y(o).saving,onClick:u[2]||(u[2]=d=>y(rLe)())},{default:ue(()=>[He(I(y(n)("editor.conflictOverwrite")),1)]),_:1},8,["disabled"])])]),_:1})):J("",!0),y(o).savingError!==null?(g(),S("p",CLe,I(y(o).savingError),1)):J("",!0),y(o).path!==null?(g(),ce(wLe,{key:2,path:y(o).path,"language-id":y(o).languageId},null,8,["path","language-id"])):J("",!0)],64))]))}}),ALe=mt(MLe,[["__scopeId","data-v-579cb4a1"]]),ELe={class:"tp"},TLe=Ge({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=U(null);return Ue(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||vt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(g(),S("div",ELe,[Z(la,{title:y(s)("common.preview"),subtitle:e.subtitle??y(s)("thinking.panelTitle"),"close-label":y(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},I(e.text),513)]))}}),ILe=mt(TLe,[["__scopeId","data-v-e1ad626c"]]),LLe={class:"agent-panel"},$Le={key:0,class:"agent-fallback"},NLe={key:0,class:"agent-error"},zLe={key:1,class:"fallback-lines"},BLe=Ge({__name:"AgentDetailPanel",props:{member:{},turns:{},running:{type:Boolean},loading:{type:Boolean},loadError:{type:Boolean},hasMore:{type:Boolean},loadingMore:{type:Boolean},loadMoreError:{type:Boolean}},emits:["close","loadOlderMessages","openAgent","openFile","openMedia","openTurnDiff"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=Gp(),r=B(()=>i.value?"lg":"md"),l=B(()=>i.value?"lg":"sm"),a=U(null),c=U(!0),u=U(!1),d=U(null),f=U(null),p=U({}),h=U(null);let m=null,k=0;const x=B(()=>{const q=new Set,P=[],W=n.member.prompt?.trim(),G=W?`$ ${W}`:void 0;for(const ee of[n.member.prompt,n.member.suspendedReason,n.member.text,n.member.outputLines?.join(` +`),n.member.summary]){const se=ee?.trim();!se||q.has(se)||se===G||(q.add(se),P.push(se))}return P}),v=B(()=>x.value.filter(q=>q!==n.member.prompt?.trim()).join(` +`)),w=pn("modelDisplay"),b=pn("subagentEffort"),M=B(()=>[n.member.subagentType,w?.(n.member.model),b?.(n.member.thinkingEffort)].filter(Boolean).join(" · ")||void 0);function R(){const q=a.value;q&&(c.value=q.scrollHeight-q.scrollTop-q.clientHeight<24)}function z(){vt(()=>{const q=a.value;q&&(q.scrollTop=q.scrollHeight)})}jn("pinScroll",q=>{const P=a.value;if(!P)return;const W=q.getBoundingClientRect().top;requestAnimationFrame(()=>{P.scrollTop+=q.getBoundingClientRect().top-W})}),Ue(()=>{const q=n.turns.at(-1);return`${n.member.id}:${n.turns.length}:${q?.text.length??0}:${q?.tools?.length??0}`},()=>{c.value&&z()},{immediate:!0});function $(q){const P=q[0].toUpperCase()+q.slice(1);return s(`tools.dynamic_workflow.phase${P}`)}function E(){const q=d.value?.el,P=f.value?.el;if(!q||!P)return;const W=q.getBoundingClientRect(),G=8,ee=8,se=Math.max(ee,Math.min(W.right-P.offsetWidth,window.innerWidth-P.offsetWidth-ee));W.bottom+G+P.offsetHeight<=window.innerHeight-ee?p.value={left:`${se}px`,top:`${W.bottom+G}px`}:p.value={left:`${se}px`,bottom:`${window.innerHeight-W.top+G}px`}}function T(){f.value?.el?.querySelector(".ui-menu-item:not(:disabled)")?.focus()}function N(q=!1){u.value&&(u.value=!1,window.removeEventListener("mousedown",H,!0),window.removeEventListener("keydown",V,!0),window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0),q&&d.value?.el?.focus())}async function C(){if(u.value){N(!0);return}u.value=!0,await vt(),u.value&&(E(),T(),window.addEventListener("mousedown",H,!0),window.addEventListener("keydown",V,!0),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0))}function O(q){q.preventDefault(),C()}function H(q){const P=q.target;P&&(f.value?.el?.contains(P)||d.value?.el?.contains(P)||N())}function V(q){q.key==="Escape"&&(q.preventDefault(),q.stopImmediatePropagation(),N(!0))}function A(q){if(q.key!=="ArrowDown"&&q.key!=="ArrowUp")return;q.preventDefault();const P=Array.from(f.value?.el?.querySelectorAll(".ui-menu-item:not(:disabled)")??[]);if(P.length===0)return;const W=P.indexOf(document.activeElement),G=q.key==="ArrowDown"?(W+1)%P.length:(W-1+P.length)%P.length;P[G]?.focus()}function F(q){const P=q.relatedTarget;P&&(f.value?.el?.contains(P)||d.value?.el?.contains(P))||N()}async function j(q){const P=q==="command"?n.member.prompt:q==="output"?v.value:[n.member.prompt?.trim(),v.value].filter(Boolean).join(` + +`);if(!P)return;const W=++k;!await ss(P)||W!==k||(m!==null&&clearTimeout(m),h.value=q,m=setTimeout(()=>{m=null,h.value=null},1400),N(!0))}return Ue(()=>n.member.id,()=>{k+=1,m!==null&&clearTimeout(m),m=null,h.value=null,N()}),An(()=>{m!==null&&clearTimeout(m),N()}),(q,P)=>(g(),S("div",LLe,[Z(la,{title:e.member.name,subtitle:M.value,"close-label":y(s)("thinking.close"),onClose:P[0]||(P[0]=W=>o("close"))},{default:ue(()=>[Z(wr,{variant:"neutral",size:"sm"},{default:ue(()=>[He(I($(e.member.phase)),1)]),_:1}),e.member.prompt||v.value?(g(),ce(Zt,{key:0,ref_key:"copyTriggerRef",ref:d,size:l.value,class:Be({"copy-menu-open":u.value}),label:y(s)("tasks.copy"),tooltip:y(s)("tasks.copy"),"aria-haspopup":"menu","aria-expanded":u.value,onClick:C,onKeydown:[To(xt(O,["prevent"]),["down"]),To(xt(O,["prevent"]),["up"])],onFocusout:F},{default:ue(()=>[Z(Le,{name:h.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["size","class","label","tooltip","aria-expanded","onKeydown"])):J("",!0)]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:a,class:"agent-transcript",onScrollPassive:R},[e.turns.length===0&&!e.loading&&(e.loadError||x.value.length>0)?(g(),S("div",$Le,[e.loadError?(g(),S("div",NLe,I(y(s)("tasks.transcriptLoadError")),1)):J("",!0),x.value.length>0?(g(),S("pre",zLe,I(x.value.join(` +`)),1)):J("",!0)])):(g(),ce(Jv,{key:1,turns:e.turns,"turn-active":e.running,"session-loading":e.loading&&e.turns.length===0,"has-more-messages":e.hasMore,"loading-more":e.loadingMore,"loading-more-error":e.loadMoreError,"is-following":c.value,"read-only":"",inspector:"",onLoadOlderMessages:P[1]||(P[1]=W=>o("loadOlderMessages")),onOpenAgent:P[2]||(P[2]=W=>o("openAgent",W)),onOpenFile:P[3]||(P[3]=W=>o("openFile",W)),onOpenMedia:P[4]||(P[4]=W=>o("openMedia",W)),onOpenTurnDiff:P[5]||(P[5]=W=>o("openTurnDiff",W))},null,8,["turns","turn-active","session-loading","has-more-messages","loading-more","loading-more-error","is-following"]))],544),(g(),ce(Gr,{to:"body"},[u.value?(g(),ce(qr,{key:0,ref_key:"copyMenuRef",ref:f,class:"copy-menu",style:Wt(p.value),onKeydown:A,onFocusout:F},{default:ue(()=>[e.member.prompt?(g(),ce(yn,{key:0,size:r.value,onClick:P[6]||(P[6]=W=>j("command"))},{default:ue(()=>[Z(Le,{name:"terminal",size:"sm"}),_("span",null,I(y(s)("tasks.copyCommand")),1)]),_:1},8,["size"])):J("",!0),Z(yn,{size:r.value,disabled:!v.value,onClick:P[7]||(P[7]=W=>j("output"))},{default:ue(()=>[Z(Le,{name:"file-text",size:"sm"}),_("span",null,I(y(s)("tasks.copyOutput")),1)]),_:1},8,["size","disabled"]),Z(yn,{separator:""}),Z(yn,{size:r.value,onClick:P[8]||(P[8]=W=>j("all"))},{default:ue(()=>[Z(Le,{name:"copy",size:"sm"}),_("span",null,I(y(s)("tasks.copyAll")),1)]),_:1},8,["size"])]),_:1},8,["style"])):J("",!0)]))]))}}),RLe=mt(BLe,[["__scopeId","data-v-469ea882"]]),FLe={class:"tdp"},jLe={class:"tdp-body"},OLe={key:1,class:"tdp-output"},PLe={key:2,class:"tdp-empty"},HLe=Ge({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Lt();return(s,i)=>(g(),S("div",FLe,[Z(la,{title:e.target.title,subtitle:e.target.path,"close-label":y(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",jLe,[e.target.lines&&e.target.lines.length>0?(g(),ce(DE,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(g(),S("div",OLe,[(g(!0),S(Me,null,it(e.target.output,(r,l)=>(g(),S("div",{key:l},I(r),1))),128))])):(g(),S("div",PLe,I(y(o)("diff.noDiff")),1))])]))}}),DLe=mt(HLe,[["__scopeId","data-v-8b9af3ab"]]),VLe={class:"hl-body"},WLe={key:0,class:"hl-gutter"},qLe={class:"hl-sign"},ULe={class:"hl-text"},ZLe=["data-line"],KLe={key:0,class:"hl-gutter"},GLe={class:"hl-text"},YLe=200,XLe=Ge({__name:"HighlightedCode",props:{code:{},lines:{},path:{},lineNumbers:{type:[Boolean,Array],default:!1},framed:{type:Boolean,default:!0},fullTexts:{default:null},lineClass:{},responsiveWrap:{type:Boolean,default:!1}},setup(e){const t={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",vue:"vue",svelte:"svelte",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",kt:"kt",kts:"kts",scala:"scala",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"cs",php:"php",sh:"sh",bash:"bash",zsh:"zsh",fish:"fish",ps1:"ps1",bat:"bat",cmd:"bat",sql:"sql",graphql:"graphql",prisma:"prisma",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yml",toml:"toml",ini:"ini",md:"md",markdown:"markdown",mdx:"mdx",lua:"lua",r:"r",dart:"dart",zig:"zig",mk:"makefile",cmake:"cmake",diff:"diff",proto:"proto"},n={dockerfile:"dockerfile",makefile:"makefile","cmakelists.txt":"cmake"};function o(V){const A=V?.split(/[\\/]/).pop()?.toLowerCase()??"";if(!A)return;const F=n[A];if(F)return F;const j=A.lastIndexOf(".");if(!(j<=0))return t[A.slice(j+1)]}function s(V){return V.split(/\r?\n/)}function i(V){const A={};V.color&&(A.color=V.color);const F=V.fontStyle??0;return F&1&&(A.fontStyle="italic"),F&2&&(A.fontWeight="var(--weight-semibold)"),F&4&&(A.textDecoration="underline"),A}const r=e,l=wp(),a=B(()=>r.lines!==void 0),c=B(()=>(r.lines??[]).some(V=>V.oldNo!==void 0)),u=B(()=>(r.lines??[]).some(V=>V.newNo!==void 0)),d=B(()=>r.lineNumbers===!0&&a.value),f=B(()=>Array.isArray(r.lineNumbers)?r.lineNumbers:null),p=B(()=>d.value?Number(c.value)+Number(u.value):f.value===null?0:1),h=B(()=>Array.isArray(r.code)?r.code:s(r.code??"")),m=B(()=>{const V=r.lines;return V?r.fullTexts?r.fullTexts:{before:V.filter(A=>A.oldNo!==void 0).map(A=>A.text).join(` `),after:V.filter(A=>A.newNo!==void 0).map(A=>A.text).join(` -`)}:null}),k=U(null),x=U(null),w=U(null);function v(){k.value=null,x.value=null,w.value=null}let b=0,M=0,R=null,z=null;async function $(){const V=++b;M=Date.now();const A=o(i.path);if(!A){V===b&&v();return}try{z??=ps(()=>import("./index-BfLDYVXY.js").then(P=>P.i),[]).then(P=>P.codeToTokens);const F=await z,j=l.value?"github-dark":"github-light",q=m.value;if(q){const[P,W]=await Promise.all([q.before?F(q.before,{lang:A,theme:j}):null,q.after?F(q.after,{lang:A,theme:j}):null]);if(V!==b)return;x.value=P?.tokens??null,w.value=W?.tokens??null}else{const P=h.value.length>0?await F(h.value.join(` -`),{lang:A,theme:j}):null;if(V!==b)return;k.value=P?.tokens??null}}catch{V===b&&v()}}function T(){if(R!==null)return;const V=Math.max(0,RLe-(Date.now()-M));R=setTimeout(()=>{R=null,$()},V)}Ue([()=>h.value.join(` -`),()=>m.value?.before??null,()=>m.value?.after??null],T),Ue([()=>i.path,l,()=>i.fullTexts],()=>{b++,v(),T()}),xn(()=>void $()),vo(()=>{b++,R!==null&&clearTimeout(R)});const E=B(()=>{const V=new Map;let A=0;for(const F of i.lines??[])F.oldNo!==void 0&&V.set(F.oldNo,A++);return V}),N=B(()=>{const V=new Map;let A=0;for(const F of i.lines??[])F.newNo!==void 0&&V.set(F.newNo,A++);return V});function C(V){if(V.type==="del"){if(V.oldNo===void 0)return null;const F=i.fullTexts?V.oldNo-1:E.value.get(V.oldNo);return F===void 0?null:x.value?.[F]??null}if(V.newNo===void 0)return null;const A=i.fullTexts?V.newNo-1:N.value.get(V.newNo);return A===void 0?null:w.value?.[A]??null}function O(V){return V.type==="add"?"+":V.type==="del"?"-":" "}const H=B(()=>{let V=0;if(f.value)for(const A of f.value)A>V&&(V=A);else for(const A of i.lines??[])A.oldNo!==void 0&&A.oldNo>V&&(V=A.oldNo),A.newNo!==void 0&&A.newNo>V&&(V=A.newNo);return Math.max(4,String(V).length)});return(V,A)=>(g(),S("div",{class:Be(["hl-code",{gutter:d.value,"plain-pad":!a.value&&f.value===null,framed:e.framed,"responsive-wrap":e.responsiveWrap,"one-gutter":p.value===1,"two-gutters":p.value===2}]),style:Wt({"--gutter-ch":`${H.value}ch`})},[_("div",ELe,[a.value?(g(!0),S(Me,{key:0},rt(e.lines,(F,j)=>(g(),S("div",{key:j,class:Be(["hl-row",`row-${F.type}`])},[d.value?(g(),S(Me,{key:0},[c.value?(g(),S("span",ILe,I(F.oldNo??""),1)):J("",!0),u.value?(g(),S("span",{key:1,class:Be(["hl-gutter new",{offset:c.value}])},I(F.newNo??""),3)):J("",!0)],64)):J("",!0),_("span",LLe,I(O(F)),1),_("span",$Le,[C(F)?(g(!0),S(Me,{key:0},rt(C(F),(q,P)=>(g(),S("span",{key:P,style:Wt(r(q))},I(q.content),5))),128)):(g(),S(Me,{key:1},[He(I(F.text),1)],64))])],2))),128)):(g(!0),S(Me,{key:1},rt(h.value,(F,j)=>(g(),S("div",{key:j,class:Be(["hl-row",e.lineClass?e.lineClass(f.value?.[j]??-1):void 0]),"data-line":f.value?f.value[j]:void 0},[f.value?(g(),S("span",zLe,I(f.value[j]??""),1)):J("",!0),_("span",BLe,[k.value&&k.value[j]?(g(!0),S(Me,{key:0},rt(k.value[j],(q,P)=>(g(),S("span",{key:P,style:Wt(r(q))},I(q.content),5))),128)):(g(),S(Me,{key:1},[He(I(F),1)],64))])],10,NLe))),128))])],6))}}),Iz=mt(FLe,[["__scopeId","data-v-4b6e3ce1"]]),jLe={class:"turn-diff-panel"},OLe={class:"tdp-body"},PLe={class:"tdp-file-head"},HLe={class:"tdp-path"},DLe={key:0,class:"tdp-diff"},VLe={key:1,class:"tdp-unavailable"},WLe=Ge({__name:"TurnDiffPanel",props:{changes:{},cwd:{}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function r(a,c){if(!c)return null;const u=w=>w.replaceAll("\\","/"),d=u(a);let f=u(c);f.length>1&&(f=f.replace(/\/+$/,""));const p=/^[a-z]:\//i.test(f)||/^[a-z]:\//i.test(d)||f.startsWith("//")||d.startsWith("//"),h=p?f.toLowerCase():f,m=p?d.toLowerCase():d,k=h.endsWith("/")?h:`${h}/`;if(m!==h&&!m.startsWith(k))return null;const x=m===h?"":d.slice(k.length);return x.split("/").includes("..")?null:x||null}function i(a,c=48){return!a||a.length<=c?a:"…"+a.slice(a.length-c+1)}function l(a){return r(a.path,n.cwd)??a.path}return(a,c)=>(g(),S("div",jLe,[Z(la,{title:y(s)("conversation.turnFiles.diffTitle"),onClose:c[0]||(c[0]=u=>o("close"))},null,8,["title"]),_("div",OLe,[(g(!0),S(Me,null,rt(e.changes,u=>(g(),S("section",{key:u.path,class:"tdp-file"},[_("div",PLe,[Z(Cn,{text:u.path},{default:ue(()=>[_("span",HLe,I(i(l(u))),1)]),_:2},1032,["text"]),Z(It,{variant:"ghost",size:"sm",onClick:d=>o("openFile",{path:u.path})},{default:ue(()=>[He(I(y(s)("conversation.turnFiles.openFile")),1)]),_:1},8,["onClick"])]),u.diff?(g(),S("div",DLe,[Z(Iz,{lines:u.diff,path:u.path,framed:!1},null,8,["lines","path"])])):(g(),S("div",VLe,[_("p",null,I(y(s)("conversation.turnFiles.diffUnavailable")),1),Z(It,{variant:"ghost",size:"sm",onClick:d=>o("openFile",{path:u.path})},{default:ue(()=>[He(I(y(s)("conversation.turnFiles.openFile")),1)]),_:1},8,["onClick"])]))]))),128))])]))}}),qLe=mt(WLe,[["__scopeId","data-v-67a3cc7e"]]),ULe=["aria-label"],ZLe=Ge({__name:"ThinkingIndicator",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=Wl.length*m0;function n(o){return{"--thinking-frame-delay":`${o*m0-t}ms`,"--thinking-frame-fast-delay":`${o*(m0/2)-t/2}ms`}}return(o,s)=>(g(),S("span",{class:Be(["ui-thinking-indicator",[`ui-thinking-indicator--${e.size}`,{"ui-thinking-indicator--fast":e.fast}]]),"aria-label":e.label,role:"status"},[(g(!0),S(Me,null,rt(y(Wl),(r,i)=>(g(),S("span",{key:r,class:"ui-thinking-indicator__frame",style:Wt(n(i)),"aria-hidden":"true"},I(r),5))),128))],10,ULe))}}),KLe=mt(ZLe,[["__scopeId","data-v-ed8aef9e"]]),GLe={class:"sc"},YLe={key:0,class:"sc-empty"},XLe={key:2,class:"sc-loading","aria-hidden":"true"},JLe={class:"sc-composer"},QLe=["placeholder"],e$e=["disabled"],t$e=Ge({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:r}=Lt(),i=B(()=>o.turns.find(b=>b.role==="user")?.text?.trim()??""),l=B(()=>o.title?.trim()||r("sideChat.title")),a=B(()=>o.subtitle?.trim()?o.subtitle.trim():i.value||r("sideChat.subtitle")),c=U(""),u=U(null),d=U(null);function f(){const v=c.value.trim();v&&(s("send",v),c.value="",vt(()=>{u.value&&(u.value.style.height="auto"),p()}))}function p(){const v=d.value;v&&(v.scrollTop=v.scrollHeight)}const h=B(()=>{const v=o.turns;if(v.length===0)return"0";const b=v.at(-1),M=b.thinking?.length??0,R=b.tools?.reduce((z,$)=>z+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${b.text.length}:${M}:${R}`});Ue(h,async()=>{!o.running&&!o.sending||(await vt(),p())});const m=B(()=>o.sending?o.turns.at(-1)?.role==="user":!1);function k(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),f())}function x(){const v=u.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}function w(){u.value?.focus()}return t({focusInput:w}),(v,b)=>(g(),S("div",GLe,[Z(la,{title:l.value,subtitle:a.value,"close-label":y(r)("thinking.close"),onClose:b[0]||(b[0]=M=>s("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:d,class:"sc-body"},[e.turns.length===0?(g(),S("div",YLe,I(y(r)("sideChat.empty")),1)):(g(),ce(Xv,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),m.value?(g(),S("div",XLe,[Z(KLe)])):J("",!0)],512),_("div",JLe,[Zn(_("textarea",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":b[1]||(b[1]=M=>c.value=M),class:"sc-input",rows:"1",placeholder:y(r)("sideChat.placeholder"),onInput:x,onKeydown:k},null,40,QLe),[[Fs,c.value]]),Z(Cn,{text:y(r)("sideChat.send")},{default:ue(()=>[_("button",{type:"button",class:"sc-send",disabled:!c.value.trim(),onClick:f},[Z(Le,{name:"arrow-right",size:"sm"})],8,e$e)]),_:1},8,["text"])])]))}}),n$e=mt(t$e,[["__scopeId","data-v-130e8cd2"]]),o$e={class:"changes-pane"},s$e={class:"dv-path"},r$e={class:"diff-head"},i$e={class:"back-label"},l$e={key:"loading",class:"empty-state diff-loading"},a$e={key:"empty",class:"empty-state"},c$e={class:"dv-change-count"},u$e={class:"ch-head"},d$e={class:"br-label"},f$e={class:"br-name"},p$e={key:0,class:"sync-info"},h$e={key:0,class:"ahead"},m$e={key:0,class:"behind"},g$e={key:1,class:"empty-head"},v$e={key:0,class:"ch-list"},w$e=["onClick"],y$e={class:"fpath"},k$e={key:1,class:"ch-list ch-tree"},b$e={class:"tree-list"},_$e=["onClick"],x$e={class:"tree-name"},S$e=["onClick"],C$e={class:"tree-name"},M$e={key:2,class:"empty-state"},A$e={key:3,class:"empty-state"},T$e=Ge({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{default:null},emptyFile:{type:Boolean,default:!1},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t;function r(C){const O=C.toLowerCase();return O==="modified"?"modified":O==="added"?"added":O==="deleted"?"deleted":O==="renamed"?"renamed":O==="untracked"?"untracked":O==="conflicted"?"conflicted":O==="ignored"?"ignored":O==="clean"?"clean":"unknown"}const i={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(C){return i[r(C)]??"?"}function a(C,O=60){return C.length<=O?C:"…"+C.slice(C.length-O+1)}const c=B(()=>o.gitInfo!==null),u=B(()=>o.changes.length>0),d=B(()=>(o.selectedDiffPath??null)!==null),f=B(()=>o.mode==="detail"||o.mode==="full"&&d.value),p=B(()=>o.fileDiff??[]),h=B(()=>o.fileDiffLoading===!0),m=U(null);Ue([()=>o.selectedDiffPath,h],([,C])=>{!C&&m.value&&(m.value.scrollLeft=0)},{flush:"post"});function k(C){s("open",C)}function x(){s("back")}function w(){s("close")}const v=U("list");function b(C){v.value=C}function M(C){const O={children:[]},H=[...C].sort((V,A)=>V.path.localeCompare(A.path));for(const V of H){const A=V.path.split("/");let F=O;for(let j=0;jee.name===q&&ee.kind===(P?"file":"folder"));G||(G={name:q,path:W,kind:P?"file":"folder",status:P?V.status:void 0,children:[]},F.children.push(G)),F=G}}return O.children}const R=B(()=>M(o.changes)),z=U(new Set);function $(C){return!z.value.has(C)}const T=B(()=>{const C=[];function O(H,V){for(const A of H)C.push({node:A,depth:V}),A.kind==="folder"&&$(A.path)&&O(A.children,V+1)}return O(R.value,0),C});function E(C){const O=new Set(z.value);O.has(C.path)?O.delete(C.path):O.add(C.path),z.value=O}function N(C){return`${16+C*16}px`}return(C,O)=>(g(),S("div",o$e,[f.value?(g(),S(Me,{key:0},[Z(la,{title:y(n)("diff.title"),closable:e.closable,"close-label":y(n)("diff.close"),onClose:w},{default:ue(()=>[Z(Cn,{text:e.selectedDiffPath??""},{default:ue(()=>[_("span",s$e,I(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",r$e,[e.hideBack?J("",!0):(g(),ce(It,{key:0,variant:"ghost",size:"sm",onClick:x},{default:ue(()=>[O[0]||(O[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",i$e,I(y(n)("diff.back")),1)]),_:1}))]),Z(gi,{name:"diff-content",mode:"out-in"},{default:ue(()=>[h.value?(g(),S("div",l$e,[Z(Go,{size:"md"}),_("span",null,I(y(n)("diff.loading")),1)])):p.value.length>0?(g(),S("div",{key:"lines",ref_key:"diffScrollRef",ref:m,class:"dv-lines-wrap"},[Z(Iz,{lines:p.value,path:e.selectedDiffPath??void 0,"line-numbers":!0,framed:!1,"full-texts":e.fullTexts,"responsive-wrap":""},null,8,["lines","path","full-texts"])],512)):(g(),S("div",a$e,I(e.emptyFile?y(n)("diff.emptyFile"):y(n)("diff.noDiff")),1))]),_:1})],64)):(g(),S(Me,{key:1},[Z(la,{title:y(n)("diff.title"),closable:e.closable,"close-label":y(n)("diff.close"),onClose:w},{default:ue(()=>[_("span",c$e,I(y(n)(e.changes.length===1?"diff.fileCountOne":"diff.fileCountOther",{number:e.changes.length})),1),Z(nr,{"model-value":v.value,size:"sm",options:[{value:"list",label:y(n)("diff.list")},{value:"tree",label:y(n)("diff.tree")}],"onUpdate:modelValue":b},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",u$e,[c.value?(g(),S(Me,{key:0},[_("span",d$e,I(y(n)("diff.branch")),1),_("span",f$e,I(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(g(),S("span",p$e,[Z(Cn,{text:y(n)("diff.aheadTitle")},{default:ue(()=>[e.gitInfo.ahead>0?(g(),S("span",h$e,"↑"+I(e.gitInfo.ahead),1)):J("",!0)]),_:1},8,["text"]),Z(Cn,{text:y(n)("diff.behindTitle")},{default:ue(()=>[e.gitInfo.behind>0?(g(),S("span",m$e,"↓"+I(e.gitInfo.behind),1)):J("",!0)]),_:1},8,["text"])])):J("",!0)],64)):(g(),S("span",g$e,I(y(n)("diff.empty")),1))]),u.value&&v.value==="list"?(g(),S("div",v$e,[(g(!0),S(Me,null,rt(e.changes,H=>(g(),ce(Cn,{key:H.path,text:H.path},{default:ue(()=>[_("button",{type:"button",class:"ch-row",onClick:V=>k(H.path)},[_("span",{class:Be(["badge",r(H.status)])},I(l(H.status)),3),_("span",y$e,I(a(H.path)),1)],8,w$e)]),_:2},1032,["text"]))),128))])):u.value&&v.value==="tree"?(g(),S("div",k$e,[_("ul",b$e,[(g(!0),S(Me,null,rt(T.value,({node:H,depth:V})=>(g(),S("li",{key:H.path,class:"tree-node"},[H.kind==="folder"?(g(),S("button",{key:0,type:"button",class:"tree-row tree-folder",style:Wt({paddingLeft:N(V)}),onClick:A=>E(H)},[Z(Le,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",x$e,I(H.name),1)],12,_$e)):(g(),ce(Cn,{key:1,text:H.path},{default:ue(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Wt({paddingLeft:N(V)}),onClick:A=>k(H.path)},[_("span",{class:Be(["badge",r(H.status)])},I(l(H.status)),3),_("span",C$e,I(H.name),1)],12,S$e)]),_:2},1032,["text"]))]))),128))])])):c.value?(g(),S("div",M$e,I(y(n)("diff.clean")),1)):(g(),S("div",A$e,I(y(n)("diff.empty")),1))],64))]))}}),E$e=mt(T$e,[["__scopeId","data-v-811473b6"]]);function Lz(e,t){let n=null;xn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,vt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),vo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const I$e={class:"search-wrap"},L$e={key:0,class:"tab-strip"},$$e={key:1,class:"state-row"},N$e={key:2,class:"state-row unavail"},z$e={key:3,class:"model-list"},B$e=["aria-selected","onClick","onMouseenter"],R$e={class:"check"},F$e={class:"model-main"},j$e={class:"model-name"},O$e={class:"model-id"},P$e={key:0,class:"caps"},H$e={class:"model-provider"},D$e={class:"model-ctx"},V$e={key:0,class:"empty"},W$e={class:"footer-hint"},q$e=Ge({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=Kp(),s=B(()=>o.value?Kc:T0),r=B(()=>o.value?{modelValue:!0,title:n("model.title"),closeOnEsc:!1}:{open:!0,title:n("model.title"),closeOnEsc:!1,size:"xl",height:"fixed"}),i=e,l=t,a=B(()=>new Set(i.starredIds??[]));function c($){return a.value.has($)}const u=U(""),d=U(null),f=U(null),p=U("all");Lz(f,d);const h=B(()=>{const $=new Set,T=[{id:"all",label:n("model.allTab")}];for(const E of i.models)$.has(E.provider)||($.add(E.provider),T.push({id:E.provider,label:E.provider}));return T}),m=B(()=>{const $=u.value.toLowerCase().trim(),T=i.models.filter(E=>{if(p.value!=="all"&&E.provider!==p.value)return!1;const N=(E.displayName??E.model).toLowerCase().includes($),C=E.provider.toLowerCase().includes($),O=E.id.toLowerCase().includes($);return!$||N||C||O});return p.value!=="all"?T:T.sort((E,N)=>{const C=c(E.id)?1:0;return(c(N.id)?1:0)-C})}),k=B(()=>m.value),x=U(0);Ue([u,p],()=>{x.value=0}),Ue(h,$=>{$.some(T=>T.id===p.value)||(p.value="all")}),Ue(k,$=>{x.value=Math.min(x.value,Math.max($.length-1,0))});function w($){if($.key==="Escape"){l("close");return}if($.key==="ArrowDown")$.preventDefault(),x.value=Math.min(x.value+1,k.value.length-1);else if($.key==="ArrowUp")$.preventDefault(),x.value=Math.max(x.value-1,0);else if($.key==="Enter"){const T=k.value[x.value];T&&l("select",T.id)}}xn(()=>{document.addEventListener("keydown",w)}),An(()=>{document.removeEventListener("keydown",w)});function v($){l("select",$)}function b($){return k.value.indexOf($)}function M($){p.value=$}const R={image_in:"imageIn",imageIn:"imageIn",image_out:"imageOut",imageOut:"imageOut",vision:"vision",video_in:"videoIn",videoIn:"videoIn",audio_in:"audioIn",audioIn:"audioIn",audio_out:"audioOut",audioOut:"audioOut",thinking:"thinking",always_thinking:"alwaysThinking",alwaysThinking:"alwaysThinking",adaptive_thinking:"adaptiveThinking",adaptiveThinking:"adaptiveThinking",tool_use:"toolUse",toolUse:"toolUse",fast_mode:"fastMode",fastMode:"fastMode"};function z($){const T=R[$];return T?n(`model.capabilities.${T}`):n("model.capabilities.unknown",{capability:$})}return($,T)=>(g(),ce(ns(s.value),Vn(r.value,{onClose:T[1]||(T[1]=E=>l("close"))}),{default:ue(()=>[_("div",{ref_key:"dialogRef",ref:f,class:Be(["mp",{"mp--sheet":y(o)}])},[_("div",I$e,[Z(os,{ref_key:"searchRef",ref:d,modelValue:u.value,"onUpdate:modelValue":T[0]||(T[0]=E=>u.value=E),placeholder:y(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),h.value.length>1?(g(),S("div",L$e,[(g(!0),S(Me,null,rt(h.value,E=>(g(),ce(It,{key:E.id,variant:E.id===p.value?"secondary":"ghost",size:"sm",onClick:N=>M(E.id)},{default:ue(()=>[He(I(E.label),1)]),_:2},1032,["variant","onClick"]))),128))])):J("",!0),e.loading?(g(),S("div",$$e,[Z(Go,{size:"sm"}),_("span",null,I(y(n)("model.loading")),1)])):e.unavailable?(g(),S("div",N$e,[Z(Le,{name:"alert-triangle",size:"lg"}),_("span",null,I(y(n)("model.unavailable")),1)])):(g(),S("div",z$e,[(g(!0),S(Me,null,rt(k.value,E=>(g(),S("div",{key:E.id,class:Be(["model-row",{"is-current":E.id===e.current,"is-selected":b(E)===x.value}]),role:"option","aria-selected":E.id===e.current,onClick:N=>v(E.id),onMouseenter:N=>x.value=b(E)},[_("span",R$e,[E.id===e.current?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",F$e,[_("span",j$e,I(E.displayName??E.model),1),_("span",O$e,I(E.id),1),E.capabilities&&E.capabilities.length>0?(g(),S("span",P$e,[(g(!0),S(Me,null,rt(E.capabilities,N=>(g(),ce(wi,{key:N,variant:"info",size:"sm"},{default:ue(()=>[He(I(z(N)),1)]),_:2},1024))),128))])):J("",!0)]),_("span",H$e,I(E.provider),1),_("span",D$e,I(y(n)("model.contextSuffix",{size:y(na)(E.maxContextSize)})),1),Z(Zt,{size:"sm",label:c(E.id)?y(n)("model.unstarTitle"):y(n)("model.starTitle"),onClick:xt(N=>l("toggle-star",E.id),["stop"])},{default:ue(()=>[c(E.id)?(g(),ce(Le,{key:0,name:"star",size:"md"})):(g(),ce(Le,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,B$e))),128)),k.value.length===0&&!e.loading&&!e.unavailable?(g(),S("div",V$e,I(i.models.length===0?y(n)("model.emptyNoModels"):y(n)("model.emptyNoMatch")),1)):J("",!0)])),_("div",W$e,I(y(n)("model.footerHint")),1)],2)]),_:1},16))}}),U$e=mt(q$e,[["__scopeId","data-v-466b8fec"]]),Z$e=["aria-checked","aria-label","disabled"],K$e=Ge({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(g(),S("button",{class:Be(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=r=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,Z$e))}}),xr=mt(K$e,[["__scopeId","data-v-d7337ade"]]),G$e=["value","disabled"],Y$e=Ge({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,r)=>(g(),S("select",{class:Be(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[Tn(s.$slots,"default",{},void 0,!0)],42,G$e))}}),M4=mt(Y$e,[["__scopeId","data-v-77d887db"]]),X$e=["pythinker","openai","openai_responses","anthropic","google-genai","vertexai"],J$e=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function V7(){return{model:"",maxContextSize:"",displayName:""}}function eM(){return{id:"",type:"openai",apiKey:"",baseUrl:"",models:[V7()]}}function $z(e,t){const n=[];for(const o of Object.values(t??{})){if(o===null||typeof o!="object")continue;const s=o;s.provider===e.id&&n.push({model:typeof s.model=="string"?s.model:"",maxContextSize:typeof s.maxContextSize=="number"?String(s.maxContextSize):"",displayName:typeof s.displayName=="string"?s.displayName:""})}return n}function Q$e(e,t={}){const n={models:{}},o=e.id.trim();return o===""?n.id="idRequired":J$e.test(o)||(n.id="idInvalid"),t.apiKey===!0&&e.apiKey.trim()===""&&(n.apiKey="apiKeyRequired"),t.baseUrl===!0&&e.baseUrl.trim()===""&&(n.baseUrl="baseUrlRequired"),e.models.length===0&&(n.modelsEmpty="modelRequired"),e.models.forEach((s,r)=>{const i={};s.model.trim()===""&&(i.model="modelRequired");const l=s.maxContextSize.trim(),a=Number(l);l===""?i.maxContextSize="contextSizeRequired":(!/^\d+$/.test(l)||!Number.isSafeInteger(a)||a<1)&&(i.maxContextSize="contextSizeInvalid"),(i.model!==void 0||i.maxContextSize!==void 0)&&(n.models[r]=i)}),n}function eNe(e){return e.id!==void 0||e.apiKey!==void 0||e.baseUrl!==void 0||e.modelsEmpty!==void 0||Object.keys(e.models).length>0}function Nz(e){return e.map(t=>({model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),displayName:t.displayName.trim()||void 0}))}function tNe(e){return{id:e.id.trim(),type:e.type,apiKey:e.apiKey.trim()||void 0,baseUrl:e.baseUrl.trim()||void 0,models:Nz(e.models)}}function nNe(e,t,n,o){const s=Nz(e.models),r=o?.includes("/")?o.slice(o.indexOf("/")+1):o;return{newId:e.id.trim()!==t.id?e.id.trim():void 0,type:e.type,apiKey:e.apiKey.trim()||(n?"":void 0),baseUrl:e.baseUrl.trim()||void 0,defaultModel:r&&s.some(i=>i.model===r)?r:void 0,models:s}}const oNe=Ge({__name:"Skeleton",props:{width:{},height:{},circle:{type:Boolean}},setup(e){return(t,n)=>(g(),S("span",{class:Be(["ui-skeleton",{"is-circle":e.circle}]),style:Wt({width:e.width??"100%",height:e.height??"12px"}),"aria-hidden":"true"},null,6))}}),tM=mt(oNe,[["__scopeId","data-v-f4989189"]]),sNe={key:0,class:"ui-field__label"},rNe={key:1,class:"ui-field__error"},iNe={key:2,class:"ui-field__hint"},lNe=Ge({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-field",{"has-error":!!e.error}])},[e.label?(g(),S("label",sNe,I(e.label),1)):J("",!0),Tn(t.$slots,"default",{},void 0,!0),e.error?(g(),S("span",rNe,I(e.error),1)):e.hint?(g(),S("span",iNe,I(e.hint),1)):J("",!0)],2))}}),hl=mt(lNe,[["__scopeId","data-v-bd93f701"]]),aNe={class:"provider-form__fields"},cNe=["value"],uNe={class:"provider-form__key"},dNe={class:"provider-form__models-head"},fNe={class:"provider-form__models"},pNe={class:"provider-form__model provider-form__model--head"},hNe={key:0,class:"provider-form__row-error",role:"alert"},mNe={key:0,class:"provider-form__error",role:"alert"},gNe={class:"provider-form__actions"},vNe=Ge({__name:"ProviderForm",props:{mode:{},provider:{},config:{}},emits:["dirtyChange","saved","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=eM(),i=Rs(r),l=U({models:{}}),a=U(""),c=U(!1),u=U(!1),d=U(!1),f=U(!1),p=B(()=>X$e.map($=>({value:$,label:s(`providers.types.${$}`)})));function h(){const $=n.provider;if(n.mode==="edit"&&$!==void 0){i.id=$.id,i.type=$.type,i.apiKey="",i.baseUrl=$.baseUrl??"";const T=$z($,n.config?.models);i.models=T.length>0?T:[V7()]}else Object.assign(i,eM());l.value={models:{}},a.value="",o("dirtyChange",!1)}function m($){const T=l.value[$];return T===void 0?"":s(`providers.error.${T}`)}function k($,T){const E=l.value.models[$]?.[T];return E===void 0?"":s(`providers.error.${E}`)}function x($){if(l.value[$]===void 0)return;const{[$]:T,...E}=l.value;l.value={...E,models:l.value.models}}function w($,T){const E=l.value.models[$];if(E?.[T]===void 0)return;const{[T]:N,...C}=E,{[$]:O,...H}=l.value.models;l.value={...l.value,models:Object.keys(C).length>0?{...H,[$]:C}:H}}async function v(){const $=n.provider;if(!(n.mode!=="edit"||$===void 0||!$.hasApiKey))try{const T=await At().getProvider($.id);T.apiKey&&!f.value&&(i.apiKey=T.apiKey,d.value=!0)}catch{d.value=!1}}function b(){o("dirtyChange",!0)}function M(){i.models.push(V7()),b()}function R($){i.models.length<=1||(i.models.splice($,1),l.value={...l.value,models:{}},b())}async function z(){if(c.value)return;const $=Q$e(i,{apiKey:n.mode==="add",baseUrl:n.mode==="add"});if(l.value=$,eNe($)){a.value=$.modelsEmpty===void 0?"":s(`providers.error.${$.modelsEmpty}`);return}c.value=!0,a.value="";try{if(n.mode==="add"){const N=await At().addProvider(tNe(i));o("dirtyChange",!1),o("saved",N.id);return}const T=n.provider;if(T===void 0)return;const E=await At().updateProvider(T.id,nNe(i,T,d.value,n.config?.providers[T.id]?.defaultModel));o("dirtyChange",!1),o("saved",E.provider.id)}catch{a.value=s("providers.saveFailed")}finally{c.value=!1}}return xn(()=>{h(),v()}),($,T)=>(g(),S("form",{class:"provider-form",onSubmit:xt(z,["prevent"]),onInput:b},[_("div",aNe,[Z(hl,{label:y(s)("providers.fieldId"),error:m("id")},{default:ue(()=>[Z(os,{modelValue:i.id,"onUpdate:modelValue":[T[0]||(T[0]=E=>i.id=E),T[1]||(T[1]=E=>x("id"))],autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label","error"]),Z(hl,{label:y(s)("providers.fieldType")},{default:ue(()=>[Z(M4,{modelValue:i.type,"onUpdate:modelValue":T[2]||(T[2]=E=>i.type=E)},{default:ue(()=>[(g(!0),S(Me,null,rt(p.value,E=>(g(),S("option",{key:E.value,value:E.value},I(E.label),9,cNe))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey"),error:m("apiKey")},{default:ue(()=>[_("div",uNe,[Z(os,{modelValue:i.apiKey,"onUpdate:modelValue":[T[3]||(T[3]=E=>i.apiKey=E),T[4]||(T[4]=E=>{f.value=!0,x("apiKey")})],type:u.value?"text":"password",placeholder:e.provider?.hasApiKey?y(s)("providers.apiKeySet"):"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),Z(Zt,{class:"provider-form__eye",size:"sm",label:u.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:T[5]||(T[5]=E=>u.value=!u.value)},{default:ue(()=>[Z(Le,{name:u.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label","error"]),Z(hl,{label:y(s)("providers.fieldBaseUrl"),error:m("baseUrl")},{default:ue(()=>[Z(os,{modelValue:i.baseUrl,"onUpdate:modelValue":[T[6]||(T[6]=E=>i.baseUrl=E),T[7]||(T[7]=E=>x("baseUrl"))],placeholder:y(s)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label","error"])]),_("div",dNe,[_("strong",null,I(y(s)("providers.fieldModels")),1),Z(It,{type:"button",size:"sm",variant:"secondary",onClick:M},{default:ue(()=>[Z(Le,{name:"plus",size:"sm"}),He(I(y(s)("providers.addModel")),1)]),_:1})]),_("div",fNe,[_("div",pNe,[_("span",null,I(y(s)("providers.colModelId")),1),_("span",null,I(y(s)("providers.colContext")),1),_("span",null,I(y(s)("providers.colDisplayName")),1),T[9]||(T[9]=_("span",null,null,-1))]),(g(!0),S(Me,null,rt(i.models,(E,N)=>(g(),S(Me,{key:N},[_("div",{class:Be(["provider-form__model",{"has-error":!!l.value.models[N]}])},[Z(os,{modelValue:E.model,"onUpdate:modelValue":[C=>E.model=C,C=>w(N,"model")],placeholder:y(s)("providers.modelIdPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(os,{modelValue:E.maxContextSize,"onUpdate:modelValue":[C=>E.maxContextSize=C,C=>w(N,"maxContextSize")],inputmode:"numeric",placeholder:y(s)("providers.modelContextPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(os,{modelValue:E.displayName,"onUpdate:modelValue":C=>E.displayName=C,placeholder:y(s)("providers.modelNamePlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(Zt,{size:"sm",disabled:i.models.length<=1,label:y(s)("providers.removeModel"),onClick:C=>R(N)},{default:ue(()=>[Z(Le,{name:"trash",size:"sm"})]),_:1},8,["disabled","label","onClick"])],2),l.value.models[N]?(g(),S("div",hNe,I([k(N,"model"),k(N,"maxContextSize")].filter(Boolean).join(" · ")),1)):J("",!0)],64))),128))]),a.value?(g(),S("div",mNe,I(a.value),1)):J("",!0),_("div",gNe,[Z(It,{type:"button",variant:"secondary",onClick:T[8]||(T[8]=E=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:c.value},{default:ue(()=>[He(I(y(s)("providers.save")),1)]),_:1},8,["loading"])])],32))}}),zz=mt(vNe,[["__scopeId","data-v-66e70e30"]]),wNe={class:"add-provider-flow"},yNe={key:0,class:"add-provider-flow__section"},kNe={key:0,class:"add-provider-flow__state"},bNe={key:1,class:"add-provider-flow__state"},_Ne={class:"add-provider-flow__catalog"},xNe=["disabled","onClick"],SNe={class:"add-provider-flow__name"},CNe={key:0,class:"add-provider-flow__empty"},MNe={class:"add-provider-flow__key"},ANe={key:1,class:"add-provider-flow__warning"},TNe={class:"add-provider-flow__note"},ENe={key:2,class:"add-provider-flow__error",role:"alert"},INe={class:"add-provider-flow__actions"},LNe={class:"add-provider-flow__note"},$Ne={class:"add-provider-flow__key"},NNe={key:0,class:"add-provider-flow__error",role:"alert"},zNe={class:"add-provider-flow__actions"},BNe={key:2,class:"add-provider-flow__section"},RNe=Ge({__name:"AddProviderFlow",props:{config:{},initialSource:{}},emits:["dirtyChange","added","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=U(n.initialSource??"catalog"),i=B(()=>[{value:"catalog",label:s("providers.catalog.sourceCatalog")},{value:"registry",label:s("providers.catalog.sourceRegistry")},{value:"manual",label:s("providers.catalog.sourceManual")}]),l=U([]),a=U("loading"),c=U(""),u=U(null),d=Rs({id:"",apiKey:"",baseUrl:""}),f=U(""),p=U(!1),h=U(!1),m=Rs({url:"",apiKey:""}),k=U(""),x=U(!1),w=U(!1),v=B(()=>{const N=c.value.trim().toLowerCase();return N===""?l.value:l.value.filter(C=>C.name.toLowerCase().includes(N)||C.id.toLowerCase().includes(N))}),b=B(()=>Object.hasOwn(n.config?.providers??{},d.id.trim()));async function M(){a.value="loading";try{l.value=await At().listCatalogProviders(),a.value="ready";const N=l.value.filter(C=>!C.rejected);N.length===1&&u.value===null&&z(N[0])}catch{a.value="error"}}function R(N){const C=N.rejectReason===null?"":`providers.catalog.rejectReason.${N.rejectReason}`;return C!==""&&s(C)!==C?s(C):s("providers.catalog.rejected")}function z(N){N.rejected||(u.value=N,d.id=N.id,d.apiKey="",d.baseUrl="",f.value="")}function $(){o("dirtyChange",!0)}async function T(){const N=u.value;if(N===null||p.value)return;const C=d.id.trim();if(C===""){f.value=s("providers.error.idRequired");return}if(d.apiKey.trim()===""){f.value=s("providers.error.apiKeyRequired");return}if(N.needsBaseUrl&&d.baseUrl.trim()===""){f.value=s("providers.error.baseUrlRequired");return}p.value=!0,f.value="";try{await At().importCatalogProvider({catalogId:N.id,id:C===N.id?void 0:C,apiKey:d.apiKey.trim(),baseUrl:d.baseUrl.trim()||void 0}),o("dirtyChange",!1),o("added",C)}catch{f.value=s("providers.addFailed")}finally{p.value=!1}}async function E(){if(x.value)return;const N=m.url.trim();if(N===""){k.value=s("providers.error.registryUrlRequired");return}x.value=!0,k.value="";try{const C=await At().importCustomRegistry({url:N,apiKey:m.apiKey.trim()||void 0});o("dirtyChange",!1);const O=C.providers[0];O===void 0?o("cancel"):o("added",O.id)}catch{k.value=s("providers.addFailed")}finally{x.value=!1}}return xn(M),(N,C)=>(g(),S("div",wNe,[Z(nr,{modelValue:r.value,"onUpdate:modelValue":C[0]||(C[0]=O=>r.value=O),size:"sm",options:i.value},null,8,["modelValue","options"]),r.value==="catalog"?(g(),S("section",yNe,[a.value==="loading"?(g(),S("div",kNe,[Z(Go,{size:"sm"}),He(I(y(s)("providers.catalog.loading")),1)])):a.value==="error"?(g(),S("div",bNe,[_("span",null,I(y(s)("providers.catalog.loadError")),1),Z(It,{size:"sm",variant:"secondary",onClick:M},{default:ue(()=>[He(I(y(s)("providers.catalog.retry")),1)]),_:1})])):u.value===null?(g(),S(Me,{key:2},[Z(os,{modelValue:c.value,"onUpdate:modelValue":C[1]||(C[1]=O=>c.value=O),placeholder:y(s)("providers.catalog.searchPlaceholder"),autocomplete:"off"},null,8,["modelValue","placeholder"]),_("div",_Ne,[(g(!0),S(Me,null,rt(v.value,O=>(g(),S("button",{key:O.id,type:"button",class:"add-provider-flow__entry",disabled:O.rejected,onClick:H=>z(O)},[_("span",SNe,I(O.name),1),O.wireType?(g(),ce(wi,{key:0,size:"sm",variant:"neutral"},{default:ue(()=>[He(I(O.wireType),1)]),_:2},1024)):J("",!0),C[15]||(C[15]=_("span",{class:"add-provider-flow__grow"},null,-1)),_("span",null,I(O.rejected?R(O):y(s)("providers.modelCount",{count:O.models.length})),1)],8,xNe))),128)),v.value.length===0?(g(),S("div",CNe,I(y(s)("providers.catalog.empty")),1)):J("",!0)])],64)):(g(),S("form",{key:3,class:"add-provider-flow__form",onSubmit:xt(T,["prevent"]),onInput:$},[_("button",{type:"button",class:"add-provider-flow__back",onClick:C[2]||(C[2]=O=>u.value=null)},[Z(Le,{class:"add-provider-flow__back-icon",name:"chevron-right",size:"sm"}),He(I(y(s)("providers.catalog.backToList")),1)]),Z(hl,{label:y(s)("providers.fieldId")},{default:ue(()=>[Z(os,{modelValue:d.id,"onUpdate:modelValue":C[3]||(C[3]=O=>d.id=O),autocomplete:"off"},null,8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey")},{default:ue(()=>[_("div",MNe,[Z(os,{modelValue:d.apiKey,"onUpdate:modelValue":C[4]||(C[4]=O=>d.apiKey=O),type:h.value?"text":"password",autocomplete:"off"},null,8,["modelValue","type"]),Z(Zt,{class:"add-provider-flow__eye",size:"sm",label:h.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:C[5]||(C[5]=O=>h.value=!h.value)},{default:ue(()=>[Z(Le,{name:h.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label"]),u.value.needsBaseUrl?(g(),ce(hl,{key:0,label:y(s)("providers.fieldBaseUrl")},{default:ue(()=>[Z(os,{modelValue:d.baseUrl,"onUpdate:modelValue":C[6]||(C[6]=O=>d.baseUrl=O),placeholder:y(s)("providers.baseUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):J("",!0),b.value?(g(),S("div",ANe,I(y(s)("providers.catalog.overwriteWarning")),1)):J("",!0),_("div",TNe,I(y(s)("providers.catalog.willImport",{count:u.value.models.length})),1),f.value?(g(),S("div",ENe,I(f.value),1)):J("",!0),_("div",INe,[Z(It,{type:"button",variant:"secondary",onClick:C[7]||(C[7]=O=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:p.value},{default:ue(()=>[He(I(y(s)("providers.catalog.importAction")),1)]),_:1},8,["loading"])])],32))])):r.value==="registry"?(g(),S("form",{key:1,class:"add-provider-flow__section add-provider-flow__form",onSubmit:xt(E,["prevent"]),onInput:$},[_("p",LNe,I(y(s)("providers.catalog.registryHint")),1),Z(hl,{label:y(s)("providers.catalog.registryUrlLabel")},{default:ue(()=>[Z(os,{modelValue:m.url,"onUpdate:modelValue":C[8]||(C[8]=O=>m.url=O),placeholder:"https://example.com/api.json",autocomplete:"off"},null,8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey")},{default:ue(()=>[_("div",$Ne,[Z(os,{modelValue:m.apiKey,"onUpdate:modelValue":C[9]||(C[9]=O=>m.apiKey=O),type:w.value?"text":"password",autocomplete:"off"},null,8,["modelValue","type"]),Z(Zt,{class:"add-provider-flow__eye",size:"sm",label:w.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:C[10]||(C[10]=O=>w.value=!w.value)},{default:ue(()=>[Z(Le,{name:w.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label"]),k.value?(g(),S("div",NNe,I(k.value),1)):J("",!0),_("div",zNe,[Z(It,{type:"button",variant:"secondary",onClick:C[11]||(C[11]=O=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:x.value},{default:ue(()=>[He(I(y(s)("providers.catalog.importAction")),1)]),_:1},8,["loading"])])],32)):(g(),S("div",BNe,[Z(zz,{mode:"add",config:e.config,onDirtyChange:C[12]||(C[12]=O=>o("dirtyChange",O)),onSaved:C[13]||(C[13]=O=>o("added",O)),onCancel:C[14]||(C[14]=O=>o("cancel"))},null,8,["config"])]))]))}}),Bz=mt(RNe,[["__scopeId","data-v-01edc4ef"]]),FNe={class:"providers-panel"},jNe={class:"providers-panel__heading"},ONe={key:1,class:"providers-panel__split"},PNe=["aria-label"],HNe={class:"providers-pane-label"},DNe=["aria-label"],VNe=["data-testid","aria-current","onClick"],WNe=["aria-label"],qNe={"aria-hidden":"true"},UNe={class:"providers-panel__row-name"},ZNe={class:"providers-pane-label"},KNe=["aria-current"],GNe={class:"providers-panel__add-icon"},YNe={class:"providers-panel__row-name"},XNe={class:"providers-panel__detail"},JNe={class:"providers-detail__head"},QNe={class:"providers-detail__tile","aria-hidden":"true"},eze={class:"providers-detail__identity"},tze={class:"providers-detail__name-row"},nze={class:"providers-detail__meta"},oze={class:"mono"},sze={class:"providers-detail__sec"},rze={class:"providers-detail__sec-head"},ize={class:"providers-pane-label"},lze={class:"providers-detail__count"},aze={key:0,class:"providers-model-card"},cze={key:0,class:"providers-model-name"},uze={key:1,class:"providers-detail__empty"},dze={class:"providers-detail__sec"},fze={class:"providers-detail__foot"},nM="$add",pze=Ge({__name:"ProvidersPanel",props:{discardToken:{default:0}},emits:["dirtyChange"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),{confirm:s}=y1(),r=b1(),i=U([]),l=U(null),a=U(!1),c=U(!1),u=U(null),d=U(!1),f=B(()=>i.value.toSorted((T,E)=>T.id.localeCompare(E.id))),p=B(()=>u.value===nM),h=B(()=>f.value.find(T=>T.id===u.value)??null),m=B(()=>{const T=h.value;if(!T?.models?.length)return[];const E=new Map($z(T,l.value?.models).map(N=>[N.model,N.maxContextSize]));return T.models.map(N=>{const C=E.get(N)?.trim()??"";return{id:N,contextBadge:k(C)}})});function k(T){if(!T||!/^\d+$/.test(T))return;const E=Number(T);if(!(!Number.isFinite(E)||E<=0))return E>=1e6?`${x(E/1e6)}M`:E>=1e3?`${x(E/1e3)}K`:String(E)}function x(T){return String(Number(T.toFixed(1)))}function w(T){return T==="connected"?"ok":T==="error"?"error":"idle"}function v(T){return(T.trim()[0]??"?").toUpperCase()}Ue(d,T=>n("dirtyChange",T),{immediate:!0}),Ue(()=>e.discardToken,()=>{d.value=!1,u.value=f.value[0]?.id??null});async function b(){await r.refreshRuntimeState(),await M()}async function M(){a.value=!0,c.value=!1;try{i.value=await At().listProviders(),f.value.some(T=>T.id===u.value)||(u.value=f.value[0]?.id??null)}catch{i.value=[],c.value=!0}try{l.value=await At().getConfig()}catch{l.value=null}finally{a.value=!1}}function R(T){d.value||(u.value=T)}async function z(T){d.value=!1,await b(),u.value=T}async function $(T){await s({title:o("providers.deleteProvider"),message:o("providers.deleteConfirm",{id:T.id,count:T.models?.length??0}),confirmLabel:o("providers.deleteConfirmYes"),cancelLabel:o("common.cancel"),variant:"danger",action:async()=>{await At().deleteProvider(T.id),u.value=null,d.value=!1,await b()}})}return xn(M),(T,E)=>(g(),S("section",FNe,[_("div",jNe,[_("div",null,[_("h3",null,I(y(o)("providers.title")),1),_("p",null,I(y(o)("providers.description")),1)]),!a.value&&!c.value?(g(),ce(Zt,{key:0,size:"sm",label:y(o)("providers.refresh"),"data-testid":"providers-refresh",onClick:E[0]||(E[0]=N=>b())},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"})]),_:1},8,["label"])):J("",!0)]),c.value?(g(),ce(z9,{key:0,variant:"warning"},{default:ue(()=>[He(I(y(o)("providers.unavailable")),1)]),_:1})):(g(),S("div",ONe,[_("nav",{class:"providers-panel__list","aria-label":y(o)("providers.title")},[_("div",HNe,I(y(o)("settings.tabs.providers")),1),a.value?(g(),S(Me,{key:0},rt(3,N=>_("div",{key:N,class:"providers-panel__row providers-panel__row--skeleton",role:"status","aria-label":y(o)("providers.loading")},[Z(tM,{width:"26px",height:"26px",circle:""}),Z(tM,{width:`${52-N*6}%`,height:"11px"},null,8,["width"])],8,DNe)),64)):(g(),S(Me,{key:1},[(g(!0),S(Me,null,rt(f.value,N=>(g(),S("button",{key:N.id,type:"button",class:Be(["providers-panel__row",{"is-selected":u.value===N.id}]),"data-testid":`provider-${N.id}-toggle`,"aria-current":u.value===N.id,onClick:C=>R(N.id)},[Z(Cn,{text:y(o)(`providers.status.${N.status}`)},{default:ue(()=>[_("span",{class:Be(["providers-panel__tile",`is-${w(N.status)}`]),role:"img","aria-label":y(o)(`providers.status.${N.status}`)},[_("span",qNe,I(v(N.type)),1)],10,WNe)]),_:2},1032,["text"]),_("span",UNe,I(N.id),1),_("span",{class:Be(["providers-panel__row-dot",`is-${w(N.status)}`]),"aria-hidden":"true"},null,2)],10,VNe))),128)),_("div",ZNe,I(y(o)("providers.customProviders")),1),_("button",{type:"button",class:Be(["providers-panel__row providers-panel__row--add",{"is-selected":p.value}]),"aria-current":p.value,onClick:E[1]||(E[1]=N=>R(nM))},[_("span",GNe,[Z(Le,{name:"plus",size:"sm"})]),_("span",YNe,I(y(o)("providers.addProvider")),1)],10,KNe)],64))],8,PNe),_("div",XNe,[p.value?(g(),ce(Bz,{key:0,config:l.value,onDirtyChange:E[2]||(E[2]=N=>d.value=N),onAdded:z,onCancel:E[3]||(E[3]=N=>{u.value=f.value[0]?.id??null,d.value=!1})},null,8,["config"])):h.value?(g(),S(Me,{key:1},[_("header",JNe,[_("span",QNe,I(v(h.value.type)),1),_("div",eze,[_("div",tze,[_("h4",null,I(h.value.id),1),Z(wi,{variant:h.value.status==="connected"?"success":h.value.status==="error"?"danger":"neutral",size:"md"},{default:ue(()=>[He(I(y(o)(`providers.status.${h.value.status}`)),1)]),_:1},8,["variant"])]),_("p",nze,[_("span",null,I(h.value.type),1),h.value.baseUrl?(g(),S(Me,{key:0},[E[7]||(E[7]=_("span",{"aria-hidden":"true"},"·",-1)),_("span",oze,I(h.value.baseUrl),1)],64)):J("",!0)])])]),_("section",sze,[_("div",rze,[_("span",ize,I(y(o)("providers.fieldModels")),1),_("span",lze,I(y(o)("providers.modelCount",{count:h.value.models?.length??0})),1)]),m.value.length>0?(g(),S("div",aze,[(g(!0),S(Me,null,rt(m.value,N=>(g(),S("div",{key:N.id,class:"providers-model-row"},[_("code",null,I(N.id),1),N.displayName?(g(),S("span",cze,I(N.displayName),1)):J("",!0),E[8]||(E[8]=_("span",{class:"providers-model-grow"},null,-1)),N.contextBadge?(g(),ce(wi,{key:1,variant:"neutral",size:"sm"},{default:ue(()=>[He(I(N.contextBadge),1)]),_:2},1024)):J("",!0)]))),128))])):(g(),S("p",uze,I(y(o)("providers.noModels")),1))]),_("section",dze,[Z(zz,{mode:"edit",provider:h.value,config:l.value,onDirtyChange:E[4]||(E[4]=N=>d.value=N),onSaved:z,onCancel:E[5]||(E[5]=N=>{u.value=f.value[0]?.id??null,d.value=!1})},null,8,["provider","config"])]),_("footer",fze,[Z(It,{variant:"danger-soft",size:"sm","data-testid":`provider-${h.value.id}-delete`,onClick:E[6]||(E[6]=N=>$(h.value))},{default:ue(()=>[Z(Le,{name:"trash",size:"sm"}),He(I(y(o)("providers.deleteProvider")),1)]),_:1},8,["data-testid"])])],64)):i.value.length===0&&!a.value?(g(),ce(Sg,{key:2,title:y(o)("providers.empty"),hint:y(o)("providers.emptyHint")},{icon:ue(()=>[Z(Le,{name:"bolt"})]),_:1},8,["title","hint"])):J("",!0)])]))]))}}),hze=mt(pze,[["__scopeId","data-v-66a5ed6a"]]),mze=["aria-expanded","aria-label","disabled"],gze=["aria-label"],vze=["aria-label"],wze=["aria-selected"],yze={class:"sm-picker__option-label"},kze={class:"sm-picker__group"},bze=["aria-selected","onMouseenter","onClick"],_ze={class:"sm-picker__option-label"},xze=["aria-label"],Sze={class:"sm-picker__group"},Cze=["aria-selected","onMouseenter","onClick"],Mze={class:"sm-picker__option-label"},Aze=250,Tze=188,Eze=Ge({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{},disabled:{type:Boolean}},emits:["inherit","select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),r=`sm-picker-${Math.random().toString(36).slice(2,9)}`,i=U(null),l=U(null),a=U(null),c=U(!1),u=U(!1),d=U({}),f=U(null),p=U(""),h=U(0),m=U("models"),k=U(0),x=U(0),w=U("right"),v=new Map;let b=null;const M=B(()=>[{id:"",label:s("settings.noSecondaryModel")},...n.groups.flatMap(Y=>Y.options)]),R=B(()=>n.modelValue?M.value.find(Y=>Y.id===n.modelValue)?.label??n.modelValue:""),z=B(()=>n.modelValue?n.effort?`${R.value} · ${n.effort}`:R.value:s("settings.noSecondaryModel")),$=B(()=>{const Y=f.value;if(Y===null||Y==="")return[];const ne=Zp(n.modelInfoById[Y]),D=n.effort===""?[null,...ne]:[...ne];return n.modelValue===Y&&n.effort!==""&&!ne.includes(n.effort)&&D.push(n.effort),D});function T(Y){return n.modelValue!==f.value?!1:Y===null?n.effort==="":n.effort===Y}function E(){const Y=$.value.findIndex(T);return Y>=0?Y:0}function N(Y,ne){Y instanceof HTMLElement?v.set(ne,Y):v.delete(ne)}function C(){b!==null&&(clearTimeout(b),b=null)}function O(){C(),b=setTimeout(()=>{f.value=null,m.value==="efforts"&&(m.value="models")},Aze)}function H(Y){Y!==p.value&&(p.value=Y,h.value=Math.max(0,M.value.findIndex(ne=>ne.id===Y)))}function V(){const Y=i.value,ne=l.value;if(!Y||!ne)return;const D=Y.getBoundingClientRect(),X=ne.offsetHeight,ve=window.innerHeight-D.bottom;u.value=veX;const fe=Math.max(8,window.innerWidth-D.right);d.value=u.value?{right:`${fe}px`,bottom:`${window.innerHeight-D.top+4}px`,top:"auto"}:{right:`${fe}px`,top:`${D.bottom+4}px`,bottom:"auto"}}function A(){const Y=l.value,ne=f.value===null?void 0:v.get(f.value);if(!Y||!ne)return;const D=Y.getBoundingClientRect(),X=ne.getBoundingClientRect(),ve=a.value?.offsetHeight??0,fe=Math.max(0,window.innerHeight-8-ve-D.top);x.value=Math.max(0,Math.min(X.top-D.top-4,Y.offsetHeight-40,fe));const pe=window.innerWidth-D.right;w.value=pe>=Tze||pe>=D.left?"right":"left"}function F(){c.value||n.disabled||(c.value=!0,p.value=n.modelValue||M.value[0]?.id||"",h.value=Math.max(0,M.value.findIndex(Y=>Y.id===p.value)),f.value=null,m.value="models",vt(V))}function j({restoreFocus:Y=!1}={}){c.value&&(C(),c.value=!1,f.value=null,Y&&vt(()=>i.value?.focus()))}function q(){c.value?j({restoreFocus:!0}):F()}function P(){f.value=null,m.value="models"}function W(Y,{moveFocus:ne=!1}={}){if(H(Y),C(),Y===""){f.value=null,m.value="models";return}f.value=Y,vt(A),ne&&(m.value="efforts",k.value=E())}function G(Y){const ne=f.value;if(ne===null)return;const D={model:ne,...Y===null?{}:{effort:Y}};(D.model!==n.modelValue||(D.effort??"")!==n.effort)&&o("select",D),j({restoreFocus:!0})}function ee(){o("inherit"),j({restoreFocus:!0})}function se(){vt(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function oe(Y){const ne=M.value;if(ne.length===0)return;const D=ne[(h.value+Y+ne.length)%ne.length];H(D.id),f.value!==null&&W(D.id),se()}function Q(Y){const ne=$.value;ne.length!==0&&(k.value=(k.value+Y+ne.length)%ne.length,se())}function ge(Y){if(!c.value){(Y.key==="Enter"||Y.key===" "||Y.key==="ArrowDown")&&(Y.preventDefault(),F());return}if(Y.key==="ArrowDown")Y.preventDefault(),m.value==="models"?oe(1):Q(1);else if(Y.key==="ArrowUp")Y.preventDefault(),m.value==="models"?oe(-1):Q(-1);else if(Y.key==="ArrowRight")Y.preventDefault(),p.value!==""&&W(p.value,{moveFocus:!0});else if(Y.key==="ArrowLeft")Y.preventDefault(),f.value!==null&&P();else if(Y.key==="Enter"||Y.key===" ")Y.preventDefault(),m.value==="models"&&p.value===""?ee():m.value==="models"?W(p.value,{moveFocus:!0}):G($.value[k.value]??null);else if(Y.key==="Home"||Y.key==="End"){Y.preventDefault();const ne=Y.key==="Home";if(m.value==="models"){const D=M.value;if(D.length===0)return;const X=(ne?D[0]:D.at(-1)).id;H(X),f.value!==null&&W(X)}else k.value=ne?0:$.value.length-1;se()}else Y.key==="Escape"&&(Y.preventDefault(),j({restoreFocus:!0}))}function xe(Y){const ne=Y.target;ne instanceof Node&&(i.value?.contains(ne)||l.value?.contains(ne)||j())}function Ke(Y){if(c.value){if(l.value?.contains(Y.target instanceof Node?Y.target:null)){A();return}j(),V()}}function et(){c.value&&V()}return xn(()=>{document.addEventListener("pointerdown",xe),document.addEventListener("scroll",Ke,!0),window.addEventListener("resize",et)}),An(()=>{document.removeEventListener("pointerdown",xe),document.removeEventListener("scroll",Ke,!0),window.removeEventListener("resize",et),C()}),(Y,ne)=>(g(),S("div",{class:Be(["sm-picker",{"is-open":c.value}])},[_("button",{ref_key:"triggerRef",ref:i,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":r,"aria-expanded":c.value,"aria-haspopup":"dialog","aria-label":y(s)("settings.secondaryModel"),disabled:e.disabled,onClick:q,onKeydown:ge},[_("span",{class:Be(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[_("span",null,I(z.value),1)],2),Z(Le,{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,mze),(g(),ce(Gi,{to:"body"},[c.value?(g(),S("div",{key:0,id:r,ref_key:"menuRef",ref:l,class:Be(["sm-picker__menu",{"sm-picker__menu--up":u.value}]),style:Wt(d.value),role:"dialog","aria-label":y(s)("settings.secondaryModel")},[_("div",{class:"sm-picker__models",role:"listbox","aria-label":y(s)("settings.secondaryModel")},[_("button",{ref:D=>N(D,""),type:"button",class:Be(["sm-picker__option",{"is-selected":e.modelValue==="","is-active":p.value==="","is-kb-active":m.value==="models"&&p.value===""}]),role:"option","aria-selected":e.modelValue==="",onMouseenter:ne[0]||(ne[0]=D=>W("")),onClick:ee},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",yze,I(y(s)("settings.noSecondaryModel")),1)],42,wze),ne[1]||(ne[1]=_("div",{class:"sm-picker__divider"},null,-1)),(g(!0),S(Me,null,rt(e.groups,D=>(g(),S(Me,{key:D.provider},[_("div",kze,I(D.provider),1),(g(!0),S(Me,null,rt(D.options,X=>(g(),S("button",{key:X.id,ref_for:!0,ref:ve=>N(ve,X.id),type:"button",class:Be(["sm-picker__option",{"is-selected":X.id===e.modelValue,"is-active":X.id===p.value,"is-kb-active":m.value==="models"&&X.id===p.value}]),role:"option","aria-selected":X.id===e.modelValue,onMouseenter:ve=>W(X.id),onMouseleave:O,onClick:ve=>W(X.id,{moveFocus:!0})},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",_ze,I(X.label),1),Z(Le,{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,bze))),128))],64))),128))],8,vze),f.value!==null?(g(),S("div",{key:0,ref_key:"flyoutRef",ref:a,class:Be(["sm-picker__flyout",`sm-picker__flyout--${w.value}`]),style:Wt({top:`${x.value}px`}),role:"listbox","aria-label":y(s)("settings.secondaryModelEffort"),onMouseenter:C,onMouseleave:O},[_("div",Sze,I(y(s)("settings.secondaryModelEffort")),1),(g(!0),S(Me,null,rt($.value,(D,X)=>(g(),S("button",{key:D??"__default__",type:"button",class:Be(["sm-picker__option",{"is-selected":T(D),"is-kb-active":m.value==="efforts"&&X===k.value,"is-muted":D===null}]),role:"option","aria-selected":T(D),onMouseenter:ve=>{m.value="efforts",k.value=X},onClick:ve=>G(D)},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",Mze,I(D??y(s)("settings.secondaryModelEffortAuto")),1)],42,Cze))),128))],46,xze)):J("",!0)],14,gze)):J("",!0)]))],2))}}),Ize=mt(Eze,[["__scopeId","data-v-5b749db7"]]),Lze=["aria-label"],$ze=["aria-selected","onClick"],Nze={class:"body"},zze={class:"panel"},Bze={class:"sec"},Rze={class:"sec-title"},Fze={class:"row"},jze={class:"rlabel"},Oze={class:"row"},Pze={class:"rlabel"},Hze={class:"row"},Dze={class:"rlabel"},Vze={class:"sec"},Wze={class:"sec-title"},qze={class:"row"},Uze={class:"rlabel"},Zze={key:0,class:"hint"},Kze={class:"row"},Gze={class:"rlabel"},Yze={key:0,class:"hint"},Xze={class:"row"},Jze={class:"rlabel"},Qze={key:0,class:"hint"},eBe={class:"row"},tBe={class:"rlabel"},nBe={class:"panel"},oBe={class:"sec"},sBe={class:"sec-title"},rBe={class:"row"},iBe={class:"rlabel"},lBe={key:0,class:"rvalue"},aBe={class:"actions"},cBe={class:"panel"},uBe={class:"panel"},dBe={class:"sec"},fBe={class:"sec-head"},pBe={class:"sec-title"},hBe={key:0,class:"saving"},mBe={class:"row"},gBe={class:"rlabel"},vBe={class:"hint"},wBe={key:0,class:"select-wrap"},yBe={key:0,value:"",disabled:""},kBe=["label"],bBe=["value"],_Be={key:1,class:"rvalue mono"},xBe={key:0,class:"sec"},SBe={class:"sec-title"},CBe={class:"row"},MBe={class:"rlabel"},ABe={class:"hint"},TBe={key:1,class:"rvalue"},EBe={key:0,class:"row"},IBe={class:"rlabel"},LBe={class:"hint"},$Be={class:"row"},NBe={class:"rlabel"},zBe={class:"hint"},BBe={class:"row"},RBe={class:"rlabel"},FBe={class:"hint"},jBe={class:"row"},OBe={class:"rlabel"},PBe={class:"hint"},HBe={class:"row"},DBe={class:"rlabel"},VBe={class:"hint"},WBe={key:1,class:"empty-config"},qBe={class:"panel"},UBe={class:"sec"},ZBe={class:"sec-title"},KBe={class:"row"},GBe={class:"rlabel"},YBe={class:"hint"},XBe={class:"rvalue mono"},JBe={class:"row"},QBe={class:"rlabel"},eRe={class:"hint"},tRe={class:"value-wrap"},nRe={class:"rvalue mono"},oRe={class:"row"},sRe={class:"rlabel"},rRe={class:"hint"},iRe={class:"value-wrap"},lRe={class:"rvalue mono"},aRe={class:"row"},cRe={class:"rlabel"},uRe={class:"rvalue mono"},dRe={key:0,class:"sec"},fRe={key:0,class:"row"},pRe={class:"rlabel"},hRe={class:"hint"},mRe={class:"hint"},gRe={class:"sec"},vRe={class:"sec-title"},wRe={class:"row"},yRe={class:"rlabel"},kRe={key:0,class:"hint"},bRe={class:"row"},_Re={class:"rlabel"},xRe={class:"panel"},SRe={key:0,class:"sec"},CRe={class:"sec-title"},MRe={"data-testid":"desktop-update-controls",class:"desktop-update-card"},ARe={class:"desktop-update-row desktop-update-summary"},TRe={class:"desktop-update-summary-copy"},ERe={class:"desktop-update-icon","aria-hidden":"true"},IRe={class:"rlabel"},LRe={class:"desktop-update-title","aria-live":"polite"},$Re={class:"hint"},NRe={class:"desktop-update-row"},zRe={class:"rlabel"},BRe={class:"hint"},RRe={class:"select-wrap desktop-update-select"},FRe=["value"],jRe={class:"desktop-update-row"},ORe={class:"rlabel"},PRe={class:"hint"},HRe={class:"desktop-update-row"},DRe={class:"rlabel"},VRe={class:"hint"},WRe={key:0,class:"desktop-update-detail"},qRe={key:0,class:"desktop-update-progress"},URe=["aria-label"],ZRe=["value","aria-label"],KRe={"data-testid":"settings-update-progress-detail"},GRe={class:"desktop-update-actions"},YRe={class:"panel"},XRe={class:"sec"},JRe={class:"sec-title"},QRe={class:"row"},eFe={class:"rlabel"},tFe={class:"hint"},nFe={class:"row"},oFe={class:"rlabel"},sFe={class:"hint"},rFe={key:0,class:"flag-chip"},iFe={key:1,class:"flag-chip flag-chip--warn"},lFe={class:"row"},aFe={class:"rlabel"},cFe={class:"hint"},uFe={key:0,class:"flag-chip"},dFe={key:1,class:"flag-chip flag-chip--warn"},fFe={key:1,class:"empty-config"},pFe={class:"panel"},hFe={class:"panel-head"},mFe={class:"panel-title"},gFe={class:"panel-desc"},vFe={class:"archive-toolbar"},wFe={class:"archive-search"},yFe=["placeholder"],kFe={value:"all"},bFe=["value"],_Fe={key:0,class:"archive-empty"},xFe={key:0,class:"archive-list"},SFe={class:"archive-workspace"},CFe={class:"path"},MFe={class:"count"},AFe={class:"setting-card"},TFe={class:"archive-meta"},EFe={class:"archive-name"},IFe={class:"archive-time"},LFe={key:1,class:"archive-empty"},$Fe=100,NFe=Ge({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{},experimentalFlagStates:{},initialTab:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,r=U(o.initialTab??"general"),i=B(()=>l9(o.uiFontSize)),l=typeof window>"u"?void 0:window.pythinkerDesktop,a=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"cute-bot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"lab",labelKey:"settings.tabs.lab",icon:"flask"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"},...l===void 0?[]:[{id:"update",labelKey:"settings.tabs.update",icon:"update-available"}],{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"}],c=p$().serverHttpUrl,u="0.1.2".trim()?"0.1.2":"0.0.0-dev",d=U(),f=U(!1),p=U();let h;const m=B(()=>d.value?.installedVersion??u),k=U(null),x=B(()=>k.value?.serverVersion||o.serverVersion||"-"),w=B(()=>k.value?.backend??o.backend??"v1"),v=B(()=>w.value==="v2"?"agent-gateway":"server"),b=U(!1),M=U(!1),R=U(0),{confirm:z,current:$}=y1(),T=["manual","yolo","auto"],E={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},N=U(null);Lz(N);function C(Ze){Ze.key==="Escape"&&$.value===null&&$t()}xn(()=>{document.addEventListener("keydown",C),D(),l!==void 0&&(h=l.onUpdateState(Ze=>{d.value=Ze}),l.getUpdateState().then(Ze=>{d.value=Ze}))}),An(()=>{document.removeEventListener("keydown",C),h?.(),kn!==null&&clearTimeout(kn)});const O=B(()=>{const Ze=d.value;if(Ze===void 0)return n("settings.desktop.loading");switch(Ze.status){case"disabled":return n("settings.desktop.disabled");case"checking":return n("settings.desktop.checking");case"available":return n("settings.desktop.available",{version:Ze.availableVersion});case"downloading":return n("settings.desktop.downloading",{version:Ze.availableVersion});case"downloaded":return n("settings.desktop.downloaded",{version:Ze.availableVersion});case"skipped":return n("settings.desktop.skipped",{version:Ze.skippedVersion??Ze.availableVersion});case"error":return Ze.message??n("settings.desktop.errorGeneric");default:return n("settings.desktop.upToDate")}}),H=B(()=>{const Ze=d.value?.percent;return Ze===void 0||!Number.isFinite(Ze)?void 0:Math.min(100,Math.max(0,Ze))}),V=["stable","beta","nightly"],A=B(()=>{const Ze=d.value?.status;return f.value||Ze===void 0||Ze==="checking"||Ze==="downloading"||Ze==="downloaded"}),F=B(()=>{const Ze=d.value?.status;return f.value||Ze===void 0||Ze==="disabled"||Ze==="checking"||Ze==="downloading"||Ze==="downloaded"}),j=B(()=>{const Ze=d.value?.lastCheckedAt;if(Ze===void 0)return n("settings.desktop.neverChecked");const Qe=new Date(Ze);return Number.isNaN(Qe.getTime())?n("settings.desktop.neverChecked"):n("settings.desktop.lastChecked",{time:new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}).format(Qe)})});function q(Ze){const Qe=["B","KB","MB","GB"];let ct=Math.max(0,Ze),mn=0;for(;ct>=1024&&mn{const Ze=d.value;if(Ze?.status!=="downloading")return"";const Qe=[];return H.value!==void 0&&Qe.push(`${Math.round(H.value)}%`),Ze.transferred!==void 0&&Ze.total!==void 0?Qe.push(n("settings.desktop.bytesOfTotal",{transferred:q(Ze.transferred),total:q(Ze.total)})):Ze.transferred!==void 0&&Qe.push(q(Ze.transferred)),Ze.bytesPerSecond!==void 0&&Qe.push(`${q(Ze.bytesPerSecond)}/s`),Qe.join(" · ")}),W=B(()=>p.value!==void 0?p.value:d.value?.status==="error"?O.value:void 0);async function G(Ze){if(!f.value){f.value=!0,p.value=void 0;try{d.value=await Ze()}catch(Qe){p.value=Qe instanceof Error?Qe.message:String(Qe)}finally{f.value=!1}}}function ee(Ze){l!==void 0&&G(()=>l.setAutoUpdate(Ze))}function se(Ze){l!==void 0&&V.includes(Ze)&&G(()=>l.setUpdateChannel(Ze))}function oe(Ze){l!==void 0&&G(()=>l.setNotifyUpdate(Ze))}function Q(){l!==void 0&&G(()=>l.checkForUpdates())}function ge(){l!==void 0&&G(()=>l.downloadUpdate())}function xe(){const Ze=d.value?.availableVersion;l!==void 0&&Ze!==void 0&&G(()=>l.skipUpdate(Ze))}function Ke(){l!==void 0&&G(()=>l.undoSkippedUpdate())}function et(){const Ze=d.value?.availableVersion;l!==void 0&&Ze!==void 0&&G(()=>l.openUpdateReleaseNotes(Ze))}function Y(){l!==void 0&&G(()=>l.restartToUpdate())}let ne=0;async function D(){const Ze=++ne;let Qe;try{Qe=await At().getMeta()}catch{Qe=null}Ze===ne&&(k.value=Qe)}Ue(()=>o.config,()=>{D()});function X(){iN()}const ve=B(()=>{const Ze=new Map;for(const Qe of o.models??[])Ze.set(Qe.id,{id:Qe.id,label:Qe.displayName??Qe.model??Qe.id,provider:Qe.provider});for(const[Qe,ct]of Object.entries(o.config?.models??{})){if(Ze.has(Qe))continue;const mn=te(ct);Ze.set(Qe,{id:Qe,label:de(Qe,ct,mn),provider:mn??Qe})}return Array.from(Ze.values())}),fe=B(()=>{const Ze=new Map;for(const Qe of ve.value){const ct=Ze.get(Qe.provider)??[];ct.push(Qe),Ze.set(Qe.provider,ct)}for(const[Qe,ct]of Ze)Ze.set(Qe,ct.toSorted((mn,_o)=>mn.label.localeCompare(_o.label)));return Array.from(Ze.entries()).toSorted(([Qe],[ct])=>Qe.localeCompare(ct)).map(([Qe,ct])=>({provider:Qe,options:ct}))}),pe=B(()=>{const Ze=o.config?.defaultPermissionMode;return Ze==="auto"||Ze==="yolo"||Ze==="manual"?Ze:"manual"});function te(Ze){if(!Ze||typeof Ze!="object")return;const Qe=Ze;return typeof Qe.provider=="string"?Qe.provider:void 0}function de(Ze,Qe,ct){if(!Qe||typeof Qe!="object")return Ze;const mn=Qe,_o=typeof mn.model=="string"?mn.model:void 0,Un=ct??te(Qe);return _o&&Un?`${Ze} (${Un}/${_o})`:_o?`${Ze} (${_o})`:Ze}function ye(Ze){return Ze===!0}function Ce(Ze){!Ze||Ze===o.config?.defaultModel||s("updateConfig",{defaultModel:Ze})}function me(Ze){Ze!==pe.value&&s("updateConfig",{defaultPermissionMode:Ze})}function be(Ze){const Qe=o.config?.[Ze];s("updateConfig",{[Ze]:!ye(Qe)})}function re(){const Ze=o.config?.thinking;return!Ze||typeof Ze!="object"?!0:Ze.enabled!==!1}function ke(){s("updateConfig",{thinking:{enabled:!re()}})}function Fe(){const Ze=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!Ze})}async function at(Ze){Ze!==r.value&&await dt()&&(r.value=Ze)}async function dt(){if(!M.value)return!0;const Ze=await z({title:n("providers.unsavedTitle"),message:n("providers.unsavedBody"),confirmLabel:n("providers.unsavedDiscard"),cancelLabel:n("providers.unsavedStay"),variant:"danger"});return Ze&&(M.value=!1,R.value+=1),Ze}async function $t(){await dt()&&s("close")}function Tt(){return[`App version: ${m.value}`,`Server version: ${x.value}`,`Backend: ${w.value}`,`Server address: ${c}`,`Server ID: ${k.value?.serverId||"-"}`,`User agent: ${typeof navigator>"u"?"-":navigator.userAgent}`].join(` -`)}async function Qt(){b.value=await ss(Tt())}const Dt=U(!1),en=U(!1);let kn=null;function In(){kn!==null&&clearTimeout(kn),kn=setTimeout(()=>{Dt.value=!1,en.value=!1,kn=null},1500)}async function Mn(){await ss(x.value)&&(Dt.value=!0,In())}async function Re(){await ss(c)&&(en.value=!0,In())}const lt=B(()=>on("secondary-model")),tt=B(()=>o.config?.secondaryModel?.defaultModel??o.config?.secondaryModel?.model??""),ht=B(()=>o.config?.secondaryModel?.defaultEffort??""),bt=B(()=>o.config?.secondaryModel?.force===!0),Rt=B(()=>Object.fromEntries((o.models??[]).map(Ze=>[Ze.id,Ze])));function on(Ze){return o.config?.experimental?.[Ze]===!0}function an(Ze){return k.value?.experimentalFlagStates?.find(ct=>ct.id===Ze)??o.experimentalFlagStates?.find(ct=>ct.id===Ze)}function sn(Ze,Qe){const ct={...o.config?.experimental,[Ze]:Qe};s("updateConfig",{experimental:ct})}function Yn(Ze,Qe,ct){const mn={defaultModel:Ze,force:ct};return Qe&&(mn.defaultEffort=Qe),mn}function Kt(Ze){const Qe=Ze.effort??"";if(o.config?.secondaryModel?.defaultModel===Ze.model&&Qe===ht.value)return;const ct=Yn(Ze.model,Qe,bt.value);s("updateConfig",{secondaryModel:ct})}function no(Ze){if(!tt.value||Ze===bt.value)return;const Qe=Yn(tt.value,ht.value,Ze);s("updateConfig",{secondaryModel:Qe})}function As(){o.config?.secondaryModel!==void 0&&s("updateConfig",{secondaryModel:null})}function ys(Ze){const Qe=zN(Ze);Qe!==void 0&&s("setUiFontSize",Qe)}const ao=b1(),co=U([]),oo=U(!1),Ct=U(!1),so=U(""),Bn=U("all"),Pn=U("archived-desc");async function js(){if(!(oo.value||Ct.value)){oo.value=!0;try{const Ze=[];let Qe;for(;;){const ct=await ao.loadArchivedSessions({beforeId:Qe,pageSize:$Fe});if(Ze.push(...ct.items),!ct.hasMore||ct.items.length===0)break;const mn=ct.items.at(-1)?.id;if(mn===void 0)break;Qe=mn}co.value=Ze,Ct.value=!0}catch(Ze){console.warn("loadAllArchived failed",Ze)}finally{oo.value=!1}}}Ue(r,Ze=>{Ze==="archived"&&!Ct.value&&js()});const Os=B(()=>{const Ze=new Set;for(const Qe of co.value)Ze.add(Qe.cwd);return Array.from(Ze).toSorted((Qe,ct)=>Qe.localeCompare(ct))}),Ts=B(()=>{const Ze=so.value.trim().toLowerCase();let Qe=co.value.filter(ct=>ct.archived===!0);return Bn.value!=="all"&&(Qe=Qe.filter(ct=>ct.cwd===Bn.value)),Ze&&(Qe=Qe.filter(ct=>ct.title.toLowerCase().includes(Ze))),Pn.value==="archived-desc"?Qe.toSorted((ct,mn)=>mn.updatedAt.localeCompare(ct.updatedAt)):Pn.value==="created-desc"?Qe.toSorted((ct,mn)=>mn.createdAt.localeCompare(ct.createdAt)):Qe.toSorted((ct,mn)=>ct.title.localeCompare(mn.title,"en"))}),ks=B(()=>{const Ze=new Map;for(const Qe of Ts.value){const ct=Ze.get(Qe.cwd)??[];ct.push(Qe),Ze.set(Qe.cwd,ct)}return Array.from(Ze.entries()).map(([Qe,ct])=>({cwd:Qe,items:ct}))});async function Lo(Ze){await ao.restoreSession(Ze)&&(co.value=co.value.filter(ct=>ct.id!==Ze))}function Ro(Ze){const Qe=new Date(Ze);if(Number.isNaN(Qe.getTime()))return Ze;const ct=mn=>String(mn).padStart(2,"0");return`${Qe.getFullYear()}-${ct(Qe.getMonth()+1)}-${ct(Qe.getDate())} ${ct(Qe.getHours())}:${ct(Qe.getMinutes())}`}return(Ze,Qe)=>(g(),ce(T0,{open:!0,"close-on-esc":!1,title:y(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:$t},{default:ue(()=>[_("div",{ref_key:"dialogRef",ref:N,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":y(n)("settings.title")},[(g(),S(Me,null,rt(a,ct=>_("button",{key:ct.id,type:"button",class:Be(["tab",{on:r.value===ct.id}]),role:"tab","aria-selected":r.value===ct.id,onClick:mn=>at(ct.id)},[Z(Le,{name:ct.icon,size:"sm"},null,8,["name"]),He(" "+I(y(n)(ct.labelKey)),1)],10,$ze)),64))],8,Lze),_("div",Nze,[Zn(_("section",zze,[_("section",Bze,[_("h3",Rze,I(y(n)("settings.appearance")),1),_("div",Fze,[_("span",jze,I(y(n)("theme.colorSchemeLabel")),1),Z(nr,{"model-value":e.colorScheme,options:[{value:"light",label:y(n)("theme.light")},{value:"dark",label:y(n)("theme.dark")},{value:"system",label:y(n)("theme.system")}],"onUpdate:modelValue":Qe[0]||(Qe[0]=ct=>s("setColorScheme",ct))},null,8,["model-value","options"])]),_("div",Oze,[_("span",Pze,I(y(n)("theme.accentLabel")),1),Z(nr,{"model-value":e.accent,options:[{value:"blue",label:y(n)("theme.accentBlue")},{value:"mono",label:y(n)("theme.accentBlack")}],"onUpdate:modelValue":Qe[1]||(Qe[1]=ct=>s("setAccent",ct))},null,8,["model-value","options"])]),_("div",Hze,[_("span",Dze,I(y(n)("settings.uiFontSize")),1),Z(nr,{"model-value":i.value,options:y(IN),"aria-label":y(n)("settings.uiFontSize"),"onUpdate:modelValue":ys},null,8,["model-value","options","aria-label"])])]),_("section",Vze,[_("h3",Wze,I(y(n)("settings.notifications")),1),_("div",qze,[_("span",Uze,[He(I(y(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",Zze,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Qe[2]||(Qe[2]=ct=>s("setNotify",ct))},null,8,["model-value","disabled","label"])]),_("div",Kze,[_("span",Gze,[He(I(y(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",Yze,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Qe[3]||(Qe[3]=ct=>s("setNotifyQuestion",ct))},null,8,["model-value","disabled","label"])]),_("div",Xze,[_("span",Jze,[He(I(y(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",Qze,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Qe[4]||(Qe[4]=ct=>s("setNotifyApproval",ct))},null,8,["model-value","disabled","label"])]),_("div",eBe,[_("span",tBe,I(y(n)("settings.soundOnComplete")),1),Z(xr,{"model-value":e.sound,label:y(n)("settings.soundOnComplete"),"onUpdate:modelValue":Qe[5]||(Qe[5]=ct=>s("setSound",ct))},null,8,["model-value","label"])])])],512),[[Er,r.value==="general"]]),Zn(_("section",nBe,[_("section",oBe,[_("h3",sBe,I(y(n)("settings.account")),1),_("div",rBe,[_("span",iBe,I(e.authReady?y(n)("settings.providers"):y(n)("sidebar.notSignedIn")),1),Z(Cn,{text:e.accountModel},{default:ue(()=>[e.authReady&&e.accountModel?(g(),S("span",lBe,I(e.accountModel),1)):J("",!0)]),_:1},8,["text"])]),_("div",aBe,[Z(It,{variant:"secondary",size:"sm",onClick:Qe[6]||(Qe[6]=ct=>{s("openOnboarding"),s("close")})},{default:ue(()=>[He(I(y(n)("onboarding.reopen")),1)]),_:1}),Z(It,{variant:"primary",size:"sm",onClick:Qe[7]||(Qe[7]=ct=>at("providers"))},{default:ue(()=>[He(I(y(n)("settings.manageProviders")),1)]),_:1})])])],512),[[Er,r.value==="account"]]),Zn(_("section",cBe,[Z(hze,{"discard-token":R.value,onDirtyChange:Qe[8]||(Qe[8]=ct=>M.value=ct)},null,8,["discard-token"])],512),[[Er,r.value==="providers"]]),Zn(_("section",uBe,[_("section",dBe,[_("div",fBe,[_("h3",pBe,I(y(n)("settings.agentDefaults")),1),e.configSaving?(g(),S("span",hBe,I(y(n)("settings.saving")),1)):J("",!0)]),e.config?(g(),S(Me,{key:0},[_("div",mBe,[_("span",gBe,[He(I(y(n)("settings.defaultModel"))+" ",1),_("span",vBe,I(y(n)("settings.defaultModelHint")),1)]),fe.value.length>0?(g(),S("div",wBe,[Z(M4,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":y(n)("settings.defaultModel"),"onUpdate:modelValue":Ce},{default:ue(()=>[e.config.defaultModel?J("",!0):(g(),S("option",yBe,I(y(n)("settings.noDefaultModel")),1)),(g(!0),S(Me,null,rt(fe.value,ct=>(g(),S("optgroup",{key:ct.provider,label:ct.provider},[(g(!0),S(Me,null,rt(ct.options,mn=>(g(),S("option",{key:mn.id,value:mn.id},I(mn.label),9,bBe))),128))],8,kBe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(g(),S("span",_Be,I(e.config.defaultModel??y(n)("settings.noDefaultModel")),1))]),lt.value?(g(),S("section",xBe,[_("h3",SBe,I(y(n)("settings.secondaryModelSection")),1),_("div",CBe,[_("span",MBe,[He(I(y(n)("settings.secondaryModel"))+" ",1),_("span",ABe,I(y(n)("settings.secondaryModelHint")),1)]),fe.value.length>0?(g(),ce(Ize,{key:0,"model-value":tt.value,effort:ht.value,groups:fe.value,"model-info-by-id":Rt.value,disabled:e.configSaving,onInherit:As,onSelect:Kt},null,8,["model-value","effort","groups","model-info-by-id","disabled"])):(g(),S("span",TBe,I(y(n)("settings.noSecondaryModel")),1))]),tt.value?(g(),S("div",EBe,[_("span",IBe,[He(I(y(n)("settings.forceSecondaryModel"))+" ",1),_("span",LBe,I(y(n)("settings.forceSecondaryModelHint")),1)]),Z(xr,{"model-value":bt.value,disabled:e.configSaving,label:y(n)("settings.forceSecondaryModel"),"onUpdate:modelValue":no},null,8,["model-value","disabled","label"])])):J("",!0)])):J("",!0),_("div",$Be,[_("span",NBe,[He(I(y(n)("settings.defaultPermission"))+" ",1),_("span",zBe,I(y(n)("settings.defaultPermissionHint")),1)]),Z(nr,{"model-value":pe.value,options:T.map(ct=>({value:ct,label:y(n)(E[ct])})),"onUpdate:modelValue":Qe[9]||(Qe[9]=ct=>me(ct))},null,8,["model-value","options"])]),_("div",BBe,[_("span",RBe,[He(I(y(n)("settings.defaultThinking"))+" ",1),_("span",FBe,I(y(n)("settings.defaultThinkingHint")),1)]),Z(xr,{"model-value":re(),disabled:e.configSaving,label:y(n)("settings.defaultThinking"),"onUpdate:modelValue":Qe[10]||(Qe[10]=ct=>ke())},null,8,["model-value","disabled","label"])]),_("div",jBe,[_("span",OBe,[He(I(y(n)("settings.defaultPlanMode"))+" ",1),_("span",PBe,I(y(n)("settings.defaultPlanModeHint")),1)]),Z(xr,{"model-value":ye(e.config.defaultPlanMode),disabled:e.configSaving,label:y(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Qe[11]||(Qe[11]=ct=>be("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",HBe,[_("span",DBe,[He(I(y(n)("settings.mergeSkills"))+" ",1),_("span",VBe,I(y(n)("settings.mergeSkillsHint")),1)]),Z(xr,{"model-value":ye(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:y(n)("settings.mergeSkills"),"onUpdate:modelValue":Qe[12]||(Qe[12]=ct=>be("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(g(),S("div",WBe,I(y(n)("settings.configUnavailable")),1))])],512),[[Er,r.value==="agent"]]),Zn(_("section",qBe,[_("section",UBe,[_("h3",ZBe,I(y(n)("settings.versionAndUpdates")),1),_("div",KBe,[_("span",GBe,[He(I(y(n)("settings.appVersion"))+" ",1),_("span",YBe,I(y(n)("settings.appVersionHint")),1)]),_("span",XBe,I(m.value),1)]),_("div",JBe,[_("span",QBe,[He(I(y(n)("settings.serverVersion"))+" ",1),_("span",eRe,I(y(n)("settings.serverVersionHint")),1)]),_("span",tRe,[_("span",nRe,I(x.value),1),Z(Zt,{size:"sm",label:Dt.value?y(n)("settings.copied"):y(n)("settings.copyServerVersion"),"data-testid":"copy-server-version",onClick:Mn},{default:ue(()=>[Z(Le,{name:Dt.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_("div",oRe,[_("span",sRe,[He(I(y(n)("settings.serverAddress"))+" ",1),_("span",rRe,I(y(n)("settings.serverAddressHint")),1)]),_("span",iRe,[_("span",lRe,I(y(c)),1),Z(Zt,{size:"sm",label:en.value?y(n)("settings.copied"):y(n)("settings.copyServerAddress"),"data-testid":"copy-server-address",onClick:Re},{default:ue(()=>[Z(Le,{name:en.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_("div",aRe,[_("span",cRe,I(y(n)("settings.backend")),1),_("span",uRe,I(v.value),1)])]),e.config?(g(),S("section",dRe,[e.config?(g(),S("div",fRe,[_("span",pRe,[He(I(y(n)("settings.telemetry"))+" ",1),_("span",hRe,I(y(n)("settings.telemetryHint")),1),_("span",mRe,I(y(n)("settings.telemetryRestartHint")),1)]),Z(xr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:y(n)("settings.telemetry"),"onUpdate:modelValue":Qe[13]||(Qe[13]=ct=>Fe())},null,8,["model-value","disabled","label"])])):J("",!0)])):J("",!0),_("section",gRe,[_("h3",vRe,I(y(n)("settings.diagnostics")),1),_("div",wRe,[_("span",yRe,[He(I(y(n)("settings.exportLog"))+" ",1),y(Ji)()?J("",!0):(g(),S("span",kRe,I(y(n)("settings.logHint")),1))]),Z(It,{variant:"secondary",size:"sm",onClick:X},{default:ue(()=>[He(I(y(n)("settings.exportLogBtn")),1)]),_:1})]),_("div",bRe,[_("span",_Re,I(y(n)("settings.copyDetails")),1),Z(It,{"data-testid":"copy-diagnostics",variant:"secondary",size:"sm",onClick:Qt},{default:ue(()=>[He(I(b.value?y(n)("settings.copied"):y(n)("settings.copyDetails")),1)]),_:1})])])],512),[[Er,r.value==="advanced"]]),Zn(_("section",xRe,[y(l)?(g(),S("section",SRe,[_("h3",CRe,I(y(n)("settings.tabs.update")),1),_("div",MRe,[_("div",ARe,[_("div",TRe,[_("span",ERe,[Z(Le,{name:"download",size:"md"})]),_("span",IRe,[_("span",LRe,I(O.value),1),_("span",$Re,I(j.value),1)])]),Z(It,{"data-testid":"settings-check-update",variant:"secondary",size:"sm",loading:d.value?.status==="checking",disabled:F.value,onClick:Q},{default:ue(()=>[He(I(y(n)("settings.desktop.checkNow")),1)]),_:1},8,["loading","disabled"])]),_("div",NRe,[_("span",zRe,[He(I(y(n)("settings.desktop.updateChannel"))+" ",1),_("span",BRe,I(y(n)("settings.desktop.updateChannelHint")),1)]),_("div",RRe,[Z(M4,{"data-testid":"desktop-update-channel",size:"sm","model-value":d.value?.channel??"stable",disabled:A.value,"aria-label":y(n)("settings.desktop.updateChannel"),"onUpdate:modelValue":se},{default:ue(()=>[(g(),S(Me,null,rt(V,ct=>_("option",{key:ct,value:ct},I(y(n)(`settings.desktop.channels.${ct}`)),9,FRe)),64))]),_:1},8,["model-value","disabled","aria-label"])])]),_("div",jRe,[_("span",ORe,[He(I(y(n)("settings.desktop.automaticChecks"))+" ",1),_("span",PRe,I(y(n)("settings.desktop.automaticChecksHint")),1)]),Z(xr,{"data-testid":"automatic-update-checks","model-value":d.value?.autoUpdate??!1,disabled:f.value||d.value===void 0||d.value.status==="disabled",label:y(n)("settings.desktop.automaticChecks"),"onUpdate:modelValue":ee},null,8,["model-value","disabled","label"])]),_("div",HRe,[_("span",DRe,[He(I(y(n)("settings.desktop.notifyUpdates"))+" ",1),_("span",VRe,I(y(n)("settings.desktop.notifyUpdatesHint")),1)]),Z(xr,{"data-testid":"update-notifications","model-value":d.value?.notifyUpdate??!0,disabled:f.value||d.value===void 0,label:y(n)("settings.desktop.notifyUpdates"),"onUpdate:modelValue":oe},null,8,["model-value","disabled","label"])]),d.value?.status==="downloading"||W.value||d.value?.availableVersion?(g(),S("div",WRe,[d.value?.status==="downloading"?(g(),S("div",qRe,[H.value===void 0?(g(),S("progress",{key:0,"data-testid":"settings-update-progress",max:"100","aria-label":y(n)("settings.desktop.progressLabel")},null,8,URe)):(g(),S("progress",{key:1,"data-testid":"settings-update-progress",value:H.value,max:"100","aria-label":y(n)("settings.desktop.progressLabel")},null,8,ZRe)),_("span",KRe,I(P.value||y(n)("settings.desktop.fetching")),1)])):J("",!0),W.value?(g(),ce(z9,{key:1,variant:"danger"},{default:ue(()=>[He(I(W.value),1)]),_:1})):J("",!0),_("div",GRe,[d.value?.availableVersion?(g(),ce(It,{key:0,variant:"ghost",size:"sm",disabled:f.value,onClick:et},{default:ue(()=>[He(I(y(n)("settings.desktop.viewNotes")),1)]),_:1},8,["disabled"])):J("",!0),d.value?.status==="available"?(g(),ce(It,{key:1,variant:"ghost",size:"sm",disabled:f.value,onClick:xe},{default:ue(()=>[He(I(y(n)("settings.desktop.skip")),1)]),_:1},8,["disabled"])):J("",!0),d.value?.status==="available"||d.value?.status==="error"&&d.value.availableVersion?(g(),ce(It,{key:2,"data-testid":"settings-download-update",size:"sm",loading:f.value,onClick:ge},{default:ue(()=>[He(I(d.value?.status==="error"?y(n)("settings.desktop.retryDownload"):y(n)("settings.desktop.download")),1)]),_:1},8,["loading"])):J("",!0),d.value?.status==="skipped"?(g(),ce(It,{key:3,size:"sm",loading:f.value,onClick:Ke},{default:ue(()=>[He(I(y(n)("settings.desktop.undoSkip")),1)]),_:1},8,["loading"])):J("",!0),d.value?.status==="downloaded"?(g(),ce(It,{key:4,"data-testid":"settings-restart-update",size:"sm",loading:f.value,onClick:Y},{default:ue(()=>[He(I(y(n)("settings.desktop.restartToUpdate")),1)]),_:1},8,["loading"])):J("",!0)])])):J("",!0)])])):J("",!0)],512),[[Er,r.value==="update"]]),Zn(_("section",YRe,[_("section",XRe,[_("h3",JRe,I(y(n)("settings.tabs.lab")),1),_("div",QRe,[_("span",eFe,[He(I(y(n)("settings.conversationToc"))+" ",1),_("span",tFe,I(y(n)("settings.conversationTocHint")),1)]),Z(xr,{"model-value":e.conversationToc??!0,label:y(n)("settings.conversationToc"),"onUpdate:modelValue":Qe[14]||(Qe[14]=ct=>s("setConversationToc",ct))},null,8,["model-value","label"])]),e.config?(g(),S(Me,{key:0},[_("div",nFe,[_("span",oFe,[He(I(y(n)("settings.lab.sidebarTabs"))+" ",1),_("span",sFe,I(y(n)("settings.lab.sidebarTabsHint")),1),an("sidebarTabs")?.externallyControlled?(g(),S("span",rFe,I(y(n)("settings.lab.environmentControlled")),1)):J("",!0),an("sidebarTabs")?.overridden?(g(),S("span",iFe,I(y(n)("settings.lab.savedSettingOverridden")),1)):J("",!0)]),Z(xr,{"model-value":on("sidebarTabs"),disabled:e.configSaving,label:y(n)("settings.lab.sidebarTabs"),"onUpdate:modelValue":Qe[15]||(Qe[15]=ct=>sn("sidebarTabs",ct))},null,8,["model-value","disabled","label"])]),_("div",lFe,[_("span",aFe,[He(I(y(n)("settings.lab.secondaryModel"))+" ",1),_("span",cFe,I(y(n)("settings.lab.secondaryModelHint")),1),an("secondary-model")?.externallyControlled?(g(),S("span",uFe,I(y(n)("settings.lab.environmentControlled")),1)):J("",!0),an("secondary-model")?.overridden?(g(),S("span",dFe,I(y(n)("settings.lab.savedSettingOverridden")),1)):J("",!0)]),Z(xr,{"model-value":on("secondary-model"),disabled:e.configSaving,label:y(n)("settings.lab.secondaryModel"),"onUpdate:modelValue":Qe[16]||(Qe[16]=ct=>sn("secondary-model",ct))},null,8,["model-value","disabled","label"])])],64)):(g(),S("div",fFe,I(y(n)("settings.configUnavailable")),1))])],512),[[Er,r.value==="lab"]]),Zn(_("section",pFe,[_("div",hFe,[Qe[20]||(Qe[20]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",mFe,I(y(n)("settings.archivedTitle")),1),_("p",gFe,I(y(n)("settings.archivedDesc")),1)]),_("div",vFe,[_("label",wFe,[Qe[21]||(Qe[21]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Zn(_("input",{"onUpdate:modelValue":Qe[17]||(Qe[17]=ct=>so.value=ct),placeholder:y(n)("settings.archivedSearch")},null,8,yFe),[[Fs,so.value]])]),Z(M4,{"model-value":Bn.value,size:"sm","aria-label":y(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Qe[18]||(Qe[18]=ct=>Bn.value=ct)},{default:ue(()=>[_("option",kFe,I(y(n)("settings.archivedAllWorkspaces")),1),(g(!0),S(Me,null,rt(Os.value,ct=>(g(),S("option",{key:ct,value:ct},I(ct),9,bFe))),128))]),_:1},8,["model-value","aria-label"]),Z(nr,{size:"sm","model-value":Pn.value,options:[{value:"archived-desc",label:y(n)("settings.archivedSortArchived")},{value:"created-desc",label:y(n)("settings.archivedSortCreated")},{value:"name-asc",label:y(n)("settings.archivedSortName")}],"onUpdate:modelValue":Qe[19]||(Qe[19]=ct=>Pn.value=ct)},null,8,["model-value","options"])]),oo.value?(g(),S("div",_Fe,I(y(n)("settings.archivedLoadingAll")),1)):(g(),S(Me,{key:1},[ks.value.length>0?(g(),S("div",xFe,[(g(!0),S(Me,null,rt(ks.value,ct=>(g(),S("section",{key:ct.cwd,class:"archive-card"},[_("div",SFe,[Qe[22]||(Qe[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",CFe,I(ct.cwd),1),_("span",MFe,I(y(n)("settings.archivedSessionsCount",{count:ct.items.length})),1)]),_("div",AFe,[(g(!0),S(Me,null,rt(ct.items,mn=>(g(),S("div",{key:mn.id,class:"archive-row"},[_("div",TFe,[_("div",EFe,I(mn.title),1),_("div",IFe,I(y(n)("settings.archivedAt",{time:Ro(mn.updatedAt)})),1)]),Z(It,{variant:"secondary",size:"sm",onClick:_o=>Lo(mn.id)},{default:ue(()=>[He(I(y(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(g(),S("div",LFe,I(co.value.length===0?y(n)("settings.archivedEmpty"):y(n)("settings.archivedNoMatch")),1))],64))],512),[[Er,r.value==="archived"]])])],512)]),_:1},8,["title"]))}}),zFe=mt(NFe,[["__scopeId","data-v-6f86d7a3"]]),BFe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,Rz=/^[A-Za-z]:[\\/]/,RFe=/^\/\/(?!\/)/;function Dm(e){return BFe.test(e.trim())}function FFe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function jFe(e){return RFe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function OFe(e){return Rz.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function PFe(e){return Rz.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function W7(e,t){let n=jFe(FFe(e.trim(),t));const o=OFe(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),r=o?/[\\/]$/.test(n):n.endsWith("/");!s&&r&&(n=n.slice(0,-1));const i=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(i,l),c=l>i?"\\":"/",u=PFe(n),d=ad.value.trim().length>0);let m=0,k=null;const x=B(()=>Dm(d.value)),w=U("idle"),v=U(""),b=U("/"),M=U([]),R=U(""),z=U(null),$=U(null),T=B(()=>w.value!=="valid"?null:DFe(d.value,R.value,$.value));let E=0,N=null;function C(oe,Q){const ge=oe.toLowerCase(),xe=Q.toLowerCase();let Ke=0;for(let et=0;et0&&Y=oM))break;ne.depth+1{k&&clearTimeout(k),N&&clearTimeout(N),E++,w.value="idle",M.value=[],$.value=null;const Q=oe.trim();if(Q===""){m++,p.value=[],f.value=!1;return}if(Dm(Q)){if(m++,p.value=[],f.value=!1,l.value)return;w.value="checking",N=setTimeout(()=>void H(Q),150);return}k=setTimeout(()=>void O(oe),220)});async function H(oe){const Q=++E;w.value="checking",$.value=null;const ge=W7(oe,R.value),{target:xe}=ge;try{const et=await o.browseFs(xe);if(Q!==E)return;if(et.path){w.value="valid",M.value=[],$.value=xe,a.value=et.path,c.value=et.parent,u.value=et.entries,l.value=!1;return}}catch{}if(Q!==E)return;const Ke=ge.base.toLowerCase();v.value=ge.parent,b.value=ge.separator;try{const et=await o.browseFs(ge.parent);if(Q!==E)return;if(et.path){M.value=et.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ke)),w.value="not-found";return}}catch{}Q===E&&(M.value=[],w.value="bad-parent")}function V(oe){d.value=HFe(v.value,oe,b.value),z.value?.focus()}const A=B(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),F=B(()=>l.value?n("workspace.degradedHint"):x.value&&w.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function j(oe){if(oe.key==="Escape"){d.value?d.value="":s("close");return}if(oe.key!=="Enter")return;const Q=d.value.trim();if(Dm(Q)){if(oe.preventDefault(),l.value){const{target:ge}=W7(Q,R.value);ge&&s("add",ge);return}w.value==="valid"?se():w.value==="not-found"&&M.value[0]&&V(M.value[0].name)}}const q=B(()=>{const oe=a.value;if(!oe)return[];const Q=oe.split("/").filter(Boolean),ge=[{label:"/",path:"/"}];let xe="";for(const Ke of Q)xe+=`/${Ke}`,ge.push({label:Ke,path:xe});return ge}),P=B(()=>!(a.value.length===0||x.value&&T.value===null));async function W(oe){i.value=!0;try{const Q=await o.browseFs(oe);if(!Q.path){l.value=!0;return}a.value=Q.path,c.value=Q.parent,u.value=Q.entries,d.value="",l.value=!1}catch{l.value=!0}finally{i.value=!1}}function G(oe){oe.isDir&&W(oe.path)}function ee(){c.value&&W(c.value)}function se(){P.value&&s("add",T.value??a.value)}return xn(async()=>{i.value=!0;try{const oe=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(oe.home&&(R.value=oe.home),o.defaultPath&&(await W(o.defaultPath),!l.value))return;R.value?await W(R.value):l.value=!0}catch{l.value=!0}finally{i.value=!1}}),An(()=>{k&&clearTimeout(k),N&&clearTimeout(N)}),(oe,Q)=>(g(),ce(T0,{open:r.value,"onUpdate:open":Q[2]||(Q[2]=ge=>r.value=ge),title:y(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:Q[3]||(Q[3]=ge=>s("close"))},{default:ue(()=>[_("div",VFe,[l.value?J("",!0):(g(),S("div",WFe,[Z(Zt,{size:"sm",disabled:!c.value,label:y(n)("workspace.up"),onClick:ee},{default:ue(()=>[Z(Le,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",qFe,[(g(!0),S(Me,null,rt(q.value,(ge,xe)=>(g(),S(Me,{key:ge.path},[xe>1?(g(),S("span",UFe,"/")):J("",!0),_("button",{class:Be(["crumb",{last:xe===q.value.length-1}]),onClick:Ke=>W(ge.path)},I(ge.label),11,ZFe)],64))),128))])])),!i.value||l.value?(g(),S("div",{key:1,class:Be(["filterbar",{"has-error":w.value==="not-found"||w.value==="bad-parent"}])},[Z(Le,{class:"filter-icon",name:"search",size:"md"}),Zn(_("input",{ref_key:"filterEl",ref:z,"onUpdate:modelValue":Q[0]||(Q[0]=ge=>d.value=ge),class:"filter-input",type:"text",placeholder:A.value,autocomplete:"off",spellcheck:"false",onKeydown:xt(j,["stop"])},null,40,KFe),[[Fs,d.value]]),f.value||w.value==="checking"?(g(),ce(Go,{key:0,size:"sm"})):J("",!0)],2)):J("",!0),l.value?(g(),S("div",uje,I(y(n)("workspace.degradedHint")),1)):(g(),S("div",GFe,[i.value?(g(),S("div",YFe,I(y(n)("workspace.browsing")),1)):x.value&&w.value!=="valid"?(g(),S(Me,{key:1},[w.value==="checking"?(g(),S("div",XFe,I(y(n)("workspace.checkingPath")),1)):w.value==="not-found"?(g(),S(Me,{key:1},[M.value.length>0?(g(),S("div",JFe,I(y(n)("workspace.pathPickHint")),1)):J("",!0),(g(!0),S(Me,null,rt(M.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>V(ge.name)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",eje,I(ge.name),1)],8,QFe))),128)),M.value.length===0?(g(),S("div",tje,I(y(n)("workspace.noPathMatch",{parent:v.value})),1)):J("",!0)],64)):w.value==="bad-parent"?(g(),S("div",nje,I(y(n)("workspace.badParent",{parent:v.value})),1)):J("",!0)],64)):h.value&&!x.value?(g(),S(Me,{key:2},[(g(!0),S(Me,null,rt(p.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>W(ge.path)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",sje,I(ge.rel),1)],8,oje))),128)),!f.value&&p.value.length===0?(g(),S("div",rje,I(y(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(g(),S("div",ije,I(y(n)("workspace.searching")),1)):J("",!0)],64)):(g(),S(Me,{key:3},[(g(!0),S(Me,null,rt(u.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>G(ge)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",aje,I(ge.name),1)],8,lje))),128)),u.value.length===0?(g(),S("div",cje,I(y(n)("workspace.noSubfolders")),1)):J("",!0)],64))])),e.error?(g(),S("div",dje,I(e.error),1)):J("",!0),_("div",fje,[Z(Cn,{text:a.value},{default:ue(()=>[l.value?J("",!0):(g(),ce(It,{key:0,variant:"primary",disabled:!P.value,onClick:se},{default:ue(()=>[He(I(y(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),Z(It,{variant:"secondary",onClick:Q[1]||(Q[1]=ge=>s("close"))},{default:ue(()=>[He(I(y(n)("workspace.cancel")),1)]),_:1})]),_("div",pje,I(F.value),1)])]),_:1},8,["open","title"]))}}),vje=mt(gje,[["__scopeId","data-v-09b74e91"]]),wje={key:0,class:"confirm-dialog__message"},yje=Ge({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function r(){n.loading||(o("update:open",!1),o("cancel"))}function i(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",i),vo(()=>{typeof window<"u"&&window.removeEventListener("keydown",i)}),(l,a)=>(g(),ce(T0,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:r},{foot:ue(()=>[Z(It,{variant:"secondary",disabled:e.loading,onClick:r},{default:ue(()=>[He(I(e.cancelLabel??y(s)("common.cancel")),1)]),_:1},8,["disabled"]),Z(It,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:ue(()=>[He(I(e.confirmLabel??y(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ue(()=>[e.message?(g(),S("p",wje,I(e.message),1)):J("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),kje=mt(yje,[["__scopeId","data-v-074405fe"]]),bje=Ge({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=y1();function r(){s()}return(i,l)=>(g(),ce(kje,{open:y(t)!==null,title:y(t)?.title??"",message:y(t)?.message,"confirm-label":y(t)?.confirmLabel,"cancel-label":y(t)?.cancelLabel,variant:y(t)?.variant,loading:y(n),onConfirm:r,onCancel:l[0]||(l[0]=a=>y(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),_je={class:"rows"},xje={class:"row"},Sje={class:"row"},Cje={class:"row"},Mje={class:"row"},Aje={class:"row"},Tje={class:"row"},Eje={class:"ctx-text"},Ije={key:0,class:"bar"},Lje={class:"row"},$je=Ge({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,r=U(!0),i=B(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=B(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:na(o.status.ctxUsed),max:na(o.status.ctxMax),pct:i.value}):n("status.statusNone"));function a(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const h=o.status.permission;return h==="yolo"?"var(--color-warning)":h==="auto"?"var(--color-danger)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.dynamicWorkflowMode?n("status.dynamicWorkflowOn"):n("status.dynamicWorkflowOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),p=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(g(),ce(T0,{open:r.value,"onUpdate:open":m[0]||(m[0]=k=>r.value=k),title:y(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=k=>s("close"))},{default:ue(()=>[_("dl",_je,[_("div",xje,[_("dt",null,I(y(n)("status.statusModel")),1),_("dd",null,I(e.status.model),1)]),_("div",Sje,[_("dt",null,I(y(n)("status.statusThinking")),1),_("dd",null,I(e.thinking),1)]),_("div",Cje,[_("dt",null,I(y(n)("status.statusPermission")),1),_("dd",{style:Wt({color:c.value})},I(a(e.status.permission)),5)]),_("div",Mje,[_("dt",null,I(y(n)("status.statusPlanMode")),1),_("dd",{class:Be({"plan-on":e.planMode})},I(u.value),3)]),_("div",Aje,[_("dt",null,I(y(n)("status.statusDynamicWorkflowMode")),1),_("dd",{class:Be({"workflow-on":e.dynamicWorkflowMode})},I(d.value),3)]),_("div",Tje,[_("dt",null,I(y(n)("status.statusContext")),1),_("dd",null,[_("span",Eje,I(l.value),1),e.status.ctxMax>0?(g(),S("span",Ije,[_("i",{style:Wt({width:i.value+"%"})},null,4)])):J("",!0)])]),_("div",Lje,[_("dt",null,I(y(n)("status.statusCost")),1),_("dd",null,I(p.value),1)])])]),_:1},8,["open","title"]))}}),Nje=mt($je,[["__scopeId","data-v-7992546c"]]),zje={class:"ui-toast__icon","aria-hidden":"true"},Bje={class:"ui-toast__body"},Rje={class:"ui-toast__title"},Fje={key:0,class:"ui-toast__msg"},jje=Ge({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-toast",`ui-toast--${e.variant}`])},[_("span",zje,[Tn(t.$slots,"icon",{},()=>[e.variant==="success"?(g(),ce(Le,{key:0,name:"check"})):e.variant==="danger"?(g(),ce(Le,{key:1,name:"close"})):e.variant==="warning"?(g(),ce(Le,{key:2,name:"alert-triangle"})):(g(),ce(Le,{key:3,name:"info"}))],!0)]),_("div",Bje,[_("div",Rje,I(e.title),1),e.message?(g(),S("div",Fje,I(e.message),1)):J("",!0),Tn(t.$slots,"default",{},void 0,!0)]),Z(Zt,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Oje=mt(jje,[["__scopeId","data-v-44bc260b"]]),Pje={key:0,class:"actions"},Hje=["onClick"],Dje=["onClick"],Vje={key:1,class:"details"},Wje=Ge({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function r(T){return typeof T=="object"&&T!==null}function i(T){return r(T)?T.title:T}function l(T){return r(T)?T.message??"":""}function a(T){return r(T)?T.details:void 0}function c(T){return r(T)?T.severity==="error":T.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|failed/i.test(T)}function u(T){if(!r(T))return c(T)?"danger":"warning";switch(T.severity){case"error":case"danger":return"danger";case"success":return"success";case"info":return"info";default:return"warning"}}function d(T){return r(T)?`notice:${T.severity}:${T.title}:${T.message??""}:${JSON.stringify(T.details??[])}`:`text:${T}`}function f(T){if(!r(T))return T;const E=[T.title];T.message&&E.push(T.message);const N=T.details??[];if(N.length>0){E.push("",`${s("warnings.diagnostics")}:`);for(const C of N)E.push(`${C.label}: ${C.value}`)}return E.join(` -`)}let p=1;const h=U([]),m=new Map,k=new Map;function x(T){const E=c(T)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?E+5e3:E}function w(T,E){const N=m.get(T)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(T),E),N.deadline=Date.now()+E,m.set(T,N)}function v(T){const E=m.get(T);E&&E.handle!==null&&clearTimeout(E.handle),m.delete(T)}function b(T){const E=m.get(T);!E||E.handle===null||(clearTimeout(E.handle),E.handle=null,E.remaining=Math.max(0,E.deadline-Date.now()))}function M(T){if(h.value.find(C=>C.id===T)?.detailsOpen)return;const N=m.get(T);!N||N.handle!==null||w(T,N.remaining)}function R(T){T.detailsOpen=!T.detailsOpen,T.detailsOpen?b(T.id):M(T.id)}async function z(T){if(!await ss(f(T.warning)))return;T.copied=!0;const N=k.get(T.id);N&&clearTimeout(N),k.set(T.id,setTimeout(()=>{T.copied=!1,k.delete(T.id)},1400))}function $(T){v(T);const E=k.get(T);E&&clearTimeout(E),k.delete(T);const N=h.value.findIndex(C=>C.id===T);N!==-1&&(h.value=h.value.filter(C=>C.id!==T),o("dismiss",N))}return Ue(()=>n.warnings,T=>{const E=[...h.value];h.value=T.map(N=>{const C=d(N),O=E.findIndex(A=>A.key===C),H=O===-1?void 0:E.splice(O,1)[0];if(H)return H.warning=N,H;const V={id:p++,key:C,warning:N,detailsOpen:!1,copied:!1};return w(V.id,x(N)),V});for(const N of E){v(N.id);const C=k.get(N.id);C&&clearTimeout(C),k.delete(N.id)}},{immediate:!0,flush:"post"}),An(()=>{m.forEach(T=>{T.handle!==null&&clearTimeout(T.handle)}),m.clear(),k.forEach(T=>clearTimeout(T)),k.clear()}),(T,E)=>(g(),ce(dj,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:ue(()=>[(g(!0),S(Me,null,rt(h.value,N=>(g(),ce(Oje,{key:N.id,variant:u(N.warning),title:i(N.warning),message:l(N.warning),"dismiss-label":y(s)("warnings.dismiss"),onDismiss:C=>$(N.id),onPointerenter:C=>b(N.id),onPointerleave:C=>M(N.id)},{default:ue(()=>[a(N.warning)?.length?(g(),S("div",Pje,[_("button",{class:"link",type:"button",onClick:C=>R(N)},I(N.detailsOpen?y(s)("warnings.hideDetails"):y(s)("warnings.showDetails")),9,Hje),_("button",{class:"link",type:"button",onClick:C=>z(N)},I(N.copied?y(s)("warnings.copied"):y(s)("warnings.copyDetails")),9,Dje)])):J("",!0),N.detailsOpen&&a(N.warning)?.length?(g(),S("dl",Vje,[(g(!0),S(Me,null,rt(a(N.warning),C=>(g(),S("div",{key:`${C.label}:${C.value}`,class:"detail-row"},[_("dt",null,I(C.label),1),_("dd",null,I(C.value),1)]))),128))])):J("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),qje=mt(Wje,[["__scopeId","data-v-6d8f28b8"]]),Uje={class:"update-dialog__head"},Zje={class:"update-dialog__brand","data-testid":"update-dialog-brand"},Kje={class:"update-dialog__titles"},Gje={class:"update-dialog__title","data-testid":"update-dialog-title"},Yje={key:0,class:"update-dialog__date","data-testid":"update-dialog-date"},Xje={key:0,class:"update-dialog__progress"},Jje={class:"update-dialog__progress-row"},Qje={class:"update-dialog__progress-label"},eOe={class:"update-dialog__progress-meta","data-testid":"update-dialog-progress-meta"},tOe={key:0,"data-testid":"update-dialog-bytes"},nOe={key:1},oOe=["aria-label"],sOe=["value","aria-label"],rOe={key:2,class:"update-dialog__message","data-testid":"update-dialog-message"},iOe=Ge({__name:"UpdateDialog",setup(e){const{t}=Lt(),n=NT();xn(()=>n.subscribe()),An(()=>n.unsubscribe());const o=B(()=>n.availableVersion.value??""),s=B(()=>n.status.value==="downloading"?t("update.dialogDownloading",{version:o.value}):n.status.value==="downloaded"?t("update.dialogReady",{version:o.value}):n.status.value==="error"?t("update.failed"):t("update.dialogAvailable",{version:o.value})),r=B(()=>{const d=n.state.value?.releaseDate;if(d===void 0)return"";const f=new Date(d);return Number.isNaN(f.getTime())?"":new Intl.DateTimeFormat(void 0,{dateStyle:"long"}).format(f)}),i=B(()=>{const d=n.state.value?.transferred;return d===void 0?void 0:Bk(d)}),l=B(()=>{const d=n.state.value?.total;return d===void 0?void 0:Bk(d)}),a=B(()=>n.status.value==="error"?n.state.value?.message??t("update.failedMessage"):n.status.value==="downloaded"?t("update.restart"):t("update.prompt")),c=B(()=>n.status.value!=="downloading");function u(){c.value&&n.closeDialog()}return(d,f)=>(g(),ce(T0,{open:y(n).dialogOpen.value,title:s.value,description:r.value||void 0,"close-on-overlay":c.value,"close-on-esc":c.value,"show-close":!1,size:"md-wide",onClose:u},{head:ue(()=>[_("div",Uje,[_("span",Zje,[Z(Dd,{size:"sm",animated:!1})]),_("div",Kje,[_("div",Gje,I(s.value),1),r.value?(g(),S("div",Yje,[Z(Le,{name:"calendar-schedule",size:"sm","aria-hidden":"true"}),_("span",null,I(r.value),1)])):J("",!0)])])]),foot:ue(()=>[y(n).status.value==="downloading"?(g(),ce(It,{key:0,"data-testid":"cancel-update-download",variant:"secondary",loading:y(n).busy.value,onClick:f[1]||(f[1]=p=>void y(n).cancelDownload())},{default:ue(()=>[He(I(y(t)("update.cancelDownload")),1)]),_:1},8,["loading"])):y(n).status.value==="downloaded"?(g(),S(Me,{key:1},[Z(It,{"data-testid":"later-update",variant:"ghost",onClick:u},{default:ue(()=>[He(I(y(t)("update.later")),1)]),_:1}),Z(It,{"data-testid":"restart-to-update",loading:y(n).busy.value,onClick:f[2]||(f[2]=p=>void y(n).restart())},{default:ue(()=>[He(I(y(t)("update.restartAction")),1)]),_:1},8,["loading"])],64)):y(n).status.value==="error"?(g(),S(Me,{key:2},[Z(It,{"data-testid":"dismiss-update",variant:"ghost",onClick:u},{default:ue(()=>[He(I(y(t)("update.dismiss")),1)]),_:1}),Z(It,{"data-testid":"retry-update",loading:y(n).busy.value,onClick:f[3]||(f[3]=p=>void y(n).retry())},{default:ue(()=>[He(I(y(t)("update.retryDownload")),1)]),_:1},8,["loading"])],64)):(g(),S(Me,{key:3},[Z(It,{"data-testid":"skip-update",variant:"secondary",onClick:f[4]||(f[4]=p=>void y(n).skip())},{default:ue(()=>[He(I(y(t)("update.skip")),1)]),_:1}),f[6]||(f[6]=_("span",{class:"update-dialog__foot-spacer"},null,-1)),Z(It,{"data-testid":"later-update",variant:"secondary",onClick:u},{default:ue(()=>[He(I(y(t)("update.later")),1)]),_:1}),Z(It,{"data-testid":"download-update",loading:y(n).busy.value,onClick:f[5]||(f[5]=p=>void y(n).download())},{default:ue(()=>[He(I(y(t)("update.download")),1)]),_:1},8,["loading"])],64))]),default:ue(()=>[y(n).status.value==="downloading"?(g(),S("div",Xje,[_("div",Jje,[_("span",Qje,I(y(t)("update.downloadProgress")),1),_("span",eOe,[i.value&&l.value?(g(),S("span",tOe,I(y(t)("update.bytesProgress",{transferred:i.value,total:l.value})),1)):(g(),S("span",nOe,I(y(t)("update.fetching")),1))])]),y(n).percent.value===void 0?(g(),S("progress",{key:0,"data-testid":"update-dialog-progress",max:"100","aria-label":y(t)("update.progressLabel")},null,8,oOe)):(g(),S("progress",{key:1,"data-testid":"update-dialog-progress",value:y(n).percent.value,max:"100","aria-label":y(t)("update.progressLabel")},null,8,sOe))])):y(n).status.value==="available"?(g(),ce(bd,{key:1,"data-testid":"automatic-update-preference","model-value":y(n).state.value?.autoUpdate??!1,disabled:y(n).busy.value,"onUpdate:modelValue":f[0]||(f[0]=p=>void y(n).setAutomaticChecks(p))},{default:ue(()=>[He(I(y(t)("update.automaticChecks")),1)]),_:1},8,["model-value","disabled"])):(g(),S("p",rOe,I(a.value),1))]),_:1},8,["open","title","description","close-on-overlay","close-on-esc"]))}}),lOe=mt(iOe,[["__scopeId","data-v-13aac9b0"]]),aOe={class:"ui-action-toast-host"},cOe={class:"ui-action-toast__body"},uOe=Ge({__name:"ActionToast",props:{duration:{default:8e3},dismissLabel:{},dismissToken:{}},emits:["dismiss"],setup(e,{emit:t}){const n=t,{t:o}=Lt();let s=null,r=0,i=e.duration;function l(u){if(u<=0){n("dismiss",e.dismissToken);return}s=setTimeout(()=>n("dismiss",e.dismissToken),u),r=Date.now()+u}function a(){s!==null&&(clearTimeout(s),s=null,i=Math.max(0,r-Date.now()))}function c(){s===null&&l(i)}return l(e.duration),An(()=>{s!==null&&clearTimeout(s)}),(u,d)=>(g(),S("div",aOe,[_("div",{class:"ui-action-toast",role:"status",onPointerenter:a,onPointerleave:c},[_("span",cOe,[Tn(u.$slots,"default",{},void 0,!0)]),Z(Zt,{class:"ui-action-toast__close",size:"sm",label:e.dismissLabel??y(o)("common.dismiss"),onClick:d[0]||(d[0]=f=>n("dismiss",e.dismissToken))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],32)]))}}),Vm=mt(uOe,[["__scopeId","data-v-9efa207b"]]),dOe={key:0,class:"window-controls"},fOe=["aria-label"],pOe=["aria-label"],hOe=["aria-label"],mOe=Ge({__name:"WindowControls",setup(e){const{t}=Lt(),n=B(()=>window.pythinkerDesktop?.platform==="win32");function o(){window.pythinkerDesktop?.minimizeWindow()}function s(){window.pythinkerDesktop?.toggleMaximizeWindow()}function r(){window.pythinkerDesktop?.closeWindow()}return(i,l)=>n.value?(g(),S("div",dOe,[_("button",{type:"button",class:"wc wc-min","aria-label":y(t)("app.minimizeWindow"),onClick:o},[...l[0]||(l[0]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","aria-hidden":"true"},[_("path",{d:"M2.5 5h5"})],-1)])],8,fOe),_("button",{type:"button",class:"wc wc-max","aria-label":y(t)("app.maximizeWindow"),onClick:s},[...l[1]||(l[1]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"2.4",y:"2.4",width:"5.2",height:"5.2",rx:"1"})],-1)])],8,pOe),_("button",{type:"button",class:"wc wc-close","aria-label":y(t)("app.closeWindow"),onClick:r},[...l[2]||(l[2]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","aria-hidden":"true"},[_("path",{d:"M3 3l4 4M7 3l-4 4"})],-1)])],8,hOe)])):J("",!0)}}),gOe=mt(mOe,[["__scopeId","data-v-768f9703"]]),vOe={class:"topbar"},wOe={class:"wsq"},yOe=["aria-label"],kOe={class:"tb-path"},bOe={class:"ws"},_Oe={class:"se"},xOe={class:"tb-sub"},SOe=Ge({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,r=B(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),i=B(()=>o.workspace?.name??n("workspace.noWorkspace")),l=B(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(g(),S("div",vOe,[_("span",wOe,I(r.value),1),_("button",{type:"button",class:"tb-mid","aria-label":y(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",kOe,[_("span",bOe,I(i.value),1),e.sessionTitle?(g(),S(Me,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",_Oe,I(e.sessionTitle),1)],64)):J("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",xOe,[_("span",{class:Be(["rd",{on:e.running}])},null,2),_("span",null,I(l.value),1),e.branch?(g(),S(Me,{key:0},[He(" · "+I(e.branch),1)],64)):J("",!0),e.sessionCount>0?(g(),S(Me,{key:1},[He(" · "+I(y(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):J("",!0)])],8,yOe),Z(Zt,{size:"lg",label:y(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:ue(()=>[Z(Le,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),COe=mt(SOe,[["__scopeId","data-v-27a83eb2"]]),MOe={class:"mlist"},AOe={key:0,class:"mempty"},TOe=["onClick"],EOe={class:"mgh-main"},IOe={class:"mgh-name"},LOe={class:"mgh-path"},$Oe={key:2,class:"att"},NOe={key:0,class:"mempty small"},zOe=["onClick"],BOe={class:"m"},ROe={class:"s"},FOe={key:0,class:"att"},jOe=["disabled","onClick"],OOe=["onClick"],POe=Ge({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t;function r(){s("update:modelValue",!1)}function i(N){s("select",N),r()}function l(N){s("createInWorkspace",N),r()}function a(){s("create"),r()}function c(){s("addWorkspace"),r()}const u=U(new Set);function d(N){return u.value.has(N)}function f(N){const C=new Set(u.value);C.has(N)?C.delete(N):C.add(N),u.value=C,v.value=null,z.value=null}const p=U(new Set);function h(N){return p.value.has(N)}function m(N){const C=new Set(p.value);C.has(N)?C.delete(N):C.add(N),p.value=C}function k(N){if(h(N.workspace.id))return N.sessions;const C=N.sessions.slice(0,N.initialCount);if(o.activeId&&!C.some(O=>O.id===o.activeId)){const O=N.sessions.find(H=>H.id===o.activeId);if(O)return[...C,O]}return C}function x(N){if(!p.value.has(N)){const C=new Set(p.value);C.add(N),p.value=C}s("loadMore",N)}function w(N){return o.attentionByWorkspace[N]??0}const v=U(null);function b(N){v.value=v.value===N?null:N,z.value=null}function M(N){v.value=null;const O=(typeof window<"u"?window.prompt(n("sidebar.rename"),N.title):null)?.trim();O&&s("rename",N.id,O)}function R(N){v.value=null,s("archive",N)}const z=U(null);function $(N){z.value=z.value===N?null:N,v.value=null}function T(N){ss(N.root),z.value=null}function E(N){z.value=null,s("deleteWorkspace",N.id)}return(N,C)=>(g(),ce(Kc,{"model-value":e.modelValue,"onUpdate:modelValue":C[2]||(C[2]=O=>s("update:modelValue",O))},{default:ue(()=>[_("button",{type:"button",class:"newrow",onClick:a},[Z(Le,{name:"message",size:"sm"}),He(" "+I(y(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[Z(Le,{name:"folder",size:"sm"}),He(" "+I(y(n)("sidebar.newWorkspace")),1)]),_("div",MOe,[e.groups.length===0?(g(),S("div",AOe,I(y(n)("workspace.noWorkspace")),1)):J("",!0),(g(!0),S(Me,null,rt(e.groups,O=>(g(),S("div",{key:O.workspace.id,class:"mgroup"},[_("div",{class:Be(["mgh",{on:O.workspace.id===e.activeWorkspaceId}]),onClick:H=>f(O.workspace.id)},[d(O.workspace.id)?(g(),ce(Le,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(g(),ce(Le,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",EOe,[_("span",IOe,I(O.workspace.name),1),Z(Cn,{text:O.workspace.root},{default:ue(()=>[_("span",LOe,I(O.workspace.shortPath),1)]),_:2},1032,["text"])]),d(O.workspace.id)&&w(O.workspace.id)>0?(g(),S("span",$Oe,I(w(O.workspace.id)),1)):J("",!0),Z(Zt,{size:"lg",class:"mgh-more",label:y(n)("sidebar.options"),onClick:xt(H=>$(O.workspace.id),["stop"])},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),Z(Zt,{size:"lg",class:"mgh-add",label:y(n)("workspace.newInGroup"),onClick:xt(H=>l(O.workspace.id),["stop"])},{default:ue(()=>[Z(Le,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),z.value===O.workspace.id?(g(),ce(qi,{key:3,class:"kmenu wsmenu",onClick:C[0]||(C[0]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{size:"lg",onClick:H=>T(O.workspace)},{default:ue(()=>[He(I(y(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),Z(yn,{size:"lg",danger:"",onClick:H=>E(O.workspace)},{default:ue(()=>[He(I(y(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):J("",!0)],10,TOe),Zn(_("div",null,[O.sessions.length===0?(g(),S("div",NOe,I(y(n)("sidebar.noSessions")),1)):J("",!0),(g(!0),S(Me,null,rt(k(O),H=>(g(),S("div",{key:H.id,class:Be(["srow",{cur:H.id===e.activeId}]),onClick:V=>i(H.id)},[_("div",BOe,[_("div",{class:Be(["t",{run:H.busy,aborted:!H.busy&&(e.attentionBySession[H.id]??0)===0&&(H.lastTurnReason==="cancelled"||H.lastTurnReason==="failed")}])},I(H.title),3),_("div",ROe,I(H.time),1)]),(e.attentionBySession[H.id]??0)>0?(g(),S("span",FOe,I(e.attentionBySession[H.id]),1)):J("",!0),Z(Zt,{size:"lg",class:"kb",label:y(n)("sidebar.options"),onClick:xt(V=>b(H.id),["stop"])},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),v.value===H.id?(g(),ce(qi,{key:1,class:"kmenu",onClick:C[1]||(C[1]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{size:"lg",onClick:V=>M(H)},{default:ue(()=>[He(I(y(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),Z(yn,{size:"lg",danger:"",onClick:V=>R(H.id)},{default:ue(()=>[He(I(y(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):J("",!0)],10,zOe))),128)),O.hasMore||O.loadingMore?(g(),S("button",{key:1,type:"button",class:"mshow-more",disabled:O.loadingMore,onClick:xt(H=>x(O.workspace.id),["stop"])},I(O.loadingMore?y(n)("sidebar.loadingMore"):y(n)("sidebar.showMore",{count:Math.max(0,O.workspace.sessionCount-O.sessions.length)})),9,jOe)):J("",!0),O.sessions.length>O.initialCount?(g(),S("button",{key:2,type:"button",class:"mshow-more",onClick:xt(H=>m(O.workspace.id),["stop"])},I(h(O.workspace.id)?y(n)("sidebar.showLess"):y(n)("sidebar.showAll",{count:O.sessions.length-O.initialCount})),9,OOe)):J("",!0)],512),[[Er,!d(O.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),HOe=mt(POe,[["__scopeId","data-v-4c7bceaf"]]),DOe={class:"group-title"},VOe={class:"srow-main"},WOe={class:"srow-label"},qOe={class:"srow-sub"},UOe={class:"srow read-only"},ZOe={class:"srow-main"},KOe={class:"srow-label"},GOe={key:0,class:"srow-sub"},YOe={class:"cache-note"},XOe={class:"srow-main"},JOe={class:"srow-label"},QOe={class:"srow-sub"},ePe=["aria-checked"],tPe={key:0,class:"srow read-only"},nPe={class:"srow-main"},oPe={class:"srow-label"},sPe={class:"srow-sub"},rPe={class:"goal-actions"},iPe=["aria-checked"],lPe={class:"srow-main"},aPe={class:"srow-label"},cPe={class:"srow-sub"},uPe=["aria-checked"],dPe={class:"srow-main"},fPe={class:"srow-label"},pPe={class:"srow-sub"},hPe={class:"srow-main"},mPe={class:"srow-label"},gPe={class:"srow read-only"},vPe={class:"srow-main"},wPe={class:"srow-label"},yPe={class:"srow-sub"},kPe=["aria-label"],bPe={class:"group-title"},_Pe={class:"srow-main"},xPe={class:"srow-label"},SPe={class:"srow-sub"},CPe={class:"srow read-only pref"},MPe={class:"srow-main"},APe={class:"srow-label"},TPe={class:"srow read-only pref"},EPe={class:"srow-main"},IPe={class:"srow-label"},LPe={class:"srow-main"},$Pe={class:"srow-label"},NPe={class:"srow-sub"},zPe=["aria-checked"],BPe={class:"srow-main"},RPe={class:"srow-label"},FPe={key:2,class:"srow read-only"},jPe={class:"srow-main"},OPe={class:"srow-label"},PPe={class:"srow-val dim"},HPe={class:"arch-subhead"},DPe={class:"arch-count"},VPe={class:"arch-tools"},WPe={key:0,class:"arch-empty"},qPe={class:"arch-meta"},UPe={class:"arch-name"},ZPe={class:"arch-time"},KPe={key:2,class:"arch-empty"},GPe=100,YPe=Ge({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},goalMode:{type:Boolean},goal:{default:null},dynamicWorkflowMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleWorkflow","toggleGoal","controlGoal","setPermission","setColorScheme","setUiFontSize","setConversationToc","login"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,{confirm:r}=y1();function i(Q){s("setColorScheme",Q)}const l=["manual","yolo","auto"],a=B(()=>o.models?.find(Q=>Q.id===o.status?.modelId)),c=B(()=>Up(a.value)),u=B(()=>Zp(a.value)),d=B(()=>r9(a.value,o.thinking)),f=B(()=>u.value.includes(d.value)?d.value:""),p=B(()=>u.value.map(Q=>({value:Q,label:Od(Q)}))),h=B(()=>o.planMode===!0),m=B(()=>o.goalMode===!0),k=B(()=>o.goal!==null&&["active","paused","blocked"].includes(o.goal?.status??"")),x=B(()=>{const Q=o.goal?.status;return Q?n(`status.goalStatus${Q[0].toUpperCase()}${Q.slice(1)}`):""});async function w(){await r({title:n("status.goalCancel"),message:n("status.goalCancelConfirm"),confirmLabel:n("status.goalCancelConfirmYes"),cancelLabel:n("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}const v=B(()=>l9(o.uiFontSize));function b(Q){const ge=zN(Q);ge!==void 0&&s("setUiFontSize",ge)}const M=B(()=>{const Q=o.status.permission;return Q==="yolo"?"var(--color-warning)":Q==="auto"?"var(--color-danger)":"var(--color-text-muted)"}),R=B(()=>{const Q=o.status.permission,ge=n(Q==="yolo"?"mobile.permYoloSub":Q==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${Q} · ${ge}`}),z=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),$=B(()=>o.status.ctxMax>0?`${na(o.status.ctxUsed)}/${na(o.status.ctxMax)}`:n("status.statusNone"));function T(Q){s("setThinking",TN(a.value,Q))}function E(){const Q=l.indexOf(o.status.permission),ge=l[(Q+1)%l.length];s("setPermission",ge)}function N(){s("pickModel"),s("update:modelValue",!1)}function C(){s("login"),s("update:modelValue",!1)}const O=b1(),H=U("main"),V=U([]),A=U(!1),F=U(!1),j=U(""),q=U("archived-desc");async function P(){if(!A.value){A.value=!0,F.value=!1;try{const Q=[];let ge;for(;;){const xe=await O.loadArchivedSessions({beforeId:ge,pageSize:GPe});if(Q.push(...xe.items),!xe.hasMore||xe.items.length===0)break;const Ke=xe.items.at(-1)?.id;if(Ke===void 0)break;ge=Ke}V.value=Q,F.value=!0}catch(Q){console.warn("loadAllArchived failed",Q)}finally{A.value=!1}}}function W(){H.value="archived",j.value="",P()}function G(){H.value="main"}const ee=B(()=>{const Q=j.value.trim().toLowerCase();let ge=V.value.filter(xe=>xe.archived===!0);return Q&&(ge=ge.filter(xe=>xe.title.toLowerCase().includes(Q))),ge=ge.slice(),q.value==="archived-desc"?ge.sort((xe,Ke)=>Ke.updatedAt.localeCompare(xe.updatedAt)):q.value==="created-desc"?ge.sort((xe,Ke)=>Ke.createdAt.localeCompare(xe.createdAt)):ge.sort((xe,Ke)=>xe.title.localeCompare(Ke.title,"en")),ge});async function se(Q){await O.restoreSession(Q)&&(V.value=V.value.filter(xe=>xe.id!==Q))}function oe(Q){const ge=new Date(Q);if(Number.isNaN(ge.getTime()))return Q;const xe=Ke=>String(Ke).padStart(2,"0");return`${ge.getFullYear()}-${xe(ge.getMonth()+1)}-${xe(ge.getDate())} ${xe(ge.getHours())}:${xe(ge.getMinutes())}`}return Ue(()=>o.modelValue,Q=>{Q||(H.value="main")}),(Q,ge)=>(g(),ce(Kc,{"model-value":e.modelValue,title:y(n)("mobile.settingsTitle"),"onUpdate:modelValue":ge[8]||(ge[8]=xe=>s("update:modelValue",xe))},{default:ue(()=>[H.value==="main"?(g(),S(Me,{key:0},[_("div",DOe,I(y(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:N},[_("span",VOe,[_("span",WOe,I(y(n)("status.statusModel")),1),_("span",qOe,I(e.status.model),1)]),ge[9]||(ge[9]=_("span",{class:"chev"},"›",-1))]),_("div",UOe,[_("span",ZOe,[_("span",KOe,I(y(n)("status.statusThinking")),1),c.value==="unsupported"?(g(),S("span",GOe,I(y(n)("status.modeNotSupported")),1)):J("",!0)]),u.value.length>1?(g(),ce(nr,{key:0,"model-value":f.value,options:p.value,size:"sm","onUpdate:modelValue":T},null,8,["model-value","options"])):(g(),S("span",{key:1,class:Be(["srow-val",{dim:d.value==="off"}])},I(d.value==="off"?y(n)("status.planOff"):y(Od)(d.value)),3))]),_("div",YOe,I(y(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:ge[0]||(ge[0]=xe=>s("togglePlan"))},[_("span",XOe,[_("span",JOe,I(y(n)("status.statusPlanMode")),1),_("span",QOe,I(y(n)("mobile.planModeSub")),1)]),_("span",{class:Be(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,ePe)]),k.value?(g(),S("div",tPe,[_("span",nPe,[_("span",oPe,I(y(n)("status.goalLabel")),1),_("span",sPe,I(x.value),1)]),_("span",rPe,[e.goal?.status==="active"?(g(),ce(It,{key:0,variant:"secondary",size:"sm",onClick:ge[1]||(ge[1]=xe=>s("controlGoal","pause"))},{default:ue(()=>[He(I(y(n)("status.goalPause")),1)]),_:1})):J("",!0),e.goal?.status==="paused"||e.goal?.status==="blocked"?(g(),ce(It,{key:1,variant:"secondary",size:"sm",onClick:ge[2]||(ge[2]=xe=>s("controlGoal","resume"))},{default:ue(()=>[He(I(y(n)("status.goalResume")),1)]),_:1})):J("",!0),Z(It,{variant:"ghost",size:"sm",onClick:w},{default:ue(()=>[He(I(y(n)("status.goalCancel")),1)]),_:1})])])):(g(),S("button",{key:1,type:"button",class:"srow",role:"switch","aria-checked":m.value,onClick:ge[3]||(ge[3]=xe=>s("toggleGoal"))},[_("span",lPe,[_("span",aPe,I(y(n)("status.goalLabel")),1),_("span",cPe,I(y(n)("mobile.goalModeSub")),1)]),_("span",{class:Be(["toggle",{on:m.value}])},null,2)],8,iPe)),_("button",{type:"button",class:"srow",role:"switch","aria-checked":e.dynamicWorkflowMode,onClick:ge[4]||(ge[4]=xe=>s("toggleWorkflow"))},[_("span",dPe,[_("span",fPe,I(y(n)("status.statusDynamicWorkflowMode")),1),_("span",pPe,I(y(n)("mobile.workflowModeSub")),1)]),_("span",{class:Be(["toggle",{on:e.dynamicWorkflowMode}])},null,2)],8,uPe),_("button",{type:"button",class:"srow",onClick:E},[_("span",hPe,[_("span",mPe,I(y(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Wt({color:M.value})},I(R.value),5)]),ge[10]||(ge[10]=_("span",{class:"chev"},"›",-1))]),_("div",gPe,[_("span",vPe,[_("span",wPe,I(y(n)("status.statusContext")),1),_("span",yPe,I($.value),1)]),_("span",{class:"ctx-meter","aria-label":$.value},[_("i",{style:Wt({width:z.value+"%"})},null,4)],8,kPe)]),_("div",bPe,I(y(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:W},[_("span",_Pe,[_("span",xPe,I(y(n)("mobile.archivedSessions")),1),_("span",SPe,I(y(n)("mobile.archivedSessionsSub")),1)]),ge[11]||(ge[11]=_("span",{class:"chev"},"›",-1))]),_("div",CPe,[_("span",MPe,[_("span",APe,I(y(n)("theme.colorSchemeLabel")),1)]),Z(nr,{"model-value":e.colorScheme??"system",options:[{value:"light",label:y(n)("theme.light")},{value:"dark",label:y(n)("theme.dark")},{value:"system",label:y(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",TPe,[_("span",EPe,[_("span",IPe,I(y(n)("settings.uiFontSize")),1)]),Z(nr,{"model-value":v.value,options:y(IN),"aria-label":y(n)("settings.uiFontSize"),"onUpdate:modelValue":b},null,8,["model-value","options","aria-label"])]),_("button",{type:"button",class:"srow",onClick:ge[5]||(ge[5]=xe=>s("setConversationToc",!e.conversationToc))},[_("span",LPe,[_("span",$Pe,I(y(n)("settings.conversationToc")),1),_("span",NPe,I(y(n)("settings.conversationTocHint")),1)]),_("span",{class:Be(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,zPe)]),_("button",{type:"button",class:"srow acct in",onClick:C},[_("span",BPe,[_("span",RPe,I(y(n)("settings.manageProviders")),1)])]),e.serverVersion?(g(),S("div",FPe,[_("span",jPe,[_("span",OPe,I(y(n)("settings.serverVersion")),1)]),_("span",PPe,I(e.serverVersion),1)])):J("",!0)],64)):(g(),S(Me,{key:1},[_("div",HPe,[_("button",{type:"button",class:"arch-back",onClick:G},[ge[12]||(ge[12]=_("span",{class:"chev back"},"‹",-1)),He(" "+I(y(n)("mobile.archivedBack")),1)]),_("span",DPe,I(y(n)("mobile.sessionCount",{n:ee.value.length})),1)]),_("div",VPe,[Z(os,{class:"arch-search-input","model-value":j.value,size:"sm",placeholder:y(n)("settings.archivedSearch"),"onUpdate:modelValue":ge[6]||(ge[6]=xe=>j.value=xe)},null,8,["model-value","placeholder"]),Z(nr,{size:"sm","model-value":q.value,options:[{value:"archived-desc",label:y(n)("settings.archivedSortArchived")},{value:"created-desc",label:y(n)("settings.archivedSortCreated")},{value:"name-asc",label:y(n)("settings.archivedSortName")}],"onUpdate:modelValue":ge[7]||(ge[7]=xe=>q.value=xe)},null,8,["model-value","options"])]),A.value?(g(),S("div",WPe,I(y(n)("settings.archivedLoadingAll")),1)):ee.value.length>0?(g(!0),S(Me,{key:1},rt(ee.value,xe=>(g(),S("div",{key:xe.id,class:"arch-row"},[_("div",qPe,[_("div",UPe,I(xe.title),1),_("div",ZPe,I(y(n)("settings.archivedAt",{time:oe(xe.updatedAt)})),1)]),Z(It,{variant:"secondary",size:"sm",onClick:Ke=>se(xe.id)},{default:ue(()=>[He(I(y(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(g(),S("div",KPe,I(V.value.length===0?y(n)("settings.archivedEmpty"):y(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),XPe=mt(YPe,[["__scopeId","data-v-bcda0873"]]),JPe=["role","aria-modal","aria-label"],QPe={class:"wiz-rail"},eHe={class:"rail-inner"},tHe={class:"eyebrow-pill"},nHe={class:"wiz-title"},oHe={class:"wiz-sub"},sHe={class:"pref-group"},rHe={class:"pref-label"},iHe={class:"theme-cards"},lHe=["onClick"],aHe={class:"opt-label"},cHe={class:"pref-group"},uHe={class:"pref-label"},dHe={class:"accent-cards"},fHe=["onClick"],pHe={class:"opt-label"},hHe={key:1,class:"wiz-actions"},mHe={key:2,class:"wiz-hint"},gHe={key:0,class:"wiz-hero","aria-hidden":"true"},vHe={class:"hero-inner"},wHe={class:"hero-tagline"},yHe={class:"hero-sub"},kHe={class:"frost-stage"},bHe={class:"frost-card"},_He={class:"frost-card"},xHe=Ge({__name:"Onboarding",props:{embedded:{type:Boolean,default:!1}},emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),{colorScheme:s,accent:r,setColorScheme:i,setAccent:l}=d9(),a=[{value:"system",label:o("theme.system")},{value:"light",label:o("theme.light")},{value:"dark",label:o("theme.dark")}],c=[{value:"blue",label:o("theme.accentBlue")},{value:"mono",label:o("theme.accentBlack")}];return(u,d)=>(g(),S("div",{class:Be(["wizard",{"is-embedded":e.embedded}]),role:e.embedded?void 0:"dialog","aria-modal":e.embedded?void 0:"true","aria-label":e.embedded?void 0:y(o)("onboarding.title")},[_("div",QPe,[_("div",eHe,[e.embedded?J("",!0):(g(),S(Me,{key:0},[_("span",tHe,I(y(o)("onboarding.eyebrow")),1),Z(Dd,{class:"brand-mark",size:"lg",animated:!1,label:"Pythinker Code"}),_("h1",nHe,I(y(o)("onboarding.title")),1),_("p",oHe,I(y(o)("onboarding.subtitle")),1)],64)),_("div",sHe,[_("div",rHe,I(y(o)("theme.colorSchemeLabel")),1),_("div",iHe,[(g(),S(Me,null,rt(a,f=>_("button",{key:f.value,type:"button",class:Be(["opt-card theme-card",{selected:y(s)===f.value}]),onClick:p=>y(i)(f.value)},[_("span",{class:Be(["theme-preview",`theme-preview--${f.value}`]),"aria-hidden":"true"},[f.value==="system"?(g(),S(Me,{key:0},[d[2]||(d[2]=P2('',2))],64)):(g(),S(Me,{key:1},[d[3]||(d[3]=_("span",{class:"theme-side"},null,-1)),d[4]||(d[4]=_("span",{class:"theme-lines"},[_("span"),_("span"),_("span")],-1))],64))],2),_("span",aHe,I(f.label),1)],10,lHe)),64))])]),_("div",cHe,[_("div",uHe,I(y(o)("theme.accentLabel")),1),_("div",dHe,[(g(),S(Me,null,rt(c,f=>_("button",{key:f.value,type:"button",class:Be(["opt-card accent-card",{selected:y(r)===f.value}]),onClick:p=>y(l)(f.value)},[_("span",{class:Be(["opt-radio",{on:y(r)===f.value}])},null,2),_("span",{class:Be(["accent-swatch",`accent-swatch--${f.value}`]),"aria-hidden":"true"},null,2),_("span",pHe,I(f.label),1)],10,fHe)),64))])]),e.embedded?J("",!0):(g(),S("div",hHe,[Z(It,{variant:"primary",size:"lg",class:"wiz-action","data-testid":"onboarding-complete",onClick:d[0]||(d[0]=f=>n("complete"))},{default:ue(()=>[_("span",null,I(y(o)("onboarding.start")),1),Z(Le,{name:"arrow-right",size:"sm"})]),_:1}),Z(It,{variant:"secondary",size:"lg",class:"wiz-action","data-testid":"onboarding-skip",onClick:d[1]||(d[1]=f=>n("skip"))},{default:ue(()=>[_("span",null,I(y(o)("onboarding.skip")),1),Z(Le,{name:"arrow-right",size:"sm"})]),_:1})])),e.embedded?J("",!0):(g(),S("p",mHe,I(y(o)("onboarding.hint")),1))])]),e.embedded?J("",!0):(g(),S("aside",gHe,[d[7]||(d[7]=_("div",{class:"hero-ambient"},[_("span",{class:"orb orb-a"}),_("span",{class:"orb orb-b"}),_("span",{class:"orb orb-c"})],-1)),_("div",vHe,[Z(Dd,{size:"hero",animated:!1,label:""}),_("p",wHe,I(y(o)("onboarding.heroTitle")),1),_("p",yHe,I(y(o)("onboarding.heroSub")),1),_("div",kHe,[_("figure",bHe,[d[5]||(d[5]=P2('',2)),_("figcaption",null,I(y(o)("onboarding.platformMac")),1)]),_("figure",_He,[d[6]||(d[6]=P2('',2)),_("figcaption",null,I(y(o)("onboarding.platformWindows")),1)])])])]))],10,JPe))}}),Fz=mt(xHe,[["__scopeId","data-v-2c24b7cb"]]),SHe=2e3;function CHe(e){const t=U("idle"),n=U(void 0),o=U(void 0),s=U(!1),r=U(!0),i=U(""),l=B(()=>t.value==="starting"||t.value==="exchanging"||t.value==="loading_models");let a,c,u=!1,d=!1;function f(){return t.value==="waiting_for_browser"||t.value==="waiting_for_code"}function p(){a!==void 0&&(clearInterval(a),a=void 0)}function h(){n.value=void 0,o.value=void 0,s.value=!1}function m(){c?.close(),c=void 0}function k($){u||(i.value=$,t.value="failed",p(),m(),h())}async function x($,T){if(u||n.value!==$||!f()&&t.value!=="exchanging"||T.state==="pending")return;if(p(),T.state==="failed"){k(T.message??"");return}if(T.state==="cancelled"){t.value="cancelled",m(),h();return}c=void 0,t.value="loading_models";let E=!0;try{E=await e?.()??!0}catch(N){k(N instanceof Error?N.message:String(N));return}finally{h()}u||(E?t.value="connected":k(""))}async function w(){if(u||d||!f())return;const $=n.value;if($!==void 0){d=!0;try{await x($,await At().getCodexLoginStatus($))}catch{}finally{d=!1}}}function v(){w()}function b(){document.visibilityState==="visible"&&w()}async function M(){if(u||l.value||f())return;t.value="starting",i.value="",h();let $=null;try{$=typeof window>"u"?null:window.open("about:blank","_blank"),$!==null&&($.opener=null,c=$)}catch{$?.close(),$=null}s.value=$===null;try{const T=At(),E=await T.startCodexLogin();if(u){m(),T.cancelCodexLogin(E.loginId).catch(()=>{});return}if(n.value=E.loginId,o.value=E.authorizeUrl,r.value=E.loopback,$!==null)try{$.location.href=E.authorizeUrl}catch{m(),s.value=!0}t.value=E.loopback?"waiting_for_browser":"waiting_for_code",p(),a=setInterval(()=>void w(),SHe)}catch(T){m(),k(T instanceof Error?T.message:String(T))}}async function R($){const T=n.value;if(u||l.value||!f()||T===void 0)return;const E=t.value;t.value="exchanging",i.value="";try{await x(T,await At().submitCodexLoginRedirect(T,$)),!u&&t.value==="exchanging"&&(t.value=E)}catch(N){u||(i.value=N instanceof Error?N.message:String(N),t.value=E)}}async function z(){const $=n.value;if(p(),m(),h(),t.value="cancelled",i.value="",$!==void 0)try{await At().cancelCodexLogin($)}catch{}}return xn(()=>{window.addEventListener("focus",v),document.addEventListener("visibilitychange",b)}),An(()=>{u=!0,window.removeEventListener("focus",v),document.removeEventListener("visibilitychange",b),p(),m();const $=n.value;$!==void 0&&f()&&At().cancelCodexLogin($).catch(()=>{})}),{phase:pi(t),busy:l,loginId:pi(n),authorizeUrl:pi(o),popupBlocked:pi(s),loopback:pi(r),error:pi(i),start:M,submitRedirect:R,cancel:z}}const MHe={class:"codex-signin"},AHe={key:1,class:"codex-signin__ok",role:"status"},THe={class:"codex-signin__status",role:"status"},EHe={key:0,class:"codex-signin__hint"},IHe=["href"],LHe={class:"codex-signin__hint"},$He={key:2,class:"codex-signin__error",role:"alert"},NHe={class:"codex-signin__actions"},zHe=Ge({__name:"CodexSignIn",emits:["connected"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),r=U(""),i=CHe(async()=>{await s.refreshRuntimeState();const a=s.authReady.value;return a&&n("connected"),a});async function l(){const a=r.value.trim();a!==""&&(await i.submitRedirect(a),r.value="")}return(a,c)=>(g(),S("div",MHe,[y(i).phase.value==="idle"||y(i).phase.value==="cancelled"?(g(),ce(It,{key:0,variant:"primary","data-testid":"codex-signin-start",onClick:c[0]||(c[0]=u=>y(i).start())},{default:ue(()=>[Z(Le,{name:"log-in",size:"sm"}),_("span",null,I(y(o)("codexLogin.signIn")),1)]),_:1})):y(i).phase.value==="connected"?(g(),S("p",AHe,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(o)("codexLogin.connected")),1)])):(g(),S(Me,{key:2},[_("p",THe,[y(i).busy.value||y(i).phase.value!=="failed"?(g(),ce(Go,{key:0,size:"sm"})):J("",!0),_("span",null,I(y(o)(`codexLogin.phase.${y(i).phase.value}`)),1)]),y(i).authorizeUrl.value?(g(),S("p",EHe,[He(I(y(o)("codexLogin.openLinkHint"))+" ",1),_("a",{href:y(i).authorizeUrl.value,target:"_blank",rel:"noreferrer noopener"},I(y(o)("codexLogin.openLink")),9,IHe)])):J("",!0),y(i).phase.value==="waiting_for_code"||y(i).phase.value==="exchanging"?(g(),S("form",{key:1,class:"codex-signin__paste",onSubmit:xt(l,["prevent"])},[_("p",LHe,I(y(o)("codexLogin.pasteHint")),1),Z(hl,{label:y(o)("codexLogin.pasteLabel")},{default:ue(()=>[Z(os,{modelValue:r.value,"onUpdate:modelValue":c[1]||(c[1]=u=>r.value=u),placeholder:y(o)("codexLogin.pastePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Z(It,{type:"submit",variant:"primary",loading:y(i).busy.value},{default:ue(()=>[He(I(y(o)("codexLogin.submit")),1)]),_:1},8,["loading"])],32)):J("",!0),y(i).error.value?(g(),S("p",$He,I(y(o)("codexLogin.failed",{message:y(i).error.value})),1)):J("",!0),_("div",NHe,[y(i).phase.value==="failed"?(g(),ce(It,{key:0,variant:"primary",onClick:c[2]||(c[2]=u=>y(i).start())},{default:ue(()=>[He(I(y(o)("codexLogin.retry")),1)]),_:1})):(g(),ce(It,{key:1,variant:"secondary",onClick:c[3]||(c[3]=u=>y(i).cancel())},{default:ue(()=>[He(I(y(o)("codexLogin.cancel")),1)]),_:1}))])],64))]))}}),BHe=mt(zHe,[["__scopeId","data-v-1570e574"]]),RHe=["aria-label"],FHe={class:"first-run__panel"},jHe={class:"first-run__steps"},OHe={class:"first-run__dot"},PHe={key:0,class:"first-run__body"},HHe={class:"first-run__sub"},DHe={key:0,class:"first-run__options"},VHe={class:"first-run__option-main"},WHe={class:"first-run__option-name"},qHe={class:"first-run__option-desc"},UHe={class:"first-run__badge"},ZHe={class:"first-run__option-main"},KHe={class:"first-run__option-name"},GHe={class:"first-run__option-desc"},YHe={class:"first-run__option-main"},XHe={class:"first-run__option-name"},JHe={class:"first-run__option-desc"},QHe={key:1,class:"first-run__route"},eDe={class:"first-run__actions"},tDe={key:2,class:"first-run__skip-hint"},nDe={key:1,class:"first-run__body"},oDe={class:"first-run__sub"},sDe={key:0,class:"first-run__empty"},rDe={key:1,class:"first-run__models"},iDe=["data-testid","onClick"],lDe={class:"first-run__model-id"},aDe={key:0,class:"first-run__badge"},cDe={class:"first-run__model-ctx"},uDe={class:"first-run__actions"},dDe={key:2,class:"first-run__body"},fDe={class:"first-run__sub"},pDe={class:"first-run__ready"},hDe={class:"first-run__actions"},mDe=Ge({__name:"FirstRun",emits:["complete"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),r=U("connect"),i=U(null),l=U(null),a=U(!1),c=U(!1),u=["connect","model","appearance"],d=B(()=>u.indexOf(r.value)),f=B(()=>(s.models.value??[]).filter(T=>T.capabilities===void 0||T.capabilities.length===0||T.capabilities.some(E=>E.trim().toLowerCase()==="tool_use"))),p=B(()=>s.defaultModel.value??void 0),h=B(()=>{const T=p.value;return f.value.toSorted((E,N)=>E.id===T?-1:N.id===T?1:N.maxContextSize-E.maxContextSize||E.id.localeCompare(N.id))}),m=B(()=>a.value?h.value:h.value.slice(0,5)),k=B(()=>(s.providers.value??[])[0]?.id??""),x=B(()=>s.authReady.value&&f.value.length>0),w=B(()=>l.value!==null);Ue([p,f],()=>{l.value===null&&(l.value=p.value??f.value[0]?.id??null)},{immediate:!0});function v(){x.value&&(r.value="model")}async function b(){const T=l.value;if(!(T===null||c.value)){c.value=!0;try{T!==s.defaultModel.value&&await s.updateConfig({defaultModel:T}),await s.refreshRuntimeState(),s.authReady.value&&(r.value="appearance")}finally{c.value=!1}}}function M(){s.setOnboarded(!0),n("complete")}function R(){M()}function z(T){i.value=T}async function $(){await s.refreshRuntimeState(),x.value&&v()}return(T,E)=>(g(),S("div",{class:"first-run",role:"dialog","aria-modal":"true","aria-label":y(o)("firstRun.connect.title")},[_("div",FHe,[_("ol",jHe,[(g(),S(Me,null,rt(u,(N,C)=>_("li",{key:N,class:Be(["first-run__step",{"is-current":C===d.value,"is-done":Cz("codex"))},[_("span",VHe,[_("span",WHe,I(y(o)("firstRun.connect.codexName")),1),_("span",qHe,I(y(o)("firstRun.connect.codexDesc")),1)]),_("span",UHe,I(y(o)("firstRun.connect.codexBadge")),1)]),_("button",{type:"button",class:"first-run__option","data-testid":"first-run-route-catalog",onClick:E[1]||(E[1]=N=>z("catalog"))},[_("span",ZHe,[_("span",KHe,I(y(o)("firstRun.connect.catalogName")),1),_("span",GHe,I(y(o)("firstRun.connect.catalogDesc")),1)]),Z(Le,{name:"chevron-right",size:"sm"})]),_("button",{type:"button",class:"first-run__option","data-testid":"first-run-route-manual",onClick:E[2]||(E[2]=N=>z("manual"))},[_("span",YHe,[_("span",XHe,I(y(o)("firstRun.connect.manualName")),1),_("span",JHe,I(y(o)("firstRun.connect.manualDesc")),1)]),Z(Le,{name:"chevron-right",size:"sm"})])])):(g(),S("div",QHe,[i.value==="codex"?(g(),ce(BHe,{key:0,onConnected:$})):(g(),ce(Bz,{key:1,config:y(s).config.value,"initial-source":i.value==="manual"?"manual":"catalog",onAdded:$,onCancel:E[3]||(E[3]=N=>i.value=null)},null,8,["config","initial-source"])),Z(It,{variant:"ghost",size:"sm",onClick:E[4]||(E[4]=N=>i.value=null)},{default:ue(()=>[He(I(y(o)("firstRun.connect.back")),1)]),_:1})])),_("div",eDe,[Z(It,{variant:"ghost","data-testid":"first-run-skip",onClick:R},{default:ue(()=>[He(I(y(o)("firstRun.connect.skip")),1)]),_:1}),E[8]||(E[8]=_("span",{class:"first-run__spacer"},null,-1)),x.value?(g(),ce(It,{key:0,variant:"primary","data-testid":"first-run-connect-continue",onClick:v},{default:ue(()=>[He(I(y(o)("firstRun.continue")),1)]),_:1})):J("",!0)]),i.value===null?(g(),S("p",tDe,I(y(o)("firstRun.connect.skipHint")),1)):J("",!0)])):r.value==="model"?(g(),S("section",nDe,[_("h1",null,I(y(o)("firstRun.model.title")),1),_("p",oDe,I(y(o)("firstRun.model.connected",{provider:k.value,count:f.value.length},f.value.length))+" "+I(y(o)("firstRun.model.subtitle")),1),f.value.length===0?(g(),S("p",sDe,I(y(o)("firstRun.model.none")),1)):(g(),S("ul",rDe,[(g(!0),S(Me,null,rt(m.value,N=>(g(),S("li",{key:N.id},[_("button",{type:"button",class:Be(["first-run__model",{"is-selected":l.value===N.id}]),"data-testid":`first-run-model-${N.id}`,onClick:C=>l.value=N.id},[E[9]||(E[9]=_("span",{class:"first-run__radio","aria-hidden":"true"},null,-1)),_("span",lDe,I(N.id),1),N.id===p.value?(g(),S("span",aDe,I(y(o)("firstRun.model.recommended")),1)):J("",!0),_("span",cDe,I(Math.round(N.maxContextSize/1e3))+"K",1)],10,iDe)]))),128))])),h.value.length>5?(g(),ce(It,{key:2,variant:"ghost",size:"sm",onClick:E[5]||(E[5]=N=>a.value=!a.value)},{default:ue(()=>[He(I(a.value?y(o)("firstRun.model.showFewer"):y(o)("firstRun.model.showAll",{count:h.value.length})),1)]),_:1})):J("",!0),_("div",uDe,[Z(It,{variant:"secondary",onClick:E[6]||(E[6]=N=>r.value="connect")},{default:ue(()=>[He(I(y(o)("firstRun.back")),1)]),_:1}),E[10]||(E[10]=_("span",{class:"first-run__spacer"},null,-1)),Z(It,{variant:"primary",loading:c.value,disabled:!w.value,"data-testid":"first-run-model-continue",onClick:b},{default:ue(()=>[He(I(y(o)("firstRun.continue")),1)]),_:1},8,["loading","disabled"])])])):(g(),S("section",dDe,[_("h1",null,I(y(o)("firstRun.appearance.title")),1),_("p",fDe,I(y(o)("firstRun.appearance.subtitle")),1),Z(Fz,{embedded:"",onComplete:M,onSkip:M}),_("p",pDe,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(o)("firstRun.appearance.ready",{model:l.value??""})),1)]),_("div",hDe,[Z(It,{variant:"secondary",onClick:E[7]||(E[7]=N=>r.value="model")},{default:ue(()=>[He(I(y(o)("firstRun.back")),1)]),_:1}),E[11]||(E[11]=_("span",{class:"first-run__spacer"},null,-1)),Z(It,{variant:"primary","data-testid":"first-run-finish",onClick:M},{default:ue(()=>[He(I(y(o)("firstRun.appearance.finish")),1)]),_:1})])]))])],8,RHe))}}),gDe=mt(mDe,[["__scopeId","data-v-23e77d0d"]]),vDe={class:"recovery"},wDe={class:"recovery__inner"},yDe={class:"recovery__mark","aria-hidden":"true"},kDe={class:"recovery__copy"},bDe={class:"recovery__options"},_De={class:"recovery__option-name"},xDe={class:"recovery__option-desc"},SDe={class:"recovery__option-name"},CDe={class:"recovery__option-desc"},MDe={class:"recovery__actions"},ADe=Ge({__name:"Recovery",emits:["openProviders","dismiss"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),r=B(()=>s.providers.value??[]),i=B(()=>r.value[0]),l=B(()=>r.value.length===0?"noProvider":r.value.some(u=>u.status==="connected")?"noModel":"credential"),a=B(()=>l.value==="noProvider"?o("recovery.noProvider"):o(`recovery.${l.value}`,{provider:i.value?.id??""}));async function c(){await s.refreshRuntimeState()}return(u,d)=>(g(),S("section",vDe,[_("div",wDe,[_("span",yDe,[Z(Le,{name:"alert-triangle",size:"md"})]),_("div",kDe,[_("h1",null,I(y(o)("recovery.title")),1),_("p",null,I(a.value),1)]),_("div",bDe,[l.value!=="noProvider"?(g(),S("button",{key:0,type:"button",class:"recovery__option is-primary","data-testid":"recovery-open-providers",onClick:d[0]||(d[0]=f=>n("openProviders"))},[_("span",_De,I(y(o)("recovery.fixProvider")),1),_("span",xDe,I(y(o)("recovery.fixProviderDesc")),1)])):J("",!0),_("button",{type:"button",class:Be(["recovery__option",{"is-primary":l.value==="noProvider"}]),"data-testid":"recovery-add-provider",onClick:d[1]||(d[1]=f=>n("openProviders"))},[_("span",SDe,I(y(o)("recovery.addProvider")),1),_("span",CDe,I(y(o)("recovery.addProviderDesc")),1)],2)]),_("div",MDe,[Z(It,{variant:"secondary","data-testid":"recovery-retry",onClick:c},{default:ue(()=>[He(I(y(o)("recovery.retry")),1)]),_:1}),Z(It,{variant:"ghost","data-testid":"recovery-dismiss",onClick:d[2]||(d[2]=f=>n("dismiss"))},{default:ue(()=>[He(I(y(o)("recovery.dismiss")),1)]),_:1})])])]))}}),TDe=mt(ADe,[["__scopeId","data-v-68311778"]]),EDe="/logo.png",IDe=["aria-label"],LDe={class:"gload-box"},$De={class:"gload-text"},NDe={key:0,class:"gload-issue"},zDe={class:"gload-issue-detail"},BDe=Ge({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",{class:"gload",role:"status","aria-label":y(t)("app.connecting")},[_("div",LDe,[o[0]||(o[0]=_("img",{class:"gload-logo",src:EDe,alt:"Pythinker",width:"120",height:"120"},null,-1)),Z(Go,{size:"md",label:y(t)("app.connecting")},null,8,["label"]),_("div",$De,I(y(t)("app.connecting")),1),e.issue?(g(),S("div",NDe,[_("div",null,I(y(t)("app.connectRetrying")),1),_("div",zDe,I(e.issue),1)])):J("",!0)])],8,IDe))}}),RDe=mt(BDe,[["__scopeId","data-v-2468172e"]]),FDe={class:"kap-root"},jDe={class:"kap-head"},ODe={class:"kap-count"},PDe={class:"kap-head-actions"},HDe={class:"kap-filters"},DDe=["value"],VDe={class:"kap-check"},WDe={class:"kap-check"},qDe={class:"kap-view-toggle",role:"group"},UDe={key:0,class:"kap-empty"},ZDe=["onClick"],KDe={class:"kap-ts"},GDe={class:"kap-label"},YDe={key:0,class:"kap-detail"},XDe={class:"kap-detail-actions"},JDe=["onClick"],QDe={key:1,class:"kap-agg"},eVe={class:"mono"},tVe={class:"mono"},nVe={class:"num"},oVe={class:"num"},sVe={key:0},rVe={class:"mono"},iVe={class:"num"},lVe={class:"num"},aVe={key:0},cVe=Ge({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=U("all"),s=U(""),r=U(""),i=U(!1),l=U("timeline"),a=B(()=>(Wv.value,[...w8e()])),c=B(()=>{const T=new Set;for(const E of a.value)E.sessionId&&T.add(E.sessionId);return[...T].sort()});function u(T){return T.kind==="rest:error"||T.code!==void 0&&T.code!==0||T.eventType==="error"||T.eventType==="parse-error"}const d=B(()=>{const T=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||r.value&&E.sessionId!==r.value||i.value&&!u(E)||T&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(T)))}),f=B(()=>{const T=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const N=E.kind==="ws:in"?"←":"→",C=`${N} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,O=T.get(C)??{key:C,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:N,count:0};O.count++,E.seq!==void 0&&(O.lastSeq=E.seq),T.set(C,O)}return[...T.values()].sort((E,N)=>N.count-E.count)}),p=B(()=>{const T=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const N=`${E.method??"?"} ${E.path??"?"}`,C=T.get(N)??{count:0,errors:0,totalMs:0,timed:0};C.count++,u(E)&&C.errors++,E.durationMs!==void 0&&(C.totalMs+=E.durationMs,C.timed++),T.set(N,C)}return[...T.entries()].map(([E,N])=>({key:E,count:N.count,errors:N.errors,avgMs:N.timed>0?Math.round(N.totalMs/N.timed):0})).sort((E,N)=>N.count-E.count)}),h=U(null),m=U(!0),k=U(null),x=U(null);Ue(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await vt();const T=k.value;T&&(T.scrollTop=T.scrollHeight)});function w(T){h.value=h.value===T?null:T}function v(T){const E=new Date(T),N=(C,O=2)=>String(C).padStart(O,"0");return`${N(E.getHours())}:${N(E.getMinutes())}:${N(E.getSeconds())}.${N(E.getMilliseconds(),3)}`}function b(T){return JSON.stringify(T,null,2)}async function M(T){await ss(b(T))&&(x.value=T.id,setTimeout(()=>{x.value===T.id&&(x.value=null)},1500))}function R(){iN(d.value)}function z(T){return u(T)||T.source==="client"?"b-err":T.source==="rest"?"b-rest":T.kind==="ws:lifecycle"?"b-life":T.kind==="ws:out"?"b-out":"b-in"}function $(T){return T.source==="rest"?"REST":T.source==="client"?"APP":"WS"}return(T,E)=>(g(),S("section",FDe,[_("header",jDe,[E[11]||(E[11]=_("strong",null,"KAP debug",-1)),_("span",ODe,I(d.value.length)+"/"+I(a.value.length),1),_("div",PDe,[_("button",{type:"button",class:Be({on:y(N2)}),onClick:E[0]||(E[0]=N=>N2.value=!y(N2))},I(y(N2)?"resume":"pause"),3),_("button",{type:"button",onClick:E[1]||(E[1]=N=>y(y8e)())},"clear"),_("button",{type:"button",onClick:E[2]||(E[2]=N=>R())},"export jsonl"),Z(Cn,{text:"Close window"},{default:ue(()=>[_("button",{type:"button",onClick:E[3]||(E[3]=N=>n("close"))},"✕")]),_:1})])]),_("div",HDe,[Zn(_("select",{"onUpdate:modelValue":E[4]||(E[4]=N=>o.value=N),"aria-label":"Source filter"},[...E[12]||(E[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[c8,o.value]]),Zn(_("select",{"onUpdate:modelValue":E[5]||(E[5]=N=>r.value=N),"aria-label":"Session filter"},[E[13]||(E[13]=_("option",{value:""},"all sessions",-1)),(g(!0),S(Me,null,rt(c.value,N=>(g(),S("option",{key:N,value:N},I(N),9,DDe))),128))],512),[[c8,r.value]]),Zn(_("input",{"onUpdate:modelValue":E[6]||(E[6]=N=>s.value=N),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Fs,s.value]]),_("label",VDe,[Zn(_("input",{"onUpdate:modelValue":E[7]||(E[7]=N=>i.value=N),type:"checkbox"},null,512),[[W4,i.value]]),E[14]||(E[14]=He(" errors",-1))]),_("label",WDe,[Zn(_("input",{"onUpdate:modelValue":E[8]||(E[8]=N=>m.value=N),type:"checkbox"},null,512),[[W4,m.value]]),E[15]||(E[15]=He(" follow",-1))]),_("div",qDe,[_("button",{type:"button",class:Be({on:l.value==="timeline"}),onClick:E[9]||(E[9]=N=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:Be({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=N=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(g(),S("div",{key:0,ref_key:"listRef",ref:k,class:"kap-list"},[d.value.length===0?(g(),S("div",UDe," No trace entries yet. REST calls and WS frames will appear here. ")):J("",!0),(g(!0),S(Me,null,rt(d.value,N=>(g(),S("div",{key:N.id,class:"kap-row-wrap"},[_("button",{type:"button",class:Be(["kap-row",{expanded:h.value===N.id}]),onClick:C=>w(N.id)},[_("span",KDe,I(v(N.ts)),1),_("span",{class:Be(["kap-badge",z(N)])},I($(N)),3),_("span",GDe,I(N.label),1)],10,ZDe),h.value===N.id?(g(),S("div",YDe,[_("div",XDe,[_("button",{type:"button",onClick:C=>M(N)},I(x.value===N.id?"copied ✓":"copy json"),9,JDe)]),_("pre",null,I(b(N)),1)])):J("",!0)]))),128))],512)):(g(),S("div",QDe,[E[20]||(E[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[E[17]||(E[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(g(!0),S(Me,null,rt(f.value,N=>(g(),S("tr",{key:N.key},[_("td",null,I(N.dir),1),_("td",eVe,I(N.eventType),1),_("td",tVe,I(N.sessionId),1),_("td",nVe,I(N.count),1),_("td",oVe,I(N.lastSeq??"—"),1)]))),128)),f.value.length===0?(g(),S("tr",sVe,[...E[16]||(E[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):J("",!0)])]),E[21]||(E[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[E[19]||(E[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(g(!0),S(Me,null,rt(p.value,N=>(g(),S("tr",{key:N.key},[_("td",rVe,I(N.key),1),_("td",iVe,I(N.count),1),_("td",{class:Be(["num",{err:N.errors>0}])},I(N.errors),3),_("td",lVe,I(N.avgMs),1)]))),128)),p.value.length===0?(g(),S("tr",aVe,[...E[18]||(E[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):J("",!0)])])]))]))}}),uVe=mt(cVe,[["__scopeId","data-v-7bab00af"]]),dVe=Ge({__name:"DebugPanel",setup(e){const t=U(!1);let n=null,o=null,s=null;const r=["data-color-scheme","data-accent"];function i(u){const d=document.documentElement,f=u.documentElement;for(const p of r){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));i(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=q4(uVe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&i(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...r]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return xn(()=>{c()}),vo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(g(),ce(Cn,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ue(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),fVe=mt(dVe,[["__scopeId","data-v-992ae84c"]]);function pVe({client:e}){const t=B(()=>e.appState.value==="first-run"||e.appState.value==="recovery"),n="/login",o=U(null);function s(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function r(i){typeof window>"u"||window.history.replaceState(window.history.state,"",i)}return Ue(t,i=>{if(!(typeof window>"u")){if(i){window.location.pathname!==n&&(o.value=s(),r(n));return}window.location.pathname===n&&(r(o.value??"/"),o.value=null)}},{immediate:!0}),{showAuthGate:t}}function hVe({running:e,showAuthGate:t}){const{t:n}=Lt(),o=U(Wl[0]);let s=0,r;function i(){r!==void 0&&clearInterval(r),r=void 0}Ue(e,a=>{i(),s=0,o.value=Wl[0],a&&(r=setInterval(()=>{s=(s+1)%Wl.length,o.value=Wl[s]??Wl[0]},m0))},{immediate:!0}),du(i);const l=B(()=>{const a=e.value?`${o.value} `:"";return t.value?`${a}${n("app.authPageTitle")} - Pythinker Code Web`:`${a}Pythinker Code Web`});FM(()=>{typeof document<"u"&&(document.title=l.value)})}function mVe(e,t,n){const o=new Map(e.attachments.map(a=>[a.attachmentId,a])),s=new Map(e.tasks.map(a=>[a.taskId,a])),r=e.items.find(a=>a.kind==="turn"),i=e.items.findLast(a=>a.kind==="turn"),l=e.items.flatMap(a=>a.kind==="turn"?gVe(a,o,s,{...n,startedAt:a.turnId===r?.turnId?t?.createdAt:void 0,endedAt:a.turnId===i?.turnId?t?.disposedAt:void 0}):[]);return b9(l,[],a=>n.getFileUrl(a),e.meta.activity==="turn")}function gVe(e,t,n,o){const s=[],r=kVe([e.startedAt,...e.steps.map(c=>c.startedAt),o.startedAt]),i=w2(e.endedAt)??w2(o.endedAt),l=e.turnId;if(e.prompt!==void 0&&e.prompt.length>0){const c=[{type:"text",text:e.prompt}];for(const u of e.attachmentIds??[]){const d=wVe(t.get(u));d!==void 0&&c.push(d)}s.push({id:`${e.turnId}:input`,sessionId:o.sessionId,role:"user",content:c,createdAt:r,promptId:l,metadata:{origin:e.origin}})}for(const c of e.steps){const u=w2(c.startedAt)??r;for(const d of c.frames){if(d.kind==="text"){if(d.text.length===0||d.role==="user"&&d.taskId===void 0)continue;s.push({id:d.frameId,sessionId:o.sessionId,role:d.role,content:[{type:"text",text:d.text}],createdAt:u,promptId:l,metadata:d.taskId===void 0?void 0:{origin:{kind:"task",taskId:d.taskId},task:n.get(d.taskId),[u$]:vVe(d.taskId,d.text,n.get(d.taskId))}});continue}if(d.kind==="thinking"){if(d.text.length===0)continue;s.push({id:d.frameId,sessionId:o.sessionId,role:"assistant",content:[{type:"thinking",thinking:d.text,startedAt:u,durationMs:sM(u,w2(c.endedAt))}],createdAt:u,promptId:l});continue}d.kind==="tool"&&(s.push({id:`${d.frameId}:call`,sessionId:o.sessionId,role:"assistant",content:[{type:"toolUse",toolCallId:d.toolCallId,toolName:d.name,input:d.input??d.display??{},outputLines:d.state==="running"?yVe(d.output):void 0}],createdAt:u,promptId:l}),d.state!=="running"&&s.push({id:`${d.frameId}:result`,sessionId:o.sessionId,role:"tool",content:[{type:"toolResult",toolCallId:d.toolCallId,output:d.output??d.error??"",isError:d.state==="error"}],createdAt:w2(c.endedAt)??u,promptId:l}))}}const a=e.durationMs??sM(r,i);if(a!==void 0){const c=s.findLastIndex(u=>u.role==="assistant");c>=0&&(s[c]={...s[c],durationMs:a})}return s}function vVe(e,t,n){if(d$(t).length>0)return;const[o="",...s]=t.split(` -`),r=n?.state??"info";return{id:`task:${e}:${r}`,category:"task",type:`task.${r}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:o.trim(),severity:r==="completed"?"info":"warning",body:s.join(` -`).trim(),raw:t}}function wVe(e){if(e?.source===void 0)return;const t=e.source.kind==="url"?{kind:"url",url:e.source.url}:{kind:"file",fileId:e.source.fileId};if(e.mediaType.startsWith("image/"))return{type:"image",source:t};if(e.mediaType.startsWith("video/"))return{type:"video",source:t};if(e.source.kind==="file")return{type:"file",fileId:e.source.fileId,name:e.name??e.attachmentId,mediaType:e.mediaType,size:e.size??0}}function yVe(e){if(e==null)return;if(typeof e=="string")return e.split(` +`)}:null}),k=U(null),x=U(null),v=U(null);function w(){k.value=null,x.value=null,v.value=null}let b=0,M=0,R=null,z=null;async function $(){const V=++b;M=Date.now();const A=o(r.path);if(!A){V===b&&w();return}try{z??=ps(()=>import("./index-DzVg_0FS.js").then(P=>P.i),[]).then(P=>P.codeToTokens);const F=await z,j=l.value?"github-dark":"github-light",q=m.value;if(q){const[P,W]=await Promise.all([q.before?F(q.before,{lang:A,theme:j}):null,q.after?F(q.after,{lang:A,theme:j}):null]);if(V!==b)return;x.value=P?.tokens??null,v.value=W?.tokens??null}else{const P=h.value.length>0?await F(h.value.join(` +`),{lang:A,theme:j}):null;if(V!==b)return;k.value=P?.tokens??null}}catch{V===b&&w()}}function E(){if(R!==null)return;const V=Math.max(0,YLe-(Date.now()-M));R=setTimeout(()=>{R=null,$()},V)}Ue([()=>h.value.join(` +`),()=>m.value?.before??null,()=>m.value?.after??null],E),Ue([()=>r.path,l,()=>r.fullTexts],()=>{b++,w(),E()}),xn(()=>void $()),vo(()=>{b++,R!==null&&clearTimeout(R)});const T=B(()=>{const V=new Map;let A=0;for(const F of r.lines??[])F.oldNo!==void 0&&V.set(F.oldNo,A++);return V}),N=B(()=>{const V=new Map;let A=0;for(const F of r.lines??[])F.newNo!==void 0&&V.set(F.newNo,A++);return V});function C(V){if(V.type==="del"){if(V.oldNo===void 0)return null;const F=r.fullTexts?V.oldNo-1:T.value.get(V.oldNo);return F===void 0?null:x.value?.[F]??null}if(V.newNo===void 0)return null;const A=r.fullTexts?V.newNo-1:N.value.get(V.newNo);return A===void 0?null:v.value?.[A]??null}function O(V){return V.type==="add"?"+":V.type==="del"?"-":" "}const H=B(()=>{let V=0;if(f.value)for(const A of f.value)A>V&&(V=A);else for(const A of r.lines??[])A.oldNo!==void 0&&A.oldNo>V&&(V=A.oldNo),A.newNo!==void 0&&A.newNo>V&&(V=A.newNo);return Math.max(4,String(V).length)});return(V,A)=>(g(),S("div",{class:Be(["hl-code",{gutter:d.value,"plain-pad":!a.value&&f.value===null,framed:e.framed,"responsive-wrap":e.responsiveWrap,"one-gutter":p.value===1,"two-gutters":p.value===2}]),style:Wt({"--gutter-ch":`${H.value}ch`})},[_("div",VLe,[a.value?(g(!0),S(Me,{key:0},it(e.lines,(F,j)=>(g(),S("div",{key:j,class:Be(["hl-row",`row-${F.type}`])},[d.value?(g(),S(Me,{key:0},[c.value?(g(),S("span",WLe,I(F.oldNo??""),1)):J("",!0),u.value?(g(),S("span",{key:1,class:Be(["hl-gutter new",{offset:c.value}])},I(F.newNo??""),3)):J("",!0)],64)):J("",!0),_("span",qLe,I(O(F)),1),_("span",ULe,[C(F)?(g(!0),S(Me,{key:0},it(C(F),(q,P)=>(g(),S("span",{key:P,style:Wt(i(q))},I(q.content),5))),128)):(g(),S(Me,{key:1},[He(I(F.text),1)],64))])],2))),128)):(g(!0),S(Me,{key:1},it(h.value,(F,j)=>(g(),S("div",{key:j,class:Be(["hl-row",e.lineClass?e.lineClass(f.value?.[j]??-1):void 0]),"data-line":f.value?f.value[j]:void 0},[f.value?(g(),S("span",KLe,I(f.value[j]??""),1)):J("",!0),_("span",GLe,[k.value&&k.value[j]?(g(!0),S(Me,{key:0},it(k.value[j],(q,P)=>(g(),S("span",{key:P,style:Wt(i(q))},I(q.content),5))),128)):(g(),S(Me,{key:1},[He(I(F),1)],64))])],10,ZLe))),128))])],6))}}),zz=mt(XLe,[["__scopeId","data-v-4b6e3ce1"]]),JLe={class:"turn-diff-panel"},QLe={class:"tdp-body"},e$e={class:"tdp-file-head"},t$e={class:"tdp-path"},n$e={key:0,class:"tdp-diff"},o$e={key:1,class:"tdp-unavailable"},s$e=Ge({__name:"TurnDiffPanel",props:{changes:{},cwd:{}},emits:["close","openFile"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function i(a,c){if(!c)return null;const u=v=>v.replaceAll("\\","/"),d=u(a);let f=u(c);f.length>1&&(f=f.replace(/\/+$/,""));const p=/^[a-z]:\//i.test(f)||/^[a-z]:\//i.test(d)||f.startsWith("//")||d.startsWith("//"),h=p?f.toLowerCase():f,m=p?d.toLowerCase():d,k=h.endsWith("/")?h:`${h}/`;if(m!==h&&!m.startsWith(k))return null;const x=m===h?"":d.slice(k.length);return x.split("/").includes("..")?null:x||null}function r(a,c=48){return!a||a.length<=c?a:"…"+a.slice(a.length-c+1)}function l(a){return i(a.path,n.cwd)??a.path}return(a,c)=>(g(),S("div",JLe,[Z(la,{title:y(s)("conversation.turnFiles.diffTitle"),onClose:c[0]||(c[0]=u=>o("close"))},null,8,["title"]),_("div",QLe,[(g(!0),S(Me,null,it(e.changes,u=>(g(),S("section",{key:u.path,class:"tdp-file"},[_("div",e$e,[Z(Cn,{text:u.path},{default:ue(()=>[_("span",t$e,I(r(l(u))),1)]),_:2},1032,["text"]),Z(It,{variant:"ghost",size:"sm",onClick:d=>o("openFile",{path:u.path})},{default:ue(()=>[He(I(y(s)("conversation.turnFiles.openFile")),1)]),_:1},8,["onClick"])]),u.diff?(g(),S("div",n$e,[Z(zz,{lines:u.diff,path:u.path,framed:!1},null,8,["lines","path"])])):(g(),S("div",o$e,[_("p",null,I(y(s)("conversation.turnFiles.diffUnavailable")),1),Z(It,{variant:"ghost",size:"sm",onClick:d=>o("openFile",{path:u.path})},{default:ue(()=>[He(I(y(s)("conversation.turnFiles.openFile")),1)]),_:1},8,["onClick"])]))]))),128))])]))}}),i$e=mt(s$e,[["__scopeId","data-v-67a3cc7e"]]),r$e=["aria-label"],l$e=Ge({__name:"ThinkingIndicator",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=Wl.length*m0;function n(o){return{"--thinking-frame-delay":`${o*m0-t}ms`,"--thinking-frame-fast-delay":`${o*(m0/2)-t/2}ms`}}return(o,s)=>(g(),S("span",{class:Be(["ui-thinking-indicator",[`ui-thinking-indicator--${e.size}`,{"ui-thinking-indicator--fast":e.fast}]]),"aria-label":e.label,role:"status"},[(g(!0),S(Me,null,it(y(Wl),(i,r)=>(g(),S("span",{key:i,class:"ui-thinking-indicator__frame",style:Wt(n(r)),"aria-hidden":"true"},I(i),5))),128))],10,r$e))}}),a$e=mt(l$e,[["__scopeId","data-v-ed8aef9e"]]),c$e={class:"sc"},u$e={key:0,class:"sc-empty"},d$e={key:2,class:"sc-loading","aria-hidden":"true"},f$e={class:"sc-composer"},p$e=["placeholder"],h$e=["disabled"],m$e=Ge({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Lt(),r=B(()=>o.turns.find(b=>b.role==="user")?.text?.trim()??""),l=B(()=>o.title?.trim()||i("sideChat.title")),a=B(()=>o.subtitle?.trim()?o.subtitle.trim():r.value||i("sideChat.subtitle")),c=U(""),u=U(null),d=U(null);function f(){const w=c.value.trim();w&&(s("send",w),c.value="",vt(()=>{u.value&&(u.value.style.height="auto"),p()}))}function p(){const w=d.value;w&&(w.scrollTop=w.scrollHeight)}const h=B(()=>{const w=o.turns;if(w.length===0)return"0";const b=w.at(-1),M=b.thinking?.length??0,R=b.tools?.reduce((z,$)=>z+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${w.length}:${b.text.length}:${M}:${R}`});Ue(h,async()=>{!o.running&&!o.sending||(await vt(),p())});const m=B(()=>o.sending?o.turns.at(-1)?.role==="user":!1);function k(w){w.key==="Enter"&&!w.shiftKey&&!w.isComposing&&(w.preventDefault(),f())}function x(){const w=u.value;w&&(w.style.height="auto",w.style.height=`${Math.min(w.scrollHeight,160)}px`)}function v(){u.value?.focus()}return t({focusInput:v}),(w,b)=>(g(),S("div",c$e,[Z(la,{title:l.value,subtitle:a.value,"close-label":y(i)("thinking.close"),onClose:b[0]||(b[0]=M=>s("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:d,class:"sc-body"},[e.turns.length===0?(g(),S("div",u$e,I(y(i)("sideChat.empty")),1)):(g(),ce(Jv,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),m.value?(g(),S("div",d$e,[Z(a$e)])):J("",!0)],512),_("div",f$e,[Zn(_("textarea",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":b[1]||(b[1]=M=>c.value=M),class:"sc-input",rows:"1",placeholder:y(i)("sideChat.placeholder"),onInput:x,onKeydown:k},null,40,p$e),[[Fs,c.value]]),Z(Cn,{text:y(i)("sideChat.send")},{default:ue(()=>[_("button",{type:"button",class:"sc-send",disabled:!c.value.trim(),onClick:f},[Z(Le,{name:"arrow-right",size:"sm"})],8,h$e)]),_:1},8,["text"])])]))}}),g$e=mt(m$e,[["__scopeId","data-v-130e8cd2"]]),v$e={class:"changes-pane"},w$e={class:"dv-path"},y$e={class:"diff-head"},k$e={class:"back-label"},b$e={key:"loading",class:"empty-state diff-loading"},_$e={key:"empty",class:"empty-state"},x$e={class:"dv-change-count"},S$e={class:"ch-head"},C$e={class:"br-label"},M$e={class:"br-name"},A$e={key:0,class:"sync-info"},E$e={key:0,class:"ahead"},T$e={key:0,class:"behind"},I$e={key:1,class:"empty-head"},L$e={key:0,class:"ch-list"},$$e=["onClick"],N$e={class:"fpath"},z$e={key:1,class:"ch-list ch-tree"},B$e={class:"tree-list"},R$e=["onClick"],F$e={class:"tree-name"},j$e=["onClick"],O$e={class:"tree-name"},P$e={key:2,class:"empty-state"},H$e={key:3,class:"empty-state"},D$e=Ge({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},fullTexts:{default:null},emptyFile:{type:Boolean,default:!1},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t;function i(C){const O=C.toLowerCase();return O==="modified"?"modified":O==="added"?"added":O==="deleted"?"deleted":O==="renamed"?"renamed":O==="untracked"?"untracked":O==="conflicted"?"conflicted":O==="ignored"?"ignored":O==="clean"?"clean":"unknown"}const r={modified:"M",added:"+",deleted:"−",renamed:"→",untracked:"+",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(C){return r[i(C)]??"?"}function a(C,O=60){return C.length<=O?C:"…"+C.slice(C.length-O+1)}const c=B(()=>o.gitInfo!==null),u=B(()=>o.changes.length>0),d=B(()=>(o.selectedDiffPath??null)!==null),f=B(()=>o.mode==="detail"||o.mode==="full"&&d.value),p=B(()=>o.fileDiff??[]),h=B(()=>o.fileDiffLoading===!0),m=U(null);Ue([()=>o.selectedDiffPath,h],([,C])=>{!C&&m.value&&(m.value.scrollLeft=0)},{flush:"post"});function k(C){s("open",C)}function x(){s("back")}function v(){s("close")}const w=U("list");function b(C){w.value=C}function M(C){const O={children:[]},H=[...C].sort((V,A)=>V.path.localeCompare(A.path));for(const V of H){const A=V.path.split("/");let F=O;for(let j=0;jee.name===q&&ee.kind===(P?"file":"folder"));G||(G={name:q,path:W,kind:P?"file":"folder",status:P?V.status:void 0,children:[]},F.children.push(G)),F=G}}return O.children}const R=B(()=>M(o.changes)),z=U(new Set);function $(C){return!z.value.has(C)}const E=B(()=>{const C=[];function O(H,V){for(const A of H)C.push({node:A,depth:V}),A.kind==="folder"&&$(A.path)&&O(A.children,V+1)}return O(R.value,0),C});function T(C){const O=new Set(z.value);O.has(C.path)?O.delete(C.path):O.add(C.path),z.value=O}function N(C){return`${16+C*16}px`}return(C,O)=>(g(),S("div",v$e,[f.value?(g(),S(Me,{key:0},[Z(la,{title:y(n)("diff.title"),closable:e.closable,"close-label":y(n)("diff.close"),onClose:v},{default:ue(()=>[Z(Cn,{text:e.selectedDiffPath??""},{default:ue(()=>[_("span",w$e,I(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",y$e,[e.hideBack?J("",!0):(g(),ce(It,{key:0,variant:"ghost",size:"sm",onClick:x},{default:ue(()=>[O[0]||(O[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",k$e,I(y(n)("diff.back")),1)]),_:1}))]),Z(gr,{name:"diff-content",mode:"out-in"},{default:ue(()=>[h.value?(g(),S("div",b$e,[Z(Go,{size:"md"}),_("span",null,I(y(n)("diff.loading")),1)])):p.value.length>0?(g(),S("div",{key:"lines",ref_key:"diffScrollRef",ref:m,class:"dv-lines-wrap"},[Z(zz,{lines:p.value,path:e.selectedDiffPath??void 0,"line-numbers":!0,framed:!1,"full-texts":e.fullTexts,"responsive-wrap":""},null,8,["lines","path","full-texts"])],512)):(g(),S("div",_$e,I(e.emptyFile?y(n)("diff.emptyFile"):y(n)("diff.noDiff")),1))]),_:1})],64)):(g(),S(Me,{key:1},[Z(la,{title:y(n)("diff.title"),closable:e.closable,"close-label":y(n)("diff.close"),onClose:v},{default:ue(()=>[_("span",x$e,I(y(n)(e.changes.length===1?"diff.fileCountOne":"diff.fileCountOther",{number:e.changes.length})),1),Z(ni,{"model-value":w.value,size:"sm",options:[{value:"list",label:y(n)("diff.list")},{value:"tree",label:y(n)("diff.tree")}],"onUpdate:modelValue":b},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",S$e,[c.value?(g(),S(Me,{key:0},[_("span",C$e,I(y(n)("diff.branch")),1),_("span",M$e,I(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(g(),S("span",A$e,[Z(Cn,{text:y(n)("diff.aheadTitle")},{default:ue(()=>[e.gitInfo.ahead>0?(g(),S("span",E$e,"↑"+I(e.gitInfo.ahead),1)):J("",!0)]),_:1},8,["text"]),Z(Cn,{text:y(n)("diff.behindTitle")},{default:ue(()=>[e.gitInfo.behind>0?(g(),S("span",T$e,"↓"+I(e.gitInfo.behind),1)):J("",!0)]),_:1},8,["text"])])):J("",!0)],64)):(g(),S("span",I$e,I(y(n)("diff.empty")),1))]),u.value&&w.value==="list"?(g(),S("div",L$e,[(g(!0),S(Me,null,it(e.changes,H=>(g(),ce(Cn,{key:H.path,text:H.path},{default:ue(()=>[_("button",{type:"button",class:"ch-row",onClick:V=>k(H.path)},[_("span",{class:Be(["badge",i(H.status)])},I(l(H.status)),3),_("span",N$e,I(a(H.path)),1)],8,$$e)]),_:2},1032,["text"]))),128))])):u.value&&w.value==="tree"?(g(),S("div",z$e,[_("ul",B$e,[(g(!0),S(Me,null,it(E.value,({node:H,depth:V})=>(g(),S("li",{key:H.path,class:"tree-node"},[H.kind==="folder"?(g(),S("button",{key:0,type:"button",class:"tree-row tree-folder",style:Wt({paddingLeft:N(V)}),onClick:A=>T(H)},[Z(Le,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",F$e,I(H.name),1)],12,R$e)):(g(),ce(Cn,{key:1,text:H.path},{default:ue(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Wt({paddingLeft:N(V)}),onClick:A=>k(H.path)},[_("span",{class:Be(["badge",i(H.status)])},I(l(H.status)),3),_("span",O$e,I(H.name),1)],12,j$e)]),_:2},1032,["text"]))]))),128))])])):c.value?(g(),S("div",P$e,I(y(n)("diff.clean")),1)):(g(),S("div",H$e,I(y(n)("diff.empty")),1))],64))]))}}),V$e=mt(D$e,[["__scopeId","data-v-811473b6"]]);function Bz(e,t){let n=null;xn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,vt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),vo(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const W$e={class:"search-wrap"},q$e={key:0,class:"tab-strip"},U$e={key:1,class:"state-row"},Z$e={key:2,class:"state-row unavail"},K$e={key:3,class:"model-list"},G$e=["aria-selected","onClick","onMouseenter"],Y$e={class:"check"},X$e={class:"model-main"},J$e={class:"model-name"},Q$e={class:"model-id"},eNe={key:0,class:"caps"},tNe={class:"model-provider"},nNe={class:"model-ctx"},oNe={key:0,class:"empty"},sNe={class:"footer-hint"},iNe=Ge({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=Gp(),s=B(()=>o.value?Gc:E0),i=B(()=>o.value?{modelValue:!0,title:n("model.title"),closeOnEsc:!1}:{open:!0,title:n("model.title"),closeOnEsc:!1,size:"xl",height:"fixed"}),r=e,l=t,a=B(()=>new Set(r.starredIds??[]));function c($){return a.value.has($)}const u=U(""),d=U(null),f=U(null),p=U("all");Bz(f,d);const h=B(()=>{const $=new Set,E=[{id:"all",label:n("model.allTab")}];for(const T of r.models)$.has(T.provider)||($.add(T.provider),E.push({id:T.provider,label:T.provider}));return E}),m=B(()=>{const $=u.value.toLowerCase().trim(),E=r.models.filter(T=>{if(p.value!=="all"&&T.provider!==p.value)return!1;const N=(T.displayName??T.model).toLowerCase().includes($),C=T.provider.toLowerCase().includes($),O=T.id.toLowerCase().includes($);return!$||N||C||O});return p.value!=="all"?E:E.sort((T,N)=>{const C=c(T.id)?1:0;return(c(N.id)?1:0)-C})}),k=B(()=>m.value),x=U(0);Ue([u,p],()=>{x.value=0}),Ue(h,$=>{$.some(E=>E.id===p.value)||(p.value="all")}),Ue(k,$=>{x.value=Math.min(x.value,Math.max($.length-1,0))});function v($){if($.key==="Escape"){l("close");return}if($.key==="ArrowDown")$.preventDefault(),x.value=Math.min(x.value+1,k.value.length-1);else if($.key==="ArrowUp")$.preventDefault(),x.value=Math.max(x.value-1,0);else if($.key==="Enter"){const E=k.value[x.value];E&&l("select",E.id)}}xn(()=>{document.addEventListener("keydown",v)}),An(()=>{document.removeEventListener("keydown",v)});function w($){l("select",$)}function b($){return k.value.indexOf($)}function M($){p.value=$}const R={image_in:"imageIn",imageIn:"imageIn",image_out:"imageOut",imageOut:"imageOut",vision:"vision",video_in:"videoIn",videoIn:"videoIn",audio_in:"audioIn",audioIn:"audioIn",audio_out:"audioOut",audioOut:"audioOut",thinking:"thinking",always_thinking:"alwaysThinking",alwaysThinking:"alwaysThinking",adaptive_thinking:"adaptiveThinking",adaptiveThinking:"adaptiveThinking",tool_use:"toolUse",toolUse:"toolUse",fast_mode:"fastMode",fastMode:"fastMode"};function z($){const E=R[$];return E?n(`model.capabilities.${E}`):n("model.capabilities.unknown",{capability:$})}return($,E)=>(g(),ce(ns(s.value),Vn(i.value,{onClose:E[1]||(E[1]=T=>l("close"))}),{default:ue(()=>[_("div",{ref_key:"dialogRef",ref:f,class:Be(["mp",{"mp--sheet":y(o)}])},[_("div",W$e,[Z(os,{ref_key:"searchRef",ref:d,modelValue:u.value,"onUpdate:modelValue":E[0]||(E[0]=T=>u.value=T),placeholder:y(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),h.value.length>1?(g(),S("div",q$e,[(g(!0),S(Me,null,it(h.value,T=>(g(),ce(It,{key:T.id,variant:T.id===p.value?"secondary":"ghost",size:"sm",onClick:N=>M(T.id)},{default:ue(()=>[He(I(T.label),1)]),_:2},1032,["variant","onClick"]))),128))])):J("",!0),e.loading?(g(),S("div",U$e,[Z(Go,{size:"sm"}),_("span",null,I(y(n)("model.loading")),1)])):e.unavailable?(g(),S("div",Z$e,[Z(Le,{name:"alert-triangle",size:"lg"}),_("span",null,I(y(n)("model.unavailable")),1)])):(g(),S("div",K$e,[(g(!0),S(Me,null,it(k.value,T=>(g(),S("div",{key:T.id,class:Be(["model-row",{"is-current":T.id===e.current,"is-selected":b(T)===x.value}]),role:"option","aria-selected":T.id===e.current,onClick:N=>w(T.id),onMouseenter:N=>x.value=b(T)},[_("span",Y$e,[T.id===e.current?(g(),ce(Le,{key:0,name:"check",size:"sm"})):J("",!0)]),_("span",X$e,[_("span",J$e,I(T.displayName??T.model),1),_("span",Q$e,I(T.id),1),T.capabilities&&T.capabilities.length>0?(g(),S("span",eNe,[(g(!0),S(Me,null,it(T.capabilities,N=>(g(),ce(wr,{key:N,variant:"info",size:"sm"},{default:ue(()=>[He(I(z(N)),1)]),_:2},1024))),128))])):J("",!0)]),_("span",tNe,I(T.provider),1),_("span",nNe,I(y(n)("model.contextSuffix",{size:y(na)(T.maxContextSize)})),1),Z(Zt,{size:"sm",label:c(T.id)?y(n)("model.unstarTitle"):y(n)("model.starTitle"),onClick:xt(N=>l("toggle-star",T.id),["stop"])},{default:ue(()=>[c(T.id)?(g(),ce(Le,{key:0,name:"star",size:"md"})):(g(),ce(Le,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,G$e))),128)),k.value.length===0&&!e.loading&&!e.unavailable?(g(),S("div",oNe,I(r.models.length===0?y(n)("model.emptyNoModels"):y(n)("model.emptyNoMatch")),1)):J("",!0)])),_("div",sNe,I(y(n)("model.footerHint")),1)],2)]),_:1},16))}}),rNe=mt(iNe,[["__scopeId","data-v-466b8fec"]]),lNe=["aria-checked","aria-label","disabled"],aNe=Ge({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(g(),S("button",{class:Be(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,lNe))}}),xi=mt(aNe,[["__scopeId","data-v-d7337ade"]]),cNe=["value","disabled"],uNe=Ge({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(g(),S("select",{class:Be(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[En(s.$slots,"default",{},void 0,!0)],42,cNe))}}),A4=mt(uNe,[["__scopeId","data-v-77d887db"]]),dNe=["pythinker","openai","openai_responses","anthropic","google-genai","vertexai"],fNe=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function W7(){return{model:"",maxContextSize:"",displayName:""}}function oM(){return{id:"",type:"openai",apiKey:"",baseUrl:"",models:[W7()]}}function Rz(e,t){const n=[];for(const o of Object.values(t??{})){if(o===null||typeof o!="object")continue;const s=o;s.provider===e.id&&n.push({model:typeof s.model=="string"?s.model:"",maxContextSize:typeof s.maxContextSize=="number"?String(s.maxContextSize):"",displayName:typeof s.displayName=="string"?s.displayName:""})}return n}function pNe(e,t={}){const n={models:{}},o=e.id.trim();return o===""?n.id="idRequired":fNe.test(o)||(n.id="idInvalid"),t.apiKey===!0&&e.apiKey.trim()===""&&(n.apiKey="apiKeyRequired"),t.baseUrl===!0&&e.baseUrl.trim()===""&&(n.baseUrl="baseUrlRequired"),e.models.length===0&&(n.modelsEmpty="modelRequired"),e.models.forEach((s,i)=>{const r={};s.model.trim()===""&&(r.model="modelRequired");const l=s.maxContextSize.trim(),a=Number(l);l===""?r.maxContextSize="contextSizeRequired":(!/^\d+$/.test(l)||!Number.isSafeInteger(a)||a<1)&&(r.maxContextSize="contextSizeInvalid"),(r.model!==void 0||r.maxContextSize!==void 0)&&(n.models[i]=r)}),n}function hNe(e){return e.id!==void 0||e.apiKey!==void 0||e.baseUrl!==void 0||e.modelsEmpty!==void 0||Object.keys(e.models).length>0}function Fz(e){return e.map(t=>({model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),displayName:t.displayName.trim()||void 0}))}function mNe(e){return{id:e.id.trim(),type:e.type,apiKey:e.apiKey.trim()||void 0,baseUrl:e.baseUrl.trim()||void 0,models:Fz(e.models)}}function gNe(e,t,n,o){const s=Fz(e.models),i=o?.includes("/")?o.slice(o.indexOf("/")+1):o;return{newId:e.id.trim()!==t.id?e.id.trim():void 0,type:e.type,apiKey:e.apiKey.trim()||(n?"":void 0),baseUrl:e.baseUrl.trim()||void 0,defaultModel:i&&s.some(r=>r.model===i)?i:void 0,models:s}}const vNe=Ge({__name:"Skeleton",props:{width:{},height:{},circle:{type:Boolean}},setup(e){return(t,n)=>(g(),S("span",{class:Be(["ui-skeleton",{"is-circle":e.circle}]),style:Wt({width:e.width??"100%",height:e.height??"12px"}),"aria-hidden":"true"},null,6))}}),sM=mt(vNe,[["__scopeId","data-v-f4989189"]]),wNe={key:0,class:"ui-field__label"},yNe={key:1,class:"ui-field__error"},kNe={key:2,class:"ui-field__hint"},bNe=Ge({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-field",{"has-error":!!e.error}])},[e.label?(g(),S("label",wNe,I(e.label),1)):J("",!0),En(t.$slots,"default",{},void 0,!0),e.error?(g(),S("span",yNe,I(e.error),1)):e.hint?(g(),S("span",kNe,I(e.hint),1)):J("",!0)],2))}}),hl=mt(bNe,[["__scopeId","data-v-bd93f701"]]),_Ne={class:"provider-form__fields"},xNe=["value"],SNe={class:"provider-form__key"},CNe={class:"provider-form__models-head"},MNe={class:"provider-form__models"},ANe={class:"provider-form__model provider-form__model--head"},ENe={key:0,class:"provider-form__row-error",role:"alert"},TNe={key:0,class:"provider-form__error",role:"alert"},INe={class:"provider-form__actions"},LNe=Ge({__name:"ProviderForm",props:{mode:{},provider:{},config:{}},emits:["dirtyChange","saved","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=oM(),r=Rs(i),l=U({models:{}}),a=U(""),c=U(!1),u=U(!1),d=U(!1),f=U(!1),p=B(()=>dNe.map($=>({value:$,label:s(`providers.types.${$}`)})));function h(){const $=n.provider;if(n.mode==="edit"&&$!==void 0){r.id=$.id,r.type=$.type,r.apiKey="",r.baseUrl=$.baseUrl??"";const E=Rz($,n.config?.models);r.models=E.length>0?E:[W7()]}else Object.assign(r,oM());l.value={models:{}},a.value="",o("dirtyChange",!1)}function m($){const E=l.value[$];return E===void 0?"":s(`providers.error.${E}`)}function k($,E){const T=l.value.models[$]?.[E];return T===void 0?"":s(`providers.error.${T}`)}function x($){if(l.value[$]===void 0)return;const{[$]:E,...T}=l.value;l.value={...T,models:l.value.models}}function v($,E){const T=l.value.models[$];if(T?.[E]===void 0)return;const{[E]:N,...C}=T,{[$]:O,...H}=l.value.models;l.value={...l.value,models:Object.keys(C).length>0?{...H,[$]:C}:H}}async function w(){const $=n.provider;if(!(n.mode!=="edit"||$===void 0||!$.hasApiKey))try{const E=await At().getProvider($.id);E.apiKey&&!f.value&&(r.apiKey=E.apiKey,d.value=!0)}catch{d.value=!1}}function b(){o("dirtyChange",!0)}function M(){r.models.push(W7()),b()}function R($){r.models.length<=1||(r.models.splice($,1),l.value={...l.value,models:{}},b())}async function z(){if(c.value)return;const $=pNe(r,{apiKey:n.mode==="add",baseUrl:n.mode==="add"});if(l.value=$,hNe($)){a.value=$.modelsEmpty===void 0?"":s(`providers.error.${$.modelsEmpty}`);return}c.value=!0,a.value="";try{if(n.mode==="add"){const N=await At().addProvider(mNe(r));o("dirtyChange",!1),o("saved",N.id);return}const E=n.provider;if(E===void 0)return;const T=await At().updateProvider(E.id,gNe(r,E,d.value,n.config?.providers[E.id]?.defaultModel));o("dirtyChange",!1),o("saved",T.provider.id)}catch{a.value=s("providers.saveFailed")}finally{c.value=!1}}return xn(()=>{h(),w()}),($,E)=>(g(),S("form",{class:"provider-form",onSubmit:xt(z,["prevent"]),onInput:b},[_("div",_Ne,[Z(hl,{label:y(s)("providers.fieldId"),error:m("id")},{default:ue(()=>[Z(os,{modelValue:r.id,"onUpdate:modelValue":[E[0]||(E[0]=T=>r.id=T),E[1]||(E[1]=T=>x("id"))],autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label","error"]),Z(hl,{label:y(s)("providers.fieldType")},{default:ue(()=>[Z(A4,{modelValue:r.type,"onUpdate:modelValue":E[2]||(E[2]=T=>r.type=T)},{default:ue(()=>[(g(!0),S(Me,null,it(p.value,T=>(g(),S("option",{key:T.value,value:T.value},I(T.label),9,xNe))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey"),error:m("apiKey")},{default:ue(()=>[_("div",SNe,[Z(os,{modelValue:r.apiKey,"onUpdate:modelValue":[E[3]||(E[3]=T=>r.apiKey=T),E[4]||(E[4]=T=>{f.value=!0,x("apiKey")})],type:u.value?"text":"password",placeholder:e.provider?.hasApiKey?y(s)("providers.apiKeySet"):"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","type","placeholder"]),Z(Zt,{class:"provider-form__eye",size:"sm",label:u.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:E[5]||(E[5]=T=>u.value=!u.value)},{default:ue(()=>[Z(Le,{name:u.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label","error"]),Z(hl,{label:y(s)("providers.fieldBaseUrl"),error:m("baseUrl")},{default:ue(()=>[Z(os,{modelValue:r.baseUrl,"onUpdate:modelValue":[E[6]||(E[6]=T=>r.baseUrl=T),E[7]||(E[7]=T=>x("baseUrl"))],placeholder:y(s)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label","error"])]),_("div",CNe,[_("strong",null,I(y(s)("providers.fieldModels")),1),Z(It,{type:"button",size:"sm",variant:"secondary",onClick:M},{default:ue(()=>[Z(Le,{name:"plus",size:"sm"}),He(I(y(s)("providers.addModel")),1)]),_:1})]),_("div",MNe,[_("div",ANe,[_("span",null,I(y(s)("providers.colModelId")),1),_("span",null,I(y(s)("providers.colContext")),1),_("span",null,I(y(s)("providers.colDisplayName")),1),E[9]||(E[9]=_("span",null,null,-1))]),(g(!0),S(Me,null,it(r.models,(T,N)=>(g(),S(Me,{key:N},[_("div",{class:Be(["provider-form__model",{"has-error":!!l.value.models[N]}])},[Z(os,{modelValue:T.model,"onUpdate:modelValue":[C=>T.model=C,C=>v(N,"model")],placeholder:y(s)("providers.modelIdPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(os,{modelValue:T.maxContextSize,"onUpdate:modelValue":[C=>T.maxContextSize=C,C=>v(N,"maxContextSize")],inputmode:"numeric",placeholder:y(s)("providers.modelContextPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(os,{modelValue:T.displayName,"onUpdate:modelValue":C=>T.displayName=C,placeholder:y(s)("providers.modelNamePlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]),Z(Zt,{size:"sm",disabled:r.models.length<=1,label:y(s)("providers.removeModel"),onClick:C=>R(N)},{default:ue(()=>[Z(Le,{name:"trash",size:"sm"})]),_:1},8,["disabled","label","onClick"])],2),l.value.models[N]?(g(),S("div",ENe,I([k(N,"model"),k(N,"maxContextSize")].filter(Boolean).join(" · ")),1)):J("",!0)],64))),128))]),a.value?(g(),S("div",TNe,I(a.value),1)):J("",!0),_("div",INe,[Z(It,{type:"button",variant:"secondary",onClick:E[8]||(E[8]=T=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:c.value},{default:ue(()=>[He(I(y(s)("providers.save")),1)]),_:1},8,["loading"])])],32))}}),jz=mt(LNe,[["__scopeId","data-v-66e70e30"]]),$Ne={class:"add-provider-flow"},NNe={key:0,class:"add-provider-flow__section"},zNe={key:0,class:"add-provider-flow__state"},BNe={key:1,class:"add-provider-flow__state"},RNe={class:"add-provider-flow__catalog"},FNe=["disabled","onClick"],jNe={class:"add-provider-flow__name"},ONe={key:0,class:"add-provider-flow__empty"},PNe={class:"add-provider-flow__key"},HNe={key:1,class:"add-provider-flow__warning"},DNe={class:"add-provider-flow__note"},VNe={key:2,class:"add-provider-flow__error",role:"alert"},WNe={class:"add-provider-flow__actions"},qNe={class:"add-provider-flow__note"},UNe={class:"add-provider-flow__key"},ZNe={key:0,class:"add-provider-flow__error",role:"alert"},KNe={class:"add-provider-flow__actions"},GNe={key:2,class:"add-provider-flow__section"},YNe=Ge({__name:"AddProviderFlow",props:{config:{},initialSource:{}},emits:["dirtyChange","added","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=U(n.initialSource??"catalog"),r=B(()=>[{value:"catalog",label:s("providers.catalog.sourceCatalog")},{value:"registry",label:s("providers.catalog.sourceRegistry")},{value:"manual",label:s("providers.catalog.sourceManual")}]),l=U([]),a=U("loading"),c=U(""),u=U(null),d=Rs({id:"",apiKey:"",baseUrl:""}),f=U(""),p=U(!1),h=U(!1),m=Rs({url:"",apiKey:""}),k=U(""),x=U(!1),v=U(!1),w=B(()=>{const N=c.value.trim().toLowerCase();return N===""?l.value:l.value.filter(C=>C.name.toLowerCase().includes(N)||C.id.toLowerCase().includes(N))}),b=B(()=>Object.hasOwn(n.config?.providers??{},d.id.trim()));async function M(){a.value="loading";try{l.value=await At().listCatalogProviders(),a.value="ready";const N=l.value.filter(C=>!C.rejected);N.length===1&&u.value===null&&z(N[0])}catch{a.value="error"}}function R(N){const C=N.rejectReason===null?"":`providers.catalog.rejectReason.${N.rejectReason}`;return C!==""&&s(C)!==C?s(C):s("providers.catalog.rejected")}function z(N){N.rejected||(u.value=N,d.id=N.id,d.apiKey="",d.baseUrl="",f.value="")}function $(){o("dirtyChange",!0)}async function E(){const N=u.value;if(N===null||p.value)return;const C=d.id.trim();if(C===""){f.value=s("providers.error.idRequired");return}if(d.apiKey.trim()===""){f.value=s("providers.error.apiKeyRequired");return}if(N.needsBaseUrl&&d.baseUrl.trim()===""){f.value=s("providers.error.baseUrlRequired");return}p.value=!0,f.value="";try{await At().importCatalogProvider({catalogId:N.id,id:C===N.id?void 0:C,apiKey:d.apiKey.trim(),baseUrl:d.baseUrl.trim()||void 0}),o("dirtyChange",!1),o("added",C)}catch{f.value=s("providers.addFailed")}finally{p.value=!1}}async function T(){if(x.value)return;const N=m.url.trim();if(N===""){k.value=s("providers.error.registryUrlRequired");return}x.value=!0,k.value="";try{const C=await At().importCustomRegistry({url:N,apiKey:m.apiKey.trim()||void 0});o("dirtyChange",!1);const O=C.providers[0];O===void 0?o("cancel"):o("added",O.id)}catch{k.value=s("providers.addFailed")}finally{x.value=!1}}return xn(M),(N,C)=>(g(),S("div",$Ne,[Z(ni,{modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=O=>i.value=O),size:"sm",options:r.value},null,8,["modelValue","options"]),i.value==="catalog"?(g(),S("section",NNe,[a.value==="loading"?(g(),S("div",zNe,[Z(Go,{size:"sm"}),He(I(y(s)("providers.catalog.loading")),1)])):a.value==="error"?(g(),S("div",BNe,[_("span",null,I(y(s)("providers.catalog.loadError")),1),Z(It,{size:"sm",variant:"secondary",onClick:M},{default:ue(()=>[He(I(y(s)("providers.catalog.retry")),1)]),_:1})])):u.value===null?(g(),S(Me,{key:2},[Z(os,{modelValue:c.value,"onUpdate:modelValue":C[1]||(C[1]=O=>c.value=O),placeholder:y(s)("providers.catalog.searchPlaceholder"),autocomplete:"off"},null,8,["modelValue","placeholder"]),_("div",RNe,[(g(!0),S(Me,null,it(w.value,O=>(g(),S("button",{key:O.id,type:"button",class:"add-provider-flow__entry",disabled:O.rejected,onClick:H=>z(O)},[_("span",jNe,I(O.name),1),O.wireType?(g(),ce(wr,{key:0,size:"sm",variant:"neutral"},{default:ue(()=>[He(I(O.wireType),1)]),_:2},1024)):J("",!0),C[15]||(C[15]=_("span",{class:"add-provider-flow__grow"},null,-1)),_("span",null,I(O.rejected?R(O):y(s)("providers.modelCount",{count:O.models.length})),1)],8,FNe))),128)),w.value.length===0?(g(),S("div",ONe,I(y(s)("providers.catalog.empty")),1)):J("",!0)])],64)):(g(),S("form",{key:3,class:"add-provider-flow__form",onSubmit:xt(E,["prevent"]),onInput:$},[_("button",{type:"button",class:"add-provider-flow__back",onClick:C[2]||(C[2]=O=>u.value=null)},[Z(Le,{class:"add-provider-flow__back-icon",name:"chevron-right",size:"sm"}),He(I(y(s)("providers.catalog.backToList")),1)]),Z(hl,{label:y(s)("providers.fieldId")},{default:ue(()=>[Z(os,{modelValue:d.id,"onUpdate:modelValue":C[3]||(C[3]=O=>d.id=O),autocomplete:"off"},null,8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey")},{default:ue(()=>[_("div",PNe,[Z(os,{modelValue:d.apiKey,"onUpdate:modelValue":C[4]||(C[4]=O=>d.apiKey=O),type:h.value?"text":"password",autocomplete:"off"},null,8,["modelValue","type"]),Z(Zt,{class:"add-provider-flow__eye",size:"sm",label:h.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:C[5]||(C[5]=O=>h.value=!h.value)},{default:ue(()=>[Z(Le,{name:h.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label"]),u.value.needsBaseUrl?(g(),ce(hl,{key:0,label:y(s)("providers.fieldBaseUrl")},{default:ue(()=>[Z(os,{modelValue:d.baseUrl,"onUpdate:modelValue":C[6]||(C[6]=O=>d.baseUrl=O),placeholder:y(s)("providers.baseUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):J("",!0),b.value?(g(),S("div",HNe,I(y(s)("providers.catalog.overwriteWarning")),1)):J("",!0),_("div",DNe,I(y(s)("providers.catalog.willImport",{count:u.value.models.length})),1),f.value?(g(),S("div",VNe,I(f.value),1)):J("",!0),_("div",WNe,[Z(It,{type:"button",variant:"secondary",onClick:C[7]||(C[7]=O=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:p.value},{default:ue(()=>[He(I(y(s)("providers.catalog.importAction")),1)]),_:1},8,["loading"])])],32))])):i.value==="registry"?(g(),S("form",{key:1,class:"add-provider-flow__section add-provider-flow__form",onSubmit:xt(T,["prevent"]),onInput:$},[_("p",qNe,I(y(s)("providers.catalog.registryHint")),1),Z(hl,{label:y(s)("providers.catalog.registryUrlLabel")},{default:ue(()=>[Z(os,{modelValue:m.url,"onUpdate:modelValue":C[8]||(C[8]=O=>m.url=O),placeholder:"https://example.com/api.json",autocomplete:"off"},null,8,["modelValue"])]),_:1},8,["label"]),Z(hl,{label:y(s)("providers.fieldApiKey")},{default:ue(()=>[_("div",UNe,[Z(os,{modelValue:m.apiKey,"onUpdate:modelValue":C[9]||(C[9]=O=>m.apiKey=O),type:v.value?"text":"password",autocomplete:"off"},null,8,["modelValue","type"]),Z(Zt,{class:"add-provider-flow__eye",size:"sm",label:v.value?y(s)("providers.hideApiKey"):y(s)("providers.showApiKey"),onClick:C[10]||(C[10]=O=>v.value=!v.value)},{default:ue(()=>[Z(Le,{name:v.value?"eye-off":"eye",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_:1},8,["label"]),k.value?(g(),S("div",ZNe,I(k.value),1)):J("",!0),_("div",KNe,[Z(It,{type:"button",variant:"secondary",onClick:C[11]||(C[11]=O=>o("cancel"))},{default:ue(()=>[He(I(y(s)("common.cancel")),1)]),_:1}),Z(It,{type:"submit",variant:"primary",loading:x.value},{default:ue(()=>[He(I(y(s)("providers.catalog.importAction")),1)]),_:1},8,["loading"])])],32)):(g(),S("div",GNe,[Z(jz,{mode:"add",config:e.config,onDirtyChange:C[12]||(C[12]=O=>o("dirtyChange",O)),onSaved:C[13]||(C[13]=O=>o("added",O)),onCancel:C[14]||(C[14]=O=>o("cancel"))},null,8,["config"])]))]))}}),Oz=mt(YNe,[["__scopeId","data-v-01edc4ef"]]),XNe={class:"providers-panel"},JNe={class:"providers-panel__heading"},QNe={key:1,class:"providers-panel__split"},eze=["aria-label"],tze={class:"providers-pane-label"},nze=["aria-label"],oze=["data-testid","aria-current","onClick"],sze=["aria-label"],ize={"aria-hidden":"true"},rze={class:"providers-panel__row-name"},lze={class:"providers-pane-label"},aze=["aria-current"],cze={class:"providers-panel__add-icon"},uze={class:"providers-panel__row-name"},dze={class:"providers-panel__detail"},fze={class:"providers-detail__head"},pze={class:"providers-detail__tile","aria-hidden":"true"},hze={class:"providers-detail__identity"},mze={class:"providers-detail__name-row"},gze={class:"providers-detail__meta"},vze={class:"mono"},wze={class:"providers-detail__sec"},yze={class:"providers-detail__sec-head"},kze={class:"providers-pane-label"},bze={class:"providers-detail__count"},_ze={key:0,class:"providers-model-card"},xze={key:0,class:"providers-model-name"},Sze={key:1,class:"providers-detail__empty"},Cze={class:"providers-detail__sec"},Mze={class:"providers-detail__foot"},iM="$add",Aze=Ge({__name:"ProvidersPanel",props:{discardToken:{default:0}},emits:["dirtyChange"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),{confirm:s}=y1(),i=b1(),r=U([]),l=U(null),a=U(!1),c=U(!1),u=U(null),d=U(!1),f=B(()=>r.value.toSorted((E,T)=>E.id.localeCompare(T.id))),p=B(()=>u.value===iM),h=B(()=>f.value.find(E=>E.id===u.value)??null),m=B(()=>{const E=h.value;if(!E?.models?.length)return[];const T=new Map(Rz(E,l.value?.models).map(N=>[N.model,N.maxContextSize]));return E.models.map(N=>{const C=T.get(N)?.trim()??"";return{id:N,contextBadge:k(C)}})});function k(E){if(!E||!/^\d+$/.test(E))return;const T=Number(E);if(!(!Number.isFinite(T)||T<=0))return T>=1e6?`${x(T/1e6)}M`:T>=1e3?`${x(T/1e3)}K`:String(T)}function x(E){return String(Number(E.toFixed(1)))}function v(E){return E==="connected"?"ok":E==="error"?"error":"idle"}function w(E){return(E.trim()[0]??"?").toUpperCase()}Ue(d,E=>n("dirtyChange",E),{immediate:!0}),Ue(()=>e.discardToken,()=>{d.value=!1,u.value=f.value[0]?.id??null});async function b(){await i.refreshRuntimeState(),await M()}async function M(){a.value=!0,c.value=!1;try{r.value=await At().listProviders(),f.value.some(E=>E.id===u.value)||(u.value=f.value[0]?.id??null)}catch{r.value=[],c.value=!0}try{l.value=await At().getConfig()}catch{l.value=null}finally{a.value=!1}}function R(E){d.value||(u.value=E)}async function z(E){d.value=!1,await b(),u.value=E}async function $(E){await s({title:o("providers.deleteProvider"),message:o("providers.deleteConfirm",{id:E.id,count:E.models?.length??0}),confirmLabel:o("providers.deleteConfirmYes"),cancelLabel:o("common.cancel"),variant:"danger",action:async()=>{await At().deleteProvider(E.id),u.value=null,d.value=!1,await b()}})}return xn(M),(E,T)=>(g(),S("section",XNe,[_("div",JNe,[_("div",null,[_("h3",null,I(y(o)("providers.title")),1),_("p",null,I(y(o)("providers.description")),1)]),!a.value&&!c.value?(g(),ce(Zt,{key:0,size:"sm",label:y(o)("providers.refresh"),"data-testid":"providers-refresh",onClick:T[0]||(T[0]=N=>b())},{default:ue(()=>[Z(Le,{name:"undo",size:"sm"})]),_:1},8,["label"])):J("",!0)]),c.value?(g(),ce(B9,{key:0,variant:"warning"},{default:ue(()=>[He(I(y(o)("providers.unavailable")),1)]),_:1})):(g(),S("div",QNe,[_("nav",{class:"providers-panel__list","aria-label":y(o)("providers.title")},[_("div",tze,I(y(o)("settings.tabs.providers")),1),a.value?(g(),S(Me,{key:0},it(3,N=>_("div",{key:N,class:"providers-panel__row providers-panel__row--skeleton",role:"status","aria-label":y(o)("providers.loading")},[Z(sM,{width:"26px",height:"26px",circle:""}),Z(sM,{width:`${52-N*6}%`,height:"11px"},null,8,["width"])],8,nze)),64)):(g(),S(Me,{key:1},[(g(!0),S(Me,null,it(f.value,N=>(g(),S("button",{key:N.id,type:"button",class:Be(["providers-panel__row",{"is-selected":u.value===N.id}]),"data-testid":`provider-${N.id}-toggle`,"aria-current":u.value===N.id,onClick:C=>R(N.id)},[Z(Cn,{text:y(o)(`providers.status.${N.status}`)},{default:ue(()=>[_("span",{class:Be(["providers-panel__tile",`is-${v(N.status)}`]),role:"img","aria-label":y(o)(`providers.status.${N.status}`)},[_("span",ize,I(w(N.type)),1)],10,sze)]),_:2},1032,["text"]),_("span",rze,I(N.id),1),_("span",{class:Be(["providers-panel__row-dot",`is-${v(N.status)}`]),"aria-hidden":"true"},null,2)],10,oze))),128)),_("div",lze,I(y(o)("providers.customProviders")),1),_("button",{type:"button",class:Be(["providers-panel__row providers-panel__row--add",{"is-selected":p.value}]),"aria-current":p.value,onClick:T[1]||(T[1]=N=>R(iM))},[_("span",cze,[Z(Le,{name:"plus",size:"sm"})]),_("span",uze,I(y(o)("providers.addProvider")),1)],10,aze)],64))],8,eze),_("div",dze,[p.value?(g(),ce(Oz,{key:0,config:l.value,onDirtyChange:T[2]||(T[2]=N=>d.value=N),onAdded:z,onCancel:T[3]||(T[3]=N=>{u.value=f.value[0]?.id??null,d.value=!1})},null,8,["config"])):h.value?(g(),S(Me,{key:1},[_("header",fze,[_("span",pze,I(w(h.value.type)),1),_("div",hze,[_("div",mze,[_("h4",null,I(h.value.id),1),Z(wr,{variant:h.value.status==="connected"?"success":h.value.status==="error"?"danger":"neutral",size:"md"},{default:ue(()=>[He(I(y(o)(`providers.status.${h.value.status}`)),1)]),_:1},8,["variant"])]),_("p",gze,[_("span",null,I(h.value.type),1),h.value.baseUrl?(g(),S(Me,{key:0},[T[7]||(T[7]=_("span",{"aria-hidden":"true"},"·",-1)),_("span",vze,I(h.value.baseUrl),1)],64)):J("",!0)])])]),_("section",wze,[_("div",yze,[_("span",kze,I(y(o)("providers.fieldModels")),1),_("span",bze,I(y(o)("providers.modelCount",{count:h.value.models?.length??0})),1)]),m.value.length>0?(g(),S("div",_ze,[(g(!0),S(Me,null,it(m.value,N=>(g(),S("div",{key:N.id,class:"providers-model-row"},[_("code",null,I(N.id),1),N.displayName?(g(),S("span",xze,I(N.displayName),1)):J("",!0),T[8]||(T[8]=_("span",{class:"providers-model-grow"},null,-1)),N.contextBadge?(g(),ce(wr,{key:1,variant:"neutral",size:"sm"},{default:ue(()=>[He(I(N.contextBadge),1)]),_:2},1024)):J("",!0)]))),128))])):(g(),S("p",Sze,I(y(o)("providers.noModels")),1))]),_("section",Cze,[Z(jz,{mode:"edit",provider:h.value,config:l.value,onDirtyChange:T[4]||(T[4]=N=>d.value=N),onSaved:z,onCancel:T[5]||(T[5]=N=>{u.value=f.value[0]?.id??null,d.value=!1})},null,8,["provider","config"])]),_("footer",Mze,[Z(It,{variant:"danger-soft",size:"sm","data-testid":`provider-${h.value.id}-delete`,onClick:T[6]||(T[6]=N=>$(h.value))},{default:ue(()=>[Z(Le,{name:"trash",size:"sm"}),He(I(y(o)("providers.deleteProvider")),1)]),_:1},8,["data-testid"])])],64)):r.value.length===0&&!a.value?(g(),ce(Cg,{key:2,title:y(o)("providers.empty"),hint:y(o)("providers.emptyHint")},{icon:ue(()=>[Z(Le,{name:"bolt"})]),_:1},8,["title","hint"])):J("",!0)])]))]))}}),Eze=mt(Aze,[["__scopeId","data-v-66a5ed6a"]]),Tze=["aria-expanded","aria-label","disabled"],Ize=["aria-label"],Lze=["aria-label"],$ze=["aria-selected"],Nze={class:"sm-picker__option-label"},zze={class:"sm-picker__group"},Bze=["aria-selected","onMouseenter","onClick"],Rze={class:"sm-picker__option-label"},Fze=["aria-label"],jze={class:"sm-picker__group"},Oze=["aria-selected","onMouseenter","onClick"],Pze={class:"sm-picker__option-label"},Hze=250,Dze=188,Vze=Ge({__name:"SecondaryModelPicker",props:{modelValue:{},effort:{},groups:{},modelInfoById:{},disabled:{type:Boolean}},emits:["inherit","select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt(),i=`sm-picker-${Math.random().toString(36).slice(2,9)}`,r=U(null),l=U(null),a=U(null),c=U(!1),u=U(!1),d=U({}),f=U(null),p=U(""),h=U(0),m=U("models"),k=U(0),x=U(0),v=U("right"),w=new Map;let b=null;const M=B(()=>[{id:"",label:s("settings.noSecondaryModel")},...n.groups.flatMap(Y=>Y.options)]),R=B(()=>n.modelValue?M.value.find(Y=>Y.id===n.modelValue)?.label??n.modelValue:""),z=B(()=>n.modelValue?n.effort?`${R.value} · ${n.effort}`:R.value:s("settings.noSecondaryModel")),$=B(()=>{const Y=f.value;if(Y===null||Y==="")return[];const ne=Kp(n.modelInfoById[Y]),D=n.effort===""?[null,...ne]:[...ne];return n.modelValue===Y&&n.effort!==""&&!ne.includes(n.effort)&&D.push(n.effort),D});function E(Y){return n.modelValue!==f.value?!1:Y===null?n.effort==="":n.effort===Y}function T(){const Y=$.value.findIndex(E);return Y>=0?Y:0}function N(Y,ne){Y instanceof HTMLElement?w.set(ne,Y):w.delete(ne)}function C(){b!==null&&(clearTimeout(b),b=null)}function O(){C(),b=setTimeout(()=>{f.value=null,m.value==="efforts"&&(m.value="models")},Hze)}function H(Y){Y!==p.value&&(p.value=Y,h.value=Math.max(0,M.value.findIndex(ne=>ne.id===Y)))}function V(){const Y=r.value,ne=l.value;if(!Y||!ne)return;const D=Y.getBoundingClientRect(),X=ne.offsetHeight,ve=window.innerHeight-D.bottom;u.value=veX;const fe=Math.max(8,window.innerWidth-D.right);d.value=u.value?{right:`${fe}px`,bottom:`${window.innerHeight-D.top+4}px`,top:"auto"}:{right:`${fe}px`,top:`${D.bottom+4}px`,bottom:"auto"}}function A(){const Y=l.value,ne=f.value===null?void 0:w.get(f.value);if(!Y||!ne)return;const D=Y.getBoundingClientRect(),X=ne.getBoundingClientRect(),ve=a.value?.offsetHeight??0,fe=Math.max(0,window.innerHeight-8-ve-D.top);x.value=Math.max(0,Math.min(X.top-D.top-4,Y.offsetHeight-40,fe));const pe=window.innerWidth-D.right;v.value=pe>=Dze||pe>=D.left?"right":"left"}function F(){c.value||n.disabled||(c.value=!0,p.value=n.modelValue||M.value[0]?.id||"",h.value=Math.max(0,M.value.findIndex(Y=>Y.id===p.value)),f.value=null,m.value="models",vt(V))}function j({restoreFocus:Y=!1}={}){c.value&&(C(),c.value=!1,f.value=null,Y&&vt(()=>r.value?.focus()))}function q(){c.value?j({restoreFocus:!0}):F()}function P(){f.value=null,m.value="models"}function W(Y,{moveFocus:ne=!1}={}){if(H(Y),C(),Y===""){f.value=null,m.value="models";return}f.value=Y,vt(A),ne&&(m.value="efforts",k.value=T())}function G(Y){const ne=f.value;if(ne===null)return;const D={model:ne,...Y===null?{}:{effort:Y}};(D.model!==n.modelValue||(D.effort??"")!==n.effort)&&o("select",D),j({restoreFocus:!0})}function ee(){o("inherit"),j({restoreFocus:!0})}function se(){vt(()=>{l.value?.querySelector(".sm-picker__option.is-kb-active")?.scrollIntoView({block:"nearest"})})}function oe(Y){const ne=M.value;if(ne.length===0)return;const D=ne[(h.value+Y+ne.length)%ne.length];H(D.id),f.value!==null&&W(D.id),se()}function Q(Y){const ne=$.value;ne.length!==0&&(k.value=(k.value+Y+ne.length)%ne.length,se())}function ge(Y){if(!c.value){(Y.key==="Enter"||Y.key===" "||Y.key==="ArrowDown")&&(Y.preventDefault(),F());return}if(Y.key==="ArrowDown")Y.preventDefault(),m.value==="models"?oe(1):Q(1);else if(Y.key==="ArrowUp")Y.preventDefault(),m.value==="models"?oe(-1):Q(-1);else if(Y.key==="ArrowRight")Y.preventDefault(),p.value!==""&&W(p.value,{moveFocus:!0});else if(Y.key==="ArrowLeft")Y.preventDefault(),f.value!==null&&P();else if(Y.key==="Enter"||Y.key===" ")Y.preventDefault(),m.value==="models"&&p.value===""?ee():m.value==="models"?W(p.value,{moveFocus:!0}):G($.value[k.value]??null);else if(Y.key==="Home"||Y.key==="End"){Y.preventDefault();const ne=Y.key==="Home";if(m.value==="models"){const D=M.value;if(D.length===0)return;const X=(ne?D[0]:D.at(-1)).id;H(X),f.value!==null&&W(X)}else k.value=ne?0:$.value.length-1;se()}else Y.key==="Escape"&&(Y.preventDefault(),j({restoreFocus:!0}))}function xe(Y){const ne=Y.target;ne instanceof Node&&(r.value?.contains(ne)||l.value?.contains(ne)||j())}function Ke(Y){if(c.value){if(l.value?.contains(Y.target instanceof Node?Y.target:null)){A();return}j(),V()}}function et(){c.value&&V()}return xn(()=>{document.addEventListener("pointerdown",xe),document.addEventListener("scroll",Ke,!0),window.addEventListener("resize",et)}),An(()=>{document.removeEventListener("pointerdown",xe),document.removeEventListener("scroll",Ke,!0),window.removeEventListener("resize",et),C()}),(Y,ne)=>(g(),S("div",{class:Be(["sm-picker",{"is-open":c.value}])},[_("button",{ref_key:"triggerRef",ref:r,class:"sm-picker__trigger",type:"button",role:"combobox","aria-controls":i,"aria-expanded":c.value,"aria-haspopup":"dialog","aria-label":y(s)("settings.secondaryModel"),disabled:e.disabled,onClick:q,onKeydown:ge},[_("span",{class:Be(["sm-picker__value",{"is-placeholder":!e.modelValue}])},[_("span",null,I(z.value),1)],2),Z(Le,{class:"sm-picker__chevron",name:"chevron-down",size:"sm"})],40,Tze),(g(),ce(Gr,{to:"body"},[c.value?(g(),S("div",{key:0,id:i,ref_key:"menuRef",ref:l,class:Be(["sm-picker__menu",{"sm-picker__menu--up":u.value}]),style:Wt(d.value),role:"dialog","aria-label":y(s)("settings.secondaryModel")},[_("div",{class:"sm-picker__models",role:"listbox","aria-label":y(s)("settings.secondaryModel")},[_("button",{ref:D=>N(D,""),type:"button",class:Be(["sm-picker__option",{"is-selected":e.modelValue==="","is-active":p.value==="","is-kb-active":m.value==="models"&&p.value===""}]),role:"option","aria-selected":e.modelValue==="",onMouseenter:ne[0]||(ne[0]=D=>W("")),onClick:ee},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",Nze,I(y(s)("settings.noSecondaryModel")),1)],42,$ze),ne[1]||(ne[1]=_("div",{class:"sm-picker__divider"},null,-1)),(g(!0),S(Me,null,it(e.groups,D=>(g(),S(Me,{key:D.provider},[_("div",zze,I(D.provider),1),(g(!0),S(Me,null,it(D.options,X=>(g(),S("button",{key:X.id,ref_for:!0,ref:ve=>N(ve,X.id),type:"button",class:Be(["sm-picker__option",{"is-selected":X.id===e.modelValue,"is-active":X.id===p.value,"is-kb-active":m.value==="models"&&X.id===p.value}]),role:"option","aria-selected":X.id===e.modelValue,onMouseenter:ve=>W(X.id),onMouseleave:O,onClick:ve=>W(X.id,{moveFocus:!0})},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",Rze,I(X.label),1),Z(Le,{class:"sm-picker__flyout-caret",name:"chevron-right",size:"sm"})],42,Bze))),128))],64))),128))],8,Lze),f.value!==null?(g(),S("div",{key:0,ref_key:"flyoutRef",ref:a,class:Be(["sm-picker__flyout",`sm-picker__flyout--${v.value}`]),style:Wt({top:`${x.value}px`}),role:"listbox","aria-label":y(s)("settings.secondaryModelEffort"),onMouseenter:C,onMouseleave:O},[_("div",jze,I(y(s)("settings.secondaryModelEffort")),1),(g(!0),S(Me,null,it($.value,(D,X)=>(g(),S("button",{key:D??"__default__",type:"button",class:Be(["sm-picker__option",{"is-selected":E(D),"is-kb-active":m.value==="efforts"&&X===k.value,"is-muted":D===null}]),role:"option","aria-selected":E(D),onMouseenter:ve=>{m.value="efforts",k.value=X},onClick:ve=>G(D)},[Z(Le,{class:"sm-picker__check",name:"check",size:"sm"}),_("span",Pze,I(D??y(s)("settings.secondaryModelEffortAuto")),1)],42,Oze))),128))],46,Fze)):J("",!0)],14,Ize)):J("",!0)]))],2))}}),Wze=mt(Vze,[["__scopeId","data-v-5b749db7"]]),qze=["aria-label"],Uze=["aria-selected","onClick"],Zze={class:"body"},Kze={class:"panel"},Gze={class:"sec"},Yze={class:"sec-title"},Xze={class:"row"},Jze={class:"rlabel"},Qze={class:"row"},eBe={class:"rlabel"},tBe={class:"row"},nBe={class:"rlabel"},oBe={class:"sec"},sBe={class:"sec-title"},iBe={class:"row"},rBe={class:"rlabel"},lBe={key:0,class:"hint"},aBe={class:"row"},cBe={class:"rlabel"},uBe={key:0,class:"hint"},dBe={class:"row"},fBe={class:"rlabel"},pBe={key:0,class:"hint"},hBe={class:"row"},mBe={class:"rlabel"},gBe={class:"panel"},vBe={class:"sec"},wBe={class:"sec-title"},yBe={class:"row"},kBe={class:"rlabel"},bBe={key:0,class:"rvalue"},_Be={class:"actions"},xBe={class:"panel"},SBe={class:"panel"},CBe={class:"sec"},MBe={class:"sec-head"},ABe={class:"sec-title"},EBe={key:0,class:"saving"},TBe={class:"row"},IBe={class:"rlabel"},LBe={class:"hint"},$Be={key:0,class:"select-wrap"},NBe={key:0,value:"",disabled:""},zBe=["label"],BBe=["value"],RBe={key:1,class:"rvalue mono"},FBe={key:0,class:"sec"},jBe={class:"sec-title"},OBe={class:"row"},PBe={class:"rlabel"},HBe={class:"hint"},DBe={key:1,class:"rvalue"},VBe={key:0,class:"row"},WBe={class:"rlabel"},qBe={class:"hint"},UBe={class:"row"},ZBe={class:"rlabel"},KBe={class:"hint"},GBe={class:"row"},YBe={class:"rlabel"},XBe={class:"hint"},JBe={class:"row"},QBe={class:"rlabel"},eRe={class:"hint"},tRe={class:"row"},nRe={class:"rlabel"},oRe={class:"hint"},sRe={key:1,class:"empty-config"},iRe={class:"panel"},rRe={class:"sec"},lRe={class:"sec-title"},aRe={class:"row"},cRe={class:"rlabel"},uRe={class:"hint"},dRe={class:"rvalue mono"},fRe={class:"row"},pRe={class:"rlabel"},hRe={class:"hint"},mRe={class:"value-wrap"},gRe={class:"rvalue mono"},vRe={class:"row"},wRe={class:"rlabel"},yRe={class:"hint"},kRe={class:"value-wrap"},bRe={class:"rvalue mono"},_Re={class:"row"},xRe={class:"rlabel"},SRe={class:"rvalue mono"},CRe={key:0,class:"sec"},MRe={key:0,class:"row"},ARe={class:"rlabel"},ERe={class:"hint"},TRe={class:"hint"},IRe={class:"sec"},LRe={class:"sec-title"},$Re={class:"row"},NRe={class:"rlabel"},zRe={key:0,class:"hint"},BRe={class:"row"},RRe={class:"rlabel"},FRe={class:"panel"},jRe={key:0,class:"sec"},ORe={class:"sec-title"},PRe={"data-testid":"desktop-update-controls",class:"desktop-update-card"},HRe={class:"desktop-update-row desktop-update-summary"},DRe={class:"desktop-update-summary-copy"},VRe={class:"desktop-update-icon","aria-hidden":"true"},WRe={class:"rlabel"},qRe={class:"desktop-update-title","aria-live":"polite"},URe={class:"hint"},ZRe={class:"desktop-update-row"},KRe={class:"rlabel"},GRe={class:"hint"},YRe={class:"select-wrap desktop-update-select"},XRe=["value"],JRe={class:"desktop-update-row"},QRe={class:"rlabel"},eFe={class:"hint"},tFe={class:"desktop-update-row"},nFe={class:"rlabel"},oFe={class:"hint"},sFe={key:0,class:"desktop-update-detail"},iFe={key:0,class:"desktop-update-progress"},rFe=["aria-label"],lFe=["value","aria-label"],aFe={"data-testid":"settings-update-progress-detail"},cFe={class:"desktop-update-actions"},uFe={class:"panel"},dFe={class:"sec"},fFe={class:"sec-title"},pFe={class:"row"},hFe={class:"rlabel"},mFe={class:"hint"},gFe={class:"row"},vFe={class:"rlabel"},wFe={class:"hint"},yFe={key:0,class:"flag-chip"},kFe={key:1,class:"flag-chip flag-chip--warn"},bFe={class:"row"},_Fe={class:"rlabel"},xFe={class:"hint"},SFe={key:0,class:"flag-chip"},CFe={key:1,class:"flag-chip flag-chip--warn"},MFe={key:1,class:"empty-config"},AFe={class:"panel"},EFe={class:"panel-head"},TFe={class:"panel-title"},IFe={class:"panel-desc"},LFe={class:"archive-toolbar"},$Fe={class:"archive-search"},NFe=["placeholder"],zFe={value:"all"},BFe=["value"],RFe={key:0,class:"archive-empty"},FFe={key:0,class:"archive-list"},jFe={class:"archive-workspace"},OFe={class:"path"},PFe={class:"count"},HFe={class:"setting-card"},DFe={class:"archive-meta"},VFe={class:"archive-name"},WFe={class:"archive-time"},qFe={key:1,class:"archive-empty"},UFe=100,ZFe=Ge({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{},experimentalFlagStates:{},initialTab:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,i=U(o.initialTab??"general"),r=B(()=>a9(o.uiFontSize)),l=typeof window>"u"?void 0:window.pythinkerDesktop,a=[{id:"general",labelKey:"settings.tabs.general",icon:"sliders"},{id:"agent",labelKey:"settings.tabs.agent",icon:"cute-bot"},{id:"account",labelKey:"settings.tabs.account",icon:"user"},{id:"providers",labelKey:"settings.tabs.providers",icon:"bolt"},{id:"lab",labelKey:"settings.tabs.lab",icon:"flask"},{id:"archived",labelKey:"settings.tabs.archived",icon:"archive"},...l===void 0?[]:[{id:"update",labelKey:"settings.tabs.update",icon:"update-available"}],{id:"advanced",labelKey:"settings.tabs.advanced",icon:"microscope"}],c=g$().serverHttpUrl,u="0.1.2".trim()?"0.1.2":"0.0.0-dev",d=U(),f=U(!1),p=U();let h;const m=B(()=>d.value?.installedVersion??u),k=U(null),x=B(()=>k.value?.serverVersion||o.serverVersion||"-"),v=B(()=>k.value?.backend??o.backend??"v1"),w=B(()=>v.value==="v2"?"agent-gateway":"server"),b=U(!1),M=U(!1),R=U(0),{confirm:z,current:$}=y1(),E=["manual","yolo","auto"],T={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},N=U(null);Bz(N);function C(Ze){Ze.key==="Escape"&&$.value===null&&$t()}xn(()=>{document.addEventListener("keydown",C),D(),l!==void 0&&(h=l.onUpdateState(Ze=>{d.value=Ze}),l.getUpdateState().then(Ze=>{d.value=Ze}))}),An(()=>{document.removeEventListener("keydown",C),h?.(),kn!==null&&clearTimeout(kn)});const O=B(()=>{const Ze=d.value;if(Ze===void 0)return n("settings.desktop.loading");switch(Ze.status){case"disabled":return n("settings.desktop.disabled");case"checking":return n("settings.desktop.checking");case"available":return n("settings.desktop.available",{version:Ze.availableVersion});case"downloading":return n("settings.desktop.downloading",{version:Ze.availableVersion});case"downloaded":return n("settings.desktop.downloaded",{version:Ze.availableVersion});case"skipped":return n("settings.desktop.skipped",{version:Ze.skippedVersion??Ze.availableVersion});case"error":return Ze.message??n("settings.desktop.errorGeneric");default:return n("settings.desktop.upToDate")}}),H=B(()=>{const Ze=d.value?.percent;return Ze===void 0||!Number.isFinite(Ze)?void 0:Math.min(100,Math.max(0,Ze))}),V=["stable","beta","nightly"],A=B(()=>{const Ze=d.value?.status;return f.value||Ze===void 0||Ze==="checking"||Ze==="downloading"||Ze==="downloaded"}),F=B(()=>{const Ze=d.value?.status;return f.value||Ze===void 0||Ze==="disabled"||Ze==="checking"||Ze==="downloading"||Ze==="downloaded"}),j=B(()=>{const Ze=d.value?.lastCheckedAt;if(Ze===void 0)return n("settings.desktop.neverChecked");const Qe=new Date(Ze);return Number.isNaN(Qe.getTime())?n("settings.desktop.neverChecked"):n("settings.desktop.lastChecked",{time:new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}).format(Qe)})});function q(Ze){const Qe=["B","KB","MB","GB"];let ct=Math.max(0,Ze),mn=0;for(;ct>=1024&&mn{const Ze=d.value;if(Ze?.status!=="downloading")return"";const Qe=[];return H.value!==void 0&&Qe.push(`${Math.round(H.value)}%`),Ze.transferred!==void 0&&Ze.total!==void 0?Qe.push(n("settings.desktop.bytesOfTotal",{transferred:q(Ze.transferred),total:q(Ze.total)})):Ze.transferred!==void 0&&Qe.push(q(Ze.transferred)),Ze.bytesPerSecond!==void 0&&Qe.push(`${q(Ze.bytesPerSecond)}/s`),Qe.join(" · ")}),W=B(()=>p.value!==void 0?p.value:d.value?.status==="error"?O.value:void 0);async function G(Ze){if(!f.value){f.value=!0,p.value=void 0;try{d.value=await Ze()}catch(Qe){p.value=Qe instanceof Error?Qe.message:String(Qe)}finally{f.value=!1}}}function ee(Ze){l!==void 0&&G(()=>l.setAutoUpdate(Ze))}function se(Ze){l!==void 0&&V.includes(Ze)&&G(()=>l.setUpdateChannel(Ze))}function oe(Ze){l!==void 0&&G(()=>l.setNotifyUpdate(Ze))}function Q(){l!==void 0&&G(()=>l.checkForUpdates())}function ge(){l!==void 0&&G(()=>l.downloadUpdate())}function xe(){const Ze=d.value?.availableVersion;l!==void 0&&Ze!==void 0&&G(()=>l.skipUpdate(Ze))}function Ke(){l!==void 0&&G(()=>l.undoSkippedUpdate())}function et(){const Ze=d.value?.availableVersion;l!==void 0&&Ze!==void 0&&G(()=>l.openUpdateReleaseNotes(Ze))}function Y(){l!==void 0&&G(()=>l.restartToUpdate())}let ne=0;async function D(){const Ze=++ne;let Qe;try{Qe=await At().getMeta()}catch{Qe=null}Ze===ne&&(k.value=Qe)}Ue(()=>o.config,()=>{D()});function X(){cN()}const ve=B(()=>{const Ze=new Map;for(const Qe of o.models??[])Ze.set(Qe.id,{id:Qe.id,label:Qe.displayName??Qe.model??Qe.id,provider:Qe.provider});for(const[Qe,ct]of Object.entries(o.config?.models??{})){if(Ze.has(Qe))continue;const mn=te(ct);Ze.set(Qe,{id:Qe,label:de(Qe,ct,mn),provider:mn??Qe})}return Array.from(Ze.values())}),fe=B(()=>{const Ze=new Map;for(const Qe of ve.value){const ct=Ze.get(Qe.provider)??[];ct.push(Qe),Ze.set(Qe.provider,ct)}for(const[Qe,ct]of Ze)Ze.set(Qe,ct.toSorted((mn,_o)=>mn.label.localeCompare(_o.label)));return Array.from(Ze.entries()).toSorted(([Qe],[ct])=>Qe.localeCompare(ct)).map(([Qe,ct])=>({provider:Qe,options:ct}))}),pe=B(()=>{const Ze=o.config?.defaultPermissionMode;return Ze==="auto"||Ze==="yolo"||Ze==="manual"?Ze:"manual"});function te(Ze){if(!Ze||typeof Ze!="object")return;const Qe=Ze;return typeof Qe.provider=="string"?Qe.provider:void 0}function de(Ze,Qe,ct){if(!Qe||typeof Qe!="object")return Ze;const mn=Qe,_o=typeof mn.model=="string"?mn.model:void 0,Un=ct??te(Qe);return _o&&Un?`${Ze} (${Un}/${_o})`:_o?`${Ze} (${_o})`:Ze}function ye(Ze){return Ze===!0}function Ce(Ze){!Ze||Ze===o.config?.defaultModel||s("updateConfig",{defaultModel:Ze})}function me(Ze){Ze!==pe.value&&s("updateConfig",{defaultPermissionMode:Ze})}function be(Ze){const Qe=o.config?.[Ze];s("updateConfig",{[Ze]:!ye(Qe)})}function ie(){const Ze=o.config?.thinking;return!Ze||typeof Ze!="object"?!0:Ze.enabled!==!1}function ke(){s("updateConfig",{thinking:{enabled:!ie()}})}function Fe(){const Ze=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!Ze})}async function at(Ze){Ze!==i.value&&await dt()&&(i.value=Ze)}async function dt(){if(!M.value)return!0;const Ze=await z({title:n("providers.unsavedTitle"),message:n("providers.unsavedBody"),confirmLabel:n("providers.unsavedDiscard"),cancelLabel:n("providers.unsavedStay"),variant:"danger"});return Ze&&(M.value=!1,R.value+=1),Ze}async function $t(){await dt()&&s("close")}function Et(){return[`App version: ${m.value}`,`Server version: ${x.value}`,`Backend: ${v.value}`,`Server address: ${c}`,`Server ID: ${k.value?.serverId||"-"}`,`User agent: ${typeof navigator>"u"?"-":navigator.userAgent}`].join(` +`)}async function Qt(){b.value=await ss(Et())}const Dt=U(!1),en=U(!1);let kn=null;function In(){kn!==null&&clearTimeout(kn),kn=setTimeout(()=>{Dt.value=!1,en.value=!1,kn=null},1500)}async function Mn(){await ss(x.value)&&(Dt.value=!0,In())}async function Re(){await ss(c)&&(en.value=!0,In())}const lt=B(()=>on("secondary-model")),tt=B(()=>o.config?.secondaryModel?.defaultModel??o.config?.secondaryModel?.model??""),ht=B(()=>o.config?.secondaryModel?.defaultEffort??""),bt=B(()=>o.config?.secondaryModel?.force===!0),Rt=B(()=>Object.fromEntries((o.models??[]).map(Ze=>[Ze.id,Ze])));function on(Ze){return o.config?.experimental?.[Ze]===!0}function an(Ze){return k.value?.experimentalFlagStates?.find(ct=>ct.id===Ze)??o.experimentalFlagStates?.find(ct=>ct.id===Ze)}function sn(Ze,Qe){const ct={...o.config?.experimental,[Ze]:Qe};s("updateConfig",{experimental:ct})}function Yn(Ze,Qe,ct){const mn={defaultModel:Ze,force:ct};return Qe&&(mn.defaultEffort=Qe),mn}function Kt(Ze){const Qe=Ze.effort??"";if(o.config?.secondaryModel?.defaultModel===Ze.model&&Qe===ht.value)return;const ct=Yn(Ze.model,Qe,bt.value);s("updateConfig",{secondaryModel:ct})}function no(Ze){if(!tt.value||Ze===bt.value)return;const Qe=Yn(tt.value,ht.value,Ze);s("updateConfig",{secondaryModel:Qe})}function As(){o.config?.secondaryModel!==void 0&&s("updateConfig",{secondaryModel:null})}function ys(Ze){const Qe=jN(Ze);Qe!==void 0&&s("setUiFontSize",Qe)}const ao=b1(),co=U([]),oo=U(!1),Ct=U(!1),so=U(""),Bn=U("all"),Pn=U("archived-desc");async function js(){if(!(oo.value||Ct.value)){oo.value=!0;try{const Ze=[];let Qe;for(;;){const ct=await ao.loadArchivedSessions({beforeId:Qe,pageSize:UFe});if(Ze.push(...ct.items),!ct.hasMore||ct.items.length===0)break;const mn=ct.items.at(-1)?.id;if(mn===void 0)break;Qe=mn}co.value=Ze,Ct.value=!0}catch(Ze){console.warn("loadAllArchived failed",Ze)}finally{oo.value=!1}}}Ue(i,Ze=>{Ze==="archived"&&!Ct.value&&js()});const Os=B(()=>{const Ze=new Set;for(const Qe of co.value)Ze.add(Qe.cwd);return Array.from(Ze).toSorted((Qe,ct)=>Qe.localeCompare(ct))}),Es=B(()=>{const Ze=so.value.trim().toLowerCase();let Qe=co.value.filter(ct=>ct.archived===!0);return Bn.value!=="all"&&(Qe=Qe.filter(ct=>ct.cwd===Bn.value)),Ze&&(Qe=Qe.filter(ct=>ct.title.toLowerCase().includes(Ze))),Pn.value==="archived-desc"?Qe.toSorted((ct,mn)=>mn.updatedAt.localeCompare(ct.updatedAt)):Pn.value==="created-desc"?Qe.toSorted((ct,mn)=>mn.createdAt.localeCompare(ct.createdAt)):Qe.toSorted((ct,mn)=>ct.title.localeCompare(mn.title,"en"))}),ks=B(()=>{const Ze=new Map;for(const Qe of Es.value){const ct=Ze.get(Qe.cwd)??[];ct.push(Qe),Ze.set(Qe.cwd,ct)}return Array.from(Ze.entries()).map(([Qe,ct])=>({cwd:Qe,items:ct}))});async function Lo(Ze){await ao.restoreSession(Ze)&&(co.value=co.value.filter(ct=>ct.id!==Ze))}function Ro(Ze){const Qe=new Date(Ze);if(Number.isNaN(Qe.getTime()))return Ze;const ct=mn=>String(mn).padStart(2,"0");return`${Qe.getFullYear()}-${ct(Qe.getMonth()+1)}-${ct(Qe.getDate())} ${ct(Qe.getHours())}:${ct(Qe.getMinutes())}`}return(Ze,Qe)=>(g(),ce(E0,{open:!0,"close-on-esc":!1,title:y(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:$t},{default:ue(()=>[_("div",{ref_key:"dialogRef",ref:N,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":y(n)("settings.title")},[(g(),S(Me,null,it(a,ct=>_("button",{key:ct.id,type:"button",class:Be(["tab",{on:i.value===ct.id}]),role:"tab","aria-selected":i.value===ct.id,onClick:mn=>at(ct.id)},[Z(Le,{name:ct.icon,size:"sm"},null,8,["name"]),He(" "+I(y(n)(ct.labelKey)),1)],10,Uze)),64))],8,qze),_("div",Zze,[Zn(_("section",Kze,[_("section",Gze,[_("h3",Yze,I(y(n)("settings.appearance")),1),_("div",Xze,[_("span",Jze,I(y(n)("theme.colorSchemeLabel")),1),Z(ni,{"model-value":e.colorScheme,options:[{value:"light",label:y(n)("theme.light")},{value:"dark",label:y(n)("theme.dark")},{value:"system",label:y(n)("theme.system")}],"onUpdate:modelValue":Qe[0]||(Qe[0]=ct=>s("setColorScheme",ct))},null,8,["model-value","options"])]),_("div",Qze,[_("span",eBe,I(y(n)("theme.accentLabel")),1),Z(ni,{"model-value":e.accent,options:[{value:"blue",label:y(n)("theme.accentBlue")},{value:"mono",label:y(n)("theme.accentBlack")}],"onUpdate:modelValue":Qe[1]||(Qe[1]=ct=>s("setAccent",ct))},null,8,["model-value","options"])]),_("div",tBe,[_("span",nBe,I(y(n)("settings.uiFontSize")),1),Z(ni,{"model-value":r.value,options:y(zN),"aria-label":y(n)("settings.uiFontSize"),"onUpdate:modelValue":ys},null,8,["model-value","options","aria-label"])])]),_("section",oBe,[_("h3",sBe,I(y(n)("settings.notifications")),1),_("div",iBe,[_("span",rBe,[He(I(y(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",lBe,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xi,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnComplete"),"onUpdate:modelValue":Qe[2]||(Qe[2]=ct=>s("setNotify",ct))},null,8,["model-value","disabled","label"])]),_("div",aBe,[_("span",cBe,[He(I(y(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",uBe,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xi,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":Qe[3]||(Qe[3]=ct=>s("setNotifyQuestion",ct))},null,8,["model-value","disabled","label"])]),_("div",dBe,[_("span",fBe,[He(I(y(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(g(),S("span",pBe,I(y(n)("settings.notifyDenied")),1)):J("",!0)]),Z(xi,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:y(n)("settings.notifyOnApproval"),"onUpdate:modelValue":Qe[4]||(Qe[4]=ct=>s("setNotifyApproval",ct))},null,8,["model-value","disabled","label"])]),_("div",hBe,[_("span",mBe,I(y(n)("settings.soundOnComplete")),1),Z(xi,{"model-value":e.sound,label:y(n)("settings.soundOnComplete"),"onUpdate:modelValue":Qe[5]||(Qe[5]=ct=>s("setSound",ct))},null,8,["model-value","label"])])])],512),[[Ti,i.value==="general"]]),Zn(_("section",gBe,[_("section",vBe,[_("h3",wBe,I(y(n)("settings.account")),1),_("div",yBe,[_("span",kBe,I(e.authReady?y(n)("settings.providers"):y(n)("sidebar.notSignedIn")),1),Z(Cn,{text:e.accountModel},{default:ue(()=>[e.authReady&&e.accountModel?(g(),S("span",bBe,I(e.accountModel),1)):J("",!0)]),_:1},8,["text"])]),_("div",_Be,[Z(It,{variant:"secondary",size:"sm",onClick:Qe[6]||(Qe[6]=ct=>{s("openOnboarding"),s("close")})},{default:ue(()=>[He(I(y(n)("onboarding.reopen")),1)]),_:1}),Z(It,{variant:"primary",size:"sm",onClick:Qe[7]||(Qe[7]=ct=>at("providers"))},{default:ue(()=>[He(I(y(n)("settings.manageProviders")),1)]),_:1})])])],512),[[Ti,i.value==="account"]]),Zn(_("section",xBe,[Z(Eze,{"discard-token":R.value,onDirtyChange:Qe[8]||(Qe[8]=ct=>M.value=ct)},null,8,["discard-token"])],512),[[Ti,i.value==="providers"]]),Zn(_("section",SBe,[_("section",CBe,[_("div",MBe,[_("h3",ABe,I(y(n)("settings.agentDefaults")),1),e.configSaving?(g(),S("span",EBe,I(y(n)("settings.saving")),1)):J("",!0)]),e.config?(g(),S(Me,{key:0},[_("div",TBe,[_("span",IBe,[He(I(y(n)("settings.defaultModel"))+" ",1),_("span",LBe,I(y(n)("settings.defaultModelHint")),1)]),fe.value.length>0?(g(),S("div",$Be,[Z(A4,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":y(n)("settings.defaultModel"),"onUpdate:modelValue":Ce},{default:ue(()=>[e.config.defaultModel?J("",!0):(g(),S("option",NBe,I(y(n)("settings.noDefaultModel")),1)),(g(!0),S(Me,null,it(fe.value,ct=>(g(),S("optgroup",{key:ct.provider,label:ct.provider},[(g(!0),S(Me,null,it(ct.options,mn=>(g(),S("option",{key:mn.id,value:mn.id},I(mn.label),9,BBe))),128))],8,zBe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(g(),S("span",RBe,I(e.config.defaultModel??y(n)("settings.noDefaultModel")),1))]),lt.value?(g(),S("section",FBe,[_("h3",jBe,I(y(n)("settings.secondaryModelSection")),1),_("div",OBe,[_("span",PBe,[He(I(y(n)("settings.secondaryModel"))+" ",1),_("span",HBe,I(y(n)("settings.secondaryModelHint")),1)]),fe.value.length>0?(g(),ce(Wze,{key:0,"model-value":tt.value,effort:ht.value,groups:fe.value,"model-info-by-id":Rt.value,disabled:e.configSaving,onInherit:As,onSelect:Kt},null,8,["model-value","effort","groups","model-info-by-id","disabled"])):(g(),S("span",DBe,I(y(n)("settings.noSecondaryModel")),1))]),tt.value?(g(),S("div",VBe,[_("span",WBe,[He(I(y(n)("settings.forceSecondaryModel"))+" ",1),_("span",qBe,I(y(n)("settings.forceSecondaryModelHint")),1)]),Z(xi,{"model-value":bt.value,disabled:e.configSaving,label:y(n)("settings.forceSecondaryModel"),"onUpdate:modelValue":no},null,8,["model-value","disabled","label"])])):J("",!0)])):J("",!0),_("div",UBe,[_("span",ZBe,[He(I(y(n)("settings.defaultPermission"))+" ",1),_("span",KBe,I(y(n)("settings.defaultPermissionHint")),1)]),Z(ni,{"model-value":pe.value,options:E.map(ct=>({value:ct,label:y(n)(T[ct])})),"onUpdate:modelValue":Qe[9]||(Qe[9]=ct=>me(ct))},null,8,["model-value","options"])]),_("div",GBe,[_("span",YBe,[He(I(y(n)("settings.defaultThinking"))+" ",1),_("span",XBe,I(y(n)("settings.defaultThinkingHint")),1)]),Z(xi,{"model-value":ie(),disabled:e.configSaving,label:y(n)("settings.defaultThinking"),"onUpdate:modelValue":Qe[10]||(Qe[10]=ct=>ke())},null,8,["model-value","disabled","label"])]),_("div",JBe,[_("span",QBe,[He(I(y(n)("settings.defaultPlanMode"))+" ",1),_("span",eRe,I(y(n)("settings.defaultPlanModeHint")),1)]),Z(xi,{"model-value":ye(e.config.defaultPlanMode),disabled:e.configSaving,label:y(n)("settings.defaultPlanMode"),"onUpdate:modelValue":Qe[11]||(Qe[11]=ct=>be("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",tRe,[_("span",nRe,[He(I(y(n)("settings.mergeSkills"))+" ",1),_("span",oRe,I(y(n)("settings.mergeSkillsHint")),1)]),Z(xi,{"model-value":ye(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:y(n)("settings.mergeSkills"),"onUpdate:modelValue":Qe[12]||(Qe[12]=ct=>be("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(g(),S("div",sRe,I(y(n)("settings.configUnavailable")),1))])],512),[[Ti,i.value==="agent"]]),Zn(_("section",iRe,[_("section",rRe,[_("h3",lRe,I(y(n)("settings.versionAndUpdates")),1),_("div",aRe,[_("span",cRe,[He(I(y(n)("settings.appVersion"))+" ",1),_("span",uRe,I(y(n)("settings.appVersionHint")),1)]),_("span",dRe,I(m.value),1)]),_("div",fRe,[_("span",pRe,[He(I(y(n)("settings.serverVersion"))+" ",1),_("span",hRe,I(y(n)("settings.serverVersionHint")),1)]),_("span",mRe,[_("span",gRe,I(x.value),1),Z(Zt,{size:"sm",label:Dt.value?y(n)("settings.copied"):y(n)("settings.copyServerVersion"),"data-testid":"copy-server-version",onClick:Mn},{default:ue(()=>[Z(Le,{name:Dt.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_("div",vRe,[_("span",wRe,[He(I(y(n)("settings.serverAddress"))+" ",1),_("span",yRe,I(y(n)("settings.serverAddressHint")),1)]),_("span",kRe,[_("span",bRe,I(y(c)),1),Z(Zt,{size:"sm",label:en.value?y(n)("settings.copied"):y(n)("settings.copyServerAddress"),"data-testid":"copy-server-address",onClick:Re},{default:ue(()=>[Z(Le,{name:en.value?"check":"copy",size:"sm"},null,8,["name"])]),_:1},8,["label"])])]),_("div",_Re,[_("span",xRe,I(y(n)("settings.backend")),1),_("span",SRe,I(w.value),1)])]),e.config?(g(),S("section",CRe,[e.config?(g(),S("div",MRe,[_("span",ARe,[He(I(y(n)("settings.telemetry"))+" ",1),_("span",ERe,I(y(n)("settings.telemetryHint")),1),_("span",TRe,I(y(n)("settings.telemetryRestartHint")),1)]),Z(xi,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:y(n)("settings.telemetry"),"onUpdate:modelValue":Qe[13]||(Qe[13]=ct=>Fe())},null,8,["model-value","disabled","label"])])):J("",!0)])):J("",!0),_("section",IRe,[_("h3",LRe,I(y(n)("settings.diagnostics")),1),_("div",$Re,[_("span",NRe,[He(I(y(n)("settings.exportLog"))+" ",1),y(Jr)()?J("",!0):(g(),S("span",zRe,I(y(n)("settings.logHint")),1))]),Z(It,{variant:"secondary",size:"sm",onClick:X},{default:ue(()=>[He(I(y(n)("settings.exportLogBtn")),1)]),_:1})]),_("div",BRe,[_("span",RRe,I(y(n)("settings.copyDetails")),1),Z(It,{"data-testid":"copy-diagnostics",variant:"secondary",size:"sm",onClick:Qt},{default:ue(()=>[He(I(b.value?y(n)("settings.copied"):y(n)("settings.copyDetails")),1)]),_:1})])])],512),[[Ti,i.value==="advanced"]]),Zn(_("section",FRe,[y(l)?(g(),S("section",jRe,[_("h3",ORe,I(y(n)("settings.tabs.update")),1),_("div",PRe,[_("div",HRe,[_("div",DRe,[_("span",VRe,[Z(Le,{name:"download",size:"md"})]),_("span",WRe,[_("span",qRe,I(O.value),1),_("span",URe,I(j.value),1)])]),Z(It,{"data-testid":"settings-check-update",variant:"secondary",size:"sm",loading:d.value?.status==="checking",disabled:F.value,onClick:Q},{default:ue(()=>[He(I(y(n)("settings.desktop.checkNow")),1)]),_:1},8,["loading","disabled"])]),_("div",ZRe,[_("span",KRe,[He(I(y(n)("settings.desktop.updateChannel"))+" ",1),_("span",GRe,I(y(n)("settings.desktop.updateChannelHint")),1)]),_("div",YRe,[Z(A4,{"data-testid":"desktop-update-channel",size:"sm","model-value":d.value?.channel??"stable",disabled:A.value,"aria-label":y(n)("settings.desktop.updateChannel"),"onUpdate:modelValue":se},{default:ue(()=>[(g(),S(Me,null,it(V,ct=>_("option",{key:ct,value:ct},I(y(n)(`settings.desktop.channels.${ct}`)),9,XRe)),64))]),_:1},8,["model-value","disabled","aria-label"])])]),_("div",JRe,[_("span",QRe,[He(I(y(n)("settings.desktop.automaticChecks"))+" ",1),_("span",eFe,I(y(n)("settings.desktop.automaticChecksHint")),1)]),Z(xi,{"data-testid":"automatic-update-checks","model-value":d.value?.autoUpdate??!1,disabled:f.value||d.value===void 0||d.value.status==="disabled",label:y(n)("settings.desktop.automaticChecks"),"onUpdate:modelValue":ee},null,8,["model-value","disabled","label"])]),_("div",tFe,[_("span",nFe,[He(I(y(n)("settings.desktop.notifyUpdates"))+" ",1),_("span",oFe,I(y(n)("settings.desktop.notifyUpdatesHint")),1)]),Z(xi,{"data-testid":"update-notifications","model-value":d.value?.notifyUpdate??!0,disabled:f.value||d.value===void 0,label:y(n)("settings.desktop.notifyUpdates"),"onUpdate:modelValue":oe},null,8,["model-value","disabled","label"])]),d.value?.status==="downloading"||W.value||d.value?.availableVersion?(g(),S("div",sFe,[d.value?.status==="downloading"?(g(),S("div",iFe,[H.value===void 0?(g(),S("progress",{key:0,"data-testid":"settings-update-progress",max:"100","aria-label":y(n)("settings.desktop.progressLabel")},null,8,rFe)):(g(),S("progress",{key:1,"data-testid":"settings-update-progress",value:H.value,max:"100","aria-label":y(n)("settings.desktop.progressLabel")},null,8,lFe)),_("span",aFe,I(P.value||y(n)("settings.desktop.fetching")),1)])):J("",!0),W.value?(g(),ce(B9,{key:1,variant:"danger"},{default:ue(()=>[He(I(W.value),1)]),_:1})):J("",!0),_("div",cFe,[d.value?.availableVersion?(g(),ce(It,{key:0,variant:"ghost",size:"sm",disabled:f.value,onClick:et},{default:ue(()=>[He(I(y(n)("settings.desktop.viewNotes")),1)]),_:1},8,["disabled"])):J("",!0),d.value?.status==="available"?(g(),ce(It,{key:1,variant:"ghost",size:"sm",disabled:f.value,onClick:xe},{default:ue(()=>[He(I(y(n)("settings.desktop.skip")),1)]),_:1},8,["disabled"])):J("",!0),d.value?.status==="available"||d.value?.status==="error"&&d.value.availableVersion?(g(),ce(It,{key:2,"data-testid":"settings-download-update",size:"sm",loading:f.value,onClick:ge},{default:ue(()=>[He(I(d.value?.status==="error"?y(n)("settings.desktop.retryDownload"):y(n)("settings.desktop.download")),1)]),_:1},8,["loading"])):J("",!0),d.value?.status==="skipped"?(g(),ce(It,{key:3,size:"sm",loading:f.value,onClick:Ke},{default:ue(()=>[He(I(y(n)("settings.desktop.undoSkip")),1)]),_:1},8,["loading"])):J("",!0),d.value?.status==="downloaded"?(g(),ce(It,{key:4,"data-testid":"settings-restart-update",size:"sm",loading:f.value,onClick:Y},{default:ue(()=>[He(I(y(n)("settings.desktop.restartToUpdate")),1)]),_:1},8,["loading"])):J("",!0)])])):J("",!0)])])):J("",!0)],512),[[Ti,i.value==="update"]]),Zn(_("section",uFe,[_("section",dFe,[_("h3",fFe,I(y(n)("settings.tabs.lab")),1),_("div",pFe,[_("span",hFe,[He(I(y(n)("settings.conversationToc"))+" ",1),_("span",mFe,I(y(n)("settings.conversationTocHint")),1)]),Z(xi,{"model-value":e.conversationToc??!0,label:y(n)("settings.conversationToc"),"onUpdate:modelValue":Qe[14]||(Qe[14]=ct=>s("setConversationToc",ct))},null,8,["model-value","label"])]),e.config?(g(),S(Me,{key:0},[_("div",gFe,[_("span",vFe,[He(I(y(n)("settings.lab.sidebarTabs"))+" ",1),_("span",wFe,I(y(n)("settings.lab.sidebarTabsHint")),1),an("sidebarTabs")?.externallyControlled?(g(),S("span",yFe,I(y(n)("settings.lab.environmentControlled")),1)):J("",!0),an("sidebarTabs")?.overridden?(g(),S("span",kFe,I(y(n)("settings.lab.savedSettingOverridden")),1)):J("",!0)]),Z(xi,{"model-value":on("sidebarTabs"),disabled:e.configSaving,label:y(n)("settings.lab.sidebarTabs"),"onUpdate:modelValue":Qe[15]||(Qe[15]=ct=>sn("sidebarTabs",ct))},null,8,["model-value","disabled","label"])]),_("div",bFe,[_("span",_Fe,[He(I(y(n)("settings.lab.secondaryModel"))+" ",1),_("span",xFe,I(y(n)("settings.lab.secondaryModelHint")),1),an("secondary-model")?.externallyControlled?(g(),S("span",SFe,I(y(n)("settings.lab.environmentControlled")),1)):J("",!0),an("secondary-model")?.overridden?(g(),S("span",CFe,I(y(n)("settings.lab.savedSettingOverridden")),1)):J("",!0)]),Z(xi,{"model-value":on("secondary-model"),disabled:e.configSaving,label:y(n)("settings.lab.secondaryModel"),"onUpdate:modelValue":Qe[16]||(Qe[16]=ct=>sn("secondary-model",ct))},null,8,["model-value","disabled","label"])])],64)):(g(),S("div",MFe,I(y(n)("settings.configUnavailable")),1))])],512),[[Ti,i.value==="lab"]]),Zn(_("section",AFe,[_("div",EFe,[Qe[20]||(Qe[20]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",TFe,I(y(n)("settings.archivedTitle")),1),_("p",IFe,I(y(n)("settings.archivedDesc")),1)]),_("div",LFe,[_("label",$Fe,[Qe[21]||(Qe[21]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Zn(_("input",{"onUpdate:modelValue":Qe[17]||(Qe[17]=ct=>so.value=ct),placeholder:y(n)("settings.archivedSearch")},null,8,NFe),[[Fs,so.value]])]),Z(A4,{"model-value":Bn.value,size:"sm","aria-label":y(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":Qe[18]||(Qe[18]=ct=>Bn.value=ct)},{default:ue(()=>[_("option",zFe,I(y(n)("settings.archivedAllWorkspaces")),1),(g(!0),S(Me,null,it(Os.value,ct=>(g(),S("option",{key:ct,value:ct},I(ct),9,BFe))),128))]),_:1},8,["model-value","aria-label"]),Z(ni,{size:"sm","model-value":Pn.value,options:[{value:"archived-desc",label:y(n)("settings.archivedSortArchived")},{value:"created-desc",label:y(n)("settings.archivedSortCreated")},{value:"name-asc",label:y(n)("settings.archivedSortName")}],"onUpdate:modelValue":Qe[19]||(Qe[19]=ct=>Pn.value=ct)},null,8,["model-value","options"])]),oo.value?(g(),S("div",RFe,I(y(n)("settings.archivedLoadingAll")),1)):(g(),S(Me,{key:1},[ks.value.length>0?(g(),S("div",FFe,[(g(!0),S(Me,null,it(ks.value,ct=>(g(),S("section",{key:ct.cwd,class:"archive-card"},[_("div",jFe,[Qe[22]||(Qe[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",OFe,I(ct.cwd),1),_("span",PFe,I(y(n)("settings.archivedSessionsCount",{count:ct.items.length})),1)]),_("div",HFe,[(g(!0),S(Me,null,it(ct.items,mn=>(g(),S("div",{key:mn.id,class:"archive-row"},[_("div",DFe,[_("div",VFe,I(mn.title),1),_("div",WFe,I(y(n)("settings.archivedAt",{time:Ro(mn.updatedAt)})),1)]),Z(It,{variant:"secondary",size:"sm",onClick:_o=>Lo(mn.id)},{default:ue(()=>[He(I(y(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(g(),S("div",qFe,I(co.value.length===0?y(n)("settings.archivedEmpty"):y(n)("settings.archivedNoMatch")),1))],64))],512),[[Ti,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),KFe=mt(ZFe,[["__scopeId","data-v-6f86d7a3"]]),GFe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,Pz=/^[A-Za-z]:[\\/]/,YFe=/^\/\/(?!\/)/;function Vm(e){return GFe.test(e.trim())}function XFe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function JFe(e){return YFe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function QFe(e){return Pz.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function eje(e){return Pz.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function q7(e,t){let n=JFe(XFe(e.trim(),t));const o=QFe(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=eje(n),d=ad.value.trim().length>0);let m=0,k=null;const x=B(()=>Vm(d.value)),v=U("idle"),w=U(""),b=U("/"),M=U([]),R=U(""),z=U(null),$=U(null),E=B(()=>v.value!=="valid"?null:nje(d.value,R.value,$.value));let T=0,N=null;function C(oe,Q){const ge=oe.toLowerCase(),xe=Q.toLowerCase();let Ke=0;for(let et=0;et0&&Y=rM))break;ne.depth+1{k&&clearTimeout(k),N&&clearTimeout(N),T++,v.value="idle",M.value=[],$.value=null;const Q=oe.trim();if(Q===""){m++,p.value=[],f.value=!1;return}if(Vm(Q)){if(m++,p.value=[],f.value=!1,l.value)return;v.value="checking",N=setTimeout(()=>void H(Q),150);return}k=setTimeout(()=>void O(oe),220)});async function H(oe){const Q=++T;v.value="checking",$.value=null;const ge=q7(oe,R.value),{target:xe}=ge;try{const et=await o.browseFs(xe);if(Q!==T)return;if(et.path){v.value="valid",M.value=[],$.value=xe,a.value=et.path,c.value=et.parent,u.value=et.entries,l.value=!1;return}}catch{}if(Q!==T)return;const Ke=ge.base.toLowerCase();w.value=ge.parent,b.value=ge.separator;try{const et=await o.browseFs(ge.parent);if(Q!==T)return;if(et.path){M.value=et.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ke)),v.value="not-found";return}}catch{}Q===T&&(M.value=[],v.value="bad-parent")}function V(oe){d.value=tje(w.value,oe,b.value),z.value?.focus()}const A=B(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),F=B(()=>l.value?n("workspace.degradedHint"):x.value&&v.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function j(oe){if(oe.key==="Escape"){d.value?d.value="":s("close");return}if(oe.key!=="Enter")return;const Q=d.value.trim();if(Vm(Q)){if(oe.preventDefault(),l.value){const{target:ge}=q7(Q,R.value);ge&&s("add",ge);return}v.value==="valid"?se():v.value==="not-found"&&M.value[0]&&V(M.value[0].name)}}const q=B(()=>{const oe=a.value;if(!oe)return[];const Q=oe.split("/").filter(Boolean),ge=[{label:"/",path:"/"}];let xe="";for(const Ke of Q)xe+=`/${Ke}`,ge.push({label:Ke,path:xe});return ge}),P=B(()=>!(a.value.length===0||x.value&&E.value===null));async function W(oe){r.value=!0;try{const Q=await o.browseFs(oe);if(!Q.path){l.value=!0;return}a.value=Q.path,c.value=Q.parent,u.value=Q.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function G(oe){oe.isDir&&W(oe.path)}function ee(){c.value&&W(c.value)}function se(){P.value&&s("add",E.value??a.value)}return xn(async()=>{r.value=!0;try{const oe=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(oe.home&&(R.value=oe.home),o.defaultPath&&(await W(o.defaultPath),!l.value))return;R.value?await W(R.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),An(()=>{k&&clearTimeout(k),N&&clearTimeout(N)}),(oe,Q)=>(g(),ce(E0,{open:i.value,"onUpdate:open":Q[2]||(Q[2]=ge=>i.value=ge),title:y(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:Q[3]||(Q[3]=ge=>s("close"))},{default:ue(()=>[_("div",oje,[l.value?J("",!0):(g(),S("div",sje,[Z(Zt,{size:"sm",disabled:!c.value,label:y(n)("workspace.up"),onClick:ee},{default:ue(()=>[Z(Le,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",ije,[(g(!0),S(Me,null,it(q.value,(ge,xe)=>(g(),S(Me,{key:ge.path},[xe>1?(g(),S("span",rje,"/")):J("",!0),_("button",{class:Be(["crumb",{last:xe===q.value.length-1}]),onClick:Ke=>W(ge.path)},I(ge.label),11,lje)],64))),128))])])),!r.value||l.value?(g(),S("div",{key:1,class:Be(["filterbar",{"has-error":v.value==="not-found"||v.value==="bad-parent"}])},[Z(Le,{class:"filter-icon",name:"search",size:"md"}),Zn(_("input",{ref_key:"filterEl",ref:z,"onUpdate:modelValue":Q[0]||(Q[0]=ge=>d.value=ge),class:"filter-input",type:"text",placeholder:A.value,autocomplete:"off",spellcheck:"false",onKeydown:xt(j,["stop"])},null,40,aje),[[Fs,d.value]]),f.value||v.value==="checking"?(g(),ce(Go,{key:0,size:"sm"})):J("",!0)],2)):J("",!0),l.value?(g(),S("div",Sje,I(y(n)("workspace.degradedHint")),1)):(g(),S("div",cje,[r.value?(g(),S("div",uje,I(y(n)("workspace.browsing")),1)):x.value&&v.value!=="valid"?(g(),S(Me,{key:1},[v.value==="checking"?(g(),S("div",dje,I(y(n)("workspace.checkingPath")),1)):v.value==="not-found"?(g(),S(Me,{key:1},[M.value.length>0?(g(),S("div",fje,I(y(n)("workspace.pathPickHint")),1)):J("",!0),(g(!0),S(Me,null,it(M.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>V(ge.name)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",hje,I(ge.name),1)],8,pje))),128)),M.value.length===0?(g(),S("div",mje,I(y(n)("workspace.noPathMatch",{parent:w.value})),1)):J("",!0)],64)):v.value==="bad-parent"?(g(),S("div",gje,I(y(n)("workspace.badParent",{parent:w.value})),1)):J("",!0)],64)):h.value&&!x.value?(g(),S(Me,{key:2},[(g(!0),S(Me,null,it(p.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>W(ge.path)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",wje,I(ge.rel),1)],8,vje))),128)),!f.value&&p.value.length===0?(g(),S("div",yje,I(y(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&p.value.length===0?(g(),S("div",kje,I(y(n)("workspace.searching")),1)):J("",!0)],64)):(g(),S(Me,{key:3},[(g(!0),S(Me,null,it(u.value,ge=>(g(),S("button",{key:ge.path,class:"folder-row",onClick:xe=>G(ge)},[Z(Le,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",_je,I(ge.name),1)],8,bje))),128)),u.value.length===0?(g(),S("div",xje,I(y(n)("workspace.noSubfolders")),1)):J("",!0)],64))])),e.error?(g(),S("div",Cje,I(e.error),1)):J("",!0),_("div",Mje,[Z(Cn,{text:a.value},{default:ue(()=>[l.value?J("",!0):(g(),ce(It,{key:0,variant:"primary",disabled:!P.value,onClick:se},{default:ue(()=>[He(I(y(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),Z(It,{variant:"secondary",onClick:Q[1]||(Q[1]=ge=>s("close"))},{default:ue(()=>[He(I(y(n)("workspace.cancel")),1)]),_:1})]),_("div",Aje,I(F.value),1)])]),_:1},8,["open","title"]))}}),Lje=mt(Ije,[["__scopeId","data-v-09b74e91"]]),$je={key:0,class:"confirm-dialog__message"},Nje=Ge({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),vo(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(g(),ce(E0,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:ue(()=>[Z(It,{variant:"secondary",disabled:e.loading,onClick:i},{default:ue(()=>[He(I(e.cancelLabel??y(s)("common.cancel")),1)]),_:1},8,["disabled"]),Z(It,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:ue(()=>[He(I(e.confirmLabel??y(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:ue(()=>[e.message?(g(),S("p",$je,I(e.message),1)):J("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),zje=mt(Nje,[["__scopeId","data-v-074405fe"]]),Bje=Ge({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=y1();function i(){s()}return(r,l)=>(g(),ce(zje,{open:y(t)!==null,title:y(t)?.title??"",message:y(t)?.message,"confirm-label":y(t)?.confirmLabel,"cancel-label":y(t)?.cancelLabel,variant:y(t)?.variant,loading:y(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>y(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),Rje={class:"rows"},Fje={class:"row"},jje={class:"row"},Oje={class:"row"},Pje={class:"row"},Hje={class:"row"},Dje={class:"row"},Vje={class:"ctx-text"},Wje={key:0,class:"bar"},qje={class:"row"},Uje=Ge({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},dynamicWorkflowMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,i=U(!0),r=B(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=B(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:na(o.status.ctxUsed),max:na(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(h){return n(h==="yolo"?"status.permissionYolo":h==="auto"?"status.permissionAuto":"status.permissionManual")}const c=B(()=>{const h=o.status.permission;return h==="yolo"?"var(--color-warning)":h==="auto"?"var(--color-danger)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.dynamicWorkflowMode?n("status.dynamicWorkflowOn"):n("status.dynamicWorkflowOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),p=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(h,m)=>(g(),ce(E0,{open:i.value,"onUpdate:open":m[0]||(m[0]=k=>i.value=k),title:y(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=k=>s("close"))},{default:ue(()=>[_("dl",Rje,[_("div",Fje,[_("dt",null,I(y(n)("status.statusModel")),1),_("dd",null,I(e.status.model),1)]),_("div",jje,[_("dt",null,I(y(n)("status.statusThinking")),1),_("dd",null,I(e.thinking),1)]),_("div",Oje,[_("dt",null,I(y(n)("status.statusPermission")),1),_("dd",{style:Wt({color:c.value})},I(a(e.status.permission)),5)]),_("div",Pje,[_("dt",null,I(y(n)("status.statusPlanMode")),1),_("dd",{class:Be({"plan-on":e.planMode})},I(u.value),3)]),_("div",Hje,[_("dt",null,I(y(n)("status.statusDynamicWorkflowMode")),1),_("dd",{class:Be({"workflow-on":e.dynamicWorkflowMode})},I(d.value),3)]),_("div",Dje,[_("dt",null,I(y(n)("status.statusContext")),1),_("dd",null,[_("span",Vje,I(l.value),1),e.status.ctxMax>0?(g(),S("span",Wje,[_("i",{style:Wt({width:r.value+"%"})},null,4)])):J("",!0)])]),_("div",qje,[_("dt",null,I(y(n)("status.statusCost")),1),_("dd",null,I(p.value),1)])])]),_:1},8,["open","title"]))}}),Zje=mt(Uje,[["__scopeId","data-v-7992546c"]]),Kje={class:"ui-toast__icon","aria-hidden":"true"},Gje={class:"ui-toast__body"},Yje={class:"ui-toast__title"},Xje={key:0,class:"ui-toast__msg"},Jje=Ge({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(g(),S("div",{class:Be(["ui-toast",`ui-toast--${e.variant}`])},[_("span",Kje,[En(t.$slots,"icon",{},()=>[e.variant==="success"?(g(),ce(Le,{key:0,name:"check"})):e.variant==="danger"?(g(),ce(Le,{key:1,name:"close"})):e.variant==="warning"?(g(),ce(Le,{key:2,name:"alert-triangle"})):(g(),ce(Le,{key:3,name:"info"}))],!0)]),_("div",Gje,[_("div",Yje,I(e.title),1),e.message?(g(),S("div",Xje,I(e.message),1)):J("",!0),En(t.$slots,"default",{},void 0,!0)]),Z(Zt,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Qje=mt(Jje,[["__scopeId","data-v-44bc260b"]]),eOe={key:0,class:"actions"},tOe=["onClick"],nOe=["onClick"],oOe={key:1,class:"details"},sOe=Ge({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Lt();function i(E){return typeof E=="object"&&E!==null}function r(E){return i(E)?E.title:E}function l(E){return i(E)?E.message??"":""}function a(E){return i(E)?E.details:void 0}function c(E){return i(E)?E.severity==="error":E.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|failed/i.test(E)}function u(E){if(!i(E))return c(E)?"danger":"warning";switch(E.severity){case"error":case"danger":return"danger";case"success":return"success";case"info":return"info";default:return"warning"}}function d(E){return i(E)?`notice:${E.severity}:${E.title}:${E.message??""}:${JSON.stringify(E.details??[])}`:`text:${E}`}function f(E){if(!i(E))return E;const T=[E.title];E.message&&T.push(E.message);const N=E.details??[];if(N.length>0){T.push("",`${s("warnings.diagnostics")}:`);for(const C of N)T.push(`${C.label}: ${C.value}`)}return T.join(` +`)}let p=1;const h=U([]),m=new Map,k=new Map;function x(E){const T=c(E)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?T+5e3:T}function v(E,T){const N=m.get(E)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>$(E),T),N.deadline=Date.now()+T,m.set(E,N)}function w(E){const T=m.get(E);T&&T.handle!==null&&clearTimeout(T.handle),m.delete(E)}function b(E){const T=m.get(E);!T||T.handle===null||(clearTimeout(T.handle),T.handle=null,T.remaining=Math.max(0,T.deadline-Date.now()))}function M(E){if(h.value.find(C=>C.id===E)?.detailsOpen)return;const N=m.get(E);!N||N.handle!==null||v(E,N.remaining)}function R(E){E.detailsOpen=!E.detailsOpen,E.detailsOpen?b(E.id):M(E.id)}async function z(E){if(!await ss(f(E.warning)))return;E.copied=!0;const N=k.get(E.id);N&&clearTimeout(N),k.set(E.id,setTimeout(()=>{E.copied=!1,k.delete(E.id)},1400))}function $(E){w(E);const T=k.get(E);T&&clearTimeout(T),k.delete(E);const N=h.value.findIndex(C=>C.id===E);N!==-1&&(h.value=h.value.filter(C=>C.id!==E),o("dismiss",N))}return Ue(()=>n.warnings,E=>{const T=[...h.value];h.value=E.map(N=>{const C=d(N),O=T.findIndex(A=>A.key===C),H=O===-1?void 0:T.splice(O,1)[0];if(H)return H.warning=N,H;const V={id:p++,key:C,warning:N,detailsOpen:!1,copied:!1};return v(V.id,x(N)),V});for(const N of T){w(N.id);const C=k.get(N.id);C&&clearTimeout(C),k.delete(N.id)}},{immediate:!0,flush:"post"}),An(()=>{m.forEach(E=>{E.handle!==null&&clearTimeout(E.handle)}),m.clear(),k.forEach(E=>clearTimeout(E)),k.clear()}),(E,T)=>(g(),ce(mj,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:ue(()=>[(g(!0),S(Me,null,it(h.value,N=>(g(),ce(Qje,{key:N.id,variant:u(N.warning),title:r(N.warning),message:l(N.warning),"dismiss-label":y(s)("warnings.dismiss"),onDismiss:C=>$(N.id),onPointerenter:C=>b(N.id),onPointerleave:C=>M(N.id)},{default:ue(()=>[a(N.warning)?.length?(g(),S("div",eOe,[_("button",{class:"link",type:"button",onClick:C=>R(N)},I(N.detailsOpen?y(s)("warnings.hideDetails"):y(s)("warnings.showDetails")),9,tOe),_("button",{class:"link",type:"button",onClick:C=>z(N)},I(N.copied?y(s)("warnings.copied"):y(s)("warnings.copyDetails")),9,nOe)])):J("",!0),N.detailsOpen&&a(N.warning)?.length?(g(),S("dl",oOe,[(g(!0),S(Me,null,it(a(N.warning),C=>(g(),S("div",{key:`${C.label}:${C.value}`,class:"detail-row"},[_("dt",null,I(C.label),1),_("dd",null,I(C.value),1)]))),128))])):J("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),iOe=mt(sOe,[["__scopeId","data-v-6d8f28b8"]]),rOe={class:"update-dialog__head"},lOe={class:"update-dialog__brand","data-testid":"update-dialog-brand"},aOe={class:"update-dialog__titles"},cOe={class:"update-dialog__title","data-testid":"update-dialog-title"},uOe={key:0,class:"update-dialog__date","data-testid":"update-dialog-date"},dOe={key:0,class:"update-dialog__progress"},fOe={class:"update-dialog__progress-row"},pOe={class:"update-dialog__progress-label"},hOe={class:"update-dialog__progress-meta","data-testid":"update-dialog-progress-meta"},mOe={key:0,"data-testid":"update-dialog-bytes"},gOe={key:1},vOe=["aria-label"],wOe=["value","aria-label"],yOe={key:2,class:"update-dialog__message","data-testid":"update-dialog-message"},kOe=Ge({__name:"UpdateDialog",setup(e){const{t}=Lt(),n=RE();xn(()=>n.subscribe()),An(()=>n.unsubscribe());const o=B(()=>n.availableVersion.value??""),s=B(()=>n.status.value==="downloading"?t("update.dialogDownloading",{version:o.value}):n.status.value==="downloaded"?t("update.dialogReady",{version:o.value}):n.status.value==="error"?t("update.failed"):t("update.dialogAvailable",{version:o.value})),i=B(()=>{const d=n.state.value?.releaseDate;if(d===void 0)return"";const f=new Date(d);return Number.isNaN(f.getTime())?"":new Intl.DateTimeFormat(void 0,{dateStyle:"long"}).format(f)}),r=B(()=>{const d=n.state.value?.transferred;return d===void 0?void 0:Rk(d)}),l=B(()=>{const d=n.state.value?.total;return d===void 0?void 0:Rk(d)}),a=B(()=>n.status.value==="error"?n.state.value?.message??t("update.failedMessage"):n.status.value==="downloaded"?t("update.restart"):t("update.prompt")),c=B(()=>n.status.value!=="downloading");function u(){c.value&&n.closeDialog()}return(d,f)=>(g(),ce(E0,{open:y(n).dialogOpen.value,title:s.value,description:i.value||void 0,"close-on-overlay":c.value,"close-on-esc":c.value,"show-close":!1,size:"md-wide",onClose:u},{head:ue(()=>[_("div",rOe,[_("span",lOe,[Z(Vd,{size:"sm",animated:!1})]),_("div",aOe,[_("div",cOe,I(s.value),1),i.value?(g(),S("div",uOe,[Z(Le,{name:"calendar-schedule",size:"sm","aria-hidden":"true"}),_("span",null,I(i.value),1)])):J("",!0)])])]),foot:ue(()=>[y(n).status.value==="downloading"?(g(),ce(It,{key:0,"data-testid":"cancel-update-download",variant:"secondary",loading:y(n).busy.value,onClick:f[1]||(f[1]=p=>void y(n).cancelDownload())},{default:ue(()=>[He(I(y(t)("update.cancelDownload")),1)]),_:1},8,["loading"])):y(n).status.value==="downloaded"?(g(),S(Me,{key:1},[Z(It,{"data-testid":"later-update",variant:"ghost",onClick:u},{default:ue(()=>[He(I(y(t)("update.later")),1)]),_:1}),Z(It,{"data-testid":"restart-to-update",loading:y(n).busy.value,onClick:f[2]||(f[2]=p=>void y(n).restart())},{default:ue(()=>[He(I(y(t)("update.restartAction")),1)]),_:1},8,["loading"])],64)):y(n).status.value==="error"?(g(),S(Me,{key:2},[Z(It,{"data-testid":"dismiss-update",variant:"ghost",onClick:u},{default:ue(()=>[He(I(y(t)("update.dismiss")),1)]),_:1}),Z(It,{"data-testid":"retry-update",loading:y(n).busy.value,onClick:f[3]||(f[3]=p=>void y(n).retry())},{default:ue(()=>[He(I(y(t)("update.retryDownload")),1)]),_:1},8,["loading"])],64)):(g(),S(Me,{key:3},[Z(It,{"data-testid":"skip-update",variant:"secondary",onClick:f[4]||(f[4]=p=>void y(n).skip())},{default:ue(()=>[He(I(y(t)("update.skip")),1)]),_:1}),f[6]||(f[6]=_("span",{class:"update-dialog__foot-spacer"},null,-1)),Z(It,{"data-testid":"later-update",variant:"secondary",onClick:u},{default:ue(()=>[He(I(y(t)("update.later")),1)]),_:1}),Z(It,{"data-testid":"download-update",loading:y(n).busy.value,onClick:f[5]||(f[5]=p=>void y(n).download())},{default:ue(()=>[He(I(y(t)("update.download")),1)]),_:1},8,["loading"])],64))]),default:ue(()=>[y(n).status.value==="downloading"?(g(),S("div",dOe,[_("div",fOe,[_("span",pOe,I(y(t)("update.downloadProgress")),1),_("span",hOe,[r.value&&l.value?(g(),S("span",mOe,I(y(t)("update.bytesProgress",{transferred:r.value,total:l.value})),1)):(g(),S("span",gOe,I(y(t)("update.fetching")),1))])]),y(n).percent.value===void 0?(g(),S("progress",{key:0,"data-testid":"update-dialog-progress",max:"100","aria-label":y(t)("update.progressLabel")},null,8,vOe)):(g(),S("progress",{key:1,"data-testid":"update-dialog-progress",value:y(n).percent.value,max:"100","aria-label":y(t)("update.progressLabel")},null,8,wOe))])):y(n).status.value==="available"?(g(),ce(_d,{key:1,"data-testid":"automatic-update-preference","model-value":y(n).state.value?.autoUpdate??!1,disabled:y(n).busy.value,"onUpdate:modelValue":f[0]||(f[0]=p=>void y(n).setAutomaticChecks(p))},{default:ue(()=>[He(I(y(t)("update.automaticChecks")),1)]),_:1},8,["model-value","disabled"])):(g(),S("p",yOe,I(a.value),1))]),_:1},8,["open","title","description","close-on-overlay","close-on-esc"]))}}),bOe=mt(kOe,[["__scopeId","data-v-13aac9b0"]]),_Oe={class:"ui-action-toast-host"},xOe={class:"ui-action-toast__body"},SOe=Ge({__name:"ActionToast",props:{duration:{default:8e3},dismissLabel:{},dismissToken:{}},emits:["dismiss"],setup(e,{emit:t}){const n=t,{t:o}=Lt();let s=null,i=0,r=e.duration;function l(u){if(u<=0){n("dismiss",e.dismissToken);return}s=setTimeout(()=>n("dismiss",e.dismissToken),u),i=Date.now()+u}function a(){s!==null&&(clearTimeout(s),s=null,r=Math.max(0,i-Date.now()))}function c(){s===null&&l(r)}return l(e.duration),An(()=>{s!==null&&clearTimeout(s)}),(u,d)=>(g(),S("div",_Oe,[_("div",{class:"ui-action-toast",role:"status",onPointerenter:a,onPointerleave:c},[_("span",xOe,[En(u.$slots,"default",{},void 0,!0)]),Z(Zt,{class:"ui-action-toast__close",size:"sm",label:e.dismissLabel??y(o)("common.dismiss"),onClick:d[0]||(d[0]=f=>n("dismiss",e.dismissToken))},{default:ue(()=>[Z(Le,{name:"close",size:"sm"})]),_:1},8,["label"])],32)]))}}),Wm=mt(SOe,[["__scopeId","data-v-9efa207b"]]),COe={key:0,class:"window-controls"},MOe=["aria-label"],AOe=["aria-label"],EOe=["aria-label"],TOe=Ge({__name:"WindowControls",setup(e){const{t}=Lt(),n=B(()=>window.pythinkerDesktop?.platform==="win32");function o(){window.pythinkerDesktop?.minimizeWindow()}function s(){window.pythinkerDesktop?.toggleMaximizeWindow()}function i(){window.pythinkerDesktop?.closeWindow()}return(r,l)=>n.value?(g(),S("div",COe,[_("button",{type:"button",class:"wc wc-min","aria-label":y(t)("app.minimizeWindow"),onClick:o},[...l[0]||(l[0]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","aria-hidden":"true"},[_("path",{d:"M2.5 5h5"})],-1)])],8,MOe),_("button",{type:"button",class:"wc wc-max","aria-label":y(t)("app.maximizeWindow"),onClick:s},[...l[1]||(l[1]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linejoin":"round","aria-hidden":"true"},[_("rect",{x:"2.4",y:"2.4",width:"5.2",height:"5.2",rx:"1"})],-1)])],8,AOe),_("button",{type:"button",class:"wc wc-close","aria-label":y(t)("app.closeWindow"),onClick:i},[...l[2]||(l[2]=[_("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","aria-hidden":"true"},[_("path",{d:"M3 3l4 4M7 3l-4 4"})],-1)])],8,EOe)])):J("",!0)}}),IOe=mt(TOe,[["__scopeId","data-v-768f9703"]]),LOe={class:"topbar"},$Oe={class:"wsq"},NOe=["aria-label"],zOe={class:"tb-path"},BOe={class:"ws"},ROe={class:"se"},FOe={class:"tb-sub"},jOe=Ge({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,i=B(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>o.workspace?.name??n("workspace.noWorkspace")),l=B(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(g(),S("div",LOe,[_("span",$Oe,I(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":y(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",zOe,[_("span",BOe,I(r.value),1),e.sessionTitle?(g(),S(Me,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",ROe,I(e.sessionTitle),1)],64)):J("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",FOe,[_("span",{class:Be(["rd",{on:e.running}])},null,2),_("span",null,I(l.value),1),e.branch?(g(),S(Me,{key:0},[He(" · "+I(e.branch),1)],64)):J("",!0),e.sessionCount>0?(g(),S(Me,{key:1},[He(" · "+I(y(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):J("",!0)])],8,NOe),Z(Zt,{size:"lg",label:y(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:ue(()=>[Z(Le,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),OOe=mt(jOe,[["__scopeId","data-v-27a83eb2"]]),POe={class:"mlist"},HOe={key:0,class:"mempty"},DOe=["onClick"],VOe={class:"mgh-main"},WOe={class:"mgh-name"},qOe={class:"mgh-path"},UOe={key:2,class:"att"},ZOe={key:0,class:"mempty small"},KOe=["onClick"],GOe={class:"m"},YOe={class:"s"},XOe={key:0,class:"att"},JOe=["disabled","onClick"],QOe=["onClick"],ePe=Ge({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(N){s("select",N),i()}function l(N){s("createInWorkspace",N),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=U(new Set);function d(N){return u.value.has(N)}function f(N){const C=new Set(u.value);C.has(N)?C.delete(N):C.add(N),u.value=C,w.value=null,z.value=null}const p=U(new Set);function h(N){return p.value.has(N)}function m(N){const C=new Set(p.value);C.has(N)?C.delete(N):C.add(N),p.value=C}function k(N){if(h(N.workspace.id))return N.sessions;const C=N.sessions.slice(0,N.initialCount);if(o.activeId&&!C.some(O=>O.id===o.activeId)){const O=N.sessions.find(H=>H.id===o.activeId);if(O)return[...C,O]}return C}function x(N){if(!p.value.has(N)){const C=new Set(p.value);C.add(N),p.value=C}s("loadMore",N)}function v(N){return o.attentionByWorkspace[N]??0}const w=U(null);function b(N){w.value=w.value===N?null:N,z.value=null}function M(N){w.value=null;const O=(typeof window<"u"?window.prompt(n("sidebar.rename"),N.title):null)?.trim();O&&s("rename",N.id,O)}function R(N){w.value=null,s("archive",N)}const z=U(null);function $(N){z.value=z.value===N?null:N,w.value=null}function E(N){ss(N.root),z.value=null}function T(N){z.value=null,s("deleteWorkspace",N.id)}return(N,C)=>(g(),ce(Gc,{"model-value":e.modelValue,"onUpdate:modelValue":C[2]||(C[2]=O=>s("update:modelValue",O))},{default:ue(()=>[_("button",{type:"button",class:"newrow",onClick:a},[Z(Le,{name:"message",size:"sm"}),He(" "+I(y(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[Z(Le,{name:"folder",size:"sm"}),He(" "+I(y(n)("sidebar.newWorkspace")),1)]),_("div",POe,[e.groups.length===0?(g(),S("div",HOe,I(y(n)("workspace.noWorkspace")),1)):J("",!0),(g(!0),S(Me,null,it(e.groups,O=>(g(),S("div",{key:O.workspace.id,class:"mgroup"},[_("div",{class:Be(["mgh",{on:O.workspace.id===e.activeWorkspaceId}]),onClick:H=>f(O.workspace.id)},[d(O.workspace.id)?(g(),ce(Le,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(g(),ce(Le,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",VOe,[_("span",WOe,I(O.workspace.name),1),Z(Cn,{text:O.workspace.root},{default:ue(()=>[_("span",qOe,I(O.workspace.shortPath),1)]),_:2},1032,["text"])]),d(O.workspace.id)&&v(O.workspace.id)>0?(g(),S("span",UOe,I(v(O.workspace.id)),1)):J("",!0),Z(Zt,{size:"lg",class:"mgh-more",label:y(n)("sidebar.options"),onClick:xt(H=>$(O.workspace.id),["stop"])},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),Z(Zt,{size:"lg",class:"mgh-add",label:y(n)("workspace.newInGroup"),onClick:xt(H=>l(O.workspace.id),["stop"])},{default:ue(()=>[Z(Le,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),z.value===O.workspace.id?(g(),ce(qr,{key:3,class:"kmenu wsmenu",onClick:C[0]||(C[0]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{size:"lg",onClick:H=>E(O.workspace)},{default:ue(()=>[He(I(y(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),Z(yn,{size:"lg",danger:"",onClick:H=>T(O.workspace)},{default:ue(()=>[He(I(y(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):J("",!0)],10,DOe),Zn(_("div",null,[O.sessions.length===0?(g(),S("div",ZOe,I(y(n)("sidebar.noSessions")),1)):J("",!0),(g(!0),S(Me,null,it(k(O),H=>(g(),S("div",{key:H.id,class:Be(["srow",{cur:H.id===e.activeId}]),onClick:V=>r(H.id)},[_("div",GOe,[_("div",{class:Be(["t",{run:H.busy,aborted:!H.busy&&(e.attentionBySession[H.id]??0)===0&&(H.lastTurnReason==="cancelled"||H.lastTurnReason==="failed")}])},I(H.title),3),_("div",YOe,I(H.time),1)]),(e.attentionBySession[H.id]??0)>0?(g(),S("span",XOe,I(e.attentionBySession[H.id]),1)):J("",!0),Z(Zt,{size:"lg",class:"kb",label:y(n)("sidebar.options"),onClick:xt(V=>b(H.id),["stop"])},{default:ue(()=>[Z(Le,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),w.value===H.id?(g(),ce(qr,{key:1,class:"kmenu",onClick:C[1]||(C[1]=xt(()=>{},["stop"]))},{default:ue(()=>[Z(yn,{size:"lg",onClick:V=>M(H)},{default:ue(()=>[He(I(y(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),Z(yn,{size:"lg",danger:"",onClick:V=>R(H.id)},{default:ue(()=>[He(I(y(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):J("",!0)],10,KOe))),128)),O.hasMore||O.loadingMore?(g(),S("button",{key:1,type:"button",class:"mshow-more",disabled:O.loadingMore,onClick:xt(H=>x(O.workspace.id),["stop"])},I(O.loadingMore?y(n)("sidebar.loadingMore"):y(n)("sidebar.showMore",{count:Math.max(0,O.workspace.sessionCount-O.sessions.length)})),9,JOe)):J("",!0),O.sessions.length>O.initialCount?(g(),S("button",{key:2,type:"button",class:"mshow-more",onClick:xt(H=>m(O.workspace.id),["stop"])},I(h(O.workspace.id)?y(n)("sidebar.showLess"):y(n)("sidebar.showAll",{count:O.sessions.length-O.initialCount})),9,QOe)):J("",!0)],512),[[Ti,!d(O.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),tPe=mt(ePe,[["__scopeId","data-v-4c7bceaf"]]),nPe={class:"group-title"},oPe={class:"srow-main"},sPe={class:"srow-label"},iPe={class:"srow-sub"},rPe={class:"srow read-only"},lPe={class:"srow-main"},aPe={class:"srow-label"},cPe={key:0,class:"srow-sub"},uPe={class:"cache-note"},dPe={class:"srow-main"},fPe={class:"srow-label"},pPe={class:"srow-sub"},hPe=["aria-checked"],mPe={key:0,class:"srow read-only"},gPe={class:"srow-main"},vPe={class:"srow-label"},wPe={class:"srow-sub"},yPe={class:"goal-actions"},kPe=["aria-checked"],bPe={class:"srow-main"},_Pe={class:"srow-label"},xPe={class:"srow-sub"},SPe=["aria-checked"],CPe={class:"srow-main"},MPe={class:"srow-label"},APe={class:"srow-sub"},EPe={class:"srow-main"},TPe={class:"srow-label"},IPe={class:"srow read-only"},LPe={class:"srow-main"},$Pe={class:"srow-label"},NPe={class:"srow-sub"},zPe=["aria-label"],BPe={class:"group-title"},RPe={class:"srow-main"},FPe={class:"srow-label"},jPe={class:"srow-sub"},OPe={class:"srow read-only pref"},PPe={class:"srow-main"},HPe={class:"srow-label"},DPe={class:"srow read-only pref"},VPe={class:"srow-main"},WPe={class:"srow-label"},qPe={class:"srow-main"},UPe={class:"srow-label"},ZPe={class:"srow-sub"},KPe=["aria-checked"],GPe={class:"srow-main"},YPe={class:"srow-label"},XPe={key:2,class:"srow read-only"},JPe={class:"srow-main"},QPe={class:"srow-label"},eHe={class:"srow-val dim"},tHe={class:"arch-subhead"},nHe={class:"arch-count"},oHe={class:"arch-tools"},sHe={key:0,class:"arch-empty"},iHe={class:"arch-meta"},rHe={class:"arch-name"},lHe={class:"arch-time"},aHe={key:2,class:"arch-empty"},cHe=100,uHe=Ge({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},goalMode:{type:Boolean},goal:{default:null},dynamicWorkflowMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleWorkflow","toggleGoal","controlGoal","setPermission","setColorScheme","setUiFontSize","setConversationToc","login"],setup(e,{emit:t}){const{t:n}=Lt(),o=e,s=t,{confirm:i}=y1();function r(Q){s("setColorScheme",Q)}const l=["manual","yolo","auto"],a=B(()=>o.models?.find(Q=>Q.id===o.status?.modelId)),c=B(()=>Zp(a.value)),u=B(()=>Kp(a.value)),d=B(()=>r9(a.value,o.thinking)),f=B(()=>u.value.includes(d.value)?d.value:""),p=B(()=>u.value.map(Q=>({value:Q,label:Pd(Q)}))),h=B(()=>o.planMode===!0),m=B(()=>o.goalMode===!0),k=B(()=>o.goal!==null&&["active","paused","blocked"].includes(o.goal?.status??"")),x=B(()=>{const Q=o.goal?.status;return Q?n(`status.goalStatus${Q[0].toUpperCase()}${Q.slice(1)}`):""});async function v(){await i({title:n("status.goalCancel"),message:n("status.goalCancelConfirm"),confirmLabel:n("status.goalCancelConfirmYes"),cancelLabel:n("status.goalCancelConfirmNo"),variant:"danger"})&&s("controlGoal","cancel")}const w=B(()=>a9(o.uiFontSize));function b(Q){const ge=jN(Q);ge!==void 0&&s("setUiFontSize",ge)}const M=B(()=>{const Q=o.status.permission;return Q==="yolo"?"var(--color-warning)":Q==="auto"?"var(--color-danger)":"var(--color-text-muted)"}),R=B(()=>{const Q=o.status.permission,ge=n(Q==="yolo"?"mobile.permYoloSub":Q==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${Q} · ${ge}`}),z=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),$=B(()=>o.status.ctxMax>0?`${na(o.status.ctxUsed)}/${na(o.status.ctxMax)}`:n("status.statusNone"));function E(Q){s("setThinking",$N(a.value,Q))}function T(){const Q=l.indexOf(o.status.permission),ge=l[(Q+1)%l.length];s("setPermission",ge)}function N(){s("pickModel"),s("update:modelValue",!1)}function C(){s("login"),s("update:modelValue",!1)}const O=b1(),H=U("main"),V=U([]),A=U(!1),F=U(!1),j=U(""),q=U("archived-desc");async function P(){if(!A.value){A.value=!0,F.value=!1;try{const Q=[];let ge;for(;;){const xe=await O.loadArchivedSessions({beforeId:ge,pageSize:cHe});if(Q.push(...xe.items),!xe.hasMore||xe.items.length===0)break;const Ke=xe.items.at(-1)?.id;if(Ke===void 0)break;ge=Ke}V.value=Q,F.value=!0}catch(Q){console.warn("loadAllArchived failed",Q)}finally{A.value=!1}}}function W(){H.value="archived",j.value="",P()}function G(){H.value="main"}const ee=B(()=>{const Q=j.value.trim().toLowerCase();let ge=V.value.filter(xe=>xe.archived===!0);return Q&&(ge=ge.filter(xe=>xe.title.toLowerCase().includes(Q))),ge=ge.slice(),q.value==="archived-desc"?ge.sort((xe,Ke)=>Ke.updatedAt.localeCompare(xe.updatedAt)):q.value==="created-desc"?ge.sort((xe,Ke)=>Ke.createdAt.localeCompare(xe.createdAt)):ge.sort((xe,Ke)=>xe.title.localeCompare(Ke.title,"en")),ge});async function se(Q){await O.restoreSession(Q)&&(V.value=V.value.filter(xe=>xe.id!==Q))}function oe(Q){const ge=new Date(Q);if(Number.isNaN(ge.getTime()))return Q;const xe=Ke=>String(Ke).padStart(2,"0");return`${ge.getFullYear()}-${xe(ge.getMonth()+1)}-${xe(ge.getDate())} ${xe(ge.getHours())}:${xe(ge.getMinutes())}`}return Ue(()=>o.modelValue,Q=>{Q||(H.value="main")}),(Q,ge)=>(g(),ce(Gc,{"model-value":e.modelValue,title:y(n)("mobile.settingsTitle"),"onUpdate:modelValue":ge[8]||(ge[8]=xe=>s("update:modelValue",xe))},{default:ue(()=>[H.value==="main"?(g(),S(Me,{key:0},[_("div",nPe,I(y(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:N},[_("span",oPe,[_("span",sPe,I(y(n)("status.statusModel")),1),_("span",iPe,I(e.status.model),1)]),ge[9]||(ge[9]=_("span",{class:"chev"},"›",-1))]),_("div",rPe,[_("span",lPe,[_("span",aPe,I(y(n)("status.statusThinking")),1),c.value==="unsupported"?(g(),S("span",cPe,I(y(n)("status.modeNotSupported")),1)):J("",!0)]),u.value.length>1?(g(),ce(ni,{key:0,"model-value":f.value,options:p.value,size:"sm","onUpdate:modelValue":E},null,8,["model-value","options"])):(g(),S("span",{key:1,class:Be(["srow-val",{dim:d.value==="off"}])},I(d.value==="off"?y(n)("status.planOff"):y(Pd)(d.value)),3))]),_("div",uPe,I(y(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:ge[0]||(ge[0]=xe=>s("togglePlan"))},[_("span",dPe,[_("span",fPe,I(y(n)("status.statusPlanMode")),1),_("span",pPe,I(y(n)("mobile.planModeSub")),1)]),_("span",{class:Be(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,hPe)]),k.value?(g(),S("div",mPe,[_("span",gPe,[_("span",vPe,I(y(n)("status.goalLabel")),1),_("span",wPe,I(x.value),1)]),_("span",yPe,[e.goal?.status==="active"?(g(),ce(It,{key:0,variant:"secondary",size:"sm",onClick:ge[1]||(ge[1]=xe=>s("controlGoal","pause"))},{default:ue(()=>[He(I(y(n)("status.goalPause")),1)]),_:1})):J("",!0),e.goal?.status==="paused"||e.goal?.status==="blocked"?(g(),ce(It,{key:1,variant:"secondary",size:"sm",onClick:ge[2]||(ge[2]=xe=>s("controlGoal","resume"))},{default:ue(()=>[He(I(y(n)("status.goalResume")),1)]),_:1})):J("",!0),Z(It,{variant:"ghost",size:"sm",onClick:v},{default:ue(()=>[He(I(y(n)("status.goalCancel")),1)]),_:1})])])):(g(),S("button",{key:1,type:"button",class:"srow",role:"switch","aria-checked":m.value,onClick:ge[3]||(ge[3]=xe=>s("toggleGoal"))},[_("span",bPe,[_("span",_Pe,I(y(n)("status.goalLabel")),1),_("span",xPe,I(y(n)("mobile.goalModeSub")),1)]),_("span",{class:Be(["toggle",{on:m.value}])},null,2)],8,kPe)),_("button",{type:"button",class:"srow",role:"switch","aria-checked":e.dynamicWorkflowMode,onClick:ge[4]||(ge[4]=xe=>s("toggleWorkflow"))},[_("span",CPe,[_("span",MPe,I(y(n)("status.statusDynamicWorkflowMode")),1),_("span",APe,I(y(n)("mobile.workflowModeSub")),1)]),_("span",{class:Be(["toggle",{on:e.dynamicWorkflowMode}])},null,2)],8,SPe),_("button",{type:"button",class:"srow",onClick:T},[_("span",EPe,[_("span",TPe,I(y(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Wt({color:M.value})},I(R.value),5)]),ge[10]||(ge[10]=_("span",{class:"chev"},"›",-1))]),_("div",IPe,[_("span",LPe,[_("span",$Pe,I(y(n)("status.statusContext")),1),_("span",NPe,I($.value),1)]),_("span",{class:"ctx-meter","aria-label":$.value},[_("i",{style:Wt({width:z.value+"%"})},null,4)],8,zPe)]),_("div",BPe,I(y(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:W},[_("span",RPe,[_("span",FPe,I(y(n)("mobile.archivedSessions")),1),_("span",jPe,I(y(n)("mobile.archivedSessionsSub")),1)]),ge[11]||(ge[11]=_("span",{class:"chev"},"›",-1))]),_("div",OPe,[_("span",PPe,[_("span",HPe,I(y(n)("theme.colorSchemeLabel")),1)]),Z(ni,{"model-value":e.colorScheme??"system",options:[{value:"light",label:y(n)("theme.light")},{value:"dark",label:y(n)("theme.dark")},{value:"system",label:y(n)("theme.system")}],"onUpdate:modelValue":r},null,8,["model-value","options"])]),_("div",DPe,[_("span",VPe,[_("span",WPe,I(y(n)("settings.uiFontSize")),1)]),Z(ni,{"model-value":w.value,options:y(zN),"aria-label":y(n)("settings.uiFontSize"),"onUpdate:modelValue":b},null,8,["model-value","options","aria-label"])]),_("button",{type:"button",class:"srow",onClick:ge[5]||(ge[5]=xe=>s("setConversationToc",!e.conversationToc))},[_("span",qPe,[_("span",UPe,I(y(n)("settings.conversationToc")),1),_("span",ZPe,I(y(n)("settings.conversationTocHint")),1)]),_("span",{class:Be(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,KPe)]),_("button",{type:"button",class:"srow acct in",onClick:C},[_("span",GPe,[_("span",YPe,I(y(n)("settings.manageProviders")),1)])]),e.serverVersion?(g(),S("div",XPe,[_("span",JPe,[_("span",QPe,I(y(n)("settings.serverVersion")),1)]),_("span",eHe,I(e.serverVersion),1)])):J("",!0)],64)):(g(),S(Me,{key:1},[_("div",tHe,[_("button",{type:"button",class:"arch-back",onClick:G},[ge[12]||(ge[12]=_("span",{class:"chev back"},"‹",-1)),He(" "+I(y(n)("mobile.archivedBack")),1)]),_("span",nHe,I(y(n)("mobile.sessionCount",{n:ee.value.length})),1)]),_("div",oHe,[Z(os,{class:"arch-search-input","model-value":j.value,size:"sm",placeholder:y(n)("settings.archivedSearch"),"onUpdate:modelValue":ge[6]||(ge[6]=xe=>j.value=xe)},null,8,["model-value","placeholder"]),Z(ni,{size:"sm","model-value":q.value,options:[{value:"archived-desc",label:y(n)("settings.archivedSortArchived")},{value:"created-desc",label:y(n)("settings.archivedSortCreated")},{value:"name-asc",label:y(n)("settings.archivedSortName")}],"onUpdate:modelValue":ge[7]||(ge[7]=xe=>q.value=xe)},null,8,["model-value","options"])]),A.value?(g(),S("div",sHe,I(y(n)("settings.archivedLoadingAll")),1)):ee.value.length>0?(g(!0),S(Me,{key:1},it(ee.value,xe=>(g(),S("div",{key:xe.id,class:"arch-row"},[_("div",iHe,[_("div",rHe,I(xe.title),1),_("div",lHe,I(y(n)("settings.archivedAt",{time:oe(xe.updatedAt)})),1)]),Z(It,{variant:"secondary",size:"sm",onClick:Ke=>se(xe.id)},{default:ue(()=>[He(I(y(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(g(),S("div",aHe,I(V.value.length===0?y(n)("settings.archivedEmpty"):y(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),dHe=mt(uHe,[["__scopeId","data-v-bcda0873"]]),fHe=["role","aria-modal","aria-label"],pHe={class:"wiz-rail"},hHe={class:"rail-inner"},mHe={class:"eyebrow-pill"},gHe={class:"wiz-title"},vHe={class:"wiz-sub"},wHe={class:"pref-group"},yHe={class:"pref-label"},kHe={class:"theme-cards"},bHe=["onClick"],_He={class:"opt-label"},xHe={class:"pref-group"},SHe={class:"pref-label"},CHe={class:"accent-cards"},MHe=["onClick"],AHe={class:"opt-label"},EHe={key:1,class:"wiz-actions"},THe={key:2,class:"wiz-hint"},IHe={key:0,class:"wiz-hero","aria-hidden":"true"},LHe={class:"hero-inner"},$He={class:"hero-tagline"},NHe={class:"hero-sub"},zHe={class:"frost-stage"},BHe={class:"frost-card"},RHe={class:"frost-card"},FHe=Ge({__name:"Onboarding",props:{embedded:{type:Boolean,default:!1}},emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),{colorScheme:s,accent:i,setColorScheme:r,setAccent:l}=f9(),a=[{value:"system",label:o("theme.system")},{value:"light",label:o("theme.light")},{value:"dark",label:o("theme.dark")}],c=[{value:"blue",label:o("theme.accentBlue")},{value:"mono",label:o("theme.accentBlack")}];return(u,d)=>(g(),S("div",{class:Be(["wizard",{"is-embedded":e.embedded}]),role:e.embedded?void 0:"dialog","aria-modal":e.embedded?void 0:"true","aria-label":e.embedded?void 0:y(o)("onboarding.title")},[_("div",pHe,[_("div",hHe,[e.embedded?J("",!0):(g(),S(Me,{key:0},[_("span",mHe,I(y(o)("onboarding.eyebrow")),1),Z(Vd,{class:"brand-mark",size:"lg",animated:!1,label:"Pythinker Code"}),_("h1",gHe,I(y(o)("onboarding.title")),1),_("p",vHe,I(y(o)("onboarding.subtitle")),1)],64)),_("div",wHe,[_("div",yHe,I(y(o)("theme.colorSchemeLabel")),1),_("div",kHe,[(g(),S(Me,null,it(a,f=>_("button",{key:f.value,type:"button",class:Be(["opt-card theme-card",{selected:y(s)===f.value}]),onClick:p=>y(r)(f.value)},[_("span",{class:Be(["theme-preview",`theme-preview--${f.value}`]),"aria-hidden":"true"},[f.value==="system"?(g(),S(Me,{key:0},[d[2]||(d[2]=H2('',2))],64)):(g(),S(Me,{key:1},[d[3]||(d[3]=_("span",{class:"theme-side"},null,-1)),d[4]||(d[4]=_("span",{class:"theme-lines"},[_("span"),_("span"),_("span")],-1))],64))],2),_("span",_He,I(f.label),1)],10,bHe)),64))])]),_("div",xHe,[_("div",SHe,I(y(o)("theme.accentLabel")),1),_("div",CHe,[(g(),S(Me,null,it(c,f=>_("button",{key:f.value,type:"button",class:Be(["opt-card accent-card",{selected:y(i)===f.value}]),onClick:p=>y(l)(f.value)},[_("span",{class:Be(["opt-radio",{on:y(i)===f.value}])},null,2),_("span",{class:Be(["accent-swatch",`accent-swatch--${f.value}`]),"aria-hidden":"true"},null,2),_("span",AHe,I(f.label),1)],10,MHe)),64))])]),e.embedded?J("",!0):(g(),S("div",EHe,[Z(It,{variant:"primary",size:"lg",class:"wiz-action","data-testid":"onboarding-complete",onClick:d[0]||(d[0]=f=>n("complete"))},{default:ue(()=>[_("span",null,I(y(o)("onboarding.start")),1),Z(Le,{name:"arrow-right",size:"sm"})]),_:1}),Z(It,{variant:"secondary",size:"lg",class:"wiz-action","data-testid":"onboarding-skip",onClick:d[1]||(d[1]=f=>n("skip"))},{default:ue(()=>[_("span",null,I(y(o)("onboarding.skip")),1),Z(Le,{name:"arrow-right",size:"sm"})]),_:1})])),e.embedded?J("",!0):(g(),S("p",THe,I(y(o)("onboarding.hint")),1))])]),e.embedded?J("",!0):(g(),S("aside",IHe,[d[7]||(d[7]=_("div",{class:"hero-ambient"},[_("span",{class:"orb orb-a"}),_("span",{class:"orb orb-b"}),_("span",{class:"orb orb-c"})],-1)),_("div",LHe,[Z(Vd,{size:"hero",animated:!1,label:""}),_("p",$He,I(y(o)("onboarding.heroTitle")),1),_("p",NHe,I(y(o)("onboarding.heroSub")),1),_("div",zHe,[_("figure",BHe,[d[5]||(d[5]=H2('',2)),_("figcaption",null,I(y(o)("onboarding.platformMac")),1)]),_("figure",RHe,[d[6]||(d[6]=H2('',2)),_("figcaption",null,I(y(o)("onboarding.platformWindows")),1)])])])]))],10,fHe))}}),Hz=mt(FHe,[["__scopeId","data-v-2c24b7cb"]]),jHe=2e3;function OHe(e){const t=U("idle"),n=U(void 0),o=U(void 0),s=U(!1),i=U(!0),r=U(""),l=B(()=>t.value==="starting"||t.value==="exchanging"||t.value==="loading_models");let a,c,u=!1,d=!1;function f(){return t.value==="waiting_for_browser"||t.value==="waiting_for_code"}function p(){a!==void 0&&(clearInterval(a),a=void 0)}function h(){n.value=void 0,o.value=void 0,s.value=!1}function m(){c?.close(),c=void 0}function k($){u||(r.value=$,t.value="failed",p(),m(),h())}async function x($,E){if(u||n.value!==$||!f()&&t.value!=="exchanging"||E.state==="pending")return;if(p(),E.state==="failed"){k(E.message??"");return}if(E.state==="cancelled"){t.value="cancelled",m(),h();return}c=void 0,t.value="loading_models";let T=!0;try{T=await e?.()??!0}catch(N){k(N instanceof Error?N.message:String(N));return}finally{h()}u||(T?t.value="connected":k(""))}async function v(){if(u||d||!f())return;const $=n.value;if($!==void 0){d=!0;try{await x($,await At().getCodexLoginStatus($))}catch{}finally{d=!1}}}function w(){v()}function b(){document.visibilityState==="visible"&&v()}async function M(){if(u||l.value||f())return;t.value="starting",r.value="",h();let $=null;try{$=typeof window>"u"?null:window.open("about:blank","_blank"),$!==null&&($.opener=null,c=$)}catch{$?.close(),$=null}s.value=$===null;try{const E=At(),T=await E.startCodexLogin();if(u){m(),E.cancelCodexLogin(T.loginId).catch(()=>{});return}if(n.value=T.loginId,o.value=T.authorizeUrl,i.value=T.loopback,$!==null)try{$.location.href=T.authorizeUrl}catch{m(),s.value=!0}t.value=T.loopback?"waiting_for_browser":"waiting_for_code",p(),a=setInterval(()=>void v(),jHe)}catch(E){m(),k(E instanceof Error?E.message:String(E))}}async function R($){const E=n.value;if(u||l.value||!f()||E===void 0)return;const T=t.value;t.value="exchanging",r.value="";try{await x(E,await At().submitCodexLoginRedirect(E,$)),!u&&t.value==="exchanging"&&(t.value=T)}catch(N){u||(r.value=N instanceof Error?N.message:String(N),t.value=T)}}async function z(){const $=n.value;if(p(),m(),h(),t.value="cancelled",r.value="",$!==void 0)try{await At().cancelCodexLogin($)}catch{}}return xn(()=>{window.addEventListener("focus",w),document.addEventListener("visibilitychange",b)}),An(()=>{u=!0,window.removeEventListener("focus",w),document.removeEventListener("visibilitychange",b),p(),m();const $=n.value;$!==void 0&&f()&&At().cancelCodexLogin($).catch(()=>{})}),{phase:pr(t),busy:l,loginId:pr(n),authorizeUrl:pr(o),popupBlocked:pr(s),loopback:pr(i),error:pr(r),start:M,submitRedirect:R,cancel:z}}const PHe={class:"codex-signin"},HHe={key:1,class:"codex-signin__ok",role:"status"},DHe={class:"codex-signin__status",role:"status"},VHe={key:0,class:"codex-signin__hint"},WHe=["href"],qHe={class:"codex-signin__hint"},UHe={key:2,class:"codex-signin__error",role:"alert"},ZHe={class:"codex-signin__actions"},KHe=Ge({__name:"CodexSignIn",emits:["connected"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),i=U(""),r=OHe(async()=>{await s.refreshRuntimeState();const a=s.authReady.value;return a&&n("connected"),a});async function l(){const a=i.value.trim();a!==""&&(await r.submitRedirect(a),i.value="")}return(a,c)=>(g(),S("div",PHe,[y(r).phase.value==="idle"||y(r).phase.value==="cancelled"?(g(),ce(It,{key:0,variant:"primary","data-testid":"codex-signin-start",onClick:c[0]||(c[0]=u=>y(r).start())},{default:ue(()=>[Z(Le,{name:"log-in",size:"sm"}),_("span",null,I(y(o)("codexLogin.signIn")),1)]),_:1})):y(r).phase.value==="connected"?(g(),S("p",HHe,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(o)("codexLogin.connected")),1)])):(g(),S(Me,{key:2},[_("p",DHe,[y(r).busy.value||y(r).phase.value!=="failed"?(g(),ce(Go,{key:0,size:"sm"})):J("",!0),_("span",null,I(y(o)(`codexLogin.phase.${y(r).phase.value}`)),1)]),y(r).authorizeUrl.value?(g(),S("p",VHe,[He(I(y(o)("codexLogin.openLinkHint"))+" ",1),_("a",{href:y(r).authorizeUrl.value,target:"_blank",rel:"noreferrer noopener"},I(y(o)("codexLogin.openLink")),9,WHe)])):J("",!0),y(r).phase.value==="waiting_for_code"||y(r).phase.value==="exchanging"?(g(),S("form",{key:1,class:"codex-signin__paste",onSubmit:xt(l,["prevent"])},[_("p",qHe,I(y(o)("codexLogin.pasteHint")),1),Z(hl,{label:y(o)("codexLogin.pasteLabel")},{default:ue(()=>[Z(os,{modelValue:i.value,"onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),placeholder:y(o)("codexLogin.pastePlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),Z(It,{type:"submit",variant:"primary",loading:y(r).busy.value},{default:ue(()=>[He(I(y(o)("codexLogin.submit")),1)]),_:1},8,["loading"])],32)):J("",!0),y(r).error.value?(g(),S("p",UHe,I(y(o)("codexLogin.failed",{message:y(r).error.value})),1)):J("",!0),_("div",ZHe,[y(r).phase.value==="failed"?(g(),ce(It,{key:0,variant:"primary",onClick:c[2]||(c[2]=u=>y(r).start())},{default:ue(()=>[He(I(y(o)("codexLogin.retry")),1)]),_:1})):(g(),ce(It,{key:1,variant:"secondary",onClick:c[3]||(c[3]=u=>y(r).cancel())},{default:ue(()=>[He(I(y(o)("codexLogin.cancel")),1)]),_:1}))])],64))]))}}),GHe=mt(KHe,[["__scopeId","data-v-1570e574"]]),YHe=["aria-label"],XHe={class:"first-run__panel"},JHe={class:"first-run__steps"},QHe={class:"first-run__dot"},eDe={key:0,class:"first-run__body"},tDe={class:"first-run__sub"},nDe={key:0,class:"first-run__options"},oDe={class:"first-run__option-main"},sDe={class:"first-run__option-name"},iDe={class:"first-run__option-desc"},rDe={class:"first-run__badge"},lDe={class:"first-run__option-main"},aDe={class:"first-run__option-name"},cDe={class:"first-run__option-desc"},uDe={class:"first-run__option-main"},dDe={class:"first-run__option-name"},fDe={class:"first-run__option-desc"},pDe={key:1,class:"first-run__route"},hDe={class:"first-run__actions"},mDe={key:2,class:"first-run__skip-hint"},gDe={key:1,class:"first-run__body"},vDe={class:"first-run__sub"},wDe={key:0,class:"first-run__empty"},yDe={key:1,class:"first-run__models"},kDe=["data-testid","onClick"],bDe={class:"first-run__model-id"},_De={key:0,class:"first-run__badge"},xDe={class:"first-run__model-ctx"},SDe={class:"first-run__actions"},CDe={key:2,class:"first-run__body"},MDe={class:"first-run__sub"},ADe={class:"first-run__ready"},EDe={class:"first-run__actions"},TDe=Ge({__name:"FirstRun",emits:["complete"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),i=U("connect"),r=U(null),l=U(null),a=U(!1),c=U(!1),u=["connect","model","appearance"],d=B(()=>u.indexOf(i.value)),f=B(()=>(s.models.value??[]).filter(E=>E.capabilities===void 0||E.capabilities.length===0||E.capabilities.some(T=>T.trim().toLowerCase()==="tool_use"))),p=B(()=>s.defaultModel.value??void 0),h=B(()=>{const E=p.value;return f.value.toSorted((T,N)=>T.id===E?-1:N.id===E?1:N.maxContextSize-T.maxContextSize||T.id.localeCompare(N.id))}),m=B(()=>a.value?h.value:h.value.slice(0,5)),k=B(()=>(s.providers.value??[])[0]?.id??""),x=B(()=>s.authReady.value&&f.value.length>0),v=B(()=>l.value!==null);Ue([p,f],()=>{l.value===null&&(l.value=p.value??f.value[0]?.id??null)},{immediate:!0});function w(){x.value&&(i.value="model")}async function b(){const E=l.value;if(!(E===null||c.value)){c.value=!0;try{E!==s.defaultModel.value&&await s.updateConfig({defaultModel:E}),await s.refreshRuntimeState(),s.authReady.value&&(i.value="appearance")}finally{c.value=!1}}}function M(){s.setOnboarded(!0),n("complete")}function R(){M()}function z(E){r.value=E}async function $(){await s.refreshRuntimeState(),x.value&&w()}return(E,T)=>(g(),S("div",{class:"first-run",role:"dialog","aria-modal":"true","aria-label":y(o)("firstRun.connect.title")},[_("div",XHe,[_("ol",JHe,[(g(),S(Me,null,it(u,(N,C)=>_("li",{key:N,class:Be(["first-run__step",{"is-current":C===d.value,"is-done":Cz("codex"))},[_("span",oDe,[_("span",sDe,I(y(o)("firstRun.connect.codexName")),1),_("span",iDe,I(y(o)("firstRun.connect.codexDesc")),1)]),_("span",rDe,I(y(o)("firstRun.connect.codexBadge")),1)]),_("button",{type:"button",class:"first-run__option","data-testid":"first-run-route-catalog",onClick:T[1]||(T[1]=N=>z("catalog"))},[_("span",lDe,[_("span",aDe,I(y(o)("firstRun.connect.catalogName")),1),_("span",cDe,I(y(o)("firstRun.connect.catalogDesc")),1)]),Z(Le,{name:"chevron-right",size:"sm"})]),_("button",{type:"button",class:"first-run__option","data-testid":"first-run-route-manual",onClick:T[2]||(T[2]=N=>z("manual"))},[_("span",uDe,[_("span",dDe,I(y(o)("firstRun.connect.manualName")),1),_("span",fDe,I(y(o)("firstRun.connect.manualDesc")),1)]),Z(Le,{name:"chevron-right",size:"sm"})])])):(g(),S("div",pDe,[r.value==="codex"?(g(),ce(GHe,{key:0,onConnected:$})):(g(),ce(Oz,{key:1,config:y(s).config.value,"initial-source":r.value==="manual"?"manual":"catalog",onAdded:$,onCancel:T[3]||(T[3]=N=>r.value=null)},null,8,["config","initial-source"])),Z(It,{variant:"ghost",size:"sm",onClick:T[4]||(T[4]=N=>r.value=null)},{default:ue(()=>[He(I(y(o)("firstRun.connect.back")),1)]),_:1})])),_("div",hDe,[Z(It,{variant:"ghost","data-testid":"first-run-skip",onClick:R},{default:ue(()=>[He(I(y(o)("firstRun.connect.skip")),1)]),_:1}),T[8]||(T[8]=_("span",{class:"first-run__spacer"},null,-1)),x.value?(g(),ce(It,{key:0,variant:"primary","data-testid":"first-run-connect-continue",onClick:w},{default:ue(()=>[He(I(y(o)("firstRun.continue")),1)]),_:1})):J("",!0)]),r.value===null?(g(),S("p",mDe,I(y(o)("firstRun.connect.skipHint")),1)):J("",!0)])):i.value==="model"?(g(),S("section",gDe,[_("h1",null,I(y(o)("firstRun.model.title")),1),_("p",vDe,I(y(o)("firstRun.model.connected",{provider:k.value,count:f.value.length},f.value.length))+" "+I(y(o)("firstRun.model.subtitle")),1),f.value.length===0?(g(),S("p",wDe,I(y(o)("firstRun.model.none")),1)):(g(),S("ul",yDe,[(g(!0),S(Me,null,it(m.value,N=>(g(),S("li",{key:N.id},[_("button",{type:"button",class:Be(["first-run__model",{"is-selected":l.value===N.id}]),"data-testid":`first-run-model-${N.id}`,onClick:C=>l.value=N.id},[T[9]||(T[9]=_("span",{class:"first-run__radio","aria-hidden":"true"},null,-1)),_("span",bDe,I(N.id),1),N.id===p.value?(g(),S("span",_De,I(y(o)("firstRun.model.recommended")),1)):J("",!0),_("span",xDe,I(Math.round(N.maxContextSize/1e3))+"K",1)],10,kDe)]))),128))])),h.value.length>5?(g(),ce(It,{key:2,variant:"ghost",size:"sm",onClick:T[5]||(T[5]=N=>a.value=!a.value)},{default:ue(()=>[He(I(a.value?y(o)("firstRun.model.showFewer"):y(o)("firstRun.model.showAll",{count:h.value.length})),1)]),_:1})):J("",!0),_("div",SDe,[Z(It,{variant:"secondary",onClick:T[6]||(T[6]=N=>i.value="connect")},{default:ue(()=>[He(I(y(o)("firstRun.back")),1)]),_:1}),T[10]||(T[10]=_("span",{class:"first-run__spacer"},null,-1)),Z(It,{variant:"primary",loading:c.value,disabled:!v.value,"data-testid":"first-run-model-continue",onClick:b},{default:ue(()=>[He(I(y(o)("firstRun.continue")),1)]),_:1},8,["loading","disabled"])])])):(g(),S("section",CDe,[_("h1",null,I(y(o)("firstRun.appearance.title")),1),_("p",MDe,I(y(o)("firstRun.appearance.subtitle")),1),Z(Hz,{embedded:"",onComplete:M,onSkip:M}),_("p",ADe,[Z(Le,{name:"circle-check",size:"sm"}),_("span",null,I(y(o)("firstRun.appearance.ready",{model:l.value??""})),1)]),_("div",EDe,[Z(It,{variant:"secondary",onClick:T[7]||(T[7]=N=>i.value="model")},{default:ue(()=>[He(I(y(o)("firstRun.back")),1)]),_:1}),T[11]||(T[11]=_("span",{class:"first-run__spacer"},null,-1)),Z(It,{variant:"primary","data-testid":"first-run-finish",onClick:M},{default:ue(()=>[He(I(y(o)("firstRun.appearance.finish")),1)]),_:1})])]))])],8,YHe))}}),IDe=mt(TDe,[["__scopeId","data-v-23e77d0d"]]),LDe={class:"recovery"},$De={class:"recovery__inner"},NDe={class:"recovery__mark","aria-hidden":"true"},zDe={class:"recovery__copy"},BDe={class:"recovery__options"},RDe={class:"recovery__option-name"},FDe={class:"recovery__option-desc"},jDe={class:"recovery__option-name"},ODe={class:"recovery__option-desc"},PDe={class:"recovery__actions"},HDe=Ge({__name:"Recovery",emits:["openProviders","dismiss"],setup(e,{emit:t}){const n=t,{t:o}=Lt(),s=b1(),i=B(()=>s.providers.value??[]),r=B(()=>i.value[0]),l=B(()=>i.value.length===0?"noProvider":i.value.some(u=>u.status==="connected")?"noModel":"credential"),a=B(()=>l.value==="noProvider"?o("recovery.noProvider"):o(`recovery.${l.value}`,{provider:r.value?.id??""}));async function c(){await s.refreshRuntimeState()}return(u,d)=>(g(),S("section",LDe,[_("div",$De,[_("span",NDe,[Z(Le,{name:"alert-triangle",size:"md"})]),_("div",zDe,[_("h1",null,I(y(o)("recovery.title")),1),_("p",null,I(a.value),1)]),_("div",BDe,[l.value!=="noProvider"?(g(),S("button",{key:0,type:"button",class:"recovery__option is-primary","data-testid":"recovery-open-providers",onClick:d[0]||(d[0]=f=>n("openProviders"))},[_("span",RDe,I(y(o)("recovery.fixProvider")),1),_("span",FDe,I(y(o)("recovery.fixProviderDesc")),1)])):J("",!0),_("button",{type:"button",class:Be(["recovery__option",{"is-primary":l.value==="noProvider"}]),"data-testid":"recovery-add-provider",onClick:d[1]||(d[1]=f=>n("openProviders"))},[_("span",jDe,I(y(o)("recovery.addProvider")),1),_("span",ODe,I(y(o)("recovery.addProviderDesc")),1)],2)]),_("div",PDe,[Z(It,{variant:"secondary","data-testid":"recovery-retry",onClick:c},{default:ue(()=>[He(I(y(o)("recovery.retry")),1)]),_:1}),Z(It,{variant:"ghost","data-testid":"recovery-dismiss",onClick:d[2]||(d[2]=f=>n("dismiss"))},{default:ue(()=>[He(I(y(o)("recovery.dismiss")),1)]),_:1})])])]))}}),DDe=mt(HDe,[["__scopeId","data-v-68311778"]]),VDe="/logo.png",WDe=["aria-label"],qDe={class:"gload-box"},UDe={class:"gload-text"},ZDe={key:0,class:"gload-issue"},KDe={class:"gload-issue-detail"},GDe=Ge({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Lt();return(n,o)=>(g(),S("div",{class:"gload",role:"status","aria-label":y(t)("app.connecting")},[_("div",qDe,[o[0]||(o[0]=_("img",{class:"gload-logo",src:VDe,alt:"Pythinker",width:"120",height:"120"},null,-1)),Z(Go,{size:"md",label:y(t)("app.connecting")},null,8,["label"]),_("div",UDe,I(y(t)("app.connecting")),1),e.issue?(g(),S("div",ZDe,[_("div",null,I(y(t)("app.connectRetrying")),1),_("div",KDe,I(e.issue),1)])):J("",!0)])],8,WDe))}}),YDe=mt(GDe,[["__scopeId","data-v-2468172e"]]),XDe={class:"kap-root"},JDe={class:"kap-head"},QDe={class:"kap-count"},eVe={class:"kap-head-actions"},tVe={class:"kap-filters"},nVe=["value"],oVe={class:"kap-check"},sVe={class:"kap-check"},iVe={class:"kap-view-toggle",role:"group"},rVe={key:0,class:"kap-empty"},lVe=["onClick"],aVe={class:"kap-ts"},cVe={class:"kap-label"},uVe={key:0,class:"kap-detail"},dVe={class:"kap-detail-actions"},fVe=["onClick"],pVe={key:1,class:"kap-agg"},hVe={class:"mono"},mVe={class:"mono"},gVe={class:"num"},vVe={class:"num"},wVe={key:0},yVe={class:"mono"},kVe={class:"num"},bVe={class:"num"},_Ve={key:0},xVe=Ge({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=U("all"),s=U(""),i=U(""),r=U(!1),l=U("timeline"),a=B(()=>(qv.value,[...x8e()])),c=B(()=>{const E=new Set;for(const T of a.value)T.sessionId&&E.add(T.sessionId);return[...E].sort()});function u(E){return E.kind==="rest:error"||E.code!==void 0&&E.code!==0||E.eventType==="error"||E.eventType==="parse-error"}const d=B(()=>{const E=s.value.trim().toLowerCase();return a.value.filter(T=>!(o.value!=="all"&&T.source!==o.value||i.value&&T.sessionId!==i.value||r.value&&!u(T)||E&&!`${T.label} ${T.kind} ${T.eventType??""} ${T.sessionId??""} ${T.requestId??""}`.toLowerCase().includes(E)))}),f=B(()=>{const E=new Map;for(const T of d.value){if(T.kind!=="ws:in"&&T.kind!=="ws:out")continue;const N=T.kind==="ws:in"?"←":"→",C=`${N} ${T.eventType??"?"} @ ${T.sessionId??"-"}`,O=E.get(C)??{key:C,sessionId:T.sessionId??"-",eventType:T.eventType??"?",dir:N,count:0};O.count++,T.seq!==void 0&&(O.lastSeq=T.seq),E.set(C,O)}return[...E.values()].sort((T,N)=>N.count-T.count)}),p=B(()=>{const E=new Map;for(const T of d.value){if(T.source!=="rest"||T.kind==="rest:request")continue;const N=`${T.method??"?"} ${T.path??"?"}`,C=E.get(N)??{count:0,errors:0,totalMs:0,timed:0};C.count++,u(T)&&C.errors++,T.durationMs!==void 0&&(C.totalMs+=T.durationMs,C.timed++),E.set(N,C)}return[...E.entries()].map(([T,N])=>({key:T,count:N.count,errors:N.errors,avgMs:N.timed>0?Math.round(N.totalMs/N.timed):0})).sort((T,N)=>N.count-T.count)}),h=U(null),m=U(!0),k=U(null),x=U(null);Ue(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await vt();const E=k.value;E&&(E.scrollTop=E.scrollHeight)});function v(E){h.value=h.value===E?null:E}function w(E){const T=new Date(E),N=(C,O=2)=>String(C).padStart(O,"0");return`${N(T.getHours())}:${N(T.getMinutes())}:${N(T.getSeconds())}.${N(T.getMilliseconds(),3)}`}function b(E){return JSON.stringify(E,null,2)}async function M(E){await ss(b(E))&&(x.value=E.id,setTimeout(()=>{x.value===E.id&&(x.value=null)},1500))}function R(){cN(d.value)}function z(E){return u(E)||E.source==="client"?"b-err":E.source==="rest"?"b-rest":E.kind==="ws:lifecycle"?"b-life":E.kind==="ws:out"?"b-out":"b-in"}function $(E){return E.source==="rest"?"REST":E.source==="client"?"APP":"WS"}return(E,T)=>(g(),S("section",XDe,[_("header",JDe,[T[11]||(T[11]=_("strong",null,"KAP debug",-1)),_("span",QDe,I(d.value.length)+"/"+I(a.value.length),1),_("div",eVe,[_("button",{type:"button",class:Be({on:y(z2)}),onClick:T[0]||(T[0]=N=>z2.value=!y(z2))},I(y(z2)?"resume":"pause"),3),_("button",{type:"button",onClick:T[1]||(T[1]=N=>y(S8e)())},"clear"),_("button",{type:"button",onClick:T[2]||(T[2]=N=>R())},"export jsonl"),Z(Cn,{text:"Close window"},{default:ue(()=>[_("button",{type:"button",onClick:T[3]||(T[3]=N=>n("close"))},"✕")]),_:1})])]),_("div",tVe,[Zn(_("select",{"onUpdate:modelValue":T[4]||(T[4]=N=>o.value=N),"aria-label":"Source filter"},[...T[12]||(T[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[u8,o.value]]),Zn(_("select",{"onUpdate:modelValue":T[5]||(T[5]=N=>i.value=N),"aria-label":"Session filter"},[T[13]||(T[13]=_("option",{value:""},"all sessions",-1)),(g(!0),S(Me,null,it(c.value,N=>(g(),S("option",{key:N,value:N},I(N),9,nVe))),128))],512),[[u8,i.value]]),Zn(_("input",{"onUpdate:modelValue":T[6]||(T[6]=N=>s.value=N),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Fs,s.value]]),_("label",oVe,[Zn(_("input",{"onUpdate:modelValue":T[7]||(T[7]=N=>r.value=N),type:"checkbox"},null,512),[[q4,r.value]]),T[14]||(T[14]=He(" errors",-1))]),_("label",sVe,[Zn(_("input",{"onUpdate:modelValue":T[8]||(T[8]=N=>m.value=N),type:"checkbox"},null,512),[[q4,m.value]]),T[15]||(T[15]=He(" follow",-1))]),_("div",iVe,[_("button",{type:"button",class:Be({on:l.value==="timeline"}),onClick:T[9]||(T[9]=N=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:Be({on:l.value==="aggregate"}),onClick:T[10]||(T[10]=N=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(g(),S("div",{key:0,ref_key:"listRef",ref:k,class:"kap-list"},[d.value.length===0?(g(),S("div",rVe," No trace entries yet. REST calls and WS frames will appear here. ")):J("",!0),(g(!0),S(Me,null,it(d.value,N=>(g(),S("div",{key:N.id,class:"kap-row-wrap"},[_("button",{type:"button",class:Be(["kap-row",{expanded:h.value===N.id}]),onClick:C=>v(N.id)},[_("span",aVe,I(w(N.ts)),1),_("span",{class:Be(["kap-badge",z(N)])},I($(N)),3),_("span",cVe,I(N.label),1)],10,lVe),h.value===N.id?(g(),S("div",uVe,[_("div",dVe,[_("button",{type:"button",onClick:C=>M(N)},I(x.value===N.id?"copied ✓":"copy json"),9,fVe)]),_("pre",null,I(b(N)),1)])):J("",!0)]))),128))],512)):(g(),S("div",pVe,[T[20]||(T[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[T[17]||(T[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(g(!0),S(Me,null,it(f.value,N=>(g(),S("tr",{key:N.key},[_("td",null,I(N.dir),1),_("td",hVe,I(N.eventType),1),_("td",mVe,I(N.sessionId),1),_("td",gVe,I(N.count),1),_("td",vVe,I(N.lastSeq??"—"),1)]))),128)),f.value.length===0?(g(),S("tr",wVe,[...T[16]||(T[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):J("",!0)])]),T[21]||(T[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[T[19]||(T[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(g(!0),S(Me,null,it(p.value,N=>(g(),S("tr",{key:N.key},[_("td",yVe,I(N.key),1),_("td",kVe,I(N.count),1),_("td",{class:Be(["num",{err:N.errors>0}])},I(N.errors),3),_("td",bVe,I(N.avgMs),1)]))),128)),p.value.length===0?(g(),S("tr",_Ve,[...T[18]||(T[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):J("",!0)])])]))]))}}),SVe=mt(xVe,[["__scopeId","data-v-7bab00af"]]),CVe=Ge({__name:"DebugPanel",setup(e){const t=U(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const p of i){const h=d.getAttribute(p);h!==null?f.setAttribute(p,h):f.removeAttribute(p)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const h of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(h.cloneNode(!0));r(d),d.body.style.margin="0";const p=d.createElement("div");return p.style.height="100vh",d.body.appendChild(p),p}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=U4(SVe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return xn(()=>{c()}),vo(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(g(),ce(Cn,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:ue(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),MVe=mt(CVe,[["__scopeId","data-v-992ae84c"]]);function AVe({client:e}){const t=B(()=>e.appState.value==="first-run"||e.appState.value==="recovery"),n="/login",o=U(null);function s(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function i(r){typeof window>"u"||window.history.replaceState(window.history.state,"",r)}return Ue(t,r=>{if(!(typeof window>"u")){if(r){window.location.pathname!==n&&(o.value=s(),i(n));return}window.location.pathname===n&&(i(o.value??"/"),o.value=null)}},{immediate:!0}),{showAuthGate:t}}function EVe({running:e,showAuthGate:t}){const{t:n}=Lt(),o=U(Wl[0]);let s=0,i;function r(){i!==void 0&&clearInterval(i),i=void 0}Ue(e,a=>{r(),s=0,o.value=Wl[0],a&&(i=setInterval(()=>{s=(s+1)%Wl.length,o.value=Wl[s]??Wl[0]},m0))},{immediate:!0}),fu(r);const l=B(()=>{const a=e.value?`${o.value} `:"";return t.value?`${a}${n("app.authPageTitle")} - Pythinker Code Web`:`${a}Pythinker Code Web`});PM(()=>{typeof document<"u"&&(document.title=l.value)})}function TVe(e,t,n){const o=new Map(e.attachments.map(a=>[a.attachmentId,a])),s=new Map(e.tasks.map(a=>[a.taskId,a])),i=e.items.find(a=>a.kind==="turn"),r=e.items.findLast(a=>a.kind==="turn"),l=e.items.flatMap(a=>a.kind==="turn"?IVe(a,o,s,{...n,startedAt:a.turnId===i?.turnId?t?.createdAt:void 0,endedAt:a.turnId===r?.turnId?t?.disposedAt:void 0}):[]);return _9(l,[],a=>n.getFileUrl(a),e.meta.activity==="turn")}function IVe(e,t,n,o){const s=[],i=zVe([e.startedAt,...e.steps.map(c=>c.startedAt),o.startedAt]),r=y2(e.endedAt)??y2(o.endedAt),l=e.turnId;if(e.prompt!==void 0&&e.prompt.length>0){const c=[{type:"text",text:e.prompt}];for(const u of e.attachmentIds??[]){const d=$Ve(t.get(u));d!==void 0&&c.push(d)}s.push({id:`${e.turnId}:input`,sessionId:o.sessionId,role:"user",content:c,createdAt:i,promptId:l,metadata:{origin:e.origin}})}for(const c of e.steps){const u=y2(c.startedAt)??i;for(const d of c.frames){if(d.kind==="text"){if(d.text.length===0||d.role==="user"&&d.taskId===void 0)continue;s.push({id:d.frameId,sessionId:o.sessionId,role:d.role,content:[{type:"text",text:d.text}],createdAt:u,promptId:l,metadata:d.taskId===void 0?void 0:{origin:{kind:"task",taskId:d.taskId},task:n.get(d.taskId),[p$]:LVe(d.taskId,d.text,n.get(d.taskId))}});continue}if(d.kind==="thinking"){if(d.text.length===0)continue;s.push({id:d.frameId,sessionId:o.sessionId,role:"assistant",content:[{type:"thinking",thinking:d.text,startedAt:u,durationMs:lM(u,y2(c.endedAt))}],createdAt:u,promptId:l});continue}d.kind==="tool"&&(s.push({id:`${d.frameId}:call`,sessionId:o.sessionId,role:"assistant",content:[{type:"toolUse",toolCallId:d.toolCallId,toolName:d.name,input:d.input??d.display??{},outputLines:d.state==="running"?NVe(d.output):void 0}],createdAt:u,promptId:l}),d.state!=="running"&&s.push({id:`${d.frameId}:result`,sessionId:o.sessionId,role:"tool",content:[{type:"toolResult",toolCallId:d.toolCallId,output:d.output??d.error??"",isError:d.state==="error"}],createdAt:y2(c.endedAt)??u,promptId:l}))}}const a=e.durationMs??lM(i,r);if(a!==void 0){const c=s.findLastIndex(u=>u.role==="assistant");c>=0&&(s[c]={...s[c],durationMs:a})}return s}function LVe(e,t,n){if(h$(t).length>0)return;const[o="",...s]=t.split(` +`),i=n?.state??"info";return{id:`task:${e}:${i}`,category:"task",type:`task.${i}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:o.trim(),severity:i==="completed"?"info":"warning",body:s.join(` +`).trim(),raw:t}}function $Ve(e){if(e?.source===void 0)return;const t=e.source.kind==="url"?{kind:"url",url:e.source.url}:{kind:"file",fileId:e.source.fileId};if(e.mediaType.startsWith("image/"))return{type:"image",source:t};if(e.mediaType.startsWith("video/"))return{type:"video",source:t};if(e.source.kind==="file")return{type:"file",fileId:e.source.fileId,name:e.name??e.attachmentId,mediaType:e.mediaType,size:e.size??0}}function NVe(e){if(e==null)return;if(typeof e=="string")return e.split(` `);if(!Array.isArray(e))return[JSON.stringify(e)];const t=[];for(const n of e){if(typeof n=="string"){t.push(...n.split(` `));continue}if(n===null||typeof n!="object")continue;const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(` `)):o.type==="think"&&typeof o.think=="string"&&t.push(...o.think.split(` -`))}return t.length>0?t:void 0}function w2(e){return e!==void 0&&Number.isFinite(Date.parse(e))?e:void 0}function kVe(e){let t;for(const n of e){if(n===void 0)continue;const o=Date.parse(n);Number.isFinite(o)&&(t===void 0||o=0?n:void 0}const jz=U(typeof window>"u"?0:window.innerWidth);let Z3=0,Y5=!1;function q7(){jz.value=window.innerWidth}function bVe(){Y5||typeof window>"u"||(window.addEventListener("resize",q7),Y5=!0,q7())}function _Ve(){!Y5||typeof window>"u"||(window.removeEventListener("resize",q7),Y5=!1)}function Oz(e,t,n){return Math.max(t,e-n)}function U7(e,t,n){return Math.min(n,Math.max(t,e))}function Pz(){return xn(()=>{Z3+=1,bVe()}),vo(()=>{Z3=Math.max(0,Z3-1),Z3===0&&_Ve()}),{viewportWidth:jz}}const xVe="pythinker-web.file-preview-width",yc=320;function SVe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=Pz(),r=B(()=>Math.max(0,s.value-t.value)),i=B(()=>Oz(r.value,yc,yc));function l(fe){return U7(Math.round(fe),yc,i.value)}function a(){return l(r.value/2)}const c=B(()=>a()),u=U(c.value),d=B(()=>U7(u.value,yc,i.value)),f=U(null),p=B(()=>{const fe=f.value;if(!fe)return null;const pe=e.turns.value.find(te=>te.id===fe.turnId);return pe?.role==="compaction"&&pe.text?pe.text:null}),h=B(()=>p.value!==null);function m(fe){if(f.value?.turnId===fe.turnId){f.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",f.value=fe}function k(){f.value=null,n.value==="compaction"&&(n.value=null)}const x=U(null),w=B(()=>{const fe=x.value;if(!fe)return{entry:void 0,version:0};const pe=e.auxiliaryTranscripts.getEntry(fe.sessionId,fe.subagentId);return{entry:pe,version:pe?.version.value??0}});function v(fe){const pe=e.activeAppTasks.value.find(te=>te.agentId===fe||te.id===fe||te.backgroundTaskId===fe||te.parentToolCallId===fe);return pe?.agentId??pe?.id??fe}const b=B(()=>{const fe=x.value;if(!fe)return null;const pe=e.activeAppTasks.value.find(Fe=>Fe.agentId===fe.subagentId||Fe.id===fe.subagentId||Fe.backgroundTaskId===fe.subagentId);if(pe)return Tbe(pe);const te=w.value.entry?.channel;if(!te)return null;const de=te.agents.find(Fe=>Fe.agentId===fe.subagentId),ye=te.snapshot.items.findLast(Fe=>Fe.kind==="turn"),Ce=te.snapshot.meta.activity==="turn",me=te.loading,be=ye?.kind==="turn"&&ye.state==="failed",re=ye?.kind==="turn"&&ye.state==="cancelled",ke=te.refreshError&&ye===void 0;return{id:fe.subagentId,name:de?.label??fe.subagentId,subagentType:de?.type==="sub"?"subagent":de?.type,phase:Ce?"working":re?"cancelled":be||ke?"failed":me?"queued":"completed",status:Ce||me?"running":re?"cancelled":be||ke?"failed":"completed"}}),M=B(()=>{const fe=x.value,pe=w.value.entry?.channel;if(!fe||!pe)return[];const te=pe.agents.find(de=>de.agentId===fe.subagentId);return mVe(pe.snapshot,te,{sessionId:fe.sessionId,getFileUrl:de=>e.getFileUrl(de)})}),R=B(()=>w.value.entry?.channel.loading??!1),z=B(()=>w.value.entry?.channel.refreshError??!1),$=B(()=>w.value.entry?.channel.loadingOlder??!1),T=B(()=>w.value.entry?.channel.loadOlderError??!1),E=B(()=>w.value.entry?.channel.snapshot.hasMoreOlder??!1),N=B(()=>w.value.entry?.channel.snapshot.meta.activity==="turn"),C=B(()=>b.value!==null);function O(fe){const pe=e.activeSessionId.value;if(!fe||!pe)return;const te=v(fe);if(n.value==="agent"&&x.value?.sessionId===pe&&x.value.subagentId===te){H();return}const de=x.value;de&&de.subagentId!==te&&e.auxiliaryTranscripts.deactivate(de.sessionId,de.subagentId),x.value={sessionId:pe,subagentId:te},n.value="agent",e.auxiliaryTranscripts.activate(pe,te)}function H(){const fe=x.value;fe&&e.auxiliaryTranscripts.deactivate(fe.sessionId,fe.subagentId),x.value=null,n.value==="agent"&&(n.value=null)}Ue(n,(fe,pe)=>{if(pe!=="agent"||fe==="agent")return;const te=x.value;te&&e.auxiliaryTranscripts.deactivate(te.sessionId,te.subagentId)});function V(){w.value.entry?.channel.loadOlder().catch(()=>{})}const A=U(null),F=B(()=>{const fe=A.value;if(!fe)return null;const pe=BJ(e.turns.value,fe);return pe?{id:fe,title:Gs(pe.name),path:Mg(pe.arg),lines:pe.status==="error"?null:Cg(pe),output:pe.output}:null}),j=B(()=>F.value!==null);function q(fe){if(n.value==="toolDiff"&&A.value===fe){P();return}n.value="toolDiff",A.value=fe}function P(){A.value=null,n.value==="toolDiff"&&(n.value=null)}const W=U("list"),G=U(null);function ee(){if(n.value==="diff"){se();return}n.value="diff",W.value="list",G.value=null,e.loadGitStatus(e.activeSessionId.value)}function se(){n.value==="diff"&&(n.value=null),W.value="list",G.value=null,e.clearFileDiff()}async function oe(fe){W.value="detail",G.value=fe,await e.loadFileDiff(fe)}async function Q(fe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,fe):await e.openSideChat(fe),n.value="btw"}function ge(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function xe(){n.value==="btw"&&(n.value=null)}const Ke=B(()=>e.sideChatVisible.value),et=B(()=>n.value!==null&&(n.value!=="compaction"||h.value)&&(n.value!=="agent"||C.value)&&(n.value!=="toolDiff"||j.value)&&(n.value!=="btw"||Ke.value)),Y=U(!1),ne=U({});function D(){switch(n.value){case"compaction":return f.value?{kind:"compaction",...f.value}:null;case"agent":return x.value?{kind:"agent",...x.value}:null;case"toolDiff":return A.value?{kind:"toolDiff",toolId:A.value}:null;case"btw":return{kind:"btw"};default:return null}}function X(fe){if(fe)switch(fe.kind){case"compaction":f.value={turnId:fe.turnId},n.value="compaction";break;case"agent":{const pe=e.activeSessionId.value;if(!pe)break;const te=v(fe.subagentId);x.value={sessionId:pe,subagentId:te},n.value="agent",e.auxiliaryTranscripts.activate(pe,te);break}case"toolDiff":A.value=fe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ve(){return n.value==="compaction"&&h.value?(k(),!0):n.value==="agent"&&C.value?(H(),!0):n.value==="toolDiff"&&j.value?(P(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(se(),!0):n.value==="btw"?(ge(),!0):!1}return Ue(e.activeSessionId,(fe,pe)=>{if(pe){const te=D();te?ne.value[pe]=te:delete ne.value[pe]}o(),k(),H(),P(),se(),xe(),fe&&X(ne.value[fe])}),{PREVIEW_WIDTH_KEY:xVe,PREVIEW_MIN:yc,previewDefaultWidth:c,previewMax:i,previewWidth:u,previewPanelWidth:d,compactionPanelText:p,compactionPanelVisible:h,openCompactionPanel:m,closeCompactionPanel:k,agentPanelMember:b,agentPanelTurns:M,agentPanelLoading:R,agentPanelLoadError:z,agentPanelLoadingMore:$,agentPanelLoadMoreError:T,agentPanelHasMore:E,agentPanelRunning:N,agentPanelVisible:C,openAgentPanel:O,closeAgentPanel:H,loadOlderAgentMessages:V,toolDiffTarget:F,toolDiffVisible:j,openToolDiff:q,closeToolDiff:P,detailDiffMode:W,detailDiffPath:G,openDiffDetail:ee,closeDiffDetail:se,selectDiffFile:oe,btwVisible:Ke,openSideChatTab:Q,closeSideChat:ge,hideSideChatPanel:xe,sidePanelVisible:et,panelDragging:Y,closeOpenSidePanel:ve}}const CVe=ln.sidebarWidth,rM=ln.sidebarCollapsed,iM=270,Wm=170,MVe=480,AVe=320;function TVe(e={}){const{viewportWidth:t}=Pz(),n=U(iM),o=U(!1),s=U(!1),r=B(()=>{const u=AVe+(Km(e.previewOpen)?yc:0);return Math.min(MVe,Oz(t.value,Wm,u))}),i=B(()=>U7(n.value,Wm,r.value));function l(){try{o.value=Yo(rM)==="true"}catch{o.value=!1}}function a(){try{vs(rM,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:CVe,SIDEBAR_DEFAULT:iM,SIDEBAR_MIN:Wm,sidebarMax:r,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:i,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}async function EVe(e){if(!e.fileId)return{url:e.url};try{const t=await At().getFileBlob(e.fileId),n=URL.createObjectURL(t);return{url:n,revoke:()=>URL.revokeObjectURL(n)}}catch{return{url:e.url}}}function IVe({client:e,detailTarget:t}){const{t:n}=Lt(),o=U(null),s=U(null),r=U(!1),i=U(null),l=U(null);let a=0;const c=B(()=>{const v=l.value;return v?e.getFileDownloadUrl(v):null}),u=B(()=>o.value!==null);function d(v){return v.length>1?v.replace(/\/+$/,""):v}function f(v){const b=[];for(const M of v.split(/[\\/]+/))if(!(!M||M===".")){if(M===".."){b.pop();continue}b.push(M)}return b.join("/")}function p(v){const b=v.trim();if(!b)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(b))return{error:n("filePreview.errors.unsupportedPath")};if(b.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const M=d(e.status.value.cwd);if(b.startsWith("/")){if(!M||b!==M&&!b.startsWith(`${M}/`))return{error:n("filePreview.errors.outsideWorkspace")};const z=b===M?"":b.slice(M.length+1);if(z.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=f(z);return $?{path:$}:{error:n("filePreview.errors.isDirectory")}}if(b.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const R=f(b);return R?{path:R}:{error:n("filePreview.errors.emptyPath")}}async function h(v){const b=o.value;if(t.value==="file"&&b&&b.path===v.path&&b.line===v.line){k();return}const M=++a;t.value="file",s.value=null,i.value=null,r.value=!0,o.value=v,l.value=null;const R=p(v.path);if("error"in R){r.value=!1,i.value=R.error;return}l.value=R.path;try{const z=await e.readFileContent(R.path);if(M!==a)return;z?s.value={...z,path:z.path||R.path}:i.value=n("filePreview.errors.loadFailed")}catch(z){if(M!==a)return;i.value=z instanceof Error?z.message:n("filePreview.errors.loadFailed")}finally{M===a&&(r.value=!1)}}function m(){a+=1,o.value=null,l.value=null,s.value=null,i.value=null,r.value=!1}function k(){m(),t.value==="file"&&(t.value=null)}Ue(t,(v,b)=>{b==="file"&&v!=="file"&&m()});function x(){const v=s.value?.path??o.value?.path;v&&e.openWorkspaceFile(v,o.value?.line)}function w(){const v=s.value?.path??o.value?.path;v&&e.revealWorkspaceFile(v)}return{previewTarget:o,previewFile:s,previewLoading:r,previewError:i,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:h,closeFilePreview:k,openPreviewInEditor:x,revealPreviewFile:w}}const LVe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},$Ve={class:"server-auth-card"},NVe={class:"server-auth-body"},zVe={class:"server-auth-foot"},BVe=Ge({__name:"ServerAuthDialog",setup(e){const t=U(""),n=U(null),o=U(!1);xn(()=>{vt(()=>n.value?.focus())});function s(){const i=t.value;!i||o.value||(o.value=!0,pN(i),window.location.reload())}function r(i){i.key==="Enter"&&(i.preventDefault(),s())}return(i,l)=>(g(),S("div",LVe,[_("div",$Ve,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[He(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"PYTHINKER_CODE_PASSWORD"),He("). ")])],-1)),_("div",NVe,[Z(os,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:r},null,8,["modelValue","disabled"])]),_("div",zVe,[Z(It,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:ue(()=>[He(I(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),RVe=mt(BVe,[["__scopeId","data-v-82dad292"]]),FVe={class:"app-shell"},jVe={key:2,class:"offline-strip",role:"status"},OVe=["aria-label","aria-hidden"],PVe={class:"action-toast-stack"},HVe=Ge({__name:"App",setup(e){p7e();const t=U(!1);let n=null;const o=b1(),s=U([]),r=U(!1),i=U(null),l=U(null),a=U(null);let c=null;const u=B(()=>{const qe=o.activeWorkspaceId.value;return qe?[...o.sessionsForView.value,...s.value].filter(he=>he.workspaceId===qe).toSorted((he,$e)=>new Date($e.updatedAt??0).getTime()-new Date(he.updatedAt??0).getTime()).slice(0,6):[]});function d(qe){return{id:qe.id,title:qe.title,time:new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-Math.max(0,Math.floor((Date.now()-new Date(qe.updatedAt).getTime())/864e5)),"day"),busy:!1,updatedAt:qe.updatedAt,workspaceId:qe.workspaceId,archived:!0}}async function f(){try{const qe=[];let he;for(;;){const $e=await o.loadArchivedSessions({beforeId:he,pageSize:100});if(qe.push(...$e.items),!$e.hasMore||$e.items.length===0||(he=$e.items.at(-1)?.id,he===void 0))break}s.value=qe.map(d)}catch(qe){console.warn("loadDoneSessions failed",qe)}}const p=B(()=>{const qe=new Map(o.workspaceGroups.value.flatMap(he=>he.sessions.map($e=>[$e.id,$e.updatedAt])));return o.sessionsForView.value.map(he=>({id:he.id,title:he.title,workspaceId:he.workspaceId??"",workspaceName:he.workspaceName??"-",lastPrompt:he.lastPrompt,updatedAt:he.updatedAt??qe.get(he.id)??new Date(0).toISOString(),archived:!1}))});async function h(){const qe=[];let he;for(;;){const bn=await o.loadArchivedSessions({beforeId:he,pageSize:100});if(qe.push(...bn.items),!bn.hasMore||bn.items.length===0||(he=bn.items.at(-1)?.id,he===void 0))break}const $e=o.workspacesView.value;return qe.filter(bn=>!bn.parentSessionId).map(bn=>{const ri=$e.find(Ls=>Ls.id===bn.workspaceId||Ls.root===bn.cwd);return{id:bn.id,title:bn.title,workspaceId:ri?.id??bn.workspaceId??bn.cwd,workspaceName:ri?.name??bn.cwd.split("/").filter(Boolean).at(-1)??"-",lastPrompt:bn.lastPrompt,updatedAt:bn.updatedAt,archived:!0}})}function m(){r.value=!0,o.loadAllSessions()}function k(qe,he){i.value={kind:qe,ids:Array.isArray(he)?he:[he]}}const x=B(()=>!o.dangerousBypassAuth.value&&t.value);jn("resolveImage",o.resolveImageUrl),jn("modelDisplay",qe=>{if(qe===void 0||qe.length===0)return;const he=o.models.value.find($e=>$e.id===qe)??o.models.value.find($e=>$e.model===qe);return he?.displayName||he?.model||(qe.includes("/")?qe.split("/").pop():qe)}),jn("subagentEffort",qe=>qe!==void 0&&qe.length>0&&qe!=="off"&&qe!=="on"?Od(qe):void 0),jn("resolveDynamicWorkflowMembers",qe=>o.dynamicWorkflowMembersByToolCallId.value.get(qe)??[]);const{t:w}=Lt(),{confirm:v}=y1(),b=Ji(),M=Kp(),R=U(!1),z=U(!1),$=B(()=>{const qe=o.activeSessionId.value;return o.sessions.value.find(he=>he.id===qe)?.title??s.value.find(he=>he.id===qe)?.title??""}),T=B(()=>{const qe=o.activeSessionId.value;return o.sessions.value.find(he=>he.id===qe)?.lastTurnReason}),E=B(()=>{const qe=o.activeSessionId.value;if(qe)return q8e(qe)}),N=B(()=>s.value.some(qe=>qe.id===o.activeSessionId.value)),C=B(()=>o.visibleWorkspace.value?.sessionCount??0),O=B(()=>o.activity.value!=="idle"),{showAuthGate:H}=pVe({client:o});hVe({running:O,showAuthGate:H});const V=B(()=>{const qe=o.models.value.find(he=>he.id===o.status.value.modelId);return r9(qe,o.thinking.value)}),A=U(!1),F=B(()=>o.appState.value==="first-run"),j=B(()=>o.appState.value==="recovery"&&!A.value),q=B(()=>o.appState.value==="recovery"&&A.value);Ue(()=>o.appState.value,qe=>{qe!=="recovery"&&(A.value=!1)});function P(){A.value=!1}const W=U(!1);function G(){o.setOnboarded(!0),W.value=!1}function ee(){W.value=!0}let se=0;function oe(){const qe=window.visualViewport,he=document.documentElement.style;he.setProperty("--app-height",`${qe?.height??window.innerHeight}px`),he.setProperty("--app-top",`${qe?.offsetTop??0}px`)}function Q(){se||(se=requestAnimationFrame(()=>{se=0,oe()}))}xn(()=>{n=g7e(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ht(),oe(),window.visualViewport?.addEventListener("resize",Q),window.visualViewport?.addEventListener("scroll",Q),window.addEventListener("resize",Q),document.addEventListener("keydown",ge,!0)}),An(()=>{Tt(),document.removeEventListener("keydown",ge,!0),window.visualViewport?.removeEventListener("resize",Q),window.visualViewport?.removeEventListener("scroll",Q),window.removeEventListener("resize",Q),se&&(cancelAnimationFrame(se),se=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function ge(qe){if(!(qe.key!=="Escape"||qe.isComposing)&&!Ys.value){if(xe.value==="turnDiff")Y();else if(!Xn())return;qe.stopPropagation(),qe.preventDefault()}}const xe=U(null),Ke=U(null);function et(qe){if(xe.value==="turnDiff"&&Ke.value?.turnId===qe.turnId){Y();return}Ke.value=qe,xe.value="turnDiff"}function Y(){Ke.value=null,xe.value==="turnDiff"&&(xe.value=null)}const ne=U(!1);Ue(o.activeSessionId,()=>{Y(),ne.value=!0,vt(()=>{ne.value=!1})});const{previewTarget:D,previewFile:X,previewLoading:ve,previewError:fe,previewDownloadUrl:pe,previewExternalActions:te,openFilePreview:de,closeFilePreview:ye,openPreviewInEditor:Ce,revealPreviewFile:me}=IVe({client:o,detailTarget:xe});KIe(()=>o.activeSessionId.value);function be(qe){xe.value="editor",Mz({path:qe,line:D.value?.line})}function re(){xe.value==="editor"&&(xe.value=null)}Ue(xe,(qe,he)=>{he==="editor"&&qe!=="editor"&&Tz()});const ke=U(null),Fe=U(null);let at=0,dt;async function $t(qe){if(qe.kind!=="image"&&qe.kind!=="video")return;const he=++at;dt?.(),dt=void 0,ke.value=null,Fe.value=null;const $e=await EVe(qe);if(he!==at){$e.revoke?.();return}dt=$e.revoke,ke.value=qe,Fe.value=$e.url}function Tt(){at+=1,dt?.(),dt=void 0,ke.value=null,Fe.value=null}const Qt=B(()=>xe.value!==null),{SIDEBAR_WIDTH_KEY:Dt,SIDEBAR_DEFAULT:en,SIDEBAR_MIN:kn,sidebarMax:In,sessionColWidth:Mn,sidebarCollapsed:Re,sidebarDragging:lt,sideWidth:tt,loadSidebarCollapsed:ht,toggleSidebarCollapse:bt}=TVe({previewOpen:Qt}),{PREVIEW_WIDTH_KEY:Rt,PREVIEW_MIN:on,previewDefaultWidth:an,previewMax:sn,previewWidth:Yn,previewPanelWidth:Kt,compactionPanelText:no,compactionPanelVisible:As,openCompactionPanel:ys,closeCompactionPanel:ao,agentPanelMember:co,agentPanelTurns:oo,agentPanelLoading:Ct,agentPanelLoadError:so,agentPanelLoadingMore:Bn,agentPanelLoadMoreError:Pn,agentPanelHasMore:js,agentPanelRunning:Os,openAgentPanel:Ts,closeAgentPanel:ks,loadOlderAgentMessages:Lo,toolDiffTarget:Ro,openToolDiff:Ze,closeToolDiff:Qe,detailDiffMode:ct,detailDiffPath:mn,openDiffDetail:_o,closeDiffDetail:Un,selectDiffFile:Ps,btwVisible:Je,openSideChatTab:ze,closeSideChat:wt,sidePanelVisible:Mt,panelDragging:tn,closeOpenSidePanel:Xn}=SVe({client:o,sideWidth:tt,detailTarget:xe,closeFilePreview:ye}),Jn=U(null),Es=U(null);function Xo(){let qe=!1;const he=$e=>{$e instanceof KeyboardEvent&&$e.repeat||(qe=!0)};return document.addEventListener("pointerdown",he,!0),document.addEventListener("keydown",he,!0),window.addEventListener("blur",he),document.addEventListener("visibilitychange",he),()=>{vt(()=>{document.removeEventListener("pointerdown",he,!0),document.removeEventListener("keydown",he,!0),window.removeEventListener("blur",he),document.removeEventListener("visibilitychange",he),!qe&&document.hasFocus()&&Es.value?.focusInput()})}}const ro=U(!1),uo=U(!1),vn=U(!1),Hs=U(!1),bs=U("general"),Ci=B(()=>G1.value>0||ro.value||uo.value||vn.value||Hs.value||R.value||z.value||ke.value!==null),ir=U(null),Is=U(null),Ys=B(()=>G1.value>0||ro.value||uo.value||vn.value||Hs.value||W.value||R.value||z.value||ke.value!==null),io=U(!1),Io=U(!1),yr=U(!1);async function kr(){io.value=!0,Io.value=!1,ro.value=!0;try{await o.refreshAllProviders()}catch{Io.value=!0}finally{io.value=!1}}function si(qe="general"){bs.value=qe,Hs.value=!0}function Or(){si("providers")}function Pr(){Or()}async function Ee(qe){ro.value=!1,await Ae(qe)}async function Ae(qe){await o.setModel(qe)&&qe!==o.defaultModel.value&&o.updateConfig({defaultModel:qe})}async function De(qe){await o.archiveSession(qe),await f(),k("done",qe)}async function Ut(qe){await o.restoreSession(qe)&&(s.value=s.value.filter(he=>he.id!==qe),k("open",qe))}async function dn(qe,he){await o.renameSession(qe,he),s.value.some($e=>$e.id===qe)&&await f()}async function zn(qe,he){const $e=s.value.find(bn=>bn.id===qe);if(!$e){await o.setSessionEmoji(qe,he);return}await dn(qe,TT(he,$e.title))}async function So(qe,he){const $e=qe.map(bn=>bn.id);for(const bn of $e)he==="archive"?await o.archiveSession(bn):await o.restoreSession(bn);await f(),k(he==="archive"?"done":"open",$e)}async function Jo(){const qe=i.value;if(qe){i.value=null;for(const he of qe.ids)qe.kind==="done"?await o.restoreSession(he):await o.archiveSession(he);await f()}}async function Qo(qe){const he=qe??o.activeSessionId.value;if(!he)return;l.value={state:"running",sessionId:he};const $e=await o.exportSession(he);l.value=$e?{state:"done",sessionId:he}:null}async function Mi(qe){const he=o.workspacesView.value.find($e=>$e.id===qe)?.name??qe;await v({title:w("sidebar.removeWorkspace"),message:w("workspace.removeWorkspaceConfirm",{name:he}),variant:"danger",action:()=>o.deleteWorkspace(qe)})}async function es(qe){yr.value=!0;try{await o.updateConfig(qe)&&await Promise.all([o.refreshRuntimeState(),o.refreshServerMeta()])}finally{yr.value=!1}}async function is(qe){await o.undo(1),await vt(),Jn.value?.loadComposerForEdit(qe.text,qe.attachments)}function ie(qe){if(qe==="/compact"||qe.startsWith("/compact ")){o.compact(qe.slice(8).trim()||void 0);return}if(qe==="/dynamic_workflow"||qe.startsWith("/dynamic_workflow ")){const he=qe.slice(17).trim();he==="on"?o.setDynamicWorkflowMode(!0):he==="off"?o.setDynamicWorkflowMode(!1):he?(o.setDynamicWorkflowMode(!0),o.sendPrompt(he)):o.toggleDynamicWorkflowMode();return}if(qe==="/goal"||qe.startsWith("/goal ")){const he=qe.slice(5).trim();he==="pause"||he==="resume"||he==="cancel"?o.controlGoal(he):he?o.createGoal(he):o.toggleGoalMode();return}if(qe==="/btw"||qe.startsWith("/btw ")){const he=qe.slice(4).trim();if(!he&&o.sideChatVisible.value)wt();else{const $e=Xo();ze(he||void 0).then($e,$e)}return}switch(qe){case"/new":case"/clear":qt();break;case"/fork":o.forkSession();break;case"/export":Qo();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/status":vn.value=!0;break;case"/login":Pr();break;default:{const he=qe.indexOf(" "),$e=oye((he===-1?qe:qe.slice(0,he)).slice(1)),bn=he===-1?void 0:qe.slice(he+1).trim()||void 0;if(!$e)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,$e,bn):o.activateSkill($e,bn);break}}}function _e(qe){o.unqueue(qe)}function Ie(qe){o.unqueue(qe)}function je(qe){o.reorderQueue(qe.from,qe.to)}function nt(qe){o.steerQueued(qe)}async function kt(qe){const he=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&he){await o.startSessionAndSendPrompt(he,qe.text,qe.attachments);return}if(!o.activeSessionId.value&&!he){ir.value=qe,uo.value=!0;return}o.sendPrompt(qe.text,qe.attachments)}async function Pt(qe){const he=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&he){await o.startSessionAndSendPrompt(he,qe,[]);return}o.activeSessionId.value&&o.sendPrompt(qe)}async function jt(qe){if(Is.value=null,!await o.addWorkspaceByPath(qe)){Is.value=w("workspace.addFailed");return}uo.value=!1;const $e=ir.value;ir.value=null;const bn=o.activeWorkspaceId.value;$e&&bn&&await o.startSessionAndSendPrompt(bn,$e.text,$e.attachments)}function Ln(){ir.value=null,Is.value=null,uo.value=!1}async function cn(qe){for(const he of qe)if(Is.value=null,!await o.addWorkspaceByPath(he)){Is.value=w("workspace.addFailed"),uo.value=!0;return}}async function Rn(qe,he){const $e=await o.generateSessionTitle(qe);$e===null&&(a.value=w("sidebar.genTitleUnavailable"),c!==null&&clearTimeout(c),c=setTimeout(()=>{a.value=null,c=null},5e3)),he($e)}function wo(){vt(()=>{Jn.value?.focusComposer()})}function qt(){const qe=o.activeWorkspaceId.value;qe?o.openWorkspaceDraft(qe):o.clearActiveSession(),wo()}function $n(qe){o.openWorkspaceDraft(qe),wo()}function Nn(qe){qe&&window.open(qe,"_blank","noopener")}return(qe,he)=>(g(),S("div",FVe,[Z(gOe),x.value?(g(),ce(RVe,{key:0})):J("",!0),j.value?(g(),ce(TDe,{key:1,onOpenProviders:he[0]||(he[0]=()=>{A.value=!0,Or()}),onDismiss:he[1]||(he[1]=$e=>A.value=!0)})):J("",!0),q.value?(g(),S("div",jVe,[_("span",null,I(y(w)("recovery.offlineNotice")),1),_("button",{type:"button","data-testid":"offline-strip-reconnect",onClick:he[2]||(he[2]=$e=>A.value=!1)},I(y(w)("recovery.addProvider")),1)])):J("",!0),j.value?J("",!0):(g(),S("div",{key:3,class:Be(["app",{mobile:y(M),"sidebar-collapsed":y(Re)&&!y(M),"macos-desktop":y(xg)}]),style:Wt({"--preview-w":y(Kt)+"px"})},[y(M)?(g(),ce(COe,{key:1,workspace:y(o).visibleWorkspace.value,"session-title":$.value,running:O.value,branch:y(o).status.value.branch,"session-count":C.value,onOpenSwitcher:he[23]||(he[23]=$e=>R.value=!0),onOpenSettings:he[24]||(he[24]=$e=>z.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(g(),S(Me,{key:0},[Z(DG,{collapsed:y(Re),dragging:y(lt),"col-width":y(tt),"active-workspace":y(o).visibleWorkspace.value,"active-workspace-id":y(o).activeWorkspaceId.value,sessions:y(o).sessionsForView.value,"archived-sessions":s.value,"pinned-ids":y(o).pinnedSessionIds.value,"pinned-collapsed":y(o).pinnedCollapsed.value,groups:y(o).workspaceGroups.value,"active-id":y(o).activeSessionId.value,"attention-by-session":y(o).attentionBySession.value,"pending-by-session":y(o).pendingBySession.value,"unread-by-session":y(o).unreadBySession.value,"workspace-sort-mode":y(o).workspaceSortMode.value,workspaces:y(o).workspacesView.value,"tabs-enabled":y(o).config.value?.experimental?.sidebarTabs===!0,onSelect:he[3]||(he[3]=$e=>y(o).selectSession($e)),onCreate:qt,onCreateInWorkspace:he[4]||(he[4]=$e=>$n($e)),onSelectWorkspace:he[5]||(he[5]=$e=>y(o).openWorkspace($e)),onAddWorkspace:he[6]||(he[6]=$e=>uo.value=!0),onAddWorkspacePaths:cn,onRename:dn,onGenerateTitle:Rn,onArchive:he[7]||(he[7]=$e=>De($e)),onRestore:he[8]||(he[8]=$e=>Ut($e)),onPin:he[9]||(he[9]=$e=>y(o).togglePinnedSession($e)),onReorderPins:he[10]||(he[10]=$e=>y(o).reorderPinnedSessions($e)),onTogglePinnedCollapsed:he[11]||(he[11]=$e=>y(o).togglePinnedCollapsed()),onSetSessionEmoji:zn,onLoadDoneSessions:f,onFork:he[12]||(he[12]=$e=>y(o).forkSession($e)),onExport:he[13]||(he[13]=$e=>Qo($e)),onRenameWorkspace:he[14]||(he[14]=($e,bn)=>y(o).renameWorkspace($e,bn)),onDeleteWorkspace:he[15]||(he[15]=$e=>Mi($e)),onReorderWorkspaces:he[16]||(he[16]=$e=>y(o).reorderWorkspaces($e)),onSetWorkspaceSortMode:he[17]||(he[17]=$e=>y(o).setWorkspaceSortMode($e)),onLoadMoreSessions:he[18]||(he[18]=$e=>void y(o).loadMoreSessions($e)),onLoadAllSessions:he[19]||(he[19]=$e=>void y(o).loadAllSessions()),onOpenSettings:he[20]||(he[20]=$e=>si()),onOpenSessionAdmin:m,onCollapse:y(bt)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","archived-sessions","pinned-ids","pinned-collapsed","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","workspaces","tabs-enabled","onCollapse"]),Zn(Z(Rk,{class:"side-handle","storage-key":y(Dt),"default-width":y(en),min:y(kn),max:y(In),"onUpdate:width":he[21]||(he[21]=$e=>Mn.value=$e),"onUpdate:dragging":he[22]||(he[22]=$e=>lt.value=$e)},null,8,["storage-key","default-width","min","max"]),[[Er,!y(Re)]])],64)),r.value?(g(),ce(HY,{key:2,"open-sessions":p.value,workspaces:y(o).workspacesView.value,"load-archived":h,"archive-session":De,"restore-session":Ut,"run-batch":So,onOpen:he[25]||(he[25]=$e=>{r.value=!1,y(o).selectSession($e)}),onRename:he[26]||(he[26]=($e,bn)=>y(o).renameSession($e,bn)),onFork:he[27]||(he[27]=$e=>y(o).forkSession($e)),onExport:he[28]||(he[28]=$e=>Qo($e)),onBack:he[29]||(he[29]=$e=>r.value=!1)},null,8,["open-sessions","workspaces"])):(g(),ce(xEe,{key:3,ref_key:"conversationPaneRef",ref:Jn,mobile:y(M),turns:y(o).turns.value,"session-id":y(o).activeSessionId.value,approvals:y(o).pendingApprovals.value,changes:y(o).changes.value,"git-info":y(o).gitInfo.value,tasks:y(o).tasks.value,todos:y(o).todos.value,goal:y(o).goal.value,"activation-badges":y(o).activationBadges.value,status:y(o).status.value,thinking:y(o).thinking.value,"plan-mode":y(o).planMode.value,"plan-armed":y(o).planArmed.value,"session-plans":y(o).sessionPlans.value,"reveal-saved-plan":y(o).revealSavedPlan,"overlay-open":Ci.value,"goal-mode":y(o).goalMode.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,models:y(o).models.value,"starred-ids":y(o).starredModelIds.value,skills:y(o).skills.value,questions:y(o).questions.value,"pending-question-actions":y(o).pendingQuestionActions,"pending-approval-actions":y(o).pendingApprovalActions,running:O.value,"turn-active":y(o).turnActive.value,queued:y(o).queued.value,"search-files":y(o).searchFiles,"upload-image":y(o).uploadImage,working:y(o).working.value,starting:y(o).isStartingFirstPrompt.value,"fast-moon":y(o).fastMoon.value,"file-reload-key":y(o).activeSessionId.value,"session-loading":y(o).sessionLoading.value,compaction:y(o).compaction.value,"has-more-messages":y(o).hasMoreMessages.value,"loading-more":y(o).loadingMoreMessages.value,"loading-more-error":y(o).loadMoreMessagesError.value,"load-older-messages":y(o).loadOlderMessages,"workspace-name":y(o).visibleWorkspace.value?.name,"workspace-root":y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,"git-diff-stats":y(o).gitDiffStats.value,workspaces:y(o).workspacesView.value,"active-workspace-id":y(o).activeWorkspaceId.value,"session-title":$.value,pr:y(o).activePullRequest.value,"conversation-toc":y(o).conversationToc.value,"last-turn-reason":T.value,"turn-error-kind":E.value?.reason==="max_steps"?"max_steps":void 0,"turn-error-message":E.value?.message,"session-done":N.value,pinned:y(o).pinnedSessionIds.value.includes(y(o).activeSessionId.value??""),"recent-sessions":u.value,onOpenChanges:he[30]||(he[30]=$e=>y(_o)()),onSelectWorkspace:he[31]||(he[31]=$e=>$n($e)),onAddWorkspace:he[32]||(he[32]=$e=>uo.value=!0),onOpenPr:Nn,onSubmit:he[33]||(he[33]=$e=>kt($e)),onSteer:he[34]||(he[34]=$e=>y(o).steerPrompt($e.text,$e.attachments)),onApproval:he[35]||(he[35]=($e,bn)=>y(o).respondApproval($e,bn)),onCancelTask:he[36]||(he[36]=$e=>y(o).cancelTask($e)),onAnswer:he[37]||(he[37]=($e,bn)=>y(o).respondQuestion($e,bn)),onDismiss:he[38]||(he[38]=$e=>y(o).dismissQuestion($e)),onCommand:ie,onInterrupt:he[39]||(he[39]=$e=>y(o).abortCurrentPrompt()),onUnqueue:_e,onEditQueued:Ie,onReorderQueue:je,onSteerQueued:nt,onSetPermission:he[40]||(he[40]=$e=>y(o).setPermission($e)),onSetThinking:he[41]||(he[41]=$e=>y(o).setThinking($e)),onTogglePlan:he[42]||(he[42]=$e=>y(o).togglePlanMode()),onToggleWorkflow:he[43]||(he[43]=$e=>y(o).toggleDynamicWorkflowMode()),onToggleGoal:he[44]||(he[44]=$e=>y(o).toggleGoalMode()),onCreateGoal:he[45]||(he[45]=$e=>y(o).createGoal($e)),onControlGoal:he[46]||(he[46]=$e=>y(o).controlGoal($e)),onRefreshGitStatus:he[47]||(he[47]=$e=>y(o).activeSessionId.value&&y(o).loadGitStatus(y(o).activeSessionId.value)),onRenameSession:he[48]||(he[48]=($e,bn)=>y(o).renameSession($e,bn)),onForkSession:he[49]||(he[49]=$e=>y(o).forkSession($e)),onArchiveSession:he[50]||(he[50]=$e=>De($e)),onRestoreSession:he[51]||(he[51]=$e=>Ut($e)),onSelectSession:he[52]||(he[52]=$e=>y(o).selectSession($e)),onTogglePin:he[53]||(he[53]=$e=>y(o).togglePinnedSession($e)),onOpenSessionAdmin:m,onExportSession:he[54]||(he[54]=$e=>Qo($e)),onCompact:he[55]||(he[55]=$e=>y(o).compact()),onPickModel:he[56]||(he[56]=$e=>kr()),onSelectModel:he[57]||(he[57]=$e=>Ae($e)),onOpenFile:he[58]||(he[58]=$e=>y(de)($e)),onOpenMedia:he[59]||(he[59]=$e=>$t($e)),onOpenCompaction:he[60]||(he[60]=$e=>y(ys)($e)),onOpenAgent:he[61]||(he[61]=$e=>y(Ts)($e)),onOpenToolDiff:he[62]||(he[62]=$e=>y(Ze)($e)),onOpenTurnDiff:he[63]||(he[63]=$e=>et($e)),onEditMessage:is,onContinueTurn:Pt},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","plan-armed","session-plans","reveal-saved-plan","overlay-open","goal-mode","dynamic-workflow-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc","last-turn-reason","turn-error-kind","turn-error-message","session-done","pinned","recent-sessions"])),!y(M)&&y(Re)?(g(),ce(Zt,{key:4,class:"sidebar-toggle-btn",size:"sm",label:y(Re)?y(w)("sidebar.expandSidebar"):y(w)("sidebar.collapseSidebar"),onClick:y(bt)},{default:ue(()=>[Z(Le,{name:y(Re)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):J("",!0),!y(M)&&y(Re)?(g(),ce(Zt,{key:5,class:"new-chat-btn",size:"sm",label:y(w)("sidebar.newChat"),onClick:qt},{default:ue(()=>[Z(Le,{name:"chat-new"})]),_:1},8,["label"])):J("",!0),!r.value&&y(Mt)&&!y(M)?(g(),ce(Rk,{key:6,class:"preview-handle","storage-key":y(Rt),"default-width":y(an),min:y(on),max:y(sn),reverse:"","aria-label":y(w)("layout.resizePreviewAria"),"onUpdate:width":he[64]||(he[64]=$e=>Yn.value=$e),"onUpdate:dragging":he[65]||(he[65]=$e=>tn.value=$e)},null,8,["storage-key","default-width","min","max","aria-label"])):J("",!0),!r.value&&(!y(M)||y(Mt))?(g(),S("aside",{key:7,class:Be(["global-preview",{open:y(Mt),mobile:y(M),"no-anim":y(tn)||ne.value}]),role:"complementary","aria-label":y(w)("layout.detailPanelAria"),"aria-hidden":!y(Mt)},[xe.value==="compaction"&&y(As)?(g(),ce(gLe,{key:0,text:y(no)??"",subtitle:y(w)("conversation.summaryTitle"),onClose:y(ao)},null,8,["text","subtitle","onClose"])):xe.value==="agent"&&y(co)?(g(),ce(_Le,{key:1,member:y(co),turns:y(oo),running:y(Os),loading:y(Ct),"load-error":y(so),"has-more":y(js),"loading-more":y(Bn),"load-more-error":y(Pn),onClose:y(ks),onLoadOlderMessages:y(Lo),onOpenFile:he[66]||(he[66]=$e=>y(de)($e)),onOpenMedia:he[67]||(he[67]=$e=>$t($e)),onOpenAgent:he[68]||(he[68]=$e=>y(Ts)($e)),onOpenTurnDiff:he[69]||(he[69]=$e=>et($e))},null,8,["member","turns","running","loading","load-error","has-more","loading-more","load-more-error","onClose","onLoadOlderMessages"])):xe.value==="btw"&&y(Je)?(g(),ce(n$e,{key:2,ref_key:"sideChatPanelRef",ref:Es,turns:y(o).sideChatTurns.value,running:y(o).sideChatRunning.value,sending:y(o).sideChatSending.value,onSend:he[70]||(he[70]=$e=>y(o).sendSideChatPrompt($e)),onClose:y(wt)},null,8,["turns","running","sending","onClose"])):xe.value==="diff"?(g(),ce(E$e,{key:3,mode:y(ct),changes:y(o).changes.value,"git-info":y(o).gitInfo.value,"file-diff":y(o).fileDiff.value,"selected-diff-path":y(o).selectedDiffPath.value,"file-diff-loading":y(o).fileDiffLoading.value,closable:"",onOpen:y(Ps),onBack:he[71]||(he[71]=$e=>{ct.value="list",mn.value=null,y(o).clearFileDiff()}),onClose:y(Un)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):xe.value==="toolDiff"&&y(Ro)?(g(),ce(TLe,{key:4,target:y(Ro),onClose:y(Qe)},null,8,["target","onClose"])):xe.value==="turnDiff"&&Ke.value?(g(),ce(qLe,{key:5,changes:Ke.value.changes,cwd:y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,onOpenFile:he[72]||(he[72]=$e=>y(de)($e)),onClose:Y},null,8,["changes","cwd"])):xe.value==="editor"?(g(),ce(pLe,{key:6,onClose:re})):xe.value==="file"?(g(),ce(BIe,{key:7,file:y(X),loading:y(ve),error:y(fe),line:y(D)?.line,"download-url":y(pe),closable:"","external-actions":y(te),editable:y(o).fsWriteSupported.value&&y(o).activeSessionId.value!==null,"open-file":y(de),onClose:y(ye),onOpenExternal:y(Ce),onReveal:y(me),onOpenEditor:he[73]||(he[73]=$e=>be($e))},null,8,["file","loading","error","line","download-url","external-actions","editable","open-file","onClose","onOpenExternal","onReveal"])):J("",!0)],10,OVe)):J("",!0),ke.value&&Fe.value?(g(),ce(IEe,{key:8,media:ke.value,src:Fe.value,onClose:Tt},null,8,["media","src"])):J("",!0),ro.value?(g(),ce(U$e,{key:9,models:y(o).models.value,current:y(o).status.value.modelId,"starred-ids":y(o).starredModelIds.value,loading:io.value,unavailable:Io.value,onSelect:he[74]||(he[74]=$e=>Ee($e)),onToggleStar:he[75]||(he[75]=$e=>y(o).toggleStarModel($e)),onClose:he[76]||(he[76]=$e=>ro.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):J("",!0),vn.value?(g(),ce(Nje,{key:10,status:y(o).status.value,thinking:V.value,"plan-mode":y(o).planMode.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,"cost-usd":y(o).sessionCost.value,onClose:he[77]||(he[77]=$e=>vn.value=!1)},null,8,["status","thinking","plan-mode","dynamic-workflow-mode","cost-usd"])):J("",!0),uo.value?(g(),ce(vje,{key:11,"browse-fs":y(o).browseFs,"get-fs-home":y(o).getFsHome,"default-path":y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,error:Is.value,onAdd:he[78]||(he[78]=$e=>jt($e)),onClose:Ln},null,8,["browse-fs","get-fs-home","default-path","error"])):J("",!0),Z(gi,{name:"gload-fade"},{default:ue(()=>[y(o).initialized.value?J("",!0):(g(),ce(RDe,{key:0,issue:y(o).connectIssue.value},null,8,["issue"]))]),_:1}),F.value?(g(),ce(gDe,{key:12,onComplete:P})):W.value?(g(),ce(Fz,{key:13,onComplete:G,onSkip:G})):J("",!0),Z(qje,{warnings:y(o).warnings.value,onDismiss:y(o).dismissWarning},null,8,["warnings","onDismiss"]),Z(lOe),_("div",PVe,[i.value?(g(),ce(Vm,{key:`${i.value.kind}:${i.value.ids.join(",")}`,duration:8e3,onDismiss:he[79]||(he[79]=$e=>i.value=null)},{default:ue(()=>[_("span",null,I(y(w)(i.value.kind==="done"?"admin.actionArchived":"admin.actionRestored",{n:i.value.ids.length})),1),_("button",{type:"button",class:"session-action-undo",onClick:Jo},I(y(w)("sidebar.archiveToastUndo")),1)]),_:1})):J("",!0),l.value?(g(),ce(Vm,{key:`${l.value.sessionId}:${l.value.state}`,duration:l.value.state==="running"?6e4:4e3,onDismiss:he[80]||(he[80]=$e=>l.value=null)},{default:ue(()=>[He(I(y(w)(l.value.state==="running"?"admin.exporting":"admin.exported")),1)]),_:1},8,["duration"])):J("",!0),a.value?(g(),ce(Vm,{key:a.value,duration:5e3,onDismiss:he[81]||(he[81]=$e=>a.value=null)},{default:ue(()=>[He(I(a.value),1)]),_:1})):J("",!0)]),y(b)?(g(),ce(fVe,{key:14})):J("",!0),y(M)?(g(),ce(HOe,{key:15,modelValue:R.value,"onUpdate:modelValue":he[82]||(he[82]=$e=>R.value=$e),groups:y(o).workspaceGroups.value,"active-workspace-id":y(o).activeWorkspaceId.value,"active-id":y(o).activeSessionId.value,"attention-by-session":y(o).attentionBySession.value,"attention-by-workspace":y(o).attentionByWorkspace.value,onSelect:he[83]||(he[83]=$e=>y(o).selectSession($e)),onCreate:qt,onCreateInWorkspace:he[84]||(he[84]=$e=>$n($e)),onAddWorkspace:he[85]||(he[85]=$e=>uo.value=!0),onRename:he[86]||(he[86]=($e,bn)=>y(o).renameSession($e,bn)),onArchive:he[87]||(he[87]=$e=>De($e)),onDeleteWorkspace:he[88]||(he[88]=$e=>Mi($e)),onLoadMore:he[89]||(he[89]=$e=>void y(o).loadMoreSessions($e))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):J("",!0),y(M)?(g(),ce(XPe,{key:16,modelValue:z.value,"onUpdate:modelValue":he[90]||(he[90]=$e=>z.value=$e),status:y(o).status.value,thinking:y(o).thinking.value,models:y(o).models.value,"plan-mode":y(o).planMode.value,"goal-mode":y(o).goalMode.value,goal:y(o).goal.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,"color-scheme":y(o).colorScheme.value,"ui-font-size":y(o).uiFontSize.value,"conversation-toc":y(o).conversationToc.value,"server-version":y(o).serverVersion.value,onPickModel:he[91]||(he[91]=$e=>kr()),onSetThinking:he[92]||(he[92]=$e=>y(o).setThinking($e)),onTogglePlan:he[93]||(he[93]=$e=>y(o).togglePlanMode()),onToggleWorkflow:he[94]||(he[94]=$e=>y(o).toggleDynamicWorkflowMode()),onToggleGoal:he[95]||(he[95]=$e=>y(o).toggleGoalMode()),onControlGoal:he[96]||(he[96]=$e=>y(o).controlGoal($e)),onSetPermission:he[97]||(he[97]=$e=>y(o).setPermission($e)),onSetColorScheme:he[98]||(he[98]=$e=>y(o).setColorScheme($e)),onSetUiFontSize:he[99]||(he[99]=$e=>y(o).setUiFontSize($e)),onSetConversationToc:he[100]||(he[100]=$e=>y(o).setConversationToc($e)),onLogin:he[101]||(he[101]=()=>{z.value=!1,Pr()})},null,8,["modelValue","status","thinking","models","plan-mode","goal-mode","goal","dynamic-workflow-mode","color-scheme","ui-font-size","conversation-toc","server-version"])):J("",!0)],6)),Hs.value?(g(),ce(zFe,{key:4,"color-scheme":y(o).colorScheme.value,accent:y(o).accent.value,"ui-font-size":y(o).uiFontSize.value,"auth-ready":y(o).authReady.value,"account-model":y(o).defaultModel.value,notify:y(o).notifyOnComplete.value,"notify-question":y(o).notifyOnQuestion.value,"notify-approval":y(o).notifyOnApproval.value,"notify-permission":y(o).notifyPermission.value,sound:y(o).soundOnComplete.value,"conversation-toc":y(o).conversationToc.value,config:y(o).config.value,models:y(o).models.value,"config-saving":yr.value,"server-version":y(o).serverVersion.value,backend:y(o).backend.value,"experimental-flag-states":y(o).experimentalFlagStates.value,"initial-tab":bs.value,onSetColorScheme:he[102]||(he[102]=$e=>y(o).setColorScheme($e)),onSetAccent:he[103]||(he[103]=$e=>y(o).setAccent($e)),onSetUiFontSize:he[104]||(he[104]=$e=>y(o).setUiFontSize($e)),onSetNotify:he[105]||(he[105]=$e=>y(o).setNotifyOnComplete($e)),onSetNotifyQuestion:he[106]||(he[106]=$e=>y(o).setNotifyOnQuestion($e)),onSetNotifyApproval:he[107]||(he[107]=$e=>y(o).setNotifyOnApproval($e)),onSetSound:he[108]||(he[108]=$e=>y(o).setSoundOnComplete($e)),onSetConversationToc:he[109]||(he[109]=$e=>y(o).setConversationToc($e)),onUpdateConfig:he[110]||(he[110]=$e=>es($e)),onOpenOnboarding:he[111]||(he[111]=()=>{Hs.value=!1,ee()}),onClose:he[112]||(he[112]=$e=>Hs.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","experimental-flag-states","initial-tab"])):J("",!0),Z(bje)]))}}),DVe=mt(HVe,[["__scopeId","data-v-ff37d4d2"]]);C8e();q4(DVe).use(yo).mount("#app");export{UB as $,dd as A,RR as B,ds as C,jWe as D,pM as E,Me as F,P2 as G,He as H,Z as I,gR as J,cWe as K,mi as L,Ge as M,ij as N,pWe as O,hWe as P,vWe as Q,T4 as R,Rc as S,Gi as T,mWe as U,dg as V,fWe as W,PWe as X,gWe as Y,NWe as Z,VVe as _,DM as a,ns as a$,gs as a0,G7 as a1,YVe as a2,eg as a3,yA as a4,hn as a5,fu as a6,nWe as a7,VWe as a8,rWe as a9,ZM as aA,ZR as aB,QR as aC,xn as aD,JR as aE,XR as aF,du as aG,YR as aH,An as aI,ng as aJ,bR as aK,g as aL,oj as aM,eWe as aN,jn as aO,IM as aP,QVe as aQ,$4 as aR,Rs as aS,pi as aT,U as aU,AWe as aV,_j as aW,rt as aX,Tn as aY,KM as aZ,uWe as a_,aWe as aa,lWe as ab,iWe as ac,EWe as ad,WWe as ae,pn as af,RF as ag,up as ah,Ua as ai,Ql as aj,rs as ak,TWe as al,Zr as am,n1 as an,Nt as ao,kWe as ap,bWe as aq,Vn as ar,vt as as,HF as at,Be as au,HB as av,Wt as aw,UR as ax,GR as ay,vo as az,JVe as b,Pue as b$,RWe as b0,ud as b1,j4 as b2,zWe as b3,t1 as b4,dR as b5,qVe as b6,jo as b7,TR as b8,BWe as b9,Fs as bA,Er as bB,FF as bC,LWe as bD,Ue as bE,FM as bF,oWe as bG,IR as bH,xWe as bI,ue as bJ,wWe as bK,Zn as bL,Eo as bM,IWe as bN,xt as bO,tWe as bP,to as bQ,ps as bR,YWe as bS,XWe as bT,CL as bU,JWe as bV,rue as bW,SL as bX,U8 as bY,nqe as bZ,Vue as b_,WVe as ba,I as bb,K3 as bc,dWe as bd,Dn as be,ZVe as bf,UVe as bg,Km as bh,MWe as bi,pR as bj,y as bk,Zd as bl,DWe as bm,OWe as bn,aj as bo,sWe as bp,SWe as bq,ER as br,HWe as bs,yWe as bt,G3 as bu,HM as bv,W4 as bw,vj as bx,BA as by,c8 as bz,$We as c,hv as c0,fv as c1,pv as c2,sqe as c3,k5 as c4,Sc as c5,w5 as c6,Rue as c7,Fue as c8,rqe as c9,mt as cA,oqe as ca,ZWe as cb,iqe as cc,Lp as cd,Tr as ce,Que as cf,Jue as cg,Jce as ch,GWe as ci,Kce as cj,Gce as ck,KWe as cl,mv as cm,e2e as cn,wx as co,J_ as cp,lue as cq,y5 as cr,v5 as cs,QWe as ct,tqe as cu,UWe as cv,eqe as cw,Le as cx,qWe as cy,KLe as cz,CWe as d,Za as e,KVe as f,gi as g,dj as h,GVe as i,XVe as j,_i as k,Wd as l,Ms as m,np as n,ea as o,FWe as p,B as q,q4 as r,ce as s,J as t,S as u,_ as v,_F as w,_We as x,bF as y,xj as z}; +`))}return t.length>0?t:void 0}function y2(e){return e!==void 0&&Number.isFinite(Date.parse(e))?e:void 0}function zVe(e){let t;for(const n of e){if(n===void 0)continue;const o=Date.parse(n);Number.isFinite(o)&&(t===void 0||o=0?n:void 0}const Dz=U(typeof window>"u"?0:window.innerWidth);let K3=0,X5=!1;function U7(){Dz.value=window.innerWidth}function BVe(){X5||typeof window>"u"||(window.addEventListener("resize",U7),X5=!0,U7())}function RVe(){!X5||typeof window>"u"||(window.removeEventListener("resize",U7),X5=!1)}function Vz(e,t,n){return Math.max(t,e-n)}function Z7(e,t,n){return Math.min(n,Math.max(t,e))}function Wz(){return xn(()=>{K3+=1,BVe()}),vo(()=>{K3=Math.max(0,K3-1),K3===0&&RVe()}),{viewportWidth:Dz}}const FVe="pythinker-web.file-preview-width",kc=320;function jVe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=Wz(),i=B(()=>Math.max(0,s.value-t.value)),r=B(()=>Vz(i.value,kc,kc));function l(fe){return Z7(Math.round(fe),kc,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=U(c.value),d=B(()=>Z7(u.value,kc,r.value)),f=U(null),p=B(()=>{const fe=f.value;if(!fe)return null;const pe=e.turns.value.find(te=>te.id===fe.turnId);return pe?.role==="compaction"&&pe.text?pe.text:null}),h=B(()=>p.value!==null);function m(fe){if(f.value?.turnId===fe.turnId){f.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",f.value=fe}function k(){f.value=null,n.value==="compaction"&&(n.value=null)}const x=U(null),v=B(()=>{const fe=x.value;if(!fe)return{entry:void 0,version:0};const pe=e.auxiliaryTranscripts.getEntry(fe.sessionId,fe.subagentId);return{entry:pe,version:pe?.version.value??0}});function w(fe){const pe=e.activeAppTasks.value.find(te=>te.agentId===fe||te.id===fe||te.backgroundTaskId===fe||te.parentToolCallId===fe);return pe?.agentId??pe?.id??fe}const b=B(()=>{const fe=x.value;if(!fe)return null;const pe=e.activeAppTasks.value.find(Fe=>Fe.agentId===fe.subagentId||Fe.id===fe.subagentId||Fe.backgroundTaskId===fe.subagentId);if(pe)return Dbe(pe);const te=v.value.entry?.channel;if(!te)return null;const de=te.agents.find(Fe=>Fe.agentId===fe.subagentId),ye=te.snapshot.items.findLast(Fe=>Fe.kind==="turn"),Ce=te.snapshot.meta.activity==="turn",me=te.loading,be=ye?.kind==="turn"&&ye.state==="failed",ie=ye?.kind==="turn"&&ye.state==="cancelled",ke=te.refreshError&&ye===void 0;return{id:fe.subagentId,name:de?.label??fe.subagentId,subagentType:de?.type==="sub"?"subagent":de?.type,phase:Ce?"working":ie?"cancelled":be||ke?"failed":me?"queued":"completed",status:Ce||me?"running":ie?"cancelled":be||ke?"failed":"completed"}}),M=B(()=>{const fe=x.value,pe=v.value.entry?.channel;if(!fe||!pe)return[];const te=pe.agents.find(de=>de.agentId===fe.subagentId);return TVe(pe.snapshot,te,{sessionId:fe.sessionId,getFileUrl:de=>e.getFileUrl(de)})}),R=B(()=>v.value.entry?.channel.loading??!1),z=B(()=>v.value.entry?.channel.refreshError??!1),$=B(()=>v.value.entry?.channel.loadingOlder??!1),E=B(()=>v.value.entry?.channel.loadOlderError??!1),T=B(()=>v.value.entry?.channel.snapshot.hasMoreOlder??!1),N=B(()=>v.value.entry?.channel.snapshot.meta.activity==="turn"),C=B(()=>b.value!==null);function O(fe){const pe=e.activeSessionId.value;if(!fe||!pe)return;const te=w(fe);if(n.value==="agent"&&x.value?.sessionId===pe&&x.value.subagentId===te){H();return}const de=x.value;de&&de.subagentId!==te&&e.auxiliaryTranscripts.deactivate(de.sessionId,de.subagentId),x.value={sessionId:pe,subagentId:te},n.value="agent",e.auxiliaryTranscripts.activate(pe,te)}function H(){const fe=x.value;fe&&e.auxiliaryTranscripts.deactivate(fe.sessionId,fe.subagentId),x.value=null,n.value==="agent"&&(n.value=null)}Ue(n,(fe,pe)=>{if(pe!=="agent"||fe==="agent")return;const te=x.value;te&&e.auxiliaryTranscripts.deactivate(te.sessionId,te.subagentId)});function V(){v.value.entry?.channel.loadOlder().catch(()=>{})}const A=U(null),F=B(()=>{const fe=A.value;if(!fe)return null;const pe=OJ(e.turns.value,fe);return pe?{id:fe,title:Gs(pe.name),path:Ag(pe.arg),lines:pe.status==="error"?null:Mg(pe),output:pe.output}:null}),j=B(()=>F.value!==null);function q(fe){if(n.value==="toolDiff"&&A.value===fe){P();return}n.value="toolDiff",A.value=fe}function P(){A.value=null,n.value==="toolDiff"&&(n.value=null)}const W=U("list"),G=U(null);function ee(){if(n.value==="diff"){se();return}n.value="diff",W.value="list",G.value=null,e.loadGitStatus(e.activeSessionId.value)}function se(){n.value==="diff"&&(n.value=null),W.value="list",G.value=null,e.clearFileDiff()}async function oe(fe){W.value="detail",G.value=fe,await e.loadFileDiff(fe)}async function Q(fe){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,fe):await e.openSideChat(fe),n.value="btw"}function ge(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function xe(){n.value==="btw"&&(n.value=null)}const Ke=B(()=>e.sideChatVisible.value),et=B(()=>n.value!==null&&(n.value!=="compaction"||h.value)&&(n.value!=="agent"||C.value)&&(n.value!=="toolDiff"||j.value)&&(n.value!=="btw"||Ke.value)),Y=U(!1),ne=U({});function D(){switch(n.value){case"compaction":return f.value?{kind:"compaction",...f.value}:null;case"agent":return x.value?{kind:"agent",...x.value}:null;case"toolDiff":return A.value?{kind:"toolDiff",toolId:A.value}:null;case"btw":return{kind:"btw"};default:return null}}function X(fe){if(fe)switch(fe.kind){case"compaction":f.value={turnId:fe.turnId},n.value="compaction";break;case"agent":{const pe=e.activeSessionId.value;if(!pe)break;const te=w(fe.subagentId);x.value={sessionId:pe,subagentId:te},n.value="agent",e.auxiliaryTranscripts.activate(pe,te);break}case"toolDiff":A.value=fe.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ve(){return n.value==="compaction"&&h.value?(k(),!0):n.value==="agent"&&C.value?(H(),!0):n.value==="toolDiff"&&j.value?(P(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(se(),!0):n.value==="btw"?(ge(),!0):!1}return Ue(e.activeSessionId,(fe,pe)=>{if(pe){const te=D();te?ne.value[pe]=te:delete ne.value[pe]}o(),k(),H(),P(),se(),xe(),fe&&X(ne.value[fe])}),{PREVIEW_WIDTH_KEY:FVe,PREVIEW_MIN:kc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,compactionPanelText:p,compactionPanelVisible:h,openCompactionPanel:m,closeCompactionPanel:k,agentPanelMember:b,agentPanelTurns:M,agentPanelLoading:R,agentPanelLoadError:z,agentPanelLoadingMore:$,agentPanelLoadMoreError:E,agentPanelHasMore:T,agentPanelRunning:N,agentPanelVisible:C,openAgentPanel:O,closeAgentPanel:H,loadOlderAgentMessages:V,toolDiffTarget:F,toolDiffVisible:j,openToolDiff:q,closeToolDiff:P,detailDiffMode:W,detailDiffPath:G,openDiffDetail:ee,closeDiffDetail:se,selectDiffFile:oe,btwVisible:Ke,openSideChatTab:Q,closeSideChat:ge,hideSideChatPanel:xe,sidePanelVisible:et,panelDragging:Y,closeOpenSidePanel:ve}}const OVe=ln.sidebarWidth,aM=ln.sidebarCollapsed,cM=270,qm=170,PVe=480,HVe=320;function DVe(e={}){const{viewportWidth:t}=Wz(),n=U(cM),o=U(!1),s=U(!1),i=B(()=>{const u=HVe+(Gm(e.previewOpen)?kc:0);return Math.min(PVe,Vz(t.value,qm,u))}),r=B(()=>Z7(n.value,qm,i.value));function l(){try{o.value=Yo(aM)==="true"}catch{o.value=!1}}function a(){try{vs(aM,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:OVe,SIDEBAR_DEFAULT:cM,SIDEBAR_MIN:qm,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}async function VVe(e){if(!e.fileId)return{url:e.url};try{const t=await At().getFileBlob(e.fileId),n=URL.createObjectURL(t);return{url:n,revoke:()=>URL.revokeObjectURL(n)}}catch{return{url:e.url}}}function WVe({client:e,detailTarget:t}){const{t:n}=Lt(),o=U(null),s=U(null),i=U(!1),r=U(null),l=U(null);let a=0;const c=B(()=>{const w=l.value;return w?e.getFileDownloadUrl(w):null}),u=B(()=>o.value!==null);function d(w){return w.length>1?w.replace(/\/+$/,""):w}function f(w){const b=[];for(const M of w.split(/[\\/]+/))if(!(!M||M===".")){if(M===".."){b.pop();continue}b.push(M)}return b.join("/")}function p(w){const b=w.trim();if(!b)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(b))return{error:n("filePreview.errors.unsupportedPath")};if(b.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const M=d(e.status.value.cwd);if(b.startsWith("/")){if(!M||b!==M&&!b.startsWith(`${M}/`))return{error:n("filePreview.errors.outsideWorkspace")};const z=b===M?"":b.slice(M.length+1);if(z.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const $=f(z);return $?{path:$}:{error:n("filePreview.errors.isDirectory")}}if(b.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const R=f(b);return R?{path:R}:{error:n("filePreview.errors.emptyPath")}}async function h(w){const b=o.value;if(t.value==="file"&&b&&b.path===w.path&&b.line===w.line){k();return}const M=++a;t.value="file",s.value=null,r.value=null,i.value=!0,o.value=w,l.value=null;const R=p(w.path);if("error"in R){i.value=!1,r.value=R.error;return}l.value=R.path;try{const z=await e.readFileContent(R.path);if(M!==a)return;z?s.value={...z,path:z.path||R.path}:r.value=n("filePreview.errors.loadFailed")}catch(z){if(M!==a)return;r.value=z instanceof Error?z.message:n("filePreview.errors.loadFailed")}finally{M===a&&(i.value=!1)}}function m(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1}function k(){m(),t.value==="file"&&(t.value=null)}Ue(t,(w,b)=>{b==="file"&&w!=="file"&&m()});function x(){const w=s.value?.path??o.value?.path;w&&e.openWorkspaceFile(w,o.value?.line)}function v(){const w=s.value?.path??o.value?.path;w&&e.revealWorkspaceFile(w)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:c,previewExternalActions:u,openFilePreview:h,closeFilePreview:k,openPreviewInEditor:x,revealPreviewFile:v}}const qVe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},UVe={class:"server-auth-card"},ZVe={class:"server-auth-body"},KVe={class:"server-auth-foot"},GVe=Ge({__name:"ServerAuthDialog",setup(e){const t=U(""),n=U(null),o=U(!1);xn(()=>{vt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,vN(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(g(),S("div",qVe,[_("div",UVe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[He(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"PYTHINKER_CODE_PASSWORD"),He("). ")])],-1)),_("div",ZVe,[Z(os,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",KVe,[Z(It,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:ue(()=>[He(I(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),YVe=mt(GVe,[["__scopeId","data-v-82dad292"]]),XVe={class:"app-shell"},JVe={key:2,class:"offline-strip",role:"status"},QVe=["aria-label","aria-hidden"],eWe={class:"action-toast-stack"},tWe=Ge({__name:"App",setup(e){A7e();const t=U(!1);let n=null;const o=b1(),s=U([]),i=U(!1),r=U(null),l=U(null),a=U(null);let c=null;const u=B(()=>{const qe=o.activeWorkspaceId.value;return qe?[...o.sessionsForView.value,...s.value].filter(he=>he.workspaceId===qe).toSorted((he,$e)=>new Date($e.updatedAt??0).getTime()-new Date(he.updatedAt??0).getTime()).slice(0,6):[]});function d(qe){return{id:qe.id,title:qe.title,time:new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-Math.max(0,Math.floor((Date.now()-new Date(qe.updatedAt).getTime())/864e5)),"day"),busy:!1,updatedAt:qe.updatedAt,workspaceId:qe.workspaceId,archived:!0}}async function f(){try{const qe=[];let he;for(;;){const $e=await o.loadArchivedSessions({beforeId:he,pageSize:100});if(qe.push(...$e.items),!$e.hasMore||$e.items.length===0||(he=$e.items.at(-1)?.id,he===void 0))break}s.value=qe.map(d)}catch(qe){console.warn("loadDoneSessions failed",qe)}}const p=B(()=>{const qe=new Map(o.workspaceGroups.value.flatMap(he=>he.sessions.map($e=>[$e.id,$e.updatedAt])));return o.sessionsForView.value.map(he=>({id:he.id,title:he.title,workspaceId:he.workspaceId??"",workspaceName:he.workspaceName??"-",lastPrompt:he.lastPrompt,updatedAt:he.updatedAt??qe.get(he.id)??new Date(0).toISOString(),archived:!1}))});async function h(){const qe=[];let he;for(;;){const bn=await o.loadArchivedSessions({beforeId:he,pageSize:100});if(qe.push(...bn.items),!bn.hasMore||bn.items.length===0||(he=bn.items.at(-1)?.id,he===void 0))break}const $e=o.workspacesView.value;return qe.filter(bn=>!bn.parentSessionId).map(bn=>{const ir=$e.find(Ls=>Ls.id===bn.workspaceId||Ls.root===bn.cwd);return{id:bn.id,title:bn.title,workspaceId:ir?.id??bn.workspaceId??bn.cwd,workspaceName:ir?.name??bn.cwd.split("/").filter(Boolean).at(-1)??"-",lastPrompt:bn.lastPrompt,updatedAt:bn.updatedAt,archived:!0}})}function m(){i.value=!0,o.loadAllSessions()}function k(qe,he){r.value={kind:qe,ids:Array.isArray(he)?he:[he]}}const x=B(()=>!o.dangerousBypassAuth.value&&t.value);jn("resolveImage",o.resolveImageUrl),jn("modelDisplay",qe=>{if(qe===void 0||qe.length===0)return;const he=o.models.value.find($e=>$e.id===qe)??o.models.value.find($e=>$e.model===qe);return he?.displayName||he?.model||(qe.includes("/")?qe.split("/").pop():qe)}),jn("subagentEffort",qe=>qe!==void 0&&qe.length>0&&qe!=="off"&&qe!=="on"?Pd(qe):void 0),jn("resolveDynamicWorkflowMembers",qe=>o.dynamicWorkflowMembersByToolCallId.value.get(qe)??[]);const{t:v}=Lt(),{confirm:w}=y1(),b=Jr(),M=Gp(),R=U(!1),z=U(!1),$=B(()=>{const qe=o.activeSessionId.value;return o.sessions.value.find(he=>he.id===qe)?.title??s.value.find(he=>he.id===qe)?.title??""}),E=B(()=>{const qe=o.activeSessionId.value;return o.sessions.value.find(he=>he.id===qe)?.lastTurnReason}),T=B(()=>{const qe=o.activeSessionId.value;if(qe)return i7e(qe)}),N=B(()=>s.value.some(qe=>qe.id===o.activeSessionId.value)),C=B(()=>o.visibleWorkspace.value?.sessionCount??0),O=B(()=>o.activity.value!=="idle"),{showAuthGate:H}=AVe({client:o});EVe({running:O,showAuthGate:H});const V=B(()=>{const qe=o.models.value.find(he=>he.id===o.status.value.modelId);return r9(qe,o.thinking.value)}),A=U(!1),F=B(()=>o.appState.value==="first-run"),j=B(()=>o.appState.value==="recovery"&&!A.value),q=B(()=>o.appState.value==="recovery"&&A.value);Ue(()=>o.appState.value,qe=>{qe!=="recovery"&&(A.value=!1)});function P(){A.value=!1}const W=U(!1);function G(){o.setOnboarded(!0),W.value=!1}function ee(){W.value=!0}let se=0;function oe(){const qe=window.visualViewport,he=document.documentElement.style;he.setProperty("--app-height",`${qe?.height??window.innerHeight}px`),he.setProperty("--app-top",`${qe?.offsetTop??0}px`)}function Q(){se||(se=requestAnimationFrame(()=>{se=0,oe()}))}xn(()=>{n=I7e(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ht(),oe(),window.visualViewport?.addEventListener("resize",Q),window.visualViewport?.addEventListener("scroll",Q),window.addEventListener("resize",Q),document.addEventListener("keydown",ge,!0)}),An(()=>{Et(),document.removeEventListener("keydown",ge,!0),window.visualViewport?.removeEventListener("resize",Q),window.visualViewport?.removeEventListener("scroll",Q),window.removeEventListener("resize",Q),se&&(cancelAnimationFrame(se),se=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function ge(qe){if(!(qe.key!=="Escape"||qe.isComposing)&&!Ys.value){if(xe.value==="turnDiff")Y();else if(!Xn())return;qe.stopPropagation(),qe.preventDefault()}}const xe=U(null),Ke=U(null);function et(qe){if(xe.value==="turnDiff"&&Ke.value?.turnId===qe.turnId){Y();return}Ke.value=qe,xe.value="turnDiff"}function Y(){Ke.value=null,xe.value==="turnDiff"&&(xe.value=null)}const ne=U(!1);Ue(o.activeSessionId,()=>{Y(),ne.value=!0,vt(()=>{ne.value=!1})});const{previewTarget:D,previewFile:X,previewLoading:ve,previewError:fe,previewDownloadUrl:pe,previewExternalActions:te,openFilePreview:de,closeFilePreview:ye,openPreviewInEditor:Ce,revealPreviewFile:me}=WVe({client:o,detailTarget:xe});aLe(()=>o.activeSessionId.value);function be(qe){xe.value="editor",Iz({path:qe,line:D.value?.line})}function ie(){xe.value==="editor"&&(xe.value=null)}Ue(xe,(qe,he)=>{he==="editor"&&qe!=="editor"&&$z()});const ke=U(null),Fe=U(null);let at=0,dt;async function $t(qe){if(qe.kind!=="image"&&qe.kind!=="video")return;const he=++at;dt?.(),dt=void 0,ke.value=null,Fe.value=null;const $e=await VVe(qe);if(he!==at){$e.revoke?.();return}dt=$e.revoke,ke.value=qe,Fe.value=$e.url}function Et(){at+=1,dt?.(),dt=void 0,ke.value=null,Fe.value=null}const Qt=B(()=>xe.value!==null),{SIDEBAR_WIDTH_KEY:Dt,SIDEBAR_DEFAULT:en,SIDEBAR_MIN:kn,sidebarMax:In,sessionColWidth:Mn,sidebarCollapsed:Re,sidebarDragging:lt,sideWidth:tt,loadSidebarCollapsed:ht,toggleSidebarCollapse:bt}=DVe({previewOpen:Qt}),{PREVIEW_WIDTH_KEY:Rt,PREVIEW_MIN:on,previewDefaultWidth:an,previewMax:sn,previewWidth:Yn,previewPanelWidth:Kt,compactionPanelText:no,compactionPanelVisible:As,openCompactionPanel:ys,closeCompactionPanel:ao,agentPanelMember:co,agentPanelTurns:oo,agentPanelLoading:Ct,agentPanelLoadError:so,agentPanelLoadingMore:Bn,agentPanelLoadMoreError:Pn,agentPanelHasMore:js,agentPanelRunning:Os,openAgentPanel:Es,closeAgentPanel:ks,loadOlderAgentMessages:Lo,toolDiffTarget:Ro,openToolDiff:Ze,closeToolDiff:Qe,detailDiffMode:ct,detailDiffPath:mn,openDiffDetail:_o,closeDiffDetail:Un,selectDiffFile:Ps,btwVisible:Je,openSideChatTab:ze,closeSideChat:wt,sidePanelVisible:Mt,panelDragging:tn,closeOpenSidePanel:Xn}=jVe({client:o,sideWidth:tt,detailTarget:xe,closeFilePreview:ye}),Jn=U(null),Ts=U(null);function Xo(){let qe=!1;const he=$e=>{$e instanceof KeyboardEvent&&$e.repeat||(qe=!0)};return document.addEventListener("pointerdown",he,!0),document.addEventListener("keydown",he,!0),window.addEventListener("blur",he),document.addEventListener("visibilitychange",he),()=>{vt(()=>{document.removeEventListener("pointerdown",he,!0),document.removeEventListener("keydown",he,!0),window.removeEventListener("blur",he),document.removeEventListener("visibilitychange",he),!qe&&document.hasFocus()&&Ts.value?.focusInput()})}}const io=U(!1),uo=U(!1),vn=U(!1),Hs=U(!1),bs=U("general"),Cr=B(()=>G1.value>0||io.value||uo.value||vn.value||Hs.value||R.value||z.value||ke.value!==null),ri=U(null),Is=U(null),Ys=B(()=>G1.value>0||io.value||uo.value||vn.value||Hs.value||W.value||R.value||z.value||ke.value!==null),ro=U(!1),Io=U(!1),yi=U(!1);async function ki(){ro.value=!0,Io.value=!1,io.value=!0;try{await o.refreshAllProviders()}catch{Io.value=!0}finally{ro.value=!1}}function sr(qe="general"){bs.value=qe,Hs.value=!0}function Oi(){sr("providers")}function Pi(){Oi()}async function Te(qe){io.value=!1,await Ae(qe)}async function Ae(qe){await o.setModel(qe)&&qe!==o.defaultModel.value&&o.updateConfig({defaultModel:qe})}async function De(qe){await o.archiveSession(qe),await f(),k("done",qe)}async function Ut(qe){await o.restoreSession(qe)&&(s.value=s.value.filter(he=>he.id!==qe),k("open",qe))}async function dn(qe,he){await o.renameSession(qe,he),s.value.some($e=>$e.id===qe)&&await f()}async function zn(qe,he){const $e=s.value.find(bn=>bn.id===qe);if(!$e){await o.setSessionEmoji(qe,he);return}await dn(qe,LE(he,$e.title))}async function So(qe,he){const $e=qe.map(bn=>bn.id);for(const bn of $e)he==="archive"?await o.archiveSession(bn):await o.restoreSession(bn);await f(),k(he==="archive"?"done":"open",$e)}async function Jo(){const qe=r.value;if(qe){r.value=null;for(const he of qe.ids)qe.kind==="done"?await o.restoreSession(he):await o.archiveSession(he);await f()}}async function Qo(qe){const he=qe??o.activeSessionId.value;if(!he)return;l.value={state:"running",sessionId:he};const $e=await o.exportSession(he);l.value=$e?{state:"done",sessionId:he}:null}async function Mr(qe){const he=o.workspacesView.value.find($e=>$e.id===qe)?.name??qe;await w({title:v("sidebar.removeWorkspace"),message:v("workspace.removeWorkspaceConfirm",{name:he}),variant:"danger",action:()=>o.deleteWorkspace(qe)})}async function es(qe){yi.value=!0;try{await o.updateConfig(qe)&&await Promise.all([o.refreshRuntimeState(),o.refreshServerMeta()])}finally{yi.value=!1}}async function rs(qe){await o.undo(1),await vt(),Jn.value?.loadComposerForEdit(qe.text,qe.attachments)}function re(qe){if(qe==="/compact"||qe.startsWith("/compact ")){o.compact(qe.slice(8).trim()||void 0);return}if(qe==="/dynamic_workflow"||qe.startsWith("/dynamic_workflow ")){const he=qe.slice(17).trim();he==="on"?o.setDynamicWorkflowMode(!0):he==="off"?o.setDynamicWorkflowMode(!1):he?(o.setDynamicWorkflowMode(!0),o.sendPrompt(he)):o.toggleDynamicWorkflowMode();return}if(qe==="/goal"||qe.startsWith("/goal ")){const he=qe.slice(5).trim();he==="pause"||he==="resume"||he==="cancel"?o.controlGoal(he):he?o.createGoal(he):o.toggleGoalMode();return}if(qe==="/btw"||qe.startsWith("/btw ")){const he=qe.slice(4).trim();if(!he&&o.sideChatVisible.value)wt();else{const $e=Xo();ze(he||void 0).then($e,$e)}return}switch(qe){case"/new":case"/clear":qt();break;case"/fork":o.forkSession();break;case"/export":Qo();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/status":vn.value=!0;break;case"/login":Pi();break;default:{const he=qe.indexOf(" "),$e=vye((he===-1?qe:qe.slice(0,he)).slice(1)),bn=he===-1?void 0:qe.slice(he+1).trim()||void 0;if(!$e)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,$e,bn):o.activateSkill($e,bn);break}}}function _e(qe){o.unqueue(qe)}function Ie(qe){o.unqueue(qe)}function je(qe){o.reorderQueue(qe.from,qe.to)}function nt(qe){o.steerQueued(qe)}async function kt(qe){const he=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&he){await o.startSessionAndSendPrompt(he,qe.text,qe.attachments);return}if(!o.activeSessionId.value&&!he){ri.value=qe,uo.value=!0;return}o.sendPrompt(qe.text,qe.attachments)}async function Pt(qe){const he=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&he){await o.startSessionAndSendPrompt(he,qe,[]);return}o.activeSessionId.value&&o.sendPrompt(qe)}async function jt(qe){if(Is.value=null,!await o.addWorkspaceByPath(qe)){Is.value=v("workspace.addFailed");return}uo.value=!1;const $e=ri.value;ri.value=null;const bn=o.activeWorkspaceId.value;$e&&bn&&await o.startSessionAndSendPrompt(bn,$e.text,$e.attachments)}function Ln(){ri.value=null,Is.value=null,uo.value=!1}async function cn(qe){for(const he of qe)if(Is.value=null,!await o.addWorkspaceByPath(he)){Is.value=v("workspace.addFailed"),uo.value=!0;return}}async function Rn(qe,he){const $e=await o.generateSessionTitle(qe);$e===null&&(a.value=v("sidebar.genTitleUnavailable"),c!==null&&clearTimeout(c),c=setTimeout(()=>{a.value=null,c=null},5e3)),he($e)}function wo(){vt(()=>{Jn.value?.focusComposer()})}function qt(){const qe=o.activeWorkspaceId.value;qe?o.openWorkspaceDraft(qe):o.clearActiveSession(),wo()}function $n(qe){o.openWorkspaceDraft(qe),wo()}function Nn(qe){qe&&window.open(qe,"_blank","noopener")}return(qe,he)=>(g(),S("div",XVe,[Z(IOe),x.value?(g(),ce(YVe,{key:0})):J("",!0),j.value?(g(),ce(DDe,{key:1,onOpenProviders:he[0]||(he[0]=()=>{A.value=!0,Oi()}),onDismiss:he[1]||(he[1]=$e=>A.value=!0)})):J("",!0),q.value?(g(),S("div",JVe,[_("span",null,I(y(v)("recovery.offlineNotice")),1),_("button",{type:"button","data-testid":"offline-strip-reconnect",onClick:he[2]||(he[2]=$e=>A.value=!1)},I(y(v)("recovery.addProvider")),1)])):J("",!0),j.value?J("",!0):(g(),S("div",{key:3,class:Be(["app",{mobile:y(M),"sidebar-collapsed":y(Re)&&!y(M),"macos-desktop":y(Sg)}]),style:Wt({"--preview-w":y(Kt)+"px"})},[y(M)?(g(),ce(OOe,{key:1,workspace:y(o).visibleWorkspace.value,"session-title":$.value,running:O.value,branch:y(o).status.value.branch,"session-count":C.value,onOpenSwitcher:he[23]||(he[23]=$e=>R.value=!0),onOpenSettings:he[24]||(he[24]=$e=>z.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(g(),S(Me,{key:0},[Z(UG,{collapsed:y(Re),dragging:y(lt),"col-width":y(tt),"active-workspace":y(o).visibleWorkspace.value,"active-workspace-id":y(o).activeWorkspaceId.value,sessions:y(o).sessionsForView.value,"archived-sessions":s.value,"pinned-ids":y(o).pinnedSessionIds.value,"pinned-collapsed":y(o).pinnedCollapsed.value,groups:y(o).workspaceGroups.value,"active-id":y(o).activeSessionId.value,"attention-by-session":y(o).attentionBySession.value,"pending-by-session":y(o).pendingBySession.value,"unread-by-session":y(o).unreadBySession.value,"workspace-sort-mode":y(o).workspaceSortMode.value,workspaces:y(o).workspacesView.value,"tabs-enabled":y(o).config.value?.experimental?.sidebarTabs===!0,onSelect:he[3]||(he[3]=$e=>y(o).selectSession($e)),onCreate:qt,onCreateInWorkspace:he[4]||(he[4]=$e=>$n($e)),onSelectWorkspace:he[5]||(he[5]=$e=>y(o).openWorkspace($e)),onAddWorkspace:he[6]||(he[6]=$e=>uo.value=!0),onAddWorkspacePaths:cn,onRename:dn,onGenerateTitle:Rn,onArchive:he[7]||(he[7]=$e=>De($e)),onRestore:he[8]||(he[8]=$e=>Ut($e)),onPin:he[9]||(he[9]=$e=>y(o).togglePinnedSession($e)),onReorderPins:he[10]||(he[10]=$e=>y(o).reorderPinnedSessions($e)),onTogglePinnedCollapsed:he[11]||(he[11]=$e=>y(o).togglePinnedCollapsed()),onSetSessionEmoji:zn,onLoadDoneSessions:f,onFork:he[12]||(he[12]=$e=>y(o).forkSession($e)),onExport:he[13]||(he[13]=$e=>Qo($e)),onRenameWorkspace:he[14]||(he[14]=($e,bn)=>y(o).renameWorkspace($e,bn)),onDeleteWorkspace:he[15]||(he[15]=$e=>Mr($e)),onReorderWorkspaces:he[16]||(he[16]=$e=>y(o).reorderWorkspaces($e)),onSetWorkspaceSortMode:he[17]||(he[17]=$e=>y(o).setWorkspaceSortMode($e)),onLoadMoreSessions:he[18]||(he[18]=$e=>void y(o).loadMoreSessions($e)),onLoadAllSessions:he[19]||(he[19]=$e=>void y(o).loadAllSessions()),onOpenSettings:he[20]||(he[20]=$e=>sr()),onOpenSessionAdmin:m,onCollapse:y(bt)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","archived-sessions","pinned-ids","pinned-collapsed","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","workspaces","tabs-enabled","onCollapse"]),Zn(Z(Fk,{class:"side-handle","storage-key":y(Dt),"default-width":y(en),min:y(kn),max:y(In),"onUpdate:width":he[21]||(he[21]=$e=>Mn.value=$e),"onUpdate:dragging":he[22]||(he[22]=$e=>lt.value=$e)},null,8,["storage-key","default-width","min","max"]),[[Ti,!y(Re)]])],64)),i.value?(g(),ce(qY,{key:2,"open-sessions":p.value,workspaces:y(o).workspacesView.value,"load-archived":h,"archive-session":De,"restore-session":Ut,"run-batch":So,onOpen:he[25]||(he[25]=$e=>{i.value=!1,y(o).selectSession($e)}),onRename:he[26]||(he[26]=($e,bn)=>y(o).renameSession($e,bn)),onFork:he[27]||(he[27]=$e=>y(o).forkSession($e)),onExport:he[28]||(he[28]=$e=>Qo($e)),onBack:he[29]||(he[29]=$e=>i.value=!1)},null,8,["open-sessions","workspaces"])):(g(),ce(FTe,{key:3,ref_key:"conversationPaneRef",ref:Jn,mobile:y(M),turns:y(o).turns.value,"session-id":y(o).activeSessionId.value,approvals:y(o).pendingApprovals.value,changes:y(o).changes.value,"git-info":y(o).gitInfo.value,tasks:y(o).tasks.value,todos:y(o).todos.value,goal:y(o).goal.value,"activation-badges":y(o).activationBadges.value,status:y(o).status.value,thinking:y(o).thinking.value,"plan-mode":y(o).planMode.value,"plan-armed":y(o).planArmed.value,"session-plans":y(o).sessionPlans.value,"reveal-saved-plan":y(o).revealSavedPlan,"overlay-open":Cr.value,"goal-mode":y(o).goalMode.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,models:y(o).models.value,"starred-ids":y(o).starredModelIds.value,skills:y(o).skills.value,questions:y(o).questions.value,"pending-question-actions":y(o).pendingQuestionActions,"pending-approval-actions":y(o).pendingApprovalActions,running:O.value,"turn-active":y(o).turnActive.value,queued:y(o).queued.value,"search-files":y(o).searchFiles,"upload-image":y(o).uploadImage,working:y(o).working.value,starting:y(o).isStartingFirstPrompt.value,"fast-moon":y(o).fastMoon.value,"file-reload-key":y(o).activeSessionId.value,"session-loading":y(o).sessionLoading.value,compaction:y(o).compaction.value,"has-more-messages":y(o).hasMoreMessages.value,"loading-more":y(o).loadingMoreMessages.value,"loading-more-error":y(o).loadMoreMessagesError.value,"load-older-messages":y(o).loadOlderMessages,"workspace-name":y(o).visibleWorkspace.value?.name,"workspace-root":y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,"git-diff-stats":y(o).gitDiffStats.value,workspaces:y(o).workspacesView.value,"active-workspace-id":y(o).activeWorkspaceId.value,"session-title":$.value,pr:y(o).activePullRequest.value,"conversation-toc":y(o).conversationToc.value,"last-turn-reason":E.value,"turn-error-kind":T.value?.reason==="max_steps"?"max_steps":void 0,"turn-error-message":T.value?.message,"session-done":N.value,pinned:y(o).pinnedSessionIds.value.includes(y(o).activeSessionId.value??""),"recent-sessions":u.value,onOpenChanges:he[30]||(he[30]=$e=>y(_o)()),onSelectWorkspace:he[31]||(he[31]=$e=>$n($e)),onAddWorkspace:he[32]||(he[32]=$e=>uo.value=!0),onOpenPr:Nn,onSubmit:he[33]||(he[33]=$e=>kt($e)),onSteer:he[34]||(he[34]=$e=>y(o).steerPrompt($e.text,$e.attachments)),onApproval:he[35]||(he[35]=($e,bn)=>y(o).respondApproval($e,bn)),onCancelTask:he[36]||(he[36]=$e=>y(o).cancelTask($e)),onAnswer:he[37]||(he[37]=($e,bn)=>y(o).respondQuestion($e,bn)),onDismiss:he[38]||(he[38]=$e=>y(o).dismissQuestion($e)),onCommand:re,onInterrupt:he[39]||(he[39]=$e=>y(o).abortCurrentPrompt()),onUnqueue:_e,onEditQueued:Ie,onReorderQueue:je,onSteerQueued:nt,onSetPermission:he[40]||(he[40]=$e=>y(o).setPermission($e)),onSetThinking:he[41]||(he[41]=$e=>y(o).setThinking($e)),onTogglePlan:he[42]||(he[42]=$e=>y(o).togglePlanMode()),onToggleWorkflow:he[43]||(he[43]=$e=>y(o).toggleDynamicWorkflowMode()),onToggleGoal:he[44]||(he[44]=$e=>y(o).toggleGoalMode()),onCreateGoal:he[45]||(he[45]=$e=>y(o).createGoal($e)),onControlGoal:he[46]||(he[46]=$e=>y(o).controlGoal($e)),onRefreshGitStatus:he[47]||(he[47]=$e=>y(o).activeSessionId.value&&y(o).loadGitStatus(y(o).activeSessionId.value)),onRenameSession:he[48]||(he[48]=($e,bn)=>y(o).renameSession($e,bn)),onForkSession:he[49]||(he[49]=$e=>y(o).forkSession($e)),onArchiveSession:he[50]||(he[50]=$e=>De($e)),onRestoreSession:he[51]||(he[51]=$e=>Ut($e)),onSelectSession:he[52]||(he[52]=$e=>y(o).selectSession($e)),onTogglePin:he[53]||(he[53]=$e=>y(o).togglePinnedSession($e)),onOpenSessionAdmin:m,onExportSession:he[54]||(he[54]=$e=>Qo($e)),onCompact:he[55]||(he[55]=$e=>y(o).compact()),onPickModel:he[56]||(he[56]=$e=>ki()),onSelectModel:he[57]||(he[57]=$e=>Ae($e)),onOpenFile:he[58]||(he[58]=$e=>y(de)($e)),onOpenMedia:he[59]||(he[59]=$e=>$t($e)),onOpenCompaction:he[60]||(he[60]=$e=>y(ys)($e)),onOpenAgent:he[61]||(he[61]=$e=>y(Es)($e)),onOpenToolDiff:he[62]||(he[62]=$e=>y(Ze)($e)),onOpenTurnDiff:he[63]||(he[63]=$e=>et($e)),onEditMessage:rs,onContinueTurn:Pt},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","plan-armed","session-plans","reveal-saved-plan","overlay-open","goal-mode","dynamic-workflow-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc","last-turn-reason","turn-error-kind","turn-error-message","session-done","pinned","recent-sessions"])),!y(M)&&y(Re)?(g(),ce(Zt,{key:4,class:"sidebar-toggle-btn",size:"sm",label:y(Re)?y(v)("sidebar.expandSidebar"):y(v)("sidebar.collapseSidebar"),onClick:y(bt)},{default:ue(()=>[Z(Le,{name:y(Re)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):J("",!0),!y(M)&&y(Re)?(g(),ce(Zt,{key:5,class:"new-chat-btn",size:"sm",label:y(v)("sidebar.newChat"),onClick:qt},{default:ue(()=>[Z(Le,{name:"chat-new"})]),_:1},8,["label"])):J("",!0),!i.value&&y(Mt)&&!y(M)?(g(),ce(Fk,{key:6,class:"preview-handle","storage-key":y(Rt),"default-width":y(an),min:y(on),max:y(sn),reverse:"","aria-label":y(v)("layout.resizePreviewAria"),"onUpdate:width":he[64]||(he[64]=$e=>Yn.value=$e),"onUpdate:dragging":he[65]||(he[65]=$e=>tn.value=$e)},null,8,["storage-key","default-width","min","max","aria-label"])):J("",!0),!i.value&&(!y(M)||y(Mt))?(g(),S("aside",{key:7,class:Be(["global-preview",{open:y(Mt),mobile:y(M),"no-anim":y(tn)||ne.value}]),role:"complementary","aria-label":y(v)("layout.detailPanelAria"),"aria-hidden":!y(Mt)},[xe.value==="compaction"&&y(As)?(g(),ce(ILe,{key:0,text:y(no)??"",subtitle:y(v)("conversation.summaryTitle"),onClose:y(ao)},null,8,["text","subtitle","onClose"])):xe.value==="agent"&&y(co)?(g(),ce(RLe,{key:1,member:y(co),turns:y(oo),running:y(Os),loading:y(Ct),"load-error":y(so),"has-more":y(js),"loading-more":y(Bn),"load-more-error":y(Pn),onClose:y(ks),onLoadOlderMessages:y(Lo),onOpenFile:he[66]||(he[66]=$e=>y(de)($e)),onOpenMedia:he[67]||(he[67]=$e=>$t($e)),onOpenAgent:he[68]||(he[68]=$e=>y(Es)($e)),onOpenTurnDiff:he[69]||(he[69]=$e=>et($e))},null,8,["member","turns","running","loading","load-error","has-more","loading-more","load-more-error","onClose","onLoadOlderMessages"])):xe.value==="btw"&&y(Je)?(g(),ce(g$e,{key:2,ref_key:"sideChatPanelRef",ref:Ts,turns:y(o).sideChatTurns.value,running:y(o).sideChatRunning.value,sending:y(o).sideChatSending.value,onSend:he[70]||(he[70]=$e=>y(o).sendSideChatPrompt($e)),onClose:y(wt)},null,8,["turns","running","sending","onClose"])):xe.value==="diff"?(g(),ce(V$e,{key:3,mode:y(ct),changes:y(o).changes.value,"git-info":y(o).gitInfo.value,"file-diff":y(o).fileDiff.value,"selected-diff-path":y(o).selectedDiffPath.value,"file-diff-loading":y(o).fileDiffLoading.value,closable:"",onOpen:y(Ps),onBack:he[71]||(he[71]=$e=>{ct.value="list",mn.value=null,y(o).clearFileDiff()}),onClose:y(Un)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):xe.value==="toolDiff"&&y(Ro)?(g(),ce(DLe,{key:4,target:y(Ro),onClose:y(Qe)},null,8,["target","onClose"])):xe.value==="turnDiff"&&Ke.value?(g(),ce(i$e,{key:5,changes:Ke.value.changes,cwd:y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,onOpenFile:he[72]||(he[72]=$e=>y(de)($e)),onClose:Y},null,8,["changes","cwd"])):xe.value==="editor"?(g(),ce(ALe,{key:6,onClose:ie})):xe.value==="file"?(g(),ce(GIe,{key:7,file:y(X),loading:y(ve),error:y(fe),line:y(D)?.line,"download-url":y(pe),closable:"","external-actions":y(te),editable:y(o).fsWriteSupported.value&&y(o).activeSessionId.value!==null,"open-file":y(de),onClose:y(ye),onOpenExternal:y(Ce),onReveal:y(me),onOpenEditor:he[73]||(he[73]=$e=>be($e))},null,8,["file","loading","error","line","download-url","external-actions","editable","open-file","onClose","onOpenExternal","onReveal"])):J("",!0)],10,QVe)):J("",!0),ke.value&&Fe.value?(g(),ce(WTe,{key:8,media:ke.value,src:Fe.value,onClose:Et},null,8,["media","src"])):J("",!0),io.value?(g(),ce(rNe,{key:9,models:y(o).models.value,current:y(o).status.value.modelId,"starred-ids":y(o).starredModelIds.value,loading:ro.value,unavailable:Io.value,onSelect:he[74]||(he[74]=$e=>Te($e)),onToggleStar:he[75]||(he[75]=$e=>y(o).toggleStarModel($e)),onClose:he[76]||(he[76]=$e=>io.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):J("",!0),vn.value?(g(),ce(Zje,{key:10,status:y(o).status.value,thinking:V.value,"plan-mode":y(o).planMode.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,"cost-usd":y(o).sessionCost.value,onClose:he[77]||(he[77]=$e=>vn.value=!1)},null,8,["status","thinking","plan-mode","dynamic-workflow-mode","cost-usd"])):J("",!0),uo.value?(g(),ce(Lje,{key:11,"browse-fs":y(o).browseFs,"get-fs-home":y(o).getFsHome,"default-path":y(o).visibleWorkspace.value?.root??y(o).status.value.cwd,error:Is.value,onAdd:he[78]||(he[78]=$e=>jt($e)),onClose:Ln},null,8,["browse-fs","get-fs-home","default-path","error"])):J("",!0),Z(gr,{name:"gload-fade"},{default:ue(()=>[y(o).initialized.value?J("",!0):(g(),ce(YDe,{key:0,issue:y(o).connectIssue.value},null,8,["issue"]))]),_:1}),F.value?(g(),ce(IDe,{key:12,onComplete:P})):W.value?(g(),ce(Hz,{key:13,onComplete:G,onSkip:G})):J("",!0),Z(iOe,{warnings:y(o).warnings.value,onDismiss:y(o).dismissWarning},null,8,["warnings","onDismiss"]),Z(bOe),_("div",eWe,[r.value?(g(),ce(Wm,{key:`${r.value.kind}:${r.value.ids.join(",")}`,duration:8e3,onDismiss:he[79]||(he[79]=$e=>r.value=null)},{default:ue(()=>[_("span",null,I(y(v)(r.value.kind==="done"?"admin.actionArchived":"admin.actionRestored",{n:r.value.ids.length})),1),_("button",{type:"button",class:"session-action-undo",onClick:Jo},I(y(v)("sidebar.archiveToastUndo")),1)]),_:1})):J("",!0),l.value?(g(),ce(Wm,{key:`${l.value.sessionId}:${l.value.state}`,duration:l.value.state==="running"?6e4:4e3,onDismiss:he[80]||(he[80]=$e=>l.value=null)},{default:ue(()=>[He(I(y(v)(l.value.state==="running"?"admin.exporting":"admin.exported")),1)]),_:1},8,["duration"])):J("",!0),a.value?(g(),ce(Wm,{key:a.value,duration:5e3,onDismiss:he[81]||(he[81]=$e=>a.value=null)},{default:ue(()=>[He(I(a.value),1)]),_:1})):J("",!0)]),y(b)?(g(),ce(MVe,{key:14})):J("",!0),y(M)?(g(),ce(tPe,{key:15,modelValue:R.value,"onUpdate:modelValue":he[82]||(he[82]=$e=>R.value=$e),groups:y(o).workspaceGroups.value,"active-workspace-id":y(o).activeWorkspaceId.value,"active-id":y(o).activeSessionId.value,"attention-by-session":y(o).attentionBySession.value,"attention-by-workspace":y(o).attentionByWorkspace.value,onSelect:he[83]||(he[83]=$e=>y(o).selectSession($e)),onCreate:qt,onCreateInWorkspace:he[84]||(he[84]=$e=>$n($e)),onAddWorkspace:he[85]||(he[85]=$e=>uo.value=!0),onRename:he[86]||(he[86]=($e,bn)=>y(o).renameSession($e,bn)),onArchive:he[87]||(he[87]=$e=>De($e)),onDeleteWorkspace:he[88]||(he[88]=$e=>Mr($e)),onLoadMore:he[89]||(he[89]=$e=>void y(o).loadMoreSessions($e))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):J("",!0),y(M)?(g(),ce(dHe,{key:16,modelValue:z.value,"onUpdate:modelValue":he[90]||(he[90]=$e=>z.value=$e),status:y(o).status.value,thinking:y(o).thinking.value,models:y(o).models.value,"plan-mode":y(o).planMode.value,"goal-mode":y(o).goalMode.value,goal:y(o).goal.value,"dynamic-workflow-mode":y(o).dynamicWorkflowMode.value,"color-scheme":y(o).colorScheme.value,"ui-font-size":y(o).uiFontSize.value,"conversation-toc":y(o).conversationToc.value,"server-version":y(o).serverVersion.value,onPickModel:he[91]||(he[91]=$e=>ki()),onSetThinking:he[92]||(he[92]=$e=>y(o).setThinking($e)),onTogglePlan:he[93]||(he[93]=$e=>y(o).togglePlanMode()),onToggleWorkflow:he[94]||(he[94]=$e=>y(o).toggleDynamicWorkflowMode()),onToggleGoal:he[95]||(he[95]=$e=>y(o).toggleGoalMode()),onControlGoal:he[96]||(he[96]=$e=>y(o).controlGoal($e)),onSetPermission:he[97]||(he[97]=$e=>y(o).setPermission($e)),onSetColorScheme:he[98]||(he[98]=$e=>y(o).setColorScheme($e)),onSetUiFontSize:he[99]||(he[99]=$e=>y(o).setUiFontSize($e)),onSetConversationToc:he[100]||(he[100]=$e=>y(o).setConversationToc($e)),onLogin:he[101]||(he[101]=()=>{z.value=!1,Pi()})},null,8,["modelValue","status","thinking","models","plan-mode","goal-mode","goal","dynamic-workflow-mode","color-scheme","ui-font-size","conversation-toc","server-version"])):J("",!0)],6)),Hs.value?(g(),ce(KFe,{key:4,"color-scheme":y(o).colorScheme.value,accent:y(o).accent.value,"ui-font-size":y(o).uiFontSize.value,"auth-ready":y(o).authReady.value,"account-model":y(o).defaultModel.value,notify:y(o).notifyOnComplete.value,"notify-question":y(o).notifyOnQuestion.value,"notify-approval":y(o).notifyOnApproval.value,"notify-permission":y(o).notifyPermission.value,sound:y(o).soundOnComplete.value,"conversation-toc":y(o).conversationToc.value,config:y(o).config.value,models:y(o).models.value,"config-saving":yi.value,"server-version":y(o).serverVersion.value,backend:y(o).backend.value,"experimental-flag-states":y(o).experimentalFlagStates.value,"initial-tab":bs.value,onSetColorScheme:he[102]||(he[102]=$e=>y(o).setColorScheme($e)),onSetAccent:he[103]||(he[103]=$e=>y(o).setAccent($e)),onSetUiFontSize:he[104]||(he[104]=$e=>y(o).setUiFontSize($e)),onSetNotify:he[105]||(he[105]=$e=>y(o).setNotifyOnComplete($e)),onSetNotifyQuestion:he[106]||(he[106]=$e=>y(o).setNotifyOnQuestion($e)),onSetNotifyApproval:he[107]||(he[107]=$e=>y(o).setNotifyOnApproval($e)),onSetSound:he[108]||(he[108]=$e=>y(o).setSoundOnComplete($e)),onSetConversationToc:he[109]||(he[109]=$e=>y(o).setConversationToc($e)),onUpdateConfig:he[110]||(he[110]=$e=>es($e)),onOpenOnboarding:he[111]||(he[111]=()=>{Hs.value=!1,ee()}),onClose:he[112]||(he[112]=$e=>Hs.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","experimental-flag-states","initial-tab"])):J("",!0),Z(Bje)]))}}),nWe=mt(tWe,[["__scopeId","data-v-ff37d4d2"]]);I8e();U4(nWe).use(yo).mount("#app");export{YB as $,fd as A,PR as B,ds as C,JWe as D,gM as E,Me as F,H2 as G,He as H,Z as I,kR as J,xWe as K,mr as L,Ge as M,uj as N,AWe as O,EWe as P,LWe as Q,T4 as R,Fc as S,Gr as T,TWe as U,fg as V,MWe as W,eqe as X,IWe as Y,ZWe as Z,oWe as _,qM as a,ns as a$,gs as a0,Y7 as a1,uWe as a2,tg as a3,_A as a4,hn as a5,pu as a6,gWe as a7,oqe as a8,yWe as a9,YM as aA,XR as aB,oF as aC,xn as aD,nF as aE,tF as aF,fu as aG,eF as aH,An as aI,og as aJ,CR as aK,g as aL,lj as aM,hWe as aN,jn as aO,NM as aP,pWe as aQ,N4 as aR,Rs as aS,pr as aT,U as aU,HWe as aV,Mj as aW,it as aX,En as aY,XM as aZ,SWe as a_,_We as aa,bWe as ab,kWe as ac,VWe as ad,sqe as ae,pn as af,PF as ag,dp as ah,Ua as ai,Ql as aj,is as ak,DWe as al,Zi as am,n1 as an,Nt as ao,zWe as ap,BWe as aq,Vn as ar,vt as as,qF as at,Be as au,qB as av,Wt as aw,YR as ax,QR as ay,vo as az,fWe as b,que as b$,YWe as b0,dd as b1,O4 as b2,KWe as b3,t1 as b4,mR as b5,iWe as b6,jo as b7,$R as b8,GWe as b9,Fs as bA,Ti as bB,HF as bC,qWe as bD,Ue as bE,PM as bF,vWe as bG,zR as bH,FWe as bI,ue as bJ,$We as bK,Zn as bL,To as bM,WWe as bN,xt as bO,mWe as bP,to as bQ,ps as bR,uqe as bS,dqe as bT,EL as bU,fqe as bV,uue as bW,AL as bX,Z8 as bY,gqe as bZ,Kue as b_,sWe as ba,I as bb,G3 as bc,CWe as bd,Dn as be,lWe as bf,rWe as bg,Gm as bh,PWe as bi,vR as bj,y as bk,Kd as bl,nqe as bm,QWe as bn,fj as bo,wWe as bp,jWe as bq,NR as br,tqe as bs,NWe as bt,Y3 as bu,WM as bv,q4 as bw,bj as bx,jA as by,u8 as bz,UWe as c,mv as c0,pv as c1,hv as c2,wqe as c3,b5 as c4,Cc as c5,y5 as c6,Hue as c7,Due as c8,yqe as c9,mt as cA,vqe as ca,lqe as cb,kqe as cc,$p as cd,Ei as ce,s2e as cf,o2e as cg,oue as ch,cqe as ci,Qce as cj,eue as ck,aqe as cl,gv as cm,i2e as cn,yx as co,Q_ as cp,fue as cq,k5 as cr,w5 as cs,pqe as ct,mqe as cu,rqe as cv,hqe as cw,Le as cx,iqe as cy,a$e as cz,OWe as d,Za as e,aWe as f,gr as g,mj as h,cWe as i,dWe as j,_r as k,qd as l,Ms as m,op as n,ea as o,XWe as p,B as q,U4 as r,ce as s,J as t,S as u,_ as v,MF as w,RWe as x,CF as y,Aj as z}; diff --git a/apps/pythinker-code/dist-web/assets/index-8mfmLWxL.js b/apps/pythinker-code/dist-web/assets/index-Dpc5cBbQ.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index-8mfmLWxL.js rename to apps/pythinker-code/dist-web/assets/index-Dpc5cBbQ.js index 4c4ddc632..84a4672bb 100644 --- a/apps/pythinker-code/dist-web/assets/index-8mfmLWxL.js +++ b/apps/pythinker-code/dist-web/assets/index-Dpc5cBbQ.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BSdLbOxc.js","assets/index-BfLDYVXY.js","assets/index-BK-wRR5p.js","assets/index-Hz7Ro1k-.css"])))=>i.map(i=>d[i]); -import{bR as Q}from"./index-BK-wRR5p.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-BSdLbOxc.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BFFX6GbO.js","assets/index-DzVg_0FS.js","assets/index-C0iEUKAq.js","assets/index-Hz7Ro1k-.css"])))=>i.map(i=>d[i]); +import{bR as Q}from"./index-C0iEUKAq.js";var Y=class{chunks=[];cached="";dirty=!1;length=0;append(e){e&&(this.chunks.push(e),this.length+=e.length,this.dirty=!0,this.chunks.length>256&&this.compact())}clear(e=""){this.chunks=e?[e]:[],this.cached=e,this.dirty=!1,this.length=e.length}toString(){return this.dirty&&(this.cached=this.chunks.join(""),this.dirty=!1),this.cached}compact(){this.chunks=[this.chunks.join("")]}};function $(e,i){e.replaceChildren();const t=document.createElement("div");t.className="stream-diffs-shell",t.style.overflow="auto",t.style.maxHeight=typeof i=="number"?`${i}px`:i??"none";const n=document.createElement("div");return n.className="stream-diffs-surface",t.appendChild(n),e.appendChild(t),{shell:t,surface:n}}function E(e,i,t){return{name:e,contents:i,lang:t}}var Z=class{input;container;surface;instance;diff;selectedLines=null;disposed=!1;renderListeners=new Set;visualRevision=0;visualReadyPromise=Promise.resolve(!1);resolveVisualReady;constructor(e){this.input=e}async mount(e){this.disposed=!1,this.container=e,this.surface=$(e).surface,await this.render()}async update(e){this.input=e,this.surface&&await this.render(!0)}updateFile(e,i){return this.update({kind:"file",file:e,annotations:i,options:this.input.kind==="file"?this.input.options:void 0,workerManager:this.input.kind==="file"?this.input.workerManager:void 0})}updateDiff(e,i,t){return this.update({kind:"diff",oldFile:e,newFile:i,annotations:t,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updateParsedDiff(e,i){return this.update({kind:"diff",fileDiff:e,annotations:i,options:z(this.input)?this.input.options:void 0,workerManager:z(this.input)?this.input.workerManager:void 0})}updatePatch(e,i=0,t,n=0){return this.update({kind:"patch",patch:e,patchIndex:n,fileIndex:i,annotations:t,options:this.input.kind==="patch"?this.input.options:void 0,workerManager:this.input.kind==="patch"?this.input.workerManager:void 0})}updateMergeConflict(e,i){return this.update({kind:"merge-conflict",file:e,annotations:i,options:this.input.kind==="merge-conflict"?this.input.options:void 0,workerManager:this.input.kind==="merge-conflict"?this.input.workerManager:void 0})}setSelectedLines(e){this.selectedLines=e,this.instance?.setSelectedLines(e)}setAnnotations(e){this.instance&&(this.input.kind==="file"?(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)):(this.input.annotations=e,this.instance.setLineAnnotations(this.input.annotations)),this.emitRender())}setThemeType(e){this.input.options?this.input.options={...this.input.options,themeType:e}:this.input.options={themeType:e},this.instance?.setThemeType(e)}async setTheme(e){this.input.options?this.input.options={...this.input.options,theme:e}:this.input.options={theme:e},this.surface&&await this.render(!1)}async setOptions(e){this.input.options=e,this.surface&&await this.render(!1)}acceptReject(e,i){if(!z(this.input)||!this.diff)throw new Error("acceptReject() requires a diff view");const{diffAcceptRejectHunk:t}=this.module;return this.diff=t(this.diff,e,i),this.instance.render({fileDiff:this.diff,containerWrapper:this.surface,lineAnnotations:this.input.annotations}),this.diff}resolveConflict(e,i){if(this.input.kind!=="merge-conflict")throw new Error("resolveConflict() requires a merge-conflict view");const t=this.instance.resolveConflict(e,i);return t&&(this.input.file=t.file,this.diff=t.fileDiff),t?.file}getResolvedFile(){if(!z(this.input)||!this.diff||this.diff.isPartial)return;const e="newFile"in this.input?this.input.newFile:void 0;return{name:e?.name??this.diff.name,contents:this.diff.additionLines.join(""),lang:e?.lang??this.diff.lang}}getDiff(){return this.diff}getInput(){return this.input}getNativeInstance(){return this.instance}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}async whenVisualReady(){let e=this.visualReadyPromise;for(;;){const i=await e;if(e===this.visualReadyPromise)return i;e=this.visualReadyPromise}}dispose(){this.disposed=!0,this.invalidateVisualReady(),this.instance?.cleanUp(),this.instance=void 0,this.surface=void 0,this.container?.replaceChildren(),this.container=void 0,this.renderListeners.clear()}module;async render(e=!0){const i=this.surface;if(!i||this.disposed)return;const t=this.beginVisualRender(),n=this.module??=await Q(()=>import("./index-BFFX6GbO.js"),__vite__mapDeps([0,1,2,3]));if(this.disposed||i!==this.surface)return;if(this.instance?.cleanUp(),i.replaceChildren(),this.input.kind==="file"){const o=new n.File(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines),this.diff=void 0;return}if(z(this.input)){if(e||!this.diff)if(this.input.kind==="patch"){const a=n.parsePatchFiles(this.input.patch)[this.input.patchIndex??0];if(!a)throw new Error(`Patch does not contain patch index ${this.input.patchIndex??0}`);const d=a.files[this.input.fileIndex??0];if(!d)throw new Error(`Patch does not contain file index ${this.input.fileIndex??0}`);this.diff=d}else"fileDiff"in this.input?this.diff=this.input.fileDiff:this.diff=n.parseDiffFromFile(this.input.oldFile,this.input.newFile,this.input.options?.parseDiffOptions);const o=new n.FileDiff(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);o.render({fileDiff:this.diff,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=o,o.setSelectedLines(this.selectedLines);return}const r=new n.UnresolvedFile(b(this.input.options,()=>this.markVisualReady(t)),this.input.workerManager);r.render({file:this.input.file,containerWrapper:i,lineAnnotations:this.input.annotations}),this.instance=r,r.setSelectedLines(this.selectedLines),this.diff=r.fileDiff}emitRender(){for(const e of this.renderListeners)e()}beginVisualRender(){this.resolveVisualReady?.(!1);const e=++this.visualRevision;return this.visualReadyPromise=new Promise(i=>{this.resolveVisualReady=i}),e}markVisualReady(e){this.disposed||e!==this.visualRevision||(this.resolveVisualReady?.(!0),this.resolveVisualReady=void 0,this.emitRender())}invalidateVisualReady(){this.visualRevision++,this.resolveVisualReady?.(!1),this.resolveVisualReady=void 0}};function x(e){return new Z(e)}function ee(e){return!e||e.useTokenTransformer===!0||!e.onTokenClick&&!e.onTokenEnter&&!e.onTokenLeave?e:{...e,useTokenTransformer:!0}}function b(e,i){const t=ee(e),n=t?.onPostRender;return{...t,onPostRender(...r){n?.(...r),i()}}}function z(e){return e.kind==="diff"||e.kind==="patch"}var K=class{options;state="idle";stats={characters:0,lines:0,writes:0,resets:0,renderMode:"plain-text",overflowed:!1};text=new Y;pending=[];scheduled;generation=0;container;shell;surface;finalizedSurface;plainText;finalizePromise;renderListeners=new Set;finalizedRenderSubscription;constructor(e={}){this.options=e}async mount(e){if(this.state==="disposed")throw new Error("Cannot mount a disposed code stream. Create a new controller instead.");++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.setState("mounting"),this.container=e;const{shell:i,surface:t}=$(e,this.options.maxHeight);this.shell=i,this.surface=t,this.mountPlainText(t),this.stats.startedAt??=performance.now(),this.setState("streaming")}append(e){if(e){if(this.state==="finalized"||this.state==="finalizing"||this.state==="disposed")throw new Error(`Cannot append while stream is ${this.state}`);this.text.append(e),this.stats.characters=this.text.length,this.stats.lines+=ie(e)+(this.stats.lines===0?1:0),this.pending.push(e),this.scheduleFlush()}}updateSnapshot(e){const i=this.text.toString();if(e.startsWith(i)){this.append(e.slice(i.length));return}const t=this.options.nonAppendBehavior??"reset";if(t!=="ignore"){if(t==="throw")throw new Error("Snapshot violates the append-only stream contract");return this.reset(e)}}async consume(e){try{if(Symbol.asyncIterator in e)for await(const i of e)this.append(i);else{const i=e.getReader();try{for(;;){const{done:t,value:n}=await i.read();if(t)break;this.append(n)}}finally{i.releaseLock()}}}catch(i){throw this.fail(i),i}}async flush(){if(this.cancelScheduledFlush(),!this.pending.length)return;const e=this.shouldFollowViewport(),i=this.pending.join("");this.pending.length=0,this.plainText?.append(i),this.stats.writes++,this.followViewport(e),this.emitRender()}finalize(e={view:"stream"}){if(this.state==="finalized")return Promise.resolve();if(this.finalizePromise)return this.finalizePromise;const i=this.performFinalize(e).finally(()=>{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed code stream");const i=this.generation;if(this.setState("finalizing"),await this.flush(),i!==this.generation)return;if(this.stats.finalizedAt=performance.now(),!e.view||e.view==="stream"){this.setState("finalized");return}const t=this.surface;if(!t)throw new Error("Mount the stream before finalizing to a file or diff view");const n=this.options.fileName??`code.${this.options.language??"txt"}`,r=E(n,this.getText(),this.options.language);let o;if(e.view==="file"){const{annotations:c,workerManager:g,view:S,...T}=e;o=x({kind:"file",file:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...T},workerManager:g??this.options.workerManager})}else{const{annotations:c,original:g,workerManager:S,view:T,...L}=e;o=x({kind:"diff",oldFile:E(n,g,this.options.language),newFile:r,annotations:c,options:{theme:this.options.theme,themeType:this.options.themeType,...L},workerManager:S??this.options.workerManager})}const a=document.createElement("div");if(a.className="stream-diffs-finalized",await o.mount(a),i!==this.generation){o.dispose();return}const d=this.shell,p=d?.scrollTop??0,h=d?d.scrollHeight-d.scrollTop-d.clientHeight:0;t.replaceWith(a),this.surface=a,this.plainText=void 0,this.finalizedSurface=o,this.finalizedRenderSubscription=o.onDidRender(()=>this.emitRender()),d&&(this.options.autoScroll==="always"||this.options.autoScroll!=="never"&&h<=(this.options.autoScrollThresholdPx??32)?d.scrollTop=d.scrollHeight:d.scrollTop=p),this.setState("finalized"),this.emitRender()}async reset(e=""){const i=this.container;++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.plainText=void 0,this.pending=[],this.finalizePromise=void 0,this.text.clear(),this.stats.resets++,this.stats.characters=0,this.stats.lines=0,this.stats.renderMode="plain-text",this.stats.overflowed=!1,this.setState("idle"),e&&this.append(e),i&&await this.mount(i)}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e===this.options.language||(this.options.language=e,!this.finalizedSurface))return;const i=this.finalizedSurface.getInput();i.kind==="file"?await this.finalizedSurface.updateFile({...i.file,lang:e},i.annotations):i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations)}getText(){return this.text.toString()}getState(){return this.state}getStats(){return{...this.stats}}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.cancelScheduledFlush(),this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.plainText=void 0,this.container=void 0,this.surface=void 0,this.shell=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}scheduleFlush(){if(this.scheduled!=null||!this.plainText)return;const e=this.options.flushStrategy??"raf";e==="raf"&&typeof requestAnimationFrame=="function"?this.scheduled=requestAnimationFrame(()=>void this.flush()):this.scheduled=globalThis.setTimeout(()=>void this.flush(),e==="raf"?0:e.intervalMs)}cancelScheduledFlush(){this.scheduled!=null&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.scheduled),clearTimeout(this.scheduled),this.scheduled=void 0)}shouldFollowViewport(){const e=this.shell;return!e||this.options.autoScroll==="never"?!1:this.options.autoScroll==="always"?!0:e.scrollHeight-e.scrollTop-e.clientHeight<=(this.options.autoScrollThresholdPx??32)}followViewport(e=this.shouldFollowViewport()){this.shell&&e&&(this.shell.scrollTop=this.shell.scrollHeight)}mountPlainText(e){const i=document.createElement("pre");i.className="stream-diffs-plain-text",i.dataset.streamDiffsState="streaming",i.style.margin="0",i.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",i.style.overflowWrap=this.options.wrap?"anywhere":"normal",i.textContent=this.getText(),e.replaceChildren(i),this.plainText=i}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}fail(e){this.state!=="disposed"&&(this.setState("error"),this.options.onError?.(e))}};function ie(e){let i=0;for(let t=0;t{this.finalizePromise===i&&(this.finalizePromise=void 0)});return this.finalizePromise=i,i}async performFinalize(e){if(this.state==="disposed")throw new Error("Cannot finalize a disposed diff stream");const i=this.surface;if(!i)throw new Error("Mount the diff stream before finalizing it");const t=this.generation;this.setState("finalizing");const n=x({kind:"diff",oldFile:this.asFile(this.original),newFile:this.asFile(this.modified),annotations:e,options:{...this.options,diffStyle:this.options.diffStyle??"unified"},workerManager:this.options.workerManager}),r=document.createElement("div");if(r.className="stream-diffs-finalized",await n.mount(r),t!==this.generation){n.dispose();return}const o=this.shell,a=o?.scrollTop??0;return i.replaceWith(r),this.surface=r,this.finalizedSurface=n,this.finalizedRenderSubscription=n.onDidRender(()=>this.emitRender()),o&&(o.scrollTop=a),this.setState("finalized"),this.emitRender(),n}setThemeType(e){this.options.themeType=e,this.finalizedSurface?.setThemeType(e)}async setTheme(e){this.options.theme=e,this.finalizedSurface&&await this.finalizedSurface.setTheme(e)}async setLanguage(e){if(e!==this.options.language){if(this.options.language=e,this.finalizedSurface){const i=this.finalizedSurface.getInput();i.kind==="diff"&&"oldFile"in i&&await this.finalizedSurface.updateDiff({...i.oldFile,lang:e},{...i.newFile,lang:e},i.annotations);return}this.renderPre()}}getOriginal(){return this.original}getModified(){return this.modified}getState(){return this.state}getElement(){return this.shell}getFinalizedSurface(){return this.finalizedSurface}onDidRender(e){return this.renderListeners.add(e),{dispose:()=>this.renderListeners.delete(e)}}dispose(){++this.generation,this.finalizedSurface?.dispose(),this.finalizedRenderSubscription?.dispose(),this.container?.replaceChildren(),this.container=void 0,this.shell=void 0,this.surface=void 0,this.finalizedSurface=void 0,this.finalizedRenderSubscription=void 0,this.finalizePromise=void 0,this.renderListeners.clear(),this.setState("disposed")}renderPre(){const e=this.surface;if(!e||this.finalizedSurface)return;const i=document.createElement("div");i.className=`stream-diffs-diff-pre stream-diffs-diff-pre--${this.options.diffStyle??"unified"}`,i.dataset.streamDiffsState="streaming",i.style.minWidth="max-content",(this.options.diffStyle??"unified")==="split"?(i.style.display="grid",i.style.gridTemplateColumns="minmax(0, 1fr) minmax(0, 1fr)",i.append(this.createPre(this.original,"deletions"),this.createPre(this.modified,"additions"))):i.append(this.createPre(te(this.original,this.modified),"unified")),e.replaceChildren(i)}createPre(e,i){const t=document.createElement("pre");return t.className=`stream-diffs-diff-pre__pane stream-diffs-diff-pre__pane--${i}`,t.dataset.side=i,t.style.margin="0",t.style.whiteSpace=this.options.wrap?"pre-wrap":"pre",t.style.overflowWrap=this.options.wrap?"anywhere":"normal",t.textContent=e,t}asFile(e){return E(this.options.fileName??`code.${this.options.language??"txt"}`,e,this.options.language)}setState(e){this.state=e,this.options.onStateChange?.(e)}emitRender(){for(const e of this.renderListeners)e()}};function te(e,i){const t=e.split(` `),n=i.split(` `);let r=0;for(;r` ${a}`),...t.slice(r,t.length-o).map(a=>`- ${a}`),...n.slice(r,n.length-o).map(a=>`+ ${a}`),...t.slice(t.length-o).map(a=>` ${a}`)].join(` `)}function he(e){return new G(e)}function ue(e={}){let i,t,n,r,o,a="text",d="",p="",h,c=0,g="system",S=U(e),T=q(e);const L={disableLineNumbers:e.lineNumbers===!1,overflow:e.wordWrap==="on"?"wrap":"scroll",enableLineSelection:e.enableLineSelection},M=()=>({...L,theme:S,themeType:g});async function H(s,l,u){k();const w=c;if(N(s,e),h=s,a=R(u),_(l))return V(s,l,a);if(e.stream===!1)return O(s,l,a);const f=new K({...M(),...F(e),fileName:`code.${a}`,language:a,maxHeight:e.MAX_HEIGHT,autoScroll:e.autoScrollOnUpdate===!1?"never":"near-bottom",autoScrollThresholdPx:e.autoScrollThresholdPx,workerManager:e.workerManager});if(i=f,f.append(l),await f.mount(s),w!==c||i!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>f.getText(),s,()=>f.getFinalizedSurface(),m=>f.onDidRender(m)),r}async function I(s,l,u,w){k();const f=c;N(s,e),h=s,a=R(w),d=l,p=u;let m,v;if(e.stream===!1){if(m=x({kind:"diff",oldFile:y(l),newFile:y(u),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),...F(e)}}),n=m,await m.mount(s),f!==c||n!==m||h!==s)throw m.dispose(),new Error("Editor creation was cancelled");e.onController?.(m)}else{if(v=new G({...M(),...F(e),fileName:`code.${a}`,language:a,diffStyle:e.diffStyle??(e.renderSideBySide===!1?"unified":"split"),maxHeight:e.MAX_HEIGHT,wrap:e.wordWrap==="on",workerManager:e.workerManager}),t=v,await v.mount(s,l,u),f!==c||t!==v||h!==s)throw v.dispose(),new Error("Editor creation was cancelled");e.onController?.(v)}return o=oe(()=>d,()=>p,s,()=>m??v?.getFinalizedSurface()),o}async function X(s,l=a){const u=R(l);if(_(s)){n?.getInput().kind==="merge-conflict"?(a=u,await n.updateMergeConflict(y(s),e.lineAnnotations)):h&&await V(h,s,u);return}if(e.stream===!1){n?.getInput().kind==="file"?(a=u,await n.updateFile(y(s),e.lineAnnotations)):h&&await O(h,s,u);return}if(!i){h&&await H(h,s,u);return}if(i.getState()==="finalized"){s!==i.getText()&&await i.reset(s);return}if(u!==a){a=u,await i.setLanguage(u),s!==i.getText()&&await i.reset(s);return}const w=i.getText();s.startsWith(w)?i.append(s.slice(w.length)):await i.reset(s)}async function P(s,l,u=a){if(d=s,p=l,a=R(u),t){await t.update(s,l);return}if(!n){h&&await I(h,s,l,u);return}await n.updateDiff(y(s),y(l))}function k(){c++,i?.dispose(),t?.dispose(),t||n?.dispose(),i=void 0,t=void 0,n=void 0,r=void 0,o=void 0,h=void 0}async function O(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"file",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}async function V(s,l,u){k();const w=c;h=s,a=u;const f=x({kind:"merge-conflict",file:y(l),annotations:e.lineAnnotations,workerManager:e.workerManager,options:{...M(),...F(e)}});if(n=f,await f.mount(s),w!==c||n!==f||h!==s)throw f.dispose(),new Error("Editor creation was cancelled");return e.onController?.(f),r=C(()=>B(f)??l,s,()=>f,m=>f.onDidRender(m)),r}function _(s){return e.mergeConflict===!1?!1:/^<<<<<<< .+$/m.test(s)&&/^=======$/m.test(s)&&/^>>>>>>> .+$/m.test(s)}async function J(s){if(s){if(typeof s=="string"){const l=e.themes;if(l?.[0]===s){await W(),g="dark",i?.setThemeType("dark"),t?.setThemeType("dark"),n?.setThemeType("dark");return}if(l?.[1]===s){await W(),g="light",i?.setThemeType("light"),t?.setThemeType("light"),n?.setThemeType("light");return}}T=void 0,S=s,await j(s)}}async function W(){const s=q(e);!s||s===T||(T=s,S=U(e),await j(S))}async function j(s){await i?.setTheme(s),await t?.setTheme(s),await n?.setTheme(s)}function y(s){return E(`code.${a||"txt"}`,s,a)}return{runtimeKind:"stream-diffs",createEditor:H,createDiffEditor:I,updateCode:X,appendCode(s){i?.append(s)},async finalizeCode(){if(!i||i.getState()==="finalized")return i?.getFinalizedSurface();const s=F(e);return delete s.lineAnnotations,await i.finalize({view:"file",...s,theme:S,themeType:g,annotations:e.lineAnnotations,workerManager:e.workerManager}),i.getFinalizedSurface()},async finalizeDiff(){return t&&(n=await t.finalize(e.lineAnnotations)),n},updateDiff:P,updateOriginal(s,l=a){return P(s,p,l)},updateModified(s,l=a){return P(d,s,l)},appendOriginal(s,l=a){return P(d+s,p,l)},appendModified(s,l=a){return P(d,p+s,l)},cleanupEditor:k,safeClean:k,setTheme:J,async setLanguage(s){if(a=R(s),await i?.setLanguage(a),await t?.setLanguage(a),n&&!t){const l=n.getInput();l.kind==="file"||l.kind==="merge-conflict"?await n.update({...l,file:{...l.file,lang:a}}):l.kind==="diff"&&"oldFile"in l&&await n.update({...l,oldFile:{...l.oldFile,lang:a},newFile:{...l.newFile,lang:a}})}},getCurrentTheme:()=>S,getEditor:()=>le,getEditorView:()=>r??null,getDiffEditorView:()=>o??null,getDiffModels:()=>({original:D(()=>d),modified:D(()=>n?.getResolvedFile()?.contents??t?.getModified()??p)}),getCode:()=>{const s=n?.getInput();return s?.kind==="diff"||s?.kind==="patch"?{original:d,modified:n?.getResolvedFile()?.contents??p}:s?.kind==="file"||s?.kind==="merge-conflict"?s.file.contents:t?{original:t.getOriginal(),modified:t.getModified()}:i?.getText()??null},refreshDiffPresentation:()=>n?.update(n.getInput()),whenVisualReady:async()=>{const s=h,l=c,u=n??i?.getFinalizedSurface()??t?.getFinalizedSurface();return!u||!await u.whenVisualReady()?!1:ne(s,()=>l===c&&s===h&&u===(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()),()=>se(n??i?.getFinalizedSurface()??t?.getFinalizedSurface()))}}}async function ne(e,i,t){if(!e||typeof window>"u")return!1;let n="",r,o=0;for(let a=0;a<120;a+=1){if(!i())return!1;const d=e.querySelector(".stream-diffs-shell"),p=d?.querySelector("diffs-container")?.shadowRoot?.querySelector("pre"),h=d?.getBoundingClientRect(),c=p?.textContent??"";if(h&&h.width>0&&h.height>0&&p&&t()){const g=`${Math.round(h.width)}:${Math.round(h.height)}:${p.scrollWidth}:${p.scrollHeight}:${c.length}`;if(o=p===r&&g===n?o+1:1,r=p,n=g,o>=2)return!0}else n="",r=void 0,o=0;await ae()}return!1}function se(e){if(!e)return!0;const i=e.getNativeInstance(),t=i?.fileRenderer??i?.hunksRenderer;if(!t)return!0;const n=t.renderCache;if(!n?.result)return!1;if(n.highlighted===!0)return!0;const r=e.getInput();if(R(r.kind==="file"||r.kind==="merge-conflict"?r.file.lang:"oldFile"in r?r.oldFile.lang??r.newFile.lang:e.getDiff()?.lang)==="text")return!0;const o=Number(t.getTokenizeMaxLength?.()??1e5);if(r.kind==="file"||r.kind==="merge-conflict")return re(r.file.contents)>o;const a=e.getDiff();return!!a&&Math.max(a.additionLines.length,a.deletionLines.length)>o}function R(e){return!e||/^(?:text|txt|plain|plaintext)$/i.test(e)?"text":e}function re(e){if(!e)return 0;let i=1;for(let t=0;t{let i=!1;const t=()=>{i||(i=!0,window.clearTimeout(r),window.cancelAnimationFrame(n),e())},n=window.requestAnimationFrame(t),r=window.setTimeout(t,50)})}function U(e){return e.themes?.length&&typeof e.themes[0]=="string"&&typeof e.themes[1]=="string"?{dark:e.themes[0],light:e.themes[1]}:e.theme??void 0}function q(e){if(!(typeof e.themes?.[0]!="string"||typeof e.themes?.[1]!="string"))return`${e.themes[0]} diff --git a/apps/pythinker-code/dist-web/assets/index-BfLDYVXY.js b/apps/pythinker-code/dist-web/assets/index-DzVg_0FS.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index-BfLDYVXY.js rename to apps/pythinker-code/dist-web/assets/index-DzVg_0FS.js index 9d7cae9a2..c2c4088a3 100644 --- a/apps/pythinker-code/dist-web/assets/index-BfLDYVXY.js +++ b/apps/pythinker-code/dist-web/assets/index-DzVg_0FS.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-DXfck5VN.js","assets/ruby-C0TQ7zu5.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-BWmVpMyf.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-5Bft2YPA.js","assets/r-Cf5RLm7j.js","assets/just-Cwhn7H3k.js","assets/perl-B9cMNwum.js","assets/latex-D5pSuvFb.js","assets/tex-D96PA37w.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-D1_yUvq7.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/org-DM6o9KBp.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-Csjmro_R.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-B1yitclQ.js","assets/scala-CqE71os6.js","assets/csharp-DSvCPggb.js","assets/dart-bE4Kk8sk.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/rst-bs7f0vWN.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Cjom0U5J.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/ts-tags-D351s5mN.js","assets/twig-27uCiNez.js","assets/typst-BUadGCkm.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-BmBUJMz7.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-BqiEGhQt.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]); -import{bR as c}from"./index-BK-wRR5p.js";var Dt=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Wi=Object.getOwnPropertyNames,zi=Object.prototype.hasOwnProperty,qi=(e,t)=>{let n={};for(var r in e)Dt(n,r,{get:e[r],enumerable:!0});return Dt(n,Symbol.toStringTag,{value:"Module"}),n},Xi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Wi(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Hi(t,a))||r.enumerable});return e},Ki=(e,t,n)=>(Xi(e,t,"default"),n);const Yt=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>c(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>c(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>c(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>c(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>c(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>c(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>c(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>c(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>c(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>c(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>c(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>c(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>c(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>c(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],cr=Object.fromEntries(Yt.map(e=>[e.id,e.import])),dr=Object.fromEntries(Yt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),pr={...cr,...dr},hr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],fr=Object.fromEntries(hr.map(e=>[e.id,e.import]));var Zt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Qi(){return 2147483648}function Ji(){return typeof performance<"u"?performance.now():Date.now()}const Yi=(e,t)=>e+(t-e%t)%t;async function Zi(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=Qi();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const _=Math.min(E,Yi(Math.max(h,g),65536));if(s(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let _="";for(;m>10,56320|I&1023)}}return _}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:Ji,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var eo=Object.defineProperty,to=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>to(e,typeof t!="symbol"?t+"":t,n);let D=null;function no(e){throw new Zt(e.UTF8ToString(e.getLastOnigError()))}class st{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=st._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const at=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new Zt("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new st(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(at,"LAST_ID",0);P(at,"_sharedPtr",0);P(at,"_sharedPtrInUse",!1);let mr=at;class ro{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new Zt("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),io(r)?r=await r.instantiator(n):oo(r)?r=await r.default(n):(so(r)&&(r=r.data),ao(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await uo(r)(n):r=await co(r)(n):lo(r)?r=await Et(r)(n):r instanceof WebAssembly.Module?r=await Et(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Et(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Ue=t(),Ue}function Et(e){return t=>WebAssembly.instantiate(e,t)}function uo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function co(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let gr;function po(e){gr=e}function ho(){return gr}async function _r(e){return e&&await en(e),{createScanner(t){return new ro(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new mr(t)}}}const fo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:_r,getDefaultWasmLoader:ho,loadWasm:en,setDefaultWasmLoader:po},Symbol.toStringTag,{value:"Module"}));var yr=qi({});Ki(yr,fo);var S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function mo(e){return tn(e)}function tn(e){return Array.isArray(e)?go(e):e instanceof RegExp?e:typeof e=="object"?_o(e):e}function go(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function br(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?br(e.substring(0,e.length-1)):e.substr(~t+1)}var bt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(bt.lastIndex=0,bt.test(e))}static replaceCaptures(e,t,n){return e.replace(bt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function wr(e,t){return et?1:0}function vr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>yo(e.parent,i.parentScopes));return r?new kr(r.fontStyle,r.foreground,r.background):null}},wt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Eo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Eo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function bo(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new wo(E,b,i,l,u,p)}}return n}var wo=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function vo(e,t){e.sort((l,u)=>{let p=wr(l.scope,u.scope);return p!==0||(p=vr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Co(t),s=new kr(n,o.getId(r),o.getId(i)),a=new ko(new Nt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},ko=class Vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Vt._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Vt(this._mainRule.clone(),Nt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ye(e,t){const n=[],r=So(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(vn(i)){const l=[];do l.push(i),i=r.next();while(vn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function vn(e){return!!e&&!!e.match(/[\w\.:]+/)}function So(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Lr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Lo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ro=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Io=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ro;for(const n of e)To(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function To(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ke({baseGrammar:o,selfGrammar:i},r):$t(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function $t(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Ze([r],t,n)}}function Ke(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ze(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Er({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ze(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Rr(o);switch(s.kind){case 0:Ke({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ke(t,n);break;case 2:$t(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?$t(s.ruleName,l,n):Ke(l,n)}else s.kind===4?n.add(new Lo(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Po=class{kind=0},Oo=class{kind=1},xo=class{constructor(e){this.ruleName=e}kind=2},Do=class{constructor(e){this.scopeName=e}kind=3},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Rr(e){if(e==="$base")return new Po;if(e==="$self")return new Oo;const t=e.indexOf("#");if(t===-1)return new Do(e);if(t===0)return new xo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new No(n,r)}}var Vo=/\\(\d+)/,Cn=/\\(\d+)/g,$o=-1,Ir=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${br(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Mo=class extends Ne{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Go=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},An=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},et=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Tr=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Mo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Go(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Er({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new An(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new Mt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Cn.lastIndex=0,this.source.replace(Cn,(i,o)=>Cr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new kn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new kn(e,r,this._items.map(i=>i.ruleId))}},kn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{let n={};for(var r in e)Dt(n,r,{get:e[r],enumerable:!0});return Dt(n,Symbol.toStringTag,{value:"Module"}),n},Xi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Wi(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Hi(t,a))||r.enumerable});return e},Ki=(e,t,n)=>(Xi(e,t,"default"),n);const Yt=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>c(()=>import("./actionscript-3-B3316cI-.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>c(()=>import("./ahk-CsyLZFj1.js"),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>c(()=>import("./ahk2-8Zs4aa1G.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-DhZFqWV2.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-CSVQ5wI8.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>c(()=>import("./bat-CickPsom.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-Bx8U0n9b.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-Dp5svz6Z.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>c(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-Dn5IMItf.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Rocq",import:(()=>c(()=>import("./coq-C7JzOVbR.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-C_m_b--Z.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-DqcFQ5yU.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CfZj7gIn.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16])))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>c(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-BZoOZj88.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-BnpPk5vE.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-CQcHuHx7.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-DJz3ZmWd.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-CHtswR0a.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-el3G9tDJ.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nsis",name:"NSIS",import:(()=>c(()=>import("./nsis-BlV79W_Q.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-D3jzshHO.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"org",name:"Org Markup",import:(()=>c(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67])))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>c(()=>import("./powershell-BmBUJMz7.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Vru482bI.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Cf5RLm7j.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89])))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>c(()=>import("./rbs-CpoqiR4B.js"),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-CqE71os6.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29])))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>c(()=>import("./smalltalk-BOQMe2GC.js"),[]))},{id:"smithy",name:"Smithy",import:(()=>c(()=>import("./smithy-cds9vsN8.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-DijEV5ha.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-C2oV4EkX.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-0hqHdDBg.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80])))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BGw2Nkan.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",import:(()=>c(()=>import("./vb-Cu-pLBUe.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-nZwndyjY.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],cr=Object.fromEntries(Yt.map(e=>[e.id,e.import])),dr=Object.fromEntries(Yt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),pr={...cr,...dr},hr=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-C3DzagqV.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DFGoQZhC.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-BRVnQi9A.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-hvxz__6c.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-5qJOZa0Y.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-C9pEdX9L.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-CpvCGNkr.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-Dlz6yCKv.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],fr=Object.fromEntries(hr.map(e=>[e.id,e.import]));var Zt=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Qi(){return 2147483648}function Ji(){return typeof performance<"u"?performance.now():Date.now()}const Yi=(e,t)=>e+(t-e%t)%t;async function Zi(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=Qi();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const _=Math.min(E,Yi(Math.max(h,g),65536));if(s(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let _="";for(;m>10,56320|I&1023)}}return _}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:Ji,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var eo=Object.defineProperty,to=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>to(e,typeof t!="symbol"?t+"":t,n);let D=null;function no(e){throw new Zt(e.UTF8ToString(e.getLastOnigError()))}class st{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=st._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const at=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new Zt("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new st(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(at,"LAST_ID",0);P(at,"_sharedPtr",0);P(at,"_sharedPtrInUse",!1);let mr=at;class ro{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new Zt("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),io(r)?r=await r.instantiator(n):oo(r)?r=await r.default(n):(so(r)&&(r=r.data),ao(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await uo(r)(n):r=await co(r)(n):lo(r)?r=await Et(r)(n):r instanceof WebAssembly.Module?r=await Et(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Et(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Ue=t(),Ue}function Et(e){return t=>WebAssembly.instantiate(e,t)}function uo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function co(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let gr;function po(e){gr=e}function ho(){return gr}async function _r(e){return e&&await en(e),{createScanner(t){return new ro(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new mr(t)}}}const fo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:_r,getDefaultWasmLoader:ho,loadWasm:en,setDefaultWasmLoader:po},Symbol.toStringTag,{value:"Module"}));var yr=qi({});Ki(yr,fo);var S=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function mo(e){return tn(e)}function tn(e){return Array.isArray(e)?go(e):e instanceof RegExp?e:typeof e=="object"?_o(e):e}function go(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function br(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?br(e.substring(0,e.length-1)):e.substr(~t+1)}var bt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(bt.lastIndex=0,bt.test(e))}static replaceCaptures(e,t,n){return e.replace(bt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function wr(e,t){return et?1:0}function vr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>yo(e.parent,i.parentScopes));return r?new kr(r.fontStyle,r.foreground,r.background):null}},wt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Eo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Eo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var kr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function bo(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new wo(E,b,i,l,u,p)}}return n}var wo=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function vo(e,t){e.sort((l,u)=>{let p=wr(l.scope,u.scope);return p!==0||(p=vr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Co(t),s=new kr(n,o.getId(r),o.getId(i)),a=new ko(new Nt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},ko=class Vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Vt._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Vt(this._mainRule.clone(),Nt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ye(e,t){const n=[],r=So(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(vn(i)){const l=[];do l.push(i),i=r.next();while(vn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function vn(e){return!!e&&!!e.match(/[\w\.:]+/)}function So(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Lr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Lo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ro=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Io=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Ro;for(const n of e)To(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function To(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ke({baseGrammar:o,selfGrammar:i},r):$t(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function $t(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Ze([r],t,n)}}function Ke(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ze(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Er({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ze(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Rr(o);switch(s.kind){case 0:Ke({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ke(t,n);break;case 2:$t(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?$t(s.ruleName,l,n):Ke(l,n)}else s.kind===4?n.add(new Lo(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Po=class{kind=0},Oo=class{kind=1},xo=class{constructor(e){this.ruleName=e}kind=2},Do=class{constructor(e){this.scopeName=e}kind=3},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Rr(e){if(e==="$base")return new Po;if(e==="$self")return new Oo;const t=e.indexOf("#");if(t===-1)return new Do(e);if(t===0)return new xo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new No(n,r)}}var Vo=/\\(\d+)/,Cn=/\\(\d+)/g,$o=-1,Ir=-2;var Ne=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${br(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Mo=class extends Ne{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Go=class extends Ne{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},An=class extends Ne{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mt=class extends Ne{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},et=class extends Ne{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Tr=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Mo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Go(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Er({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new An(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new Mt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Cn.lastIndex=0,this.source.replace(Cn,(i,o)=>Cr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new kn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new kn(e,r,this._items.map(i=>i.ruleId))}},kn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new vt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Gt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Uo=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Cr(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Sn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Or(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,p=-1;if(s){const h=Fo(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,p=h.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Sn(i,!0);f()}return new Sn(i,!1);function f(){const h=jo(e,t,n,r,i,p);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,E=h.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(E===$o){const g=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ce(e,t,n,i,o,g.endCaptures,m),o.produce(i,m[0].end);const _=i;if(i=i.parent,p=_.getAnchorPos(),!b&&_.getEnterPos()===r){i=_,o.produce(i,l),u=!0;return}}else{const g=e.getRule(E);o.produce(i,m[0].start);const _=i,w=g.getName(t.content,m),A=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(E,r,p,m[0].end===l,null,A,A),g instanceof Mt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!b&&_.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(g instanceof et){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!b&&_.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ce(e,t,n,i,o,g.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Fo(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof et&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:p}=zo(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,p);if(d){if(d.ruleId!==Ir){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Ce(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function jo(e,t,n,r,i,o){const s=Ho(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Wo(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,p=l.captureIndices[0].start;return p=a)&&(a=w,l=_.captureIndices,u=_.ruleId,p=m.priority,a===i))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:u}:null}function xr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function zo(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ce(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],p=s[0].end;for(let d=0;dp)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const E=f.getName(a,s),b=r.contentNameScopesList.pushAttributed(E,e),g=f.getContentName(a,s),_=b.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,_),A=e.createOnigString(a.substring(0,h.end));Or(e,A,n&&h.start===0,h.start,w,i,!1,0),Lr(A);continue}const m=f.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new qo(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var qo=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Xo(e,t,n,r,i,o,s,a){return new Qo(e,t,n,r,i,o,s,a)}function Ln(e,t,n,r,i){const o=Ye(t,tt),s=Tr.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function tt(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var Qo=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Bo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Rn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Ye(l,tt);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)Ln(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&Ln(t,l,a,this,a)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Rn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Tr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Bt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),d=le.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Ae.createRootAndLookUpScopeName(f,d,this):h=Ae.createRoot("unknown",d),t=new Bt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` `;const o=this.createOnigString(e),s=o.content.length,a=new Yo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Or(this,o,i,0,t,a,!0,r);return Lr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Rn(e,t){return e=mo(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ae=class K{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=wt.push(i,o.scopeNames),r=new K(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new K(null,new wt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new wt(null,t),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(n,i,s);return new K(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return K.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),le.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return K._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=K._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(t.tokenAttributes,i,s);return new K(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Bt=class ie{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ie(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ie._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ae.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ie._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new ie(this,t,n,r,i,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ie(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ae.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ie(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ae.fromExtension(r,n.contentNameScopesList))}},Jo=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ye(n,tt).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ye(n,tt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Yo=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=le.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=le.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Ut=Bt.NULL;function Ie(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function ee(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Dr(e){return Array.isArray(e)?e:[e]}async function nn(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Ve(e){return!e||["plaintext","txt","text","plain"].includes(e)}function rn(e){return e==="ansi"||Ve(e)}function $e(e){return e==="none"}function on(e){return $e(e)}const ts=/(\r?\n)/g;function Me(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(ts);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?In.light:In.dark),n||(n=t.type==="light"?Tn.light:Tn.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const p={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,p.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,p.settings.background=d}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Pn,{enumerable:!1,writable:!1,value:!0}),t}async function Nr(e){return[...new Set((await Promise.all(e.filter(t=>!rn(t)).map(async t=>await nn(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Vr(e){return(await Promise.all(e.map(async t=>on(t)?null:lt(await nn(t))))).filter(t=>!!t)}function $r(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new S(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var ns=class extends es{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=lt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Je.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=$r(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new S(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},rs=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let ve=0;function ut(e){ve+=1,e.warnings!==!1&&ve>=10&&ve%10===0&&console.warn(`[Shiki] ${ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new S("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(lt),i=new ns(new rs(e.engine,n),r,n,e.langAlias);let o;function s(_){return $r(_,e.langAlias)}function a(_){b();const w=i.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new S(`Language \`${_}\` not found, you may need to load it first`);return w}function l(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const w=i.getTheme(_);if(!w)throw new S(`Theme \`${_}\` not found, you may need to load it first`);return w}function u(_){b();const w=l(_);return o!==_&&(i.setTheme(w),o=_),{theme:w,colorMap:i.getColorMap()}}function p(){return b(),i.getLoadedThemes()}function d(){return b(),i.getLoadedLanguages()}function f(..._){b(),i.loadLanguages(_.flat(1))}async function h(..._){return f(await Nr(_))}function m(..._){b();for(const w of _.flat(1))i.loadTheme(w)}async function E(..._){return b(),m(await Vr(_))}function b(){if(t)throw new S("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),ve-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:E,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}const is=ut;async function sn(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Vr(e.themes||[]),Nr(e.langs||[]),e.engine]);return ut({...e,themes:t,langs:n,engine:r})}const os=sn,Mr=new WeakMap;function ct(e,t){Mr.set(e,t)}function Te(e){return Mr.get(e)}var dt=class Gr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Gr(Object.fromEntries(Dr(n).map(r=>[r,Ut])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return ss(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function ss(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function as(e,t){if(!(e instanceof dt))throw new S("Invalid grammar state");return e.getInternalStack(t)}const ls=/,/,us=/ /;function Br(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Ve(e.resolveLangAlias(n.lang||"text"))||$e(r))return Me(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Fr(t,s,i,o,n)}function Ur(...e){if(e.length===2)return Te(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(Ve(i)||$e(o))throw new S("Plain language does not have grammar state");if(i==="ansi")throw new S("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new dt(an(n,l,s,a,r).stateStack,l.name,s.name)}function Fr(e,t,n,r,i){const o=an(e,t,n,r,i),s=new dt(o.stateStack,t.name,n.name);return ct(o.tokens,s),o.tokens}function an(e,t,n,r,i){const o=Ie(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Me(e);let p=i.grammarState?as(i.grammarState,n.name)??Ut:i.grammarContextCode!=null?an(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ut,d=[];const f=[];for(let h=0,m=u.length;h0&&E.length>=s){d=[],f.push([{content:E,offset:b,color:"",fontStyle:0}]);continue}let g,_,w;l&&l!=="tokenType"&&(g=t.tokenizeLine(E,p,a),_=g.tokens,w=0);const A=t.tokenizeLine2(E,p,a),k=A.tokens.length/2;for(let I=0;Iyt.trim());break;case"object":pe=Q.scope;break;default:continue}En.push({settings:Q,selectors:pe.map(yt=>yt.split(us))})}q.explanation=[];let bn=0;for(;M+bn({scopeName:t}))}function ds(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)On(e[r],n[i])&&(r-=1),i-=1;return r===-1}function hs(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(ps(s,t,n)){r.push(o);break}return r}function ln(e,t,n,r=Br){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const p=r(e,t,{...n,theme:u.theme});return{tokens:p,state:Te(p),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=fs(...o.map(u=>u.tokens)),a=s[0].map((u,p)=>u.map((d,f)=>{const h={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=d.explanation),s.forEach((m,E)=>{const{content:b,explanation:g,offset:_,...w}=m[p][f];h.variants[i[E].color]=w}),h})),l=o[0].state?new dt(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&ct(a,l),a}function fs(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u4&&n.slice(0,4)==="data"&&bs.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Dn,Cs);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Dn.test(o)){let s=o.replace(Es,vs);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=un}return new i(r,t)}function vs(e){return"-"+e.toLowerCase()}function Cs(e){return e.charAt(1).toUpperCase()}const As=jr([Hr,_s,qr,Xr,Kr],"html"),Qr=jr([Hr,ys,qr,Xr,Kr],"svg"),Nn={}.hasOwnProperty;function ks(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Nn.call(i,e)){const l=String(i[e]);s=Nn.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ss=/["&'<>`]/g,Ls=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rs=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Is=/[|\\{}()[\]^$+*?.]/g,Vn=new WeakMap;function Ts(e,t){if(e=e.replace(t.subset?Ps(t.subset):Ss,r),t.subset||t.escapeOnly)return e;return e.replace(Ls,n).replace(Rs,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function Ps(e){let t=Vn.get(e);return t||(t=Os(e),Vn.set(e,t)),t}function Os(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ms=["cent","copy","divide","gt","lt","not","para","times"],Jr={}.hasOwnProperty,Wt={};let je;for(je in At)Jr.call(At,je)&&(Wt[At[je]]=je);const Gs=/[^\dA-Za-z]/;function Bs(e,t,n,r){const i=String.fromCharCode(e);if(Jr.call(Wt,i)){const o=Wt[i],s="&"+o;return n&&$s.includes(o)&&!Ms.includes(o)&&(!r||t&&t!==61&&Gs.test(String.fromCharCode(t)))?s:s+";"}return""}function Us(e,t,n){let r=Ds(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Bs(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Vs(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],Hs=["<",">"];function Ws(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return ye(o,Object.assign({},r.settings.characterReferences,{subset:Hs}))}}function zs(e,t,n,r){return""}function $n(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qs(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Xs(e){return e.join(" ").trim()}const Ks=/[ \t\n\f\r]/g;function cn(e){return typeof e=="object"?e.type==="text"?Mn(e.value):!1:Mn(e)}function Mn(e){return e.replace(Ks,"")===""}const x=Zr(1),Yr=Zr(-1),Qs=[];function Zr(e){return t;function t(n,r,i){const o=n?n.children:Qs;let s=(r||0)+e,a=o[s];if(!i)for(;a&&cn(a);)s+=e,a=o[s];return a}}const Js={}.hasOwnProperty;function ei(e){return t;function t(n,r,i){return Js.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const dn=ei({body:Zs,caption:kt,colgroup:kt,dd:ra,dt:na,head:kt,html:Ys,li:ta,optgroup:ia,option:oa,p:ea,rp:Gn,rt:Gn,tbody:aa,td:Bn,tfoot:la,th:Bn,thead:sa,tr:ua});function kt(e,t,n){const r=x(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&cn(r.value.charAt(0)))}function Ys(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function Zs(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function ea(e,t,n){const r=x(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ta(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="li"}function na(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ra(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Gn(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ia(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function oa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function sa(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function aa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function la(e,t,n){return!x(n,t)}function ua(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Bn(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ca=ei({body:ha,colgroup:fa,head:pa,html:da,tbody:ma});function da(e){const t=x(e,-1);return!t||t.type!=="comment"}function pa(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function ha(e){const t=x(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&cn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fa(e,t,n){const r=Yr(n,t),i=x(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&dn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ma(e,t,n){const r=Yr(n,t),i=x(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&dn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const He={name:[[` \f\r &/=>`.split(""),` diff --git a/apps/pythinker-code/dist-web/assets/index10-DRAKrY77.js b/apps/pythinker-code/dist-web/assets/index10-DNWrJC2M.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index10-DRAKrY77.js rename to apps/pythinker-code/dist-web/assets/index10-DNWrJC2M.js index 123a4bef6..0affbd510 100644 --- a/apps/pythinker-code/dist-web/assets/index10-DRAKrY77.js +++ b/apps/pythinker-code/dist-web/assets/index10-DNWrJC2M.js @@ -1,2 +1,2 @@ -import{bQ as Re,M as Ae,b$ as Ge,c0 as qe,c1 as Je,c2 as Qe,aU as d,bl as Ke,af as We,bY as e1,bE as B,as as U,aD as n1,c3 as Ze,az as o1,aL as r,u,aY as ge,v as t,bk as s,bb as X,au as b,t as F,aw as Ce,bL as t1,bB as l1,s as a1,I as i1,bJ as r1,bO as s1,g as u1,T as c1,q as T,c4 as Ve,c5 as ie,c6 as d1,c7 as De,c8 as v1,c9 as m1,b_ as h1}from"./index-BK-wRR5p.js";var re=(R,xe,l)=>new Promise((a,J)=>{var V=c=>{try{H(l.next(c))}catch($){J($)}},Q=c=>{try{H(l.throw(c))}catch($){J($)}},H=c=>c.done?a(c.value):Promise.resolve(c.value).then(V,Q);H((l=l.apply(R,xe)).next())});const p1=["data-markstream-mode"],f1={key:0,class:"infographic-block-header flex justify-between items-center border-b"},w1={key:0},g1={key:1,class:"flex items-center gap-x-2 overflow-hidden"},C1=["innerHTML"],k1={key:2},x1={key:3,class:"infographic-mode-toggle flex items-center gap-0.5"},y1=["disabled"],b1={class:"flex items-center gap-x-1"},M1={class:"flex items-center gap-x-1"},B1={key:4},F1={key:5,class:"infographic-header-actions flex items-center"},T1=["aria-pressed"],H1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},$1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},j1=["disabled"],L1=["disabled"],P1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},E1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},z1={key:0,class:"infographic-source"},S1={class:"infographic-source-code text-sm font-mono whitespace-pre-wrap"},Z1={key:1,class:"relative"},V1={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},D1={class:"flex items-center gap-2 backdrop-blur rounded-lg"},N1={key:0,class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap"},Y1={class:"dialog-panel infographic-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},_1={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},se="infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",ke=Re(Ae({__name:"InfographicBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(R,{emit:xe}){const l=R,{t:a}=Ge(),J=qe(),V=Je(),Q=Qe(),H=d(!1),c=d(!1),$=d(),p=d(),k=d(!0),ye=d(!1),j=d(!1),D=d(),K=d(null),L=d(!1),S=d(!1),A=d(null),P=d(typeof window>"u"||!Q.value),Ne=Ke(),x=We(e1,null);let E="";const be=T(()=>h1(l,Ne));typeof window<"u"&&B([()=>$.value,Q],([n,e])=>{var o,i,C;if((o=A.value)==null||o.destroy(),A.value=null,!e||P.value)return void(P.value=!0);if(!n)return void(P.value=!1);const f=(C=(i=V?.value.heavyBlockMargin)!=null?i:V?.value.rootMargin)!=null?C:"160px",w=J(n,{rootMargin:f,allowIdle:!1});A.value=w,P.value=w.isVisible.value,w.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const z=T(()=>l.node.code),ue=T(()=>{var n;return(function(e){if(l.maxHeight==="none")return Ve(e,void 0,null);const o=ie(l.maxHeight);return Ve(e,void 0,o)})((n=ie(l.estimatedPreviewHeightPx))!=null?n:d1(z.value))}),ce=d(`${ue.value}px`),Ye=T(()=>ie(l.estimatedPreviewHeightPx)!=null);function Me(){var n;if(!p.value||Ye.value)return;const e=p.value.scrollHeight;if(e>0){const o=(n=ie((function(i){if(l.maxHeight==="none")return`${i}px`;if(l.maxHeight!=null){const f=Number.parseFloat(String(l.maxHeight));if(Number.isFinite(f))return`${Math.min(i,f)}px`}const C=p.value;if(C){const f=getComputedStyle(C).getPropertyValue("--ms-size-code-max-height").trim(),w=Number.parseFloat(f);if(Number.isFinite(w))return`${Math.min(i,w)}px`}return`${Math.min(i,500)}px`})(e)))!=null?n:e;ce.value=`${Math.max(o,ue.value)}px`}}const M=d(1),N=d(0),Y=d(0),_=d(!1),W=d({x:0,y:0}),Be=T(()=>z.value);function Fe(n){return!n||n.disabled}function h(n,e,o="top"){if(Fe(n.currentTarget))return;const i=n,C=i?.clientX!=null&&i?.clientY!=null?{x:i.clientX,y:i.clientY}:void 0;De(n.currentTarget,e,o,!1,C,l.isDark)}function v(){v1()}function Te(n){if(Fe(n.currentTarget))return;const e=H.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=n,i=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;De(n.currentTarget,e,"top",!1,i,l.isDark)}function _e(){return re(this,null,function*(){try{const n=z.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(n){console.error("Failed to copy:",n)}})}function He(n){(n!=="preview"||Ze())&&(ye.value=!0,k.value=n==="source")}function Ie(){var n;const e=(n=p.value)==null?void 0:n.querySelector("svg");e?(function(o){re(this,null,function*(){try{const i=new XMLSerializer().serializeToString(o),C=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(C);if(typeof document<"u"){const w=document.createElement("a");w.href=f,w.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(w),w.click(),document.body.removeChild(w)}catch{}URL.revokeObjectURL(f)}}catch(i){console.error("Failed to export SVG:",i)}})})(e):console.error("SVG element not found")}function de(n){n.key==="Escape"&&j.value&&ve()}function ve(){if(j.value=!1,D.value&&(D.value.innerHTML=""),K.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}}function Oe(){(function(){if(j.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",de)}catch{}U(()=>{if(p.value&&D.value){D.value.innerHTML="";const n=document.createElement("div");n.style.transition="transform 0.1s ease",n.style.transformOrigin="center center",n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center";const e=p.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="auto",n.appendChild(e),D.value.appendChild(n),K.value=n,n.style.transform=`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}})})()}function $e(){M.value<3&&(M.value+=.1)}function je(){M.value>.5&&(M.value-=.1)}function Le(){M.value=1,N.value=0,Y.value=0}function ee(n){_.value=!0,n instanceof MouseEvent?W.value={x:n.clientX-N.value,y:n.clientY-Y.value}:W.value={x:n.touches[0].clientX-N.value,y:n.touches[0].clientY-Y.value}}function ne(n){if(!_.value)return;let e,o;n instanceof MouseEvent?(e=n.clientX,o=n.clientY):(e=n.touches[0].clientX,o=n.touches[0].clientY),N.value=e-W.value.x,Y.value=o-W.value.y}function I(){_.value=!1}let g=null,me=!1,oe=!1,G=!1,te="",q=!1,he=0;function le(n){return!q&&n===he}function Pe(n=!1){return re(this,null,function*(){var e,o;if(q||!P.value||!p.value)return;if(me)return oe=!0,void(G=G||n);const i=Be.value;if(!n&&i===te&&L.value)return;const C=l.loading===!1,f=++he;me=!0,(function(){const m=be.value;m&&E!==m&&(E&&x?.markSettled(E),E=m,x?.markPending(m))})();const w=p.value.innerHTML,pe=L.value,Xe=S.value;S.value=!1;try{const m=yield m1();if(!le(f))return;if(!m)return void console.warn("Infographic library failed to load.");const Z=p.value;if(!Z)return;g&&((e=g.destroy)==null||e.call(g),g=null),Z.innerHTML="",g=new m({container:Z,width:"100%",height:"100%"});let fe="";if((o=g.on)==null||o.call(g,"error",we=>{fe=(Array.isArray(we)?we:[we]).map(y=>{var Se;return y instanceof Error?y.message:typeof y=="string"?y:String(y&&typeof y=="object"&&"message"in y?(Se=y.message)!=null?Se:"":y??"")}).filter(Boolean).join("; ")}),g.render(z.value),fe)throw new Error(fe);if(!Z.childNodes.length)throw new Error("Infographic render returned empty output.");L.value=!0,S.value=!1,te=i,U(()=>{le(f)&&Me()})}catch(m){if(!le(f))return;C&&l.loading===!1&&i===Be.value?(console.error("Failed to render infographic:",m),L.value=!1,S.value=!0,te="",p.value&&(p.value.innerHTML=`
        Failed to render infographic: ${m instanceof Error?m.message:"Unknown error"}
        `)):(L.value=pe,S.value=Xe,pe&&p.value&&(p.value.innerHTML=w))}finally{if(me=!1,le(f))if(oe){const m=G;oe=!1,G=!1,U(()=>{Pe(m)})}else(function(){re(this,null,function*(){const m=E;m&&(E="",yield U(),(function(Z=be.value){Z&&$.value&&x?.reportHeight(Z,$.value.offsetHeight)})(m),x?.markSettled(m))})})()}})}function O(n=!1){q||!P.value||k.value||c.value||U(()=>{q||Pe(n)})}B(()=>z.value,()=>{O(!0)}),B(()=>l.loading,(n,e)=>{e&&!n&&O(!0)}),B(()=>k.value,n=>{n||O(!0)}),B(()=>c.value,n=>{n||O()}),B(()=>l.maxHeight,()=>{U(()=>{Me()})}),B([()=>l.estimatedPreviewHeightPx,()=>z.value],()=>{L.value||k.value||(ce.value=`${ue.value}px`)}),B(()=>P.value,n=>{!n||k.value||c.value||O()}),n1(()=>{!ye.value&&Ze(),O()}),o1(()=>{var n,e;if(q=!0,he+=1,oe=!1,G=!1,(n=A.value)==null||n.destroy(),A.value=null,(function(){const o=E;o&&(E="",x?.markSettled(o))})(),g&&((e=g.destroy)==null||e.call(g),g=null),te="",typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}});const Ee=T(()=>!0),ae=T(()=>k.value||c.value),Ue=T(()=>k.value?"fallback":S.value?"error":L.value?"preview":"pending"),ze=T(()=>({transform:`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}));return B(ze,n=>{j.value&&K.value&&(K.value.style.transform=n.transform)}),(n,e)=>(r(),u("div",{ref_key:"viewportTarget",ref:$,class:b(["infographic-block-container rounded-lg border overflow-hidden",[{"is-rendering":l.loading,dark:l.isDark}]]),"data-markstream-infographic":"1","data-markstream-mode":Ue.value},[l.showHeader?(r(),u("div",f1,[n.$slots["header-left"]?(r(),u("div",w1,[ge(n.$slots,"header-left",{},void 0,!0)])):(r(),u("div",g1,[t("span",{class:"icon-slot action-icon shrink-0",innerHTML:s(` +import{bQ as Re,M as Ae,b$ as Ge,c0 as qe,c1 as Je,c2 as Qe,aU as d,bl as Ke,af as We,bY as e1,bE as B,as as U,aD as n1,c3 as Ze,az as o1,aL as r,u,aY as ge,v as t,bk as s,bb as X,au as b,t as F,aw as Ce,bL as t1,bB as l1,s as a1,I as i1,bJ as r1,bO as s1,g as u1,T as c1,q as T,c4 as Ve,c5 as ie,c6 as d1,c7 as De,c8 as v1,c9 as m1,b_ as h1}from"./index-C0iEUKAq.js";var re=(R,xe,l)=>new Promise((a,J)=>{var V=c=>{try{H(l.next(c))}catch($){J($)}},Q=c=>{try{H(l.throw(c))}catch($){J($)}},H=c=>c.done?a(c.value):Promise.resolve(c.value).then(V,Q);H((l=l.apply(R,xe)).next())});const p1=["data-markstream-mode"],f1={key:0,class:"infographic-block-header flex justify-between items-center border-b"},w1={key:0},g1={key:1,class:"flex items-center gap-x-2 overflow-hidden"},C1=["innerHTML"],k1={key:2},x1={key:3,class:"infographic-mode-toggle flex items-center gap-0.5"},y1=["disabled"],b1={class:"flex items-center gap-x-1"},M1={class:"flex items-center gap-x-1"},B1={key:4},F1={key:5,class:"infographic-header-actions flex items-center"},T1=["aria-pressed"],H1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},$1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},j1=["disabled"],L1=["disabled"],P1={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},E1={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},z1={key:0,class:"infographic-source"},S1={class:"infographic-source-code text-sm font-mono whitespace-pre-wrap"},Z1={key:1,class:"relative"},V1={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},D1={class:"flex items-center gap-2 backdrop-blur rounded-lg"},N1={key:0,class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap"},Y1={class:"dialog-panel infographic-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},_1={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},se="infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",ke=Re(Ae({__name:"InfographicBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0}},emits:["copy","export","openModal"],setup(R,{emit:xe}){const l=R,{t:a}=Ge(),J=qe(),V=Je(),Q=Qe(),H=d(!1),c=d(!1),$=d(),p=d(),k=d(!0),ye=d(!1),j=d(!1),D=d(),K=d(null),L=d(!1),S=d(!1),A=d(null),P=d(typeof window>"u"||!Q.value),Ne=Ke(),x=We(e1,null);let E="";const be=T(()=>h1(l,Ne));typeof window<"u"&&B([()=>$.value,Q],([n,e])=>{var o,i,C;if((o=A.value)==null||o.destroy(),A.value=null,!e||P.value)return void(P.value=!0);if(!n)return void(P.value=!1);const f=(C=(i=V?.value.heavyBlockMargin)!=null?i:V?.value.rootMargin)!=null?C:"160px",w=J(n,{rootMargin:f,allowIdle:!1});A.value=w,P.value=w.isVisible.value,w.whenVisible.then(()=>{P.value=!0})},{immediate:!0});const z=T(()=>l.node.code),ue=T(()=>{var n;return(function(e){if(l.maxHeight==="none")return Ve(e,void 0,null);const o=ie(l.maxHeight);return Ve(e,void 0,o)})((n=ie(l.estimatedPreviewHeightPx))!=null?n:d1(z.value))}),ce=d(`${ue.value}px`),Ye=T(()=>ie(l.estimatedPreviewHeightPx)!=null);function Me(){var n;if(!p.value||Ye.value)return;const e=p.value.scrollHeight;if(e>0){const o=(n=ie((function(i){if(l.maxHeight==="none")return`${i}px`;if(l.maxHeight!=null){const f=Number.parseFloat(String(l.maxHeight));if(Number.isFinite(f))return`${Math.min(i,f)}px`}const C=p.value;if(C){const f=getComputedStyle(C).getPropertyValue("--ms-size-code-max-height").trim(),w=Number.parseFloat(f);if(Number.isFinite(w))return`${Math.min(i,w)}px`}return`${Math.min(i,500)}px`})(e)))!=null?n:e;ce.value=`${Math.max(o,ue.value)}px`}}const M=d(1),N=d(0),Y=d(0),_=d(!1),W=d({x:0,y:0}),Be=T(()=>z.value);function Fe(n){return!n||n.disabled}function h(n,e,o="top"){if(Fe(n.currentTarget))return;const i=n,C=i?.clientX!=null&&i?.clientY!=null?{x:i.clientX,y:i.clientY}:void 0;De(n.currentTarget,e,o,!1,C,l.isDark)}function v(){v1()}function Te(n){if(Fe(n.currentTarget))return;const e=H.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=n,i=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;De(n.currentTarget,e,"top",!1,i,l.isDark)}function _e(){return re(this,null,function*(){try{const n=z.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n)),H.value=!0,setTimeout(()=>{H.value=!1},1e3)}catch(n){console.error("Failed to copy:",n)}})}function He(n){(n!=="preview"||Ze())&&(ye.value=!0,k.value=n==="source")}function Ie(){var n;const e=(n=p.value)==null?void 0:n.querySelector("svg");e?(function(o){re(this,null,function*(){try{const i=new XMLSerializer().serializeToString(o),C=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(C);if(typeof document<"u"){const w=document.createElement("a");w.href=f,w.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(w),w.click(),document.body.removeChild(w)}catch{}URL.revokeObjectURL(f)}}catch(i){console.error("Failed to export SVG:",i)}})})(e):console.error("SVG element not found")}function de(n){n.key==="Escape"&&j.value&&ve()}function ve(){if(j.value=!1,D.value&&(D.value.innerHTML=""),K.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}}function Oe(){(function(){if(j.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",de)}catch{}U(()=>{if(p.value&&D.value){D.value.innerHTML="";const n=document.createElement("div");n.style.transition="transform 0.1s ease",n.style.transformOrigin="center center",n.style.width="100%",n.style.height="100%",n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center";const e=p.value.cloneNode(!0);e.classList.add("fullscreen"),e.style.height="auto",n.appendChild(e),D.value.appendChild(n),K.value=n,n.style.transform=`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}})})()}function $e(){M.value<3&&(M.value+=.1)}function je(){M.value>.5&&(M.value-=.1)}function Le(){M.value=1,N.value=0,Y.value=0}function ee(n){_.value=!0,n instanceof MouseEvent?W.value={x:n.clientX-N.value,y:n.clientY-Y.value}:W.value={x:n.touches[0].clientX-N.value,y:n.touches[0].clientY-Y.value}}function ne(n){if(!_.value)return;let e,o;n instanceof MouseEvent?(e=n.clientX,o=n.clientY):(e=n.touches[0].clientX,o=n.touches[0].clientY),N.value=e-W.value.x,Y.value=o-W.value.y}function I(){_.value=!1}let g=null,me=!1,oe=!1,G=!1,te="",q=!1,he=0;function le(n){return!q&&n===he}function Pe(n=!1){return re(this,null,function*(){var e,o;if(q||!P.value||!p.value)return;if(me)return oe=!0,void(G=G||n);const i=Be.value;if(!n&&i===te&&L.value)return;const C=l.loading===!1,f=++he;me=!0,(function(){const m=be.value;m&&E!==m&&(E&&x?.markSettled(E),E=m,x?.markPending(m))})();const w=p.value.innerHTML,pe=L.value,Xe=S.value;S.value=!1;try{const m=yield m1();if(!le(f))return;if(!m)return void console.warn("Infographic library failed to load.");const Z=p.value;if(!Z)return;g&&((e=g.destroy)==null||e.call(g),g=null),Z.innerHTML="",g=new m({container:Z,width:"100%",height:"100%"});let fe="";if((o=g.on)==null||o.call(g,"error",we=>{fe=(Array.isArray(we)?we:[we]).map(y=>{var Se;return y instanceof Error?y.message:typeof y=="string"?y:String(y&&typeof y=="object"&&"message"in y?(Se=y.message)!=null?Se:"":y??"")}).filter(Boolean).join("; ")}),g.render(z.value),fe)throw new Error(fe);if(!Z.childNodes.length)throw new Error("Infographic render returned empty output.");L.value=!0,S.value=!1,te=i,U(()=>{le(f)&&Me()})}catch(m){if(!le(f))return;C&&l.loading===!1&&i===Be.value?(console.error("Failed to render infographic:",m),L.value=!1,S.value=!0,te="",p.value&&(p.value.innerHTML=`
        Failed to render infographic: ${m instanceof Error?m.message:"Unknown error"}
        `)):(L.value=pe,S.value=Xe,pe&&p.value&&(p.value.innerHTML=w))}finally{if(me=!1,le(f))if(oe){const m=G;oe=!1,G=!1,U(()=>{Pe(m)})}else(function(){re(this,null,function*(){const m=E;m&&(E="",yield U(),(function(Z=be.value){Z&&$.value&&x?.reportHeight(Z,$.value.offsetHeight)})(m),x?.markSettled(m))})})()}})}function O(n=!1){q||!P.value||k.value||c.value||U(()=>{q||Pe(n)})}B(()=>z.value,()=>{O(!0)}),B(()=>l.loading,(n,e)=>{e&&!n&&O(!0)}),B(()=>k.value,n=>{n||O(!0)}),B(()=>c.value,n=>{n||O()}),B(()=>l.maxHeight,()=>{U(()=>{Me()})}),B([()=>l.estimatedPreviewHeightPx,()=>z.value],()=>{L.value||k.value||(ce.value=`${ue.value}px`)}),B(()=>P.value,n=>{!n||k.value||c.value||O()}),n1(()=>{!ye.value&&Ze(),O()}),o1(()=>{var n,e;if(q=!0,he+=1,oe=!1,G=!1,(n=A.value)==null||n.destroy(),A.value=null,(function(){const o=E;o&&(E="",x?.markSettled(o))})(),g&&((e=g.destroy)==null||e.call(g),g=null),te="",typeof window<"u")try{window.removeEventListener("keydown",de)}catch{}});const Ee=T(()=>!0),ae=T(()=>k.value||c.value),Ue=T(()=>k.value?"fallback":S.value?"error":L.value?"preview":"pending"),ze=T(()=>({transform:`translate(${N.value}px, ${Y.value}px) scale(${M.value})`}));return B(ze,n=>{j.value&&K.value&&(K.value.style.transform=n.transform)}),(n,e)=>(r(),u("div",{ref_key:"viewportTarget",ref:$,class:b(["infographic-block-container rounded-lg border overflow-hidden",[{"is-rendering":l.loading,dark:l.isDark}]]),"data-markstream-infographic":"1","data-markstream-mode":Ue.value},[l.showHeader?(r(),u("div",f1,[n.$slots["header-left"]?(r(),u("div",w1,[ge(n.$slots,"header-left",{},void 0,!0)])):(r(),u("div",g1,[t("span",{class:"icon-slot action-icon shrink-0",innerHTML:s(` `)},null,8,C1),e[21]||(e[21]=t("span",{class:"infographic-label font-medium font-mono truncate"},"Infographic",-1))])),n.$slots["header-center"]?(r(),u("div",k1,[ge(n.$slots,"header-center",{},void 0,!0)])):l.showModeToggle?(r(),u("div",x1,[t("button",{class:b(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[k.value?"":"is-active",Ee.value?"opacity-50 cursor-not-allowed":""]]),disabled:Ee.value,onClick:e[0]||(e[0]=()=>He("preview")),onMouseenter:e[1]||(e[1]=o=>h(o,s(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>h(o,s(a)("common.preview")||"Preview")),onMouseleave:v,onBlur:v},[t("div",b1,[e[22]||(e[22]=t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),t("circle",{cx:"12",cy:"12",r:"3"})])],-1)),t("span",null,X(s(a)("common.preview")||"Preview"),1)])],42,y1),t("button",{class:b(["infographic-mode-btn px-2 py-0.5 rounded transition-colors",[k.value?"is-active":""]]),onClick:e[3]||(e[3]=()=>He("source")),onMouseenter:e[4]||(e[4]=o=>h(o,s(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>h(o,s(a)("common.source")||"Source")),onMouseleave:v,onBlur:v},[t("div",M1,[e[23]||(e[23]=t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),t("span",null,X(s(a)("common.source")||"Source"),1)])],34)])):F("",!0),n.$slots["header-right"]?(r(),u("div",B1,[ge(n.$slots,"header-right",{},void 0,!0)])):(r(),u("div",F1,[l.showCollapseButton?(r(),u("button",{key:0,class:b(se),"aria-pressed":c.value,onClick:e[6]||(e[6]=o=>c.value=!c.value),onMouseenter:e[7]||(e[7]=o=>h(o,c.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onFocus:e[8]||(e[8]=o=>h(o,c.value?s(a)("common.expand")||"Expand":s(a)("common.collapse")||"Collapse")),onMouseleave:v,onBlur:v},[(r(),u("svg",{style:Ce({rotate:c.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[24]||(e[24]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,T1)):F("",!0),l.showCopyButton?(r(),u("button",{key:1,class:b(se),onClick:_e,onMouseenter:e[9]||(e[9]=o=>Te(o)),onFocus:e[10]||(e[10]=o=>Te(o)),onMouseleave:v,onBlur:v},[H.value?(r(),u("svg",$1,[...e[26]||(e[26]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(r(),u("svg",H1,[...e[25]||(e[25]=[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],32)):F("",!0),l.showExportButton?(r(),u("button",{key:2,class:b(`${se} ${ae.value?"opacity-50 cursor-not-allowed":""}`),disabled:ae.value,onClick:Ie,onMouseenter:e[11]||(e[11]=o=>h(o,s(a)("common.export")||"Export")),onFocus:e[12]||(e[12]=o=>h(o,s(a)("common.export")||"Export")),onMouseleave:v,onBlur:v},[...e[27]||(e[27]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,j1)):F("",!0),l.showFullscreenButton?(r(),u("button",{key:3,class:b(`${se} ${ae.value?"opacity-50 cursor-not-allowed":""}`),disabled:ae.value,onClick:Oe,onMouseenter:e[13]||(e[13]=o=>h(o,j.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onFocus:e[14]||(e[14]=o=>h(o,j.value?s(a)("common.minimize")||"Minimize":s(a)("common.open")||"Open")),onMouseleave:v,onBlur:v},[j.value?(r(),u("svg",E1,[...e[29]||(e[29]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(r(),u("svg",P1,[...e[28]||(e[28]=[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],42,L1)):F("",!0)]))])):F("",!0),t1(t("div",null,[k.value?(r(),u("div",z1,[t("pre",S1,X(z.value),1)])):(r(),u("div",Z1,[l.showZoomControls?(r(),u("div",V1,[t("div",D1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:$e,onMouseenter:e[15]||(e[15]=o=>h(o,s(a)("common.zoomIn")||"Zoom in")),onFocus:e[16]||(e[16]=o=>h(o,s(a)("common.zoomIn")||"Zoom in")),onMouseleave:v,onBlur:v},[...e[30]||(e[30]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],32),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:je,onMouseenter:e[17]||(e[17]=o=>h(o,s(a)("common.zoomOut")||"Zoom out")),onFocus:e[18]||(e[18]=o=>h(o,s(a)("common.zoomOut")||"Zoom out")),onMouseleave:v,onBlur:v},[...e[31]||(e[31]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],32),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Le,onMouseenter:e[19]||(e[19]=o=>h(o,s(a)("common.resetZoom")||"Reset zoom")),onFocus:e[20]||(e[20]=o=>h(o,s(a)("common.resetZoom")||"Reset zoom")),onMouseleave:v,onBlur:v},X(Math.round(100*M.value))+"% ",33)])])):F("",!0),t("div",{class:"infographic-preview relative transition-all overflow-hidden block",style:Ce({height:ce.value}),onMousedown:ee,onMousemove:ne,onMouseup:I,onMouseleave:I,onTouchstartPassive:ee,onTouchmovePassive:ne,onTouchendPassive:I},[L.value||S.value?F("",!0):(r(),u("pre",N1,X(z.value),1)),t("div",{class:b(["absolute inset-0 cursor-grab",{"cursor-grabbing":_.value}]),style:Ce(ze.value)},[t("div",{ref_key:"infographicContainer",ref:p,class:"w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],36)]))],512),[[l1,!c.value]]),(r(),a1(c1,{to:"body"},[t("div",{class:b(["markstream-vue",{dark:l.isDark}])},[i1(u1,{name:"infographic-dialog",appear:""},{default:r1(()=>[j.value?(r(),u("div",{key:0,class:"infographic-modal-overlay fixed inset-0 z-50 flex items-center justify-center p-4",onClick:s1(ve,["self"])},[t("div",Y1,[t("div",_1,[t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:$e},[...e[32]||(e[32]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])]),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:je},[...e[33]||(e[33]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])]),t("button",{class:"infographic-action-btn p-[var(--ms-action-btn-padding)] rounded",onClick:Le},X(Math.round(100*M.value))+"% ",1),t("button",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",onClick:ve},[...e[34]||(e[34]=[t("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])])]),t("div",{ref_key:"modalContent",ref:D,class:b(["w-full h-full flex items-center justify-center p-4 overflow-hidden",{"cursor-grab":!_.value,"cursor-grabbing":_.value}]),onMousedown:ee,onMousemove:ne,onMouseup:I,onMouseleave:I,onTouchstartPassive:ee,onTouchmovePassive:ne,onTouchendPassive:I},null,34)])])):F("",!0)]),_:1})],2)]))],10,p1))}}),[["__scopeId","data-v-de34ec4b"]]);ke.install=R=>{R.component(ke.__name,ke)};export{ke as default}; diff --git a/apps/pythinker-code/dist-web/assets/index11-Dosat3UT.js b/apps/pythinker-code/dist-web/assets/index11-HcP9dkU1.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index11-Dosat3UT.js rename to apps/pythinker-code/dist-web/assets/index11-HcP9dkU1.js index 4b6eaf165..fc4f03c50 100644 --- a/apps/pythinker-code/dist-web/assets/index11-Dosat3UT.js +++ b/apps/pythinker-code/dist-web/assets/index11-HcP9dkU1.js @@ -1,4 +1,4 @@ -import{cq as _t,bQ as _n,M as Hn,c2 as Nn,c1 as In,b$ as Yn,c0 as qn,aU as f,bl as Wn,af as Xn,bY as Vn,bE as I,az as Un,c8 as wn,aD as Zn,as as Y,aI as Kn,aL as M,u as C,aY as Rt,v as u,bk as w,bb as Ke,au as ae,t as pe,aw as Ft,bL as Gn,bB as Jn,ar as yn,bd as kn,s as Qn,I as el,bJ as tl,bO as nl,g as ll,T as rl,q as F,c7 as xn,c5 as zt,cr as ol,cs as al,ct as il,cu as ul,cv as sl,b_ as cl,cw as dl}from"./index-BK-wRR5p.js";import{i as At}from"./safeRaf-DGuzXxDK.js";function vl(d,m){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(d.slice(Math.max(0,m-12),m))}function Cn(d){return d.includes("->")||d.includes("-->")||d.includes("->>")||d.includes("-->>")||d.includes("-x")||d.includes("--x")||d.includes("-)")||d.includes("--)")||d.includes("-+")||d.includes("--+")}function fl(d){const m=d.trimStart();return/^(?:accDescr|accTitle|activate|actor|and|alt|autonumber|box|break|critical|create\s+(?:actor|participant)|deactivate|destroy|else|end|link|links|loop|Note|opt|option|par|participant|properties|rect)\b/i.test(m)||(function(y){const z=y.split(";",1)[0],a=z.indexOf(":");return a>0&&Cn(z.slice(0,a))})(m)}function ml(d){if(!d.includes(";"))return d;const m=d.indexOf(":");if(m===-1||!(function($,Q){const k=$.slice(0,Q);return/^\s*Note\b/i.test(k)||Cn(k)})(d,m))return d;const y=d.slice(0,m+1),z=d.slice(m+1),a=(function($){let Q="",k=!1;for(let P=0;P<$.length;P++){const ee=$[P];ee!==";"||vl($,P)||fl($.slice(P+1))?Q+=ee:(Q+="#59;",k=!0)}return k?Q:$})(z);return a===z?d:`${y}${a}`}function Lt(d){if(_t(d)!=="sequencediagram")return d;const m=d.split(/(\r\n|\n|\r)/);let y=!1;for(let z=0;zm in d?hl(d,m,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[m]=y,Tn=(d,m)=>{for(var y in m||(m={}))wl.call(m,y)&&Mn(d,y,m[y]);if(bn)for(var y of bn(m))yl.call(m,y)&&Mn(d,y,m[y]);return d},T=(d,m,y)=>new Promise((z,a)=>{var $=P=>{try{k(y.next(P))}catch(ee){a(ee)}},Q=P=>{try{k(y.throw(P))}catch(ee){a(ee)}},k=P=>P.done?z(P.value):Promise.resolve(P.value).then($,Q);k((y=y.apply(d,m)).next())});const xl=["data-markstream-mode","data-markstream-pending"],bl={key:0,class:"mermaid-block-header flex items-center justify-between border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]"},Ml={key:0},Tl={key:1,class:"flex items-center gap-x-2 overflow-hidden"},Cl=["innerHTML"],Bl={key:2},El={key:3,class:"mermaid-mode-toggle-group flex items-center gap-0.5"},Ol={class:"flex items-center gap-x-1"},Sl={class:"flex items-center gap-x-1"},$l={key:4},Pl={key:5,class:"mermaid-header-actions flex items-center"},Dl=["aria-pressed"],Rl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Fl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},zl=["aria-label","disabled"],Al=["aria-label","disabled"],Ll={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},jl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},_l={key:0,class:"mermaid-source-panel"},Hl={class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap"},Nl={key:1,class:"relative"},Il={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Yl={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ql={class:"dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},Wl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},pt="mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded",jt=_n(Hn({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!0},onRenderError:{}},emits:["copy","export","openModal","toggleMode"],setup(d,{emit:m}){var y,z;const a=d,$=m,Q={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},k=f(!1),P=f(typeof window>"u"),ee=Nn(),Ht=In(),Le=F(()=>a.isStrict?"strict":"loose"),Bn=F(()=>({startOnLoad:!1,securityLevel:Le.value,dompurifyConfig:Le.value==="strict"?Q:void 0,flowchart:Le.value==="strict"?{htmlLabels:!1}:void 0}));function we(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function Ee(e,t,n={}){if(!e)return null;const l=(function(r,o){if(!r)return null;const c=sl(o);if(!c)return null;const h=(function(i,s){const p=Array.from(i.childNodes),E=document.createElement("div");return E.dataset.mermaidSvgLayer="1",E.style.zIndex="1",E.appendChild(s),i.insertBefore(E,i.firstChild),p.length>0&&(function(W){const j=()=>{var X;for(const J of W)(X=J.parentNode)==null||X.removeChild(J)};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{requestAnimationFrame(j)}):setTimeout(j,32)})(p),E})(r,c);return{svg:c.outerHTML,bindTarget:h}})(e,t);return l||n.keepPreviousOnFailure||we(e),l}let ie=null;function ye(e){if(a.enableMermaidInteractions&&e?.querySelector("svg"))try{ie?.(e)}catch{}}const{t:g}=Yn();let ue=!1,ke=0;function Ge(){return T(this,null,function*(){try{const e=yield il();return ue?null:(k.value=!!e,e)}catch(e){throw ue||(k.value=!1),e}finally{ue||(P.value=!0)}})}const Je=f(!1),V=f(!1),Qe=f(),Z=f(),v=f(),se=f(),et=f(null),En=qn(),je=f(null),xe=f(typeof window>"u"||!ee.value),On=Wn(),te=Xn(Vn,null);let ce="",be=0,tt=0;const Nt=F(()=>cl(a,On));function wt(){const e=Nt.value;e&&(ce&&ce!==e&&(te?.markSettled(ce),be=0),ce=e,be+=1,tt+=1,be===1&&te?.markPending(e))}function yt(){return T(this,null,function*(){const e=ce;if(!e||(be=Math.max(0,be-1),be>0))return;ce="";const t=++tt;yield Y(),t===tt&&((function(n=Nt.value){n&&Qe.value&&te?.reportHeight(n,Qe.value.offsetHeight)})(e),te?.markSettled(e))})}function It(){const e=ce;e&&(ce="",be=0,tt+=1,te?.markSettled(e))}const Yt=f(),D=F(()=>a.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function Sn(e,t=D.value){const n=t,l={theme:e==="dark"?"dark":"default"};Le.value==="strict"&&(l.flowchart={htmlLabels:!1});const r=`%%{init: ${JSON.stringify(l)}}%% +import{cq as _t,bQ as _n,M as Hn,c2 as Nn,c1 as In,b$ as Yn,c0 as qn,aU as f,bl as Wn,af as Xn,bY as Vn,bE as I,az as Un,c8 as wn,aD as Zn,as as Y,aI as Kn,aL as M,u as C,aY as Rt,v as u,bk as w,bb as Ke,au as ae,t as pe,aw as Ft,bL as Gn,bB as Jn,ar as yn,bd as kn,s as Qn,I as el,bJ as tl,bO as nl,g as ll,T as rl,q as F,c7 as xn,c5 as zt,cr as ol,cs as al,ct as il,cu as ul,cv as sl,b_ as cl,cw as dl}from"./index-C0iEUKAq.js";import{i as At}from"./safeRaf-DGuzXxDK.js";function vl(d,m){return/(?:&#\d+|#\d+|&[a-z]+)$/i.test(d.slice(Math.max(0,m-12),m))}function Cn(d){return d.includes("->")||d.includes("-->")||d.includes("->>")||d.includes("-->>")||d.includes("-x")||d.includes("--x")||d.includes("-)")||d.includes("--)")||d.includes("-+")||d.includes("--+")}function fl(d){const m=d.trimStart();return/^(?:accDescr|accTitle|activate|actor|and|alt|autonumber|box|break|critical|create\s+(?:actor|participant)|deactivate|destroy|else|end|link|links|loop|Note|opt|option|par|participant|properties|rect)\b/i.test(m)||(function(y){const z=y.split(";",1)[0],a=z.indexOf(":");return a>0&&Cn(z.slice(0,a))})(m)}function ml(d){if(!d.includes(";"))return d;const m=d.indexOf(":");if(m===-1||!(function($,Q){const k=$.slice(0,Q);return/^\s*Note\b/i.test(k)||Cn(k)})(d,m))return d;const y=d.slice(0,m+1),z=d.slice(m+1),a=(function($){let Q="",k=!1;for(let P=0;P<$.length;P++){const ee=$[P];ee!==";"||vl($,P)||fl($.slice(P+1))?Q+=ee:(Q+="#59;",k=!0)}return k?Q:$})(z);return a===z?d:`${y}${a}`}function Lt(d){if(_t(d)!=="sequencediagram")return d;const m=d.split(/(\r\n|\n|\r)/);let y=!1;for(let z=0;zm in d?hl(d,m,{enumerable:!0,configurable:!0,writable:!0,value:y}):d[m]=y,Tn=(d,m)=>{for(var y in m||(m={}))wl.call(m,y)&&Mn(d,y,m[y]);if(bn)for(var y of bn(m))yl.call(m,y)&&Mn(d,y,m[y]);return d},T=(d,m,y)=>new Promise((z,a)=>{var $=P=>{try{k(y.next(P))}catch(ee){a(ee)}},Q=P=>{try{k(y.throw(P))}catch(ee){a(ee)}},k=P=>P.done?z(P.value):Promise.resolve(P.value).then($,Q);k((y=y.apply(d,m)).next())});const xl=["data-markstream-mode","data-markstream-pending"],bl={key:0,class:"mermaid-block-header flex items-center justify-between border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]"},Ml={key:0},Tl={key:1,class:"flex items-center gap-x-2 overflow-hidden"},Cl=["innerHTML"],Bl={key:2},El={key:3,class:"mermaid-mode-toggle-group flex items-center gap-0.5"},Ol={class:"flex items-center gap-x-1"},Sl={class:"flex items-center gap-x-1"},$l={key:4},Pl={key:5,class:"mermaid-header-actions flex items-center"},Dl=["aria-pressed"],Rl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Fl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},zl=["aria-label","disabled"],Al=["aria-label","disabled"],Ll={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},jl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},_l={key:0,class:"mermaid-source-panel"},Hl={class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap"},Nl={key:1,class:"relative"},Il={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Yl={class:"flex items-center gap-2 backdrop-blur rounded-lg"},ql={class:"dialog-panel mermaid-modal-panel relative w-full h-full max-w-full max-h-full rounded overflow-hidden"},Wl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},pt="mermaid-action-btn p-[var(--ms-action-btn-padding)] rounded",jt=_n(Hn({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:void 0},estimatedPreviewHeightPx:{},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!0},onRenderError:{}},emits:["copy","export","openModal","toggleMode"],setup(d,{emit:m}){var y,z;const a=d,$=m,Q={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},k=f(!1),P=f(typeof window>"u"),ee=Nn(),Ht=In(),Le=F(()=>a.isStrict?"strict":"loose"),Bn=F(()=>({startOnLoad:!1,securityLevel:Le.value,dompurifyConfig:Le.value==="strict"?Q:void 0,flowchart:Le.value==="strict"?{htmlLabels:!1}:void 0}));function we(e){if(e)try{e.replaceChildren()}catch{e.innerHTML=""}}function Ee(e,t,n={}){if(!e)return null;const l=(function(r,o){if(!r)return null;const c=sl(o);if(!c)return null;const h=(function(i,s){const p=Array.from(i.childNodes),E=document.createElement("div");return E.dataset.mermaidSvgLayer="1",E.style.zIndex="1",E.appendChild(s),i.insertBefore(E,i.firstChild),p.length>0&&(function(W){const j=()=>{var X;for(const J of W)(X=J.parentNode)==null||X.removeChild(J)};typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{requestAnimationFrame(j)}):setTimeout(j,32)})(p),E})(r,c);return{svg:c.outerHTML,bindTarget:h}})(e,t);return l||n.keepPreviousOnFailure||we(e),l}let ie=null;function ye(e){if(a.enableMermaidInteractions&&e?.querySelector("svg"))try{ie?.(e)}catch{}}const{t:g}=Yn();let ue=!1,ke=0;function Ge(){return T(this,null,function*(){try{const e=yield il();return ue?null:(k.value=!!e,e)}catch(e){throw ue||(k.value=!1),e}finally{ue||(P.value=!0)}})}const Je=f(!1),V=f(!1),Qe=f(),Z=f(),v=f(),se=f(),et=f(null),En=qn(),je=f(null),xe=f(typeof window>"u"||!ee.value),On=Wn(),te=Xn(Vn,null);let ce="",be=0,tt=0;const Nt=F(()=>cl(a,On));function wt(){const e=Nt.value;e&&(ce&&ce!==e&&(te?.markSettled(ce),be=0),ce=e,be+=1,tt+=1,be===1&&te?.markPending(e))}function yt(){return T(this,null,function*(){const e=ce;if(!e||(be=Math.max(0,be-1),be>0))return;ce="";const t=++tt;yield Y(),t===tt&&((function(n=Nt.value){n&&Qe.value&&te?.reportHeight(n,Qe.value.offsetHeight)})(e),te?.markSettled(e))})}function It(){const e=ce;e&&(ce="",be=0,tt+=1,te?.markSettled(e))}const Yt=f(),D=F(()=>a.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode"));function Sn(e,t=D.value){const n=t,l={theme:e==="dark"?"dark":"default"};Le.value==="strict"&&(l.flowchart={htmlLabels:!1});const r=`%%{init: ${JSON.stringify(l)}}%% `;return n.trim().startsWith("%%{")?n:r+n}function qt(){var e;return(function(t){const n=(function(){var r;const o=Z.value?getComputedStyle(Z.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";return(r=zt(o))!=null?r:360})(),l=un();return ol(t,n,l)})((e=zt(a.estimatedPreviewHeightPx))!=null?e:al(D.value))}function Wt(){return`${qt()}px`}const _e=f(null);function kt(){var e;return!!((e=v.value)!=null&&e.querySelector("svg"))}function Xt(){return a.loading!==!1&&(kt()||!!_e.value)}const B=f(1),_=f(0),H=f(0),nt=f(!1),lt=f({x:0,y:0}),x=f(!0),rt=f(!1),re=f(!1),de=f(null);let xt="",bt=!1,ve="";const ot=f(0),Mt=f(!1),$n=F(()=>{var e;return Math.max(0,(e=a.renderDebounceMs)!=null?e:300)}),Pn=F(()=>{var e;return Math.max(0,(e=a.contentStableDelayMs)!=null?e:500)}),He=F(()=>{var e;return Math.max(120,(e=a.previewPollDelayMs)!=null?e:800)}),Dn=F(()=>{var e;return Math.max(He.value,(e=a.previewPollMaxDelayMs)!=null?e:4e3)}),Vt=F(()=>{var e;return Math.max(1,Math.trunc((e=a.previewPollMaxAttempts)!=null?e:12))}),fe=F(()=>a.loading!==!1);let Ne=null,Ie=null,Oe=null,Se=null,Ye=0;const Ut=(y=globalThis.requestIdleCallback)!=null?y:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16),Zt=(z=globalThis.cancelIdleCallback)!=null?z:e=>clearTimeout(e);function b(e=ke){return!ue&&e===ke}function A(){return b()&&xe.value&&!V.value}function Tt(){Oe!=null&&(globalThis.clearTimeout(Oe),Oe=null),Se!=null&&(Zt(Se),Se=null)}function qe(){ue||Oe==null&&Se==null&&(Oe=globalThis.setTimeout(()=>{Oe=null,A()&&(Se=Ut(()=>{Se=null,A()&&gn()},{timeout:500}))},$n.value))}function We(){Ie!=null&&(globalThis.clearTimeout(Ie),Ie=null)}function Kt(e=600){if(typeof globalThis>"u"||ue)return;const t=Math.max(0,e);We(),Ie=globalThis.setTimeout(()=>{if(Ie=null,!ue){if(a.loading||re.value||!A())return void Kt(Math.min(1200,Math.max(300,1.2*t)));qe()}},t)}const q=f(Wt()),at=f(q.value);let $e=null;const O=f(!1),K=f(!1),me=f({}),he=f(0);let U=null,Pe=null;const N=f(!1),Rn=F(()=>{var e,t;return!(V.value||x.value||P.value&&!re.value&&!de.value&&(O.value||N.value&&((t=(e=v.value)==null?void 0:e.textContent)!=null&&t.trim())))}),Me=f({zoom:1,translateX:0,translateY:0,containerHeight:q.value}),Gt=F(()=>a.enableWheelZoom?{wheel:Fn}:{}),G=F(()=>{var e,t,n,l;return{worker:(e=a.workerTimeoutMs)!=null?e:1400,parse:(t=a.parseTimeoutMs)!=null?t:1800,render:(n=a.renderTimeoutMs)!=null?n:2500,fullRender:(l=a.fullRenderTimeoutMs)!=null?l:4e3}});let De=null,it=null,Re=!1,Te=He.value,ne=null,ut=0,Ct=!0,st=0;function Ce(e,t){const n=t?.timeoutMs,l=t?.signal;if(l?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let r=null,o=!1,c=null;return new Promise((h,i)=>{const s=()=>{r!=null&&clearTimeout(r),c&&l&&l.removeEventListener("abort",c)};n&&n>0&&(r=globalThis.setTimeout(()=>{o||(o=!0,s(),i(new Error("Operation timed out")))},n)),l&&(c=()=>{o||(o=!0,s(),i(new DOMException("Aborted","AbortError")))},l.addEventListener("abort",c)),e().then(p=>{o||(o=!0,s(),h(p))}).catch(p=>{o||(o=!0,s(),i(p))})})}function Jt(e){if(typeof document>"u"||!v.value)return;if(typeof a.onRenderError=="function"&&a.onRenderError(e,D.value,v.value)===!0)return N.value=!0,void L();const t=document.createElement("div");t.style.padding="var(--ms-inset-panel-body)",t.style.color="hsl(var(--ms-destructive))",t.textContent="Failed to render diagram: ";const n=document.createElement("span");n.textContent=e instanceof Error?e.message:"Unknown error",t.appendChild(n),we(v.value),v.value.appendChild(t);const l=v.value?getComputedStyle(v.value).getPropertyValue("--ms-size-diagram-min-height").trim():"";q.value=l||"360px",at.value=q.value,N.value=!0,L()}function Qt(e){const t=typeof e=="string"?e:typeof e?.message=="string"?e.message:"";return typeof t=="string"&&/timed out/i.test(t)}function en(e){return e?.name==="AbortError"}function Bt(e){return!Qt(e)&&!en(e)}typeof window<"u"&&I([()=>Qe.value,ee],([e,t])=>{var n;if((n=je.value)==null||n.destroy(),je.value=null,!t||xe.value)return void(xe.value=!0);if(!e)return void(xe.value=!1);const l=En(e,{rootMargin:Ht?.value.heavyBlockMargin,allowIdle:!1});je.value=l,xe.value=l.isVisible.value,l.whenVisible.then(()=>{xe.value=!0})},{immediate:!0}),Un(()=>{var e;ue=!0,ke+=1,he.value+=1,(e=je.value)==null||e.destroy(),je.value=null,It(),Tt()});const ct=F(()=>a.showTooltips!==!1);function tn(e){return!e||e.disabled}function R(e,t,n="top"){if(!ct.value||tn(e.currentTarget))return;const l=e,r=l?.clientX!=null&&l?.clientY!=null?{x:l.clientX,y:l.clientY}:void 0;xn(e.currentTarget,t,n,!1,r,a.isDark)}function S(){ct.value&&wn()}function nn(e){if(!ct.value||tn(e.currentTarget))return;const t=Je.value?g("common.copied")||"Copied":g("common.copy")||"Copy",n=e,l=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;xn(e.currentTarget,t,"top",!1,l,a.isDark)}function ln(e,t){const n={theme:t==="dark"?"dark":"default"};Le.value==="strict"&&(n.flowchart={htmlLabels:!1});const l=`%%{init: ${JSON.stringify(n)}}%% `;return e.trimStart().startsWith("%%{")?e:l+e}function dt(){return Ct&&!x.value&&!O.value&&!N.value}function rn(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function Et(e){if(_t(e)==="gantt")return(function(n){var l;const r=n.split(/\r?\n/);for(!/\r?\n$/.test(n)&&r.length>0&&r.pop();r.length>0;){const o=(l=r[r.length-1])==null?void 0:l.trim();if(o&&!o.startsWith("%%")){if(rn(o))break;r.pop()}else r.pop()}return r.some(rn)?r.join(` `):""})(e);const t=e.split(/\r?\n/);for(;t.length>0;){const n=t[t.length-1].trimEnd();if(n!==""){if(!(/^[-=~>|<\s]+$/.test(n.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(n)||/[-|><]$/.test(n)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(n)))break;t.pop()}else t.pop()}return t.join(` diff --git a/apps/pythinker-code/dist-web/assets/index5-D2VkNHFs.js b/apps/pythinker-code/dist-web/assets/index5-CFutgKd9.js similarity index 95% rename from apps/pythinker-code/dist-web/assets/index5-D2VkNHFs.js rename to apps/pythinker-code/dist-web/assets/index5-CFutgKd9.js index c7fddd632..b2afbbe01 100644 --- a/apps/pythinker-code/dist-web/assets/index5-D2VkNHFs.js +++ b/apps/pythinker-code/dist-web/assets/index5-CFutgKd9.js @@ -1 +1 @@ -import c from"./CodeBlockNode-DRvGmu0B.js";import{M as v,bl as g,aL as P,s as C,A as b,bJ as i,aY as d,av as k,a4 as x,ar as S,bk as T,q as O}from"./index-BK-wRR5p.js";import"./safeRaf-DGuzXxDK.js";var H=Object.defineProperty,z=Object.defineProperties,j=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,m=(o,s,e)=>s in o?H(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;const h=v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},autoScrollOnUpdate:{type:Boolean},autoScrollInitial:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(o,{emit:s}){const e=o,p=s,w=c,f=g(),y=O(()=>{return t=((a,n)=>{for(var r in n||(n={}))F.call(n,r)&&m(a,r,n[r]);if(u)for(var r of u(n))W.call(n,r)&&m(a,r,n[r]);return a})({},f),l={node:e.node,loading:e.loading,stream:e.stream,darkTheme:e.darkTheme,lightTheme:e.lightTheme,isDark:e.isDark,isShowPreview:e.isShowPreview,enableFontSizeControl:e.enableFontSizeControl,minWidth:e.minWidth,maxWidth:e.maxWidth,themes:e.themes,showHeader:e.showHeader,showCopyButton:e.showCopyButton,showExpandButton:e.showExpandButton,showPreviewButton:e.showPreviewButton,showCollapseButton:e.showCollapseButton,showFontSizeButtons:e.showFontSizeButtons,showTooltips:e.showTooltips,estimatedHeightPx:e.estimatedHeightPx,estimatedContentHeightPx:e.estimatedContentHeightPx},z(t,j(l));var t,l});function B(t){p("previewCode",{type:t.artifactType,content:e.node.code,title:t.artifactTitle})}return(t,l)=>(P(),C(T(w),S(y.value,{onPreviewCode:B,onCopy:l[0]||(l[0]=a=>p("copy",a))}),b({_:2},[t.$slots["header-left"]?{name:"header-left",fn:i(()=>[d(t.$slots,"header-left")]),key:"0"}:void 0,t.$slots["header-right"]?{name:"header-right",fn:i(()=>[d(t.$slots,"header-right")]),key:"1"}:void 0,t.$slots.loading?{name:"loading",fn:i(a=>[d(t.$slots,"loading",k(x(a)))]),key:"2"}:void 0]),1040))}});h.install=o=>{o.component(h.__name,h)};export{h as default}; +import c from"./CodeBlockNode-BWayTGpE.js";import{M as v,bl as g,aL as P,s as C,A as b,bJ as i,aY as d,av as k,a4 as x,ar as S,bk as T,q as O}from"./index-C0iEUKAq.js";import"./safeRaf-DGuzXxDK.js";var H=Object.defineProperty,z=Object.defineProperties,j=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,m=(o,s,e)=>s in o?H(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;const h=v({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},autoScrollOnUpdate:{type:Boolean},autoScrollInitial:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{},themes:{},langs:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0}},emits:["previewCode","copy"],setup(o,{emit:s}){const e=o,p=s,w=c,f=g(),y=O(()=>{return t=((a,n)=>{for(var r in n||(n={}))F.call(n,r)&&m(a,r,n[r]);if(u)for(var r of u(n))W.call(n,r)&&m(a,r,n[r]);return a})({},f),l={node:e.node,loading:e.loading,stream:e.stream,darkTheme:e.darkTheme,lightTheme:e.lightTheme,isDark:e.isDark,isShowPreview:e.isShowPreview,enableFontSizeControl:e.enableFontSizeControl,minWidth:e.minWidth,maxWidth:e.maxWidth,themes:e.themes,showHeader:e.showHeader,showCopyButton:e.showCopyButton,showExpandButton:e.showExpandButton,showPreviewButton:e.showPreviewButton,showCollapseButton:e.showCollapseButton,showFontSizeButtons:e.showFontSizeButtons,showTooltips:e.showTooltips,estimatedHeightPx:e.estimatedHeightPx,estimatedContentHeightPx:e.estimatedContentHeightPx},z(t,j(l));var t,l});function B(t){p("previewCode",{type:t.artifactType,content:e.node.code,title:t.artifactTitle})}return(t,l)=>(P(),C(T(w),S(y.value,{onPreviewCode:B,onCopy:l[0]||(l[0]=a=>p("copy",a))}),b({_:2},[t.$slots["header-left"]?{name:"header-left",fn:i(()=>[d(t.$slots,"header-left")]),key:"0"}:void 0,t.$slots["header-right"]?{name:"header-right",fn:i(()=>[d(t.$slots,"header-right")]),key:"1"}:void 0,t.$slots.loading?{name:"loading",fn:i(a=>[d(t.$slots,"loading",k(x(a)))]),key:"2"}:void 0]),1040))}});h.install=o=>{o.component(h.__name,h)};export{h as default}; diff --git a/apps/pythinker-code/dist-web/assets/index6-DUfXjQxg.js b/apps/pythinker-code/dist-web/assets/index6-CkL1tSTM.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/index6-DUfXjQxg.js rename to apps/pythinker-code/dist-web/assets/index6-CkL1tSTM.js index bec5891ee..dec7337c1 100644 --- a/apps/pythinker-code/dist-web/assets/index6-DUfXjQxg.js +++ b/apps/pythinker-code/dist-web/assets/index6-CkL1tSTM.js @@ -1 +1 @@ -import{bQ as Q,M as Y,af as Z,bY as G,a0 as ee,bS as ne,bT as A,aU as _,bZ as te,bE as P,aD as ae,az as le,aL as I,u as O,I as oe,bJ as re,t as ie,v as ue,g as se,au as F,bb as ce,aw as de,q as X,bU as ve,as as j,bV as fe,bW as me,bX as he,b_ as ge}from"./index-BK-wRR5p.js";var q=(S,B,b)=>new Promise((t,s)=>{var i=c=>{try{T(b.next(c))}catch(d){s(d)}},k=c=>{try{T(b.throw(c))}catch(d){s(d)}},T=c=>c.done?t(c.value):Promise.resolve(c.value).then(i,k);T((b=b.apply(S,B)).next())});const pe=["data-markstream-mode","data-markstream-pending"],ye={key:0,class:"math-loading-overlay"},be=["innerHTML"],ke={key:1,class:"math-block__fallback text-left"},N=Q(Y({__name:"MathBlockNode",props:{node:{},indexKey:{},cacheScope:{}},setup(S){var B,b;const t=S,s=_(null),i=Z(G,null),k=X(()=>ve(t.node.content)),T=((b=(B=ee())==null?void 0:B.vnode.el)==null?void 0:b.nodeType)===1,c=X(()=>ge(t,{})),d=(function(){if(!t.node.content)return{html:"",text:t.node.raw,loading:!1};if(t.node.loading)return{html:"",text:"",loading:!0};const e=ne();if(!e){const n=typeof window>"u"||T;return{html:"",text:n?t.node.raw:"",loading:!n}}try{const n=e.renderToString(k.value,{throwOnError:!1,displayMode:!0});return A(k.value,!0,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:t.node.loading?"":t.node.raw,loading:t.node.loading}}})(),u=_(d.html),f=_(d.text);let E=!1,x=0,v=!1,$=null;const m=te();let R=null,h="";const g=_(d.loading),K=_(!1),p=_(D());function H(e){e!=null&&e!==x||(K.value=!1)}function W(){var e;if(t.indexKey==null)return"";const n=(e=t.cacheScope)!=null?e:m?.scope;return`${n!=null&&String(n).length>0?`${String(n)}:`:""}math-block:${String(t.indexKey)}`}function D(){var e;const n=W();return n&&(e=m?.cache.get(n))!=null?e:0}function M(){if(p.value===0)return;p.value=0;const e=W();e&&m?.cache.set(e,0)}function L(e){if(u.value)return void M();if(!Number.isFinite(e)||e<=0)return;const n=Math.max(p.value,e);if(n===p.value)return;p.value=n;const a=W();a&&m?.cache.set(a,n)}function w(){j(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)})}function z(){const e=h;i&&e&&(h="",i.markSettled(e))}function U(){return q(this,null,function*(){if(v)return z(),void H();$&&($.abort(),$=null);const e=++x;if(!t.node.content)return z(),H(),g.value=!1,u.value="",f.value=t.node.raw,E=!1,void w();const n=new AbortController;$=n,K.value=!0,v||e!==x||n.signal.aborted?v||H(e):((function(){const a=c.value;i&&a&&h!==a&&(h&&i.markSettled(h),h=a,i.markPending(a))})(),fe(k.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:8,signal:n.signal}).then(a=>{v||e!==x||(u.value=a,f.value="",E=!0,g.value=!1,M(),w())}).catch(a=>q(null,null,function*(){if(v||e!==x)return;const r=a?.code||a?.name,l=r==="KATEX_DISABLED";if(r==="WORKER_INIT_ERROR"||a?.fallbackToRenderer||(r===me||r==="WORKER_TIMEOUT")&&!t.node.loading){const o=yield he();if(v||e!==x)return;if(o){try{const y=o.renderToString(k.value,{throwOnError:t.node.loading,displayMode:!0});u.value=y,f.value="",E=!0,g.value=!1,M(),w(),A(k.value,!0,y)}catch{}return}}if(l||!t.node.loading)return g.value=!1,u.value="",f.value=t.node.raw,void w();E||(g.value=!0)})).finally(()=>{v||e!==x||(H(e),(function(){const a=h;i&&a&&(h="",j(()=>{var r,l;if(!v){const o=(l=(r=s.value)==null?void 0:r.offsetHeight)!=null?l:0;o>0&&i.reportHeight(a,o)}i.markSettled(a)}))})())}))})}d.html&&(E=!0),d.html&&M();const J=[{family:"$$",open:"$$",close:"$$"},{family:"\\[]",open:"\\[",close:"\\]"},{family:"\\[]",open:"\\[",close:"]"},{family:"[]",open:"[",close:"\\]"},{family:"[]",open:"[",close:"]"},{family:"\\()",open:"\\(",close:"\\)"},{family:"$",open:"$",close:"$"}];function V(e,n){return(function(r){const l=String(r??"");for(const{family:o,open:y,close:C}of J)if((y!=="$"||!l.startsWith("$$")&&!l.endsWith("$$"))&&l.length>=y.length+C.length&&l.startsWith(y)&&l.endsWith(C))return{family:o,inner:l.slice(y.length,l.length-C.length),trusted:!0};return null})(e)||{family:"content",inner:String(n??""),trusted:!1}}return P(()=>[t.node.content,t.node.loading,t.node.raw],([e,,n],[a,,r])=>{var l,o;l=V(r,a),o=V(n,e),l.inner===""||l.family===o.family&&(l.trusted&&o.trusted?o.inner.startsWith(l.inner):o.inner===l.inner)||M(),U()},{flush:"post"}),P([()=>t.indexKey,()=>t.cacheScope],()=>{p.value=D(),w()}),ae(()=>{typeof ResizeObserver<"u"&&s.value&&(R=new ResizeObserver(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)}),R.observe(s.value)),w(),u.value||U()}),le(()=>{v=!0,z(),$&&($.abort(),$=null),R?.disconnect(),R=null}),(e,n)=>(I(),O("div",{ref_key:"containerEl",ref:s,class:"math-block text-center overflow-x-auto relative","data-markstream-math":"block","data-markstream-mode":u.value?"katex":f.value?"fallback":"loading","data-markstream-pending":K.value?"true":void 0,style:de(p.value?{minHeight:`${p.value}px`}:void 0)},[oe(se,{name:"math-fade"},{default:re(()=>[!g.value||u.value||f.value?ie("",!0):(I(),O("div",ye,[...n[0]||(n[0]=[ue("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),u.value?(I(),O("div",{key:0,class:F(["math-block__content",{"math-rendering":g.value}]),innerHTML:u.value},null,10,be)):f.value?(I(),O("pre",ke,ce(f.value),1)):(I(),O("div",{key:2,class:F(["math-block__content",{"math-rendering":g.value}])},null,2))],12,pe))}}),[["__scopeId","data-v-939191ad"]]);N.install=S=>{S.component(N.__name,N)};export{N as default}; +import{bQ as Q,M as Y,af as Z,bY as G,a0 as ee,bS as ne,bT as A,aU as _,bZ as te,bE as P,aD as ae,az as le,aL as I,u as O,I as oe,bJ as re,t as ie,v as ue,g as se,au as F,bb as ce,aw as de,q as X,bU as ve,as as j,bV as fe,bW as me,bX as he,b_ as ge}from"./index-C0iEUKAq.js";var q=(S,B,b)=>new Promise((t,s)=>{var i=c=>{try{T(b.next(c))}catch(d){s(d)}},k=c=>{try{T(b.throw(c))}catch(d){s(d)}},T=c=>c.done?t(c.value):Promise.resolve(c.value).then(i,k);T((b=b.apply(S,B)).next())});const pe=["data-markstream-mode","data-markstream-pending"],ye={key:0,class:"math-loading-overlay"},be=["innerHTML"],ke={key:1,class:"math-block__fallback text-left"},N=Q(Y({__name:"MathBlockNode",props:{node:{},indexKey:{},cacheScope:{}},setup(S){var B,b;const t=S,s=_(null),i=Z(G,null),k=X(()=>ve(t.node.content)),T=((b=(B=ee())==null?void 0:B.vnode.el)==null?void 0:b.nodeType)===1,c=X(()=>ge(t,{})),d=(function(){if(!t.node.content)return{html:"",text:t.node.raw,loading:!1};if(t.node.loading)return{html:"",text:"",loading:!0};const e=ne();if(!e){const n=typeof window>"u"||T;return{html:"",text:n?t.node.raw:"",loading:!n}}try{const n=e.renderToString(k.value,{throwOnError:!1,displayMode:!0});return A(k.value,!0,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:t.node.loading?"":t.node.raw,loading:t.node.loading}}})(),u=_(d.html),f=_(d.text);let E=!1,x=0,v=!1,$=null;const m=te();let R=null,h="";const g=_(d.loading),K=_(!1),p=_(D());function H(e){e!=null&&e!==x||(K.value=!1)}function W(){var e;if(t.indexKey==null)return"";const n=(e=t.cacheScope)!=null?e:m?.scope;return`${n!=null&&String(n).length>0?`${String(n)}:`:""}math-block:${String(t.indexKey)}`}function D(){var e;const n=W();return n&&(e=m?.cache.get(n))!=null?e:0}function M(){if(p.value===0)return;p.value=0;const e=W();e&&m?.cache.set(e,0)}function L(e){if(u.value)return void M();if(!Number.isFinite(e)||e<=0)return;const n=Math.max(p.value,e);if(n===p.value)return;p.value=n;const a=W();a&&m?.cache.set(a,n)}function w(){j(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)})}function z(){const e=h;i&&e&&(h="",i.markSettled(e))}function U(){return q(this,null,function*(){if(v)return z(),void H();$&&($.abort(),$=null);const e=++x;if(!t.node.content)return z(),H(),g.value=!1,u.value="",f.value=t.node.raw,E=!1,void w();const n=new AbortController;$=n,K.value=!0,v||e!==x||n.signal.aborted?v||H(e):((function(){const a=c.value;i&&a&&h!==a&&(h&&i.markSettled(h),h=a,i.markPending(a))})(),fe(k.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:8,signal:n.signal}).then(a=>{v||e!==x||(u.value=a,f.value="",E=!0,g.value=!1,M(),w())}).catch(a=>q(null,null,function*(){if(v||e!==x)return;const r=a?.code||a?.name,l=r==="KATEX_DISABLED";if(r==="WORKER_INIT_ERROR"||a?.fallbackToRenderer||(r===me||r==="WORKER_TIMEOUT")&&!t.node.loading){const o=yield he();if(v||e!==x)return;if(o){try{const y=o.renderToString(k.value,{throwOnError:t.node.loading,displayMode:!0});u.value=y,f.value="",E=!0,g.value=!1,M(),w(),A(k.value,!0,y)}catch{}return}}if(l||!t.node.loading)return g.value=!1,u.value="",f.value=t.node.raw,void w();E||(g.value=!0)})).finally(()=>{v||e!==x||(H(e),(function(){const a=h;i&&a&&(h="",j(()=>{var r,l;if(!v){const o=(l=(r=s.value)==null?void 0:r.offsetHeight)!=null?l:0;o>0&&i.reportHeight(a,o)}i.markSettled(a)}))})())}))})}d.html&&(E=!0),d.html&&M();const J=[{family:"$$",open:"$$",close:"$$"},{family:"\\[]",open:"\\[",close:"\\]"},{family:"\\[]",open:"\\[",close:"]"},{family:"[]",open:"[",close:"\\]"},{family:"[]",open:"[",close:"]"},{family:"\\()",open:"\\(",close:"\\)"},{family:"$",open:"$",close:"$"}];function V(e,n){return(function(r){const l=String(r??"");for(const{family:o,open:y,close:C}of J)if((y!=="$"||!l.startsWith("$$")&&!l.endsWith("$$"))&&l.length>=y.length+C.length&&l.startsWith(y)&&l.endsWith(C))return{family:o,inner:l.slice(y.length,l.length-C.length),trusted:!0};return null})(e)||{family:"content",inner:String(n??""),trusted:!1}}return P(()=>[t.node.content,t.node.loading,t.node.raw],([e,,n],[a,,r])=>{var l,o;l=V(r,a),o=V(n,e),l.inner===""||l.family===o.family&&(l.trusted&&o.trusted?o.inner.startsWith(l.inner):o.inner===l.inner)||M(),U()},{flush:"post"}),P([()=>t.indexKey,()=>t.cacheScope],()=>{p.value=D(),w()}),ae(()=>{typeof ResizeObserver<"u"&&s.value&&(R=new ResizeObserver(()=>{var e,n;L((n=(e=s.value)==null?void 0:e.offsetHeight)!=null?n:0)}),R.observe(s.value)),w(),u.value||U()}),le(()=>{v=!0,z(),$&&($.abort(),$=null),R?.disconnect(),R=null}),(e,n)=>(I(),O("div",{ref_key:"containerEl",ref:s,class:"math-block text-center overflow-x-auto relative","data-markstream-math":"block","data-markstream-mode":u.value?"katex":f.value?"fallback":"loading","data-markstream-pending":K.value?"true":void 0,style:de(p.value?{minHeight:`${p.value}px`}:void 0)},[oe(se,{name:"math-fade"},{default:re(()=>[!g.value||u.value||f.value?ie("",!0):(I(),O("div",ye,[...n[0]||(n[0]=[ue("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),u.value?(I(),O("div",{key:0,class:F(["math-block__content",{"math-rendering":g.value}]),innerHTML:u.value},null,10,be)):f.value?(I(),O("pre",ke,ce(f.value),1)):(I(),O("div",{key:2,class:F(["math-block__content",{"math-rendering":g.value}])},null,2))],12,pe))}}),[["__scopeId","data-v-939191ad"]]);N.install=S=>{S.component(N.__name,N)};export{N as default}; diff --git a/apps/pythinker-code/dist-web/assets/index7-ptJtrPOf.js b/apps/pythinker-code/dist-web/assets/index7-CvZQjD-I.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/index7-ptJtrPOf.js rename to apps/pythinker-code/dist-web/assets/index7-CvZQjD-I.js index 21294bf32..af2635e77 100644 --- a/apps/pythinker-code/dist-web/assets/index7-ptJtrPOf.js +++ b/apps/pythinker-code/dist-web/assets/index7-CvZQjD-I.js @@ -1 +1 @@ -import{bQ as C,M as D,a0 as N,bS as U,bT as L,aU as h,bE as A,aD as K,az as W,aL as y,u as x,bb as z,s as H,bJ as P,v as M,aY as V,g as X,t as j,q as O,bU as q,bV as F,bW as J,bX as Q}from"./index-BK-wRR5p.js";var S=(f,b,r)=>new Promise((e,k)=>{var i=l=>{try{p(r.next(l))}catch(t){k(t)}},d=l=>{try{p(r.throw(l))}catch(t){k(t)}},p=l=>l.done?e(l.value):Promise.resolve(l.value).then(i,d);p((r=r.apply(f,b)).next())});const Y=["data-markstream-mode","data-markstream-pending"],G=["innerHTML"],Z={key:1,class:"math-inline math-inline--fallback"},ee={class:"math-inline__loading",role:"status","aria-live":"polite"},R=C(D({__name:"MathInlineNode",props:{node:{}},setup(f){var b,r;const e=f,k=h(null),i=O(()=>e.node.markup==="$$"),d=O(()=>q(e.node.content)),p=((r=(b=N())==null?void 0:b.vnode.el)==null?void 0:r.nodeType)===1,l=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const a=U();if(!a){const n=typeof window>"u"||p;return{html:"",text:n?e.node.raw:"",loading:!n}}try{const n=a.renderToString(d.value,{throwOnError:!1,displayMode:i.value});return L(d.value,i.value,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),t=h(l.html),u=h(l.text);let g=!1,m=0,s=!1,c=null;const v=h(l.loading),_=h(!1);function T(a){a!=null&&a!==m||(_.value=!1)}function B(){return S(this,null,function*(){if(s)return;c&&(c.abort(),c=null);const a=++m;if(!e.node.content)return T(),t.value="",u.value=e.node.loading?"":e.node.raw,v.value=e.node.loading,void(g=!1);const n=new AbortController;c=n,_.value=!0,s||a!==m||n.signal.aborted?T(a):F(d.value,i.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:n.signal}).then(o=>{s||a!==m||(t.value=o,u.value="",v.value=!1,g=!0)}).catch(o=>S(null,null,function*(){if(s||a!==m)return;const w=o?.code||o?.name,$=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||(w===J||w==="WORKER_TIMEOUT")&&!e.node.loading){const I=yield Q();if(s||a!==m)return;if(I){try{const E=I.renderToString(d.value,{throwOnError:e.node.loading,displayMode:i.value});t.value=E,u.value="",v.value=!1,g=!0,L(d.value,i.value,E)}catch{}return}}if($||!e.node.loading)return v.value=!1,t.value="",void(u.value=e.node.raw);g||(v.value=!0)})).finally(()=>{s||T(a)})})}return l.html&&(g=!0),A(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{B()}),K(()=>{t.value||B()}),W(()=>{s=!0,c&&(c.abort(),c=null)}),(a,n)=>(y(),x("span",{ref_key:"containerEl",ref:k,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":u.value?"fallback":"loading","data-markstream-pending":_.value?"true":void 0},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,G)):u.value?(y(),x("span",Z,z(u.value),1)):v.value?(y(),H(X,{key:2,name:"table-node-fade"},{default:P(()=>[M("span",ee,[V(a.$slots,"loading",{isLoading:v.value},()=>[n[0]||(n[0]=M("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),n[1]||(n[1]=M("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Y))}}),[["__scopeId","data-v-6c556261"]]);R.install=f=>{f.component(R.__name,R)};export{R as default}; +import{bQ as C,M as D,a0 as N,bS as U,bT as L,aU as h,bE as A,aD as K,az as W,aL as y,u as x,bb as z,s as H,bJ as P,v as M,aY as V,g as X,t as j,q as O,bU as q,bV as F,bW as J,bX as Q}from"./index-C0iEUKAq.js";var S=(f,b,r)=>new Promise((e,k)=>{var i=l=>{try{p(r.next(l))}catch(t){k(t)}},d=l=>{try{p(r.throw(l))}catch(t){k(t)}},p=l=>l.done?e(l.value):Promise.resolve(l.value).then(i,d);p((r=r.apply(f,b)).next())});const Y=["data-markstream-mode","data-markstream-pending"],G=["innerHTML"],Z={key:1,class:"math-inline math-inline--fallback"},ee={class:"math-inline__loading",role:"status","aria-live":"polite"},R=C(D({__name:"MathInlineNode",props:{node:{}},setup(f){var b,r;const e=f,k=h(null),i=O(()=>e.node.markup==="$$"),d=O(()=>q(e.node.content)),p=((r=(b=N())==null?void 0:b.vnode.el)==null?void 0:r.nodeType)===1,l=(function(){if(!e.node.content)return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading};if(e.node.loading)return{html:"",text:"",loading:!0};const a=U();if(!a){const n=typeof window>"u"||p;return{html:"",text:n?e.node.raw:"",loading:!n}}try{const n=a.renderToString(d.value,{throwOnError:!1,displayMode:i.value});return L(d.value,i.value,n),{html:n,text:"",loading:!1}}catch{return{html:"",text:e.node.loading?"":e.node.raw,loading:e.node.loading}}})(),t=h(l.html),u=h(l.text);let g=!1,m=0,s=!1,c=null;const v=h(l.loading),_=h(!1);function T(a){a!=null&&a!==m||(_.value=!1)}function B(){return S(this,null,function*(){if(s)return;c&&(c.abort(),c=null);const a=++m;if(!e.node.content)return T(),t.value="",u.value=e.node.loading?"":e.node.raw,v.value=e.node.loading,void(g=!1);const n=new AbortController;c=n,_.value=!0,s||a!==m||n.signal.aborted?T(a):F(d.value,i.value,{timeout:1500,waitTimeout:1500,maxRetries:8,signal:n.signal}).then(o=>{s||a!==m||(t.value=o,u.value="",v.value=!1,g=!0)}).catch(o=>S(null,null,function*(){if(s||a!==m)return;const w=o?.code||o?.name,$=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||(w===J||w==="WORKER_TIMEOUT")&&!e.node.loading){const I=yield Q();if(s||a!==m)return;if(I){try{const E=I.renderToString(d.value,{throwOnError:e.node.loading,displayMode:i.value});t.value=E,u.value="",v.value=!1,g=!0,L(d.value,i.value,E)}catch{}return}}if($||!e.node.loading)return v.value=!1,t.value="",void(u.value=e.node.raw);g||(v.value=!0)})).finally(()=>{s||T(a)})})}return l.html&&(g=!0),A(()=>[e.node.content,e.node.loading,e.node.raw,e.node.markup],()=>{B()}),K(()=>{t.value||B()}),W(()=>{s=!0,c&&(c.abort(),c=null)}),(a,n)=>(y(),x("span",{ref_key:"containerEl",ref:k,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":u.value?"fallback":"loading","data-markstream-pending":_.value?"true":void 0},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,G)):u.value?(y(),x("span",Z,z(u.value),1)):v.value?(y(),H(X,{key:2,name:"table-node-fade"},{default:P(()=>[M("span",ee,[V(a.$slots,"loading",{isLoading:v.value},()=>[n[0]||(n[0]=M("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),n[1]||(n[1]=M("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):j("",!0)],8,Y))}}),[["__scopeId","data-v-6c556261"]]);R.install=f=>{f.component(R.__name,R)};export{R as default}; diff --git a/apps/pythinker-code/dist-web/assets/index8-C_WD8tqJ.js b/apps/pythinker-code/dist-web/assets/index8-DNSwKVaQ.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/index8-C_WD8tqJ.js rename to apps/pythinker-code/dist-web/assets/index8-DNSwKVaQ.js index 8cb56c58f..300f88d1a 100644 --- a/apps/pythinker-code/dist-web/assets/index8-C_WD8tqJ.js +++ b/apps/pythinker-code/dist-web/assets/index8-DNSwKVaQ.js @@ -1 +1 @@ -import{bQ as ot,M as lt,bl as at,af as rt,bY as ut,b$ as it,c0 as st,c1 as ct,c2 as dt,aU as d,bE as Z,as as fe,aD as vt,az as mt,aL as v,u as m,v as u,bk as f,au as pe,bb as N,t as T,aw as ge,bL as ft,bB as pt,q as D,c7 as Se,c8 as gt,ca as ht,b_ as yt}from"./index-BK-wRR5p.js";var wt=Object.defineProperty,Le=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,Ne=(p,n,i)=>n in p?wt(p,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[n]=i,he=(p,n)=>{for(var i in n||(n={}))bt.call(n,i)&&Ne(p,i,n[i]);if(Le)for(var i of Le(n))kt.call(n,i)&&Ne(p,i,n[i]);return p},ye=(p,n,i)=>new Promise((w,a)=>{var A=h=>{try{g(i.next(h))}catch(s){a(s)}},k=h=>{try{g(i.throw(h))}catch(s){a(s)}},g=h=>h.done?w(h.value):Promise.resolve(h.value).then(A,k);g((i=i.apply(p,n)).next())});const xt=["data-markstream-mode","data-markstream-pending"],Bt={key:0,class:"d2-block-header flex justify-between items-center border-b"},Dt={class:"d2-header-actions flex items-center"},Ct={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},Mt=["aria-label"],Et={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Tt={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},At=["aria-label"],jt=["aria-pressed"],Ot={key:0,class:"d2-source"},Ft={class:"d2-code"},It={key:0,class:"d2-error mt-2 text-xs"},Ht={key:1},St={key:0,class:"d2-source"},Lt={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Pt=["innerHTML"],Rt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=ot(lt({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(p){const n=p,i=at(),w=rt(ut,null),{t:a}=it(),A=d(!1),k=d(!1),g=d(!1),h=d(!1),s=d(null),W=d(!1),j=d(""),ae=d(""),re=d(0),P=d(""),R=d(""),ee=d(null),ue=d(null),ie=d(null),Pe=st(),te=ct(),be=dt(),Y=d(null),ke=typeof window<"u",xe=d(!1),O=d(typeof window>"u"||!be.value),F=D(()=>{var t;return(t=n.node.code)!=null?t:""}),Re=D(()=>yt(n,i)),se=D(()=>{var t,e;return[n.isDark?"dark":"light",(t=n.themeId)!=null?t:"auto",(e=n.darkThemeId)!=null?e:"auto",F.value].join(":")}),ne=D(()=>!!j.value&&ae.value===se.value),Be=D(()=>{if(!xe.value||!F.value||g.value)return!1;const t=se.value;return!!W.value||P.value!==t&&(!s.value||R.value!==t)}),De=D(()=>ne.value||!!j.value&&Be.value),oe=D(()=>g.value||!h.value||!De.value),_e=D(()=>{if(oe.value&&ue.value)return{minHeight:`${ue.value}px`}}),Ue=D(()=>n.maxHeight==="none"?{maxHeight:"none"}:n.maxHeight!=null?{maxHeight:typeof n.maxHeight=="number"?`${n.maxHeight}px`:String(n.maxHeight)}:void 0);let x=null,ce=!1,_=!1,Ce=0,U=null,I=!1,$=null,C="";typeof window<"u"&&Z([()=>ie.value,be],([t,e])=>{var o,c,H;if((o=Y.value)==null||o.destroy(),Y.value=null,!e||O.value)return void(O.value=!0);if(!t)return void(O.value=!1);const S=(H=(c=te?.value.heavyBlockMargin)!=null?c:te?.value.rootMargin)!=null?H:"160px",V=Pe(t,{rootMargin:S,allowIdle:!1});Y.value=V,O.value=V.isVisible.value,V.whenVisible.then(()=>{O.value=!0})},{immediate:!0});const Ve={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function M(t,e,o="top"){if(Me(t.currentTarget))return;const c=t,H=c?.clientX!=null&&c?.clientY!=null?{x:c.clientX,y:c.clientY}:void 0;Se(t.currentTarget,e,o,!1,H,n.isDark)}function b(){gt()}function Ee(t){if(Me(t.currentTarget))return;const e=A.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=t,c=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;Se(t.currentTarget,e,"top",!1,c,n.isDark)}function ze(){return ye(this,null,function*(){try{const t=F.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),A.value=!0,setTimeout(()=>{A.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function Ye(){k.value=!k.value}function Te(t){g.value=t==="source"}const $e=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],qe=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Xe(t){if(!t)return"";const e=t.trim();return qe.test(e)?e:""}function Ae(){j.value="",ae.value=""}function q(t){return _||t!==re.value}function Ge(){return ye(this,null,function*(){var t,e,o,c,H;if(!ke||_||!O.value||n.loading&&!n.progressiveRender)return;const S=se.value;if(S===P.value&&!s.value&&ne.value)return h.value=!0,void(n.loading&&(g.value=!1));const V=F.value;if(!V)return Ae(),s.value=null,P.value="",void(R.value="");const G=++re.value;W.value=!0,s.value=null,R.value="",(function(){const r=Re.value;w&&r&&C!==r&&(C&&w.markSettled(C),C=r,w.markPending(r))})();try{const r=yield(function(){return ye(this,null,function*(){if(x)return x;const l=yield ht();if(_||!l)return null;if(typeof l=="function"){const Q=new l;return Q&&typeof Q.compile=="function"?x=Q:typeof l.compile=="function"&&(x=l),x}return l?.D2&&typeof l.D2=="function"?(x=new l.D2,x):(typeof l.compile=="function"&&(x=l),x)})})();if(q(G))return;if(!r)return h.value=!1,g.value=!0,Ae(),s.value="D2 is not available.",void(R.value=S);if(typeof r.compile!="function"||typeof r.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield r.compile(V);if(q(G))return;const le=(t=y?.diagram)!=null?t:y,B=(o=(e=y?.renderOptions)!=null?e:y?.options)!=null?o:{},Qe=(c=n.themeId)!=null?c:B.themeID,je=(H=n.darkThemeId)!=null?H:B.darkThemeID,J=he({},B);if(J.themeID=n.isDark&&je!=null?je:Qe,J.darkThemeID=null,J.darkThemeOverrides=null,n.isDark){const l=B.themeOverrides&&typeof B.themeOverrides=="object"?B.themeOverrides:null;J.themeOverrides=he(he({},Ve),l||{})}const Ke=yield r.render(le,J);if(q(G))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(Ke);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,Q){const Fe=(function(Ie){if(typeof window>"u"||typeof DOMParser>"u"||!Ie)return"";const Ze=Ie.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(Ze,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(He){const We=new Set(["script"]),et=[He,...Array.from(He.querySelectorAll("*"))];for(const L of et){if(We.has(L.tagName.toLowerCase())){L.remove();continue}const tt=Array.from(L.attributes);for(const z of tt){const E=z.name;if(/^on/i.test(E))L.removeAttribute(E);else{if(E==="style"&&z.value){const K=z.value;if($e.some(nt=>nt.test(K))){L.removeAttribute(E);continue}}if((E==="href"||E==="xlink:href")&&z.value){const K=Xe(z.value);if(!K){L.removeAttribute(E);continue}K!==z.value&&L.setAttribute(E,K)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);j.value=Fe||"",ae.value=Fe?Q:""})(Oe,S),P.value=S,R.value="",n.loading&&(g.value=!1),s.value=null}catch(r){if(q(G))return;const y=r?.message?String(r.message):"D2 render failed.";n.loading||(s.value=y,R.value=S),P.value="",y.includes("@terrastruct/d2")&&(h.value=!1,g.value=!0)}finally{q(G)||(W.value=!1,I?(I=!1,X()):(function(){const r=C;w&&r&&(C="",fe(()=>{var y,le;if(!_){const B=(le=(y=ie.value)==null?void 0:y.offsetHeight)!=null?le:0;B>0&&w.reportHeight(r,B)}w.markSettled(r)}))})())}})}function X(t=!1){if(ce||!ke||_)return;if(W.value)return void(I=!0);const e=Math.max(120,Number(n.progressiveIntervalMs)||0),o=Date.now()-Ce;if(!t&&o{U=null,I&&(I=!1,X(!0))},Math.max(0,e-o))));ce=!0;const c=()=>{ce=!1,Ce=Date.now(),Ge()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(c):setTimeout(c,0)}function Je(){if(ne.value)try{const t=new Blob([j.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const o=document.createElement("a");o.href=e,o.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function de(){const t=ee.value;if(!t)return;const e=t.getBoundingClientRect().height;e>0&&(ue.value=e)}return Z(()=>[n.node.code,n.loading,n.isDark,n.themeId,n.darkThemeId],()=>{X()},{immediate:!0}),Z(()=>n.loading,(t,e)=>{e&&!t&&X(!0)}),Z(()=>O.value,t=>{t&&X(!0)}),Z(()=>[oe.value,j.value,F.value],()=>{fe(()=>{de()})}),vt(()=>{xe.value=!0,fe(()=>{de()}),typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{de()}),ee.value&&$.observe(ee.value))}),mt(()=>{var t;_=!0,re.value+=1,I=!1,(function(){const e=C;w&&e&&(C="",w.markSettled(e))})(),P.value="",(t=Y.value)==null||t.destroy(),Y.value=null,U!=null&&(clearTimeout(U),U=null),$?.disconnect(),$=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:n.isDark}]),"data-markstream-d2":"1","data-markstream-mode":oe.value?"fallback":"preview","data-markstream-pending":Be.value?"true":void 0},[n.showHeader?(v(),m("div",Bt,[e[16]||(e[16]=u("div",{class:"flex items-center gap-x-2"},[u("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),u("div",Dt,[n.showModeToggle?(v(),m("div",Ct,[u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"":"is-active"]),onClick:e[0]||(e[0]=o=>Te("preview")),onMouseenter:e[1]||(e[1]=o=>M(o,f(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>M(o,f(a)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},N(f(a)("common.preview")||"Preview"),35),u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"is-active":""]),onClick:e[3]||(e[3]=o=>Te("source")),onMouseenter:e[4]||(e[4]=o=>M(o,f(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>M(o,f(a)("common.source")||"Source")),onMouseleave:b,onBlur:b},N(f(a)("common.source")||"Source"),35)])):T("",!0),n.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":A.value?f(a)("common.copied")||"Copied":f(a)("common.copy")||"Copy",onClick:ze,onMouseenter:e[6]||(e[6]=o=>Ee(o)),onFocus:e[7]||(e[7]=o=>Ee(o)),onMouseleave:b,onBlur:b},[A.value?(v(),m("svg",Tt,[...e[13]||(e[13]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Et,[...e[12]||(e[12]=[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),u("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Mt)):T("",!0),n.showExportButton&&ne.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(a)("common.export")||"Export",onClick:Je,onMouseenter:e[8]||(e[8]=o=>M(o,f(a)("common.export")||"Export")),onFocus:e[9]||(e[9]=o=>M(o,f(a)("common.export")||"Export")),onMouseleave:b,onBlur:b},[...e[14]||(e[14]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,At)):T("",!0),n.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":k.value,onClick:Ye,onMouseenter:e[10]||(e[10]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(v(),m("svg",{style:ge({rotate:k.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,jt)):T("",!0)])])):T("",!0),ft(u("div",{ref_key:"bodyRef",ref:ee,class:"d2-block-body",style:ge(_e.value)},[n.loading&&!De.value?(v(),m("div",Ot,[u("pre",Ft,[u("code",null,N(F.value),1)]),s.value?(v(),m("p",It,N(s.value),1)):T("",!0)])):(v(),m("div",Ht,[oe.value?(v(),m("div",St,[u("pre",Lt,[u("code",null,N(F.value),1)]),s.value?(v(),m("p",Nt,N(s.value),1)):T("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(Ue.value)},[u("div",{class:"d2-svg",innerHTML:j.value},null,8,Pt),s.value?(v(),m("p",Rt,N(s.value),1)):T("",!0)],4))]))],4),[[pt,!k.value]])],10,xt))}}),[["__scopeId","data-v-3b434cf5"]]);we.install=p=>{p.component(we.__name,we)};export{we as default}; +import{bQ as ot,M as lt,bl as at,af as rt,bY as ut,b$ as it,c0 as st,c1 as ct,c2 as dt,aU as d,bE as Z,as as fe,aD as vt,az as mt,aL as v,u as m,v as u,bk as f,au as pe,bb as N,t as T,aw as ge,bL as ft,bB as pt,q as D,c7 as Se,c8 as gt,ca as ht,b_ as yt}from"./index-C0iEUKAq.js";var wt=Object.defineProperty,Le=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,Ne=(p,n,i)=>n in p?wt(p,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[n]=i,he=(p,n)=>{for(var i in n||(n={}))bt.call(n,i)&&Ne(p,i,n[i]);if(Le)for(var i of Le(n))kt.call(n,i)&&Ne(p,i,n[i]);return p},ye=(p,n,i)=>new Promise((w,a)=>{var A=h=>{try{g(i.next(h))}catch(s){a(s)}},k=h=>{try{g(i.throw(h))}catch(s){a(s)}},g=h=>h.done?w(h.value):Promise.resolve(h.value).then(A,k);g((i=i.apply(p,n)).next())});const xt=["data-markstream-mode","data-markstream-pending"],Bt={key:0,class:"d2-block-header flex justify-between items-center border-b"},Dt={class:"d2-header-actions flex items-center"},Ct={key:0,class:"d2-mode-toggle flex items-center gap-0.5"},Mt=["aria-label"],Et={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},Tt={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},At=["aria-label"],jt=["aria-pressed"],Ot={key:0,class:"d2-source"},Ft={class:"d2-code"},It={key:0,class:"d2-error mt-2 text-xs"},Ht={key:1},St={key:0,class:"d2-source"},Lt={class:"d2-code"},Nt={key:0,class:"d2-error mt-2 text-xs"},Pt=["innerHTML"],Rt={key:0,class:"d2-error px-4 pb-3 text-xs"},we=ot(lt({__name:"D2BlockNode",props:{node:{},maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:{},darkThemeId:{},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(p){const n=p,i=at(),w=rt(ut,null),{t:a}=it(),A=d(!1),k=d(!1),g=d(!1),h=d(!1),s=d(null),W=d(!1),j=d(""),ae=d(""),re=d(0),P=d(""),R=d(""),ee=d(null),ue=d(null),ie=d(null),Pe=st(),te=ct(),be=dt(),Y=d(null),ke=typeof window<"u",xe=d(!1),O=d(typeof window>"u"||!be.value),F=D(()=>{var t;return(t=n.node.code)!=null?t:""}),Re=D(()=>yt(n,i)),se=D(()=>{var t,e;return[n.isDark?"dark":"light",(t=n.themeId)!=null?t:"auto",(e=n.darkThemeId)!=null?e:"auto",F.value].join(":")}),ne=D(()=>!!j.value&&ae.value===se.value),Be=D(()=>{if(!xe.value||!F.value||g.value)return!1;const t=se.value;return!!W.value||P.value!==t&&(!s.value||R.value!==t)}),De=D(()=>ne.value||!!j.value&&Be.value),oe=D(()=>g.value||!h.value||!De.value),_e=D(()=>{if(oe.value&&ue.value)return{minHeight:`${ue.value}px`}}),Ue=D(()=>n.maxHeight==="none"?{maxHeight:"none"}:n.maxHeight!=null?{maxHeight:typeof n.maxHeight=="number"?`${n.maxHeight}px`:String(n.maxHeight)}:void 0);let x=null,ce=!1,_=!1,Ce=0,U=null,I=!1,$=null,C="";typeof window<"u"&&Z([()=>ie.value,be],([t,e])=>{var o,c,H;if((o=Y.value)==null||o.destroy(),Y.value=null,!e||O.value)return void(O.value=!0);if(!t)return void(O.value=!1);const S=(H=(c=te?.value.heavyBlockMargin)!=null?c:te?.value.rootMargin)!=null?H:"160px",V=Pe(t,{rootMargin:S,allowIdle:!1});Y.value=V,O.value=V.isVisible.value,V.whenVisible.then(()=>{O.value=!0})},{immediate:!0});const Ve={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function Me(t){return!t||t.disabled}function M(t,e,o="top"){if(Me(t.currentTarget))return;const c=t,H=c?.clientX!=null&&c?.clientY!=null?{x:c.clientX,y:c.clientY}:void 0;Se(t.currentTarget,e,o,!1,H,n.isDark)}function b(){gt()}function Ee(t){if(Me(t.currentTarget))return;const e=A.value?a("common.copied")||"Copied":a("common.copy")||"Copy",o=t,c=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;Se(t.currentTarget,e,"top",!1,c,n.isDark)}function ze(){return ye(this,null,function*(){try{const t=F.value;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),A.value=!0,setTimeout(()=>{A.value=!1},1e3)}catch(t){console.error("Copy failed:",t)}})}function Ye(){k.value=!k.value}function Te(t){g.value=t==="source"}const $e=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],qe=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Xe(t){if(!t)return"";const e=t.trim();return qe.test(e)?e:""}function Ae(){j.value="",ae.value=""}function q(t){return _||t!==re.value}function Ge(){return ye(this,null,function*(){var t,e,o,c,H;if(!ke||_||!O.value||n.loading&&!n.progressiveRender)return;const S=se.value;if(S===P.value&&!s.value&&ne.value)return h.value=!0,void(n.loading&&(g.value=!1));const V=F.value;if(!V)return Ae(),s.value=null,P.value="",void(R.value="");const G=++re.value;W.value=!0,s.value=null,R.value="",(function(){const r=Re.value;w&&r&&C!==r&&(C&&w.markSettled(C),C=r,w.markPending(r))})();try{const r=yield(function(){return ye(this,null,function*(){if(x)return x;const l=yield ht();if(_||!l)return null;if(typeof l=="function"){const Q=new l;return Q&&typeof Q.compile=="function"?x=Q:typeof l.compile=="function"&&(x=l),x}return l?.D2&&typeof l.D2=="function"?(x=new l.D2,x):(typeof l.compile=="function"&&(x=l),x)})})();if(q(G))return;if(!r)return h.value=!1,g.value=!0,Ae(),s.value="D2 is not available.",void(R.value=S);if(typeof r.compile!="function"||typeof r.render!="function")throw new TypeError("D2 instance is missing compile/render methods.");h.value=!0;const y=yield r.compile(V);if(q(G))return;const le=(t=y?.diagram)!=null?t:y,B=(o=(e=y?.renderOptions)!=null?e:y?.options)!=null?o:{},Qe=(c=n.themeId)!=null?c:B.themeID,je=(H=n.darkThemeId)!=null?H:B.darkThemeID,J=he({},B);if(J.themeID=n.isDark&&je!=null?je:Qe,J.darkThemeID=null,J.darkThemeOverrides=null,n.isDark){const l=B.themeOverrides&&typeof B.themeOverrides=="object"?B.themeOverrides:null;J.themeOverrides=he(he({},Ve),l||{})}const Ke=yield r.render(le,J);if(q(G))return;const Oe=(function(l){return l?typeof l=="string"?l:typeof l.svg=="string"?l.svg:typeof l.data=="string"?l.data:"":""})(Ke);if(!Oe)throw new Error("D2 render returned empty output.");(function(l,Q){const Fe=(function(Ie){if(typeof window>"u"||typeof DOMParser>"u"||!Ie)return"";const Ze=Ie.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),ve=new DOMParser().parseFromString(Ze,"image/svg+xml").documentElement;if(!ve||ve.nodeName.toLowerCase()!=="svg")return"";const me=ve;return(function(He){const We=new Set(["script"]),et=[He,...Array.from(He.querySelectorAll("*"))];for(const L of et){if(We.has(L.tagName.toLowerCase())){L.remove();continue}const tt=Array.from(L.attributes);for(const z of tt){const E=z.name;if(/^on/i.test(E))L.removeAttribute(E);else{if(E==="style"&&z.value){const K=z.value;if($e.some(nt=>nt.test(K))){L.removeAttribute(E);continue}}if((E==="href"||E==="xlink:href")&&z.value){const K=Xe(z.value);if(!K){L.removeAttribute(E);continue}K!==z.value&&L.setAttribute(E,K)}}}}})(me),me.classList.add("markstream-d2-root-svg"),me.outerHTML})(l);j.value=Fe||"",ae.value=Fe?Q:""})(Oe,S),P.value=S,R.value="",n.loading&&(g.value=!1),s.value=null}catch(r){if(q(G))return;const y=r?.message?String(r.message):"D2 render failed.";n.loading||(s.value=y,R.value=S),P.value="",y.includes("@terrastruct/d2")&&(h.value=!1,g.value=!0)}finally{q(G)||(W.value=!1,I?(I=!1,X()):(function(){const r=C;w&&r&&(C="",fe(()=>{var y,le;if(!_){const B=(le=(y=ie.value)==null?void 0:y.offsetHeight)!=null?le:0;B>0&&w.reportHeight(r,B)}w.markSettled(r)}))})())}})}function X(t=!1){if(ce||!ke||_)return;if(W.value)return void(I=!0);const e=Math.max(120,Number(n.progressiveIntervalMs)||0),o=Date.now()-Ce;if(!t&&o{U=null,I&&(I=!1,X(!0))},Math.max(0,e-o))));ce=!0;const c=()=>{ce=!1,Ce=Date.now(),Ge()};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(c):setTimeout(c,0)}function Je(){if(ne.value)try{const t=new Blob([j.value],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t);if(typeof document<"u"){const o=document.createElement("a");o.href=e,o.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}URL.revokeObjectURL(e)}catch(t){console.error("Failed to export SVG:",t)}}function de(){const t=ee.value;if(!t)return;const e=t.getBoundingClientRect().height;e>0&&(ue.value=e)}return Z(()=>[n.node.code,n.loading,n.isDark,n.themeId,n.darkThemeId],()=>{X()},{immediate:!0}),Z(()=>n.loading,(t,e)=>{e&&!t&&X(!0)}),Z(()=>O.value,t=>{t&&X(!0)}),Z(()=>[oe.value,j.value,F.value],()=>{fe(()=>{de()})}),vt(()=>{xe.value=!0,fe(()=>{de()}),typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{de()}),ee.value&&$.observe(ee.value))}),mt(()=>{var t;_=!0,re.value+=1,I=!1,(function(){const e=C;w&&e&&(C="",w.markSettled(e))})(),P.value="",(t=Y.value)==null||t.destroy(),Y.value=null,U!=null&&(clearTimeout(U),U=null),$?.disconnect(),$=null}),(t,e)=>(v(),m("div",{ref_key:"viewportTarget",ref:ie,class:pe(["d2-block-container rounded-lg border overflow-hidden",{dark:n.isDark}]),"data-markstream-d2":"1","data-markstream-mode":oe.value?"fallback":"preview","data-markstream-pending":Be.value?"true":void 0},[n.showHeader?(v(),m("div",Bt,[e[16]||(e[16]=u("div",{class:"flex items-center gap-x-2"},[u("span",{class:"d2-label font-medium font-mono"},"D2")],-1)),u("div",Dt,[n.showModeToggle?(v(),m("div",Ct,[u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"":"is-active"]),onClick:e[0]||(e[0]=o=>Te("preview")),onMouseenter:e[1]||(e[1]=o=>M(o,f(a)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=o=>M(o,f(a)("common.preview")||"Preview")),onMouseleave:b,onBlur:b},N(f(a)("common.preview")||"Preview"),35),u("button",{type:"button",class:pe(["mode-btn px-2 py-0.5 rounded",g.value?"is-active":""]),onClick:e[3]||(e[3]=o=>Te("source")),onMouseenter:e[4]||(e[4]=o=>M(o,f(a)("common.source")||"Source")),onFocus:e[5]||(e[5]=o=>M(o,f(a)("common.source")||"Source")),onMouseleave:b,onBlur:b},N(f(a)("common.source")||"Source"),35)])):T("",!0),n.showCopyButton?(v(),m("button",{key:1,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":A.value?f(a)("common.copied")||"Copied":f(a)("common.copy")||"Copy",onClick:ze,onMouseenter:e[6]||(e[6]=o=>Ee(o)),onFocus:e[7]||(e[7]=o=>Ee(o)),onMouseleave:b,onBlur:b},[A.value?(v(),m("svg",Tt,[...e[13]||(e[13]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(v(),m("svg",Et,[...e[12]||(e[12]=[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),u("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Mt)):T("",!0),n.showExportButton&&ne.value?(v(),m("button",{key:2,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-label":f(a)("common.export")||"Export",onClick:Je,onMouseenter:e[8]||(e[8]=o=>M(o,f(a)("common.export")||"Export")),onFocus:e[9]||(e[9]=o=>M(o,f(a)("common.export")||"Export")),onMouseleave:b,onBlur:b},[...e[14]||(e[14]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})],-1)])],40,At)):T("",!0),n.showCollapseButton?(v(),m("button",{key:3,type:"button",class:"d2-action-btn p-[var(--ms-action-btn-padding)] rounded-md","aria-pressed":k.value,onClick:Ye,onMouseenter:e[10]||(e[10]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onFocus:e[11]||(e[11]=o=>M(o,k.value?f(a)("common.expand")||"Expand":f(a)("common.collapse")||"Collapse")),onMouseleave:b,onBlur:b},[(v(),m("svg",{style:ge({rotate:k.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...e[15]||(e[15]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,jt)):T("",!0)])])):T("",!0),ft(u("div",{ref_key:"bodyRef",ref:ee,class:"d2-block-body",style:ge(_e.value)},[n.loading&&!De.value?(v(),m("div",Ot,[u("pre",Ft,[u("code",null,N(F.value),1)]),s.value?(v(),m("p",It,N(s.value),1)):T("",!0)])):(v(),m("div",Ht,[oe.value?(v(),m("div",St,[u("pre",Lt,[u("code",null,N(F.value),1)]),s.value?(v(),m("p",Nt,N(s.value),1)):T("",!0)])):(v(),m("div",{key:1,class:"d2-render",style:ge(Ue.value)},[u("div",{class:"d2-svg",innerHTML:j.value},null,8,Pt),s.value?(v(),m("p",Rt,N(s.value),1)):T("",!0)],4))]))],4),[[pt,!k.value]])],10,xt))}}),[["__scopeId","data-v-3b434cf5"]]);we.install=p=>{p.component(we.__name,we)};export{we as default}; diff --git a/apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-D9yY8FD1.js b/apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-DnUqCcVs.js similarity index 68% rename from apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-D9yY8FD1.js rename to apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-DnUqCcVs.js index 9257b1b93..5a7e15beb 100644 --- a/apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-D9yY8FD1.js +++ b/apps/pythinker-code/dist-web/assets/infoDiagram-RXCK75RN-DnUqCcVs.js @@ -1,2 +1,2 @@ -import{_ as e,l as s,G as n,d as i}from"./mermaid.core-Pmnag6hS.js";import{p}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"11.17.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram +import{_ as e,l as s,G as n,d as i}from"./mermaid.core-4ur3W-UG.js";import{p}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"11.17.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram `+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-CYM95aw7.js b/apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-V_xG_Q39.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-CYM95aw7.js rename to apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-V_xG_Q39.js index c9d1a9b9c..af94fdfc1 100644 --- a/apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-CYM95aw7.js +++ b/apps/pythinker-code/dist-web/assets/ishikawaDiagram-5VMMS53U-V_xG_Q39.js @@ -1,4 +1,4 @@ -import{_ as l,c as lt,a2 as ct,G as ut,am as dt,r as yt,k as ft,p as et,a as pt,b as gt,g as kt,s as mt,q as wt,d as _t}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(X,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,W,N,Y,F={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";U=[];for(G in v[W])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`: +import{_ as l,c as lt,a2 as ct,G as ut,am as dt,r as yt,k as ft,p as et,a as pt,b as gt,g as kt,s as mt,q as wt,d as _t}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var Q=(function(){var t=l(function(T,e,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=e);return s},"o"),d=[1,4],n=[1,14],a=[1,12],o=[1,13],y=[6,7,8],p=[1,20],u=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(e,s,i,h,f,r,v){var w=r.length-1;switch(f){case 6:case 7:return h;case 15:h.addNode(r[w-1].length,r[w].trim());break;case 16:h.addNode(0,r[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:n,7:[1,10],9:9,12:11,13:a,14:o},t(y,[2,3]),{1:[2,2]},t(y,[2,4]),t(y,[2,5]),{1:[2,6],6:n,12:15,13:a,14:o},{6:n,9:16,12:11,13:a,14:o},{6:p,7:u,10:17,11:m},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:p,7:u,10:22,11:m},{1:[2,7],6:n,12:15,13:a,14:o},t(k,[2,14],{7:g,11:_}),t(x,[2,8]),t(x,[2,9]),t(x,[2,10]),t(c,[2,15]),t(k,[2,13],{7:g,11:_}),t(x,[2,11]),t(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(e,s){if(s.recoverable)this.trace(e);else{var i=new Error(e);throw i.hash=s,i}},"parseError"),parse:l(function(e){var s=this,i=[0],h=[],f=[null],r=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=r.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(e,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;r.push(R);var H=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,f.length=f.length-B,r.length=r.length-B}l(X,"popStack");function J(){var B;return B=h.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(h=B,B=h.pop()),B=s.symbols_[B]||B),B}l(J,"lex");for(var M,W,N,Y,F={},G,V,tt,U;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=J()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";U=[];for(G in v[W])this.terminals_[G]&&G>L&&U.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`: `+b.showPosition()+` Expecting `+U.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:U})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),f.push(b.yytext),r.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=f[f.length-V],F._$={first_line:r[r.length-(V||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(V||1)].first_column,last_column:r[r.length-1].last_column},H&&(F._$.range=[r[r.length-(V||1)].range[0],r[r.length-1].range[1]]),Y=this.performAction.apply(F,[w,$,I,S.yy,N[1],f,r].concat(C)),typeof Y<"u")return Y;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),r=r.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),f.push(F.$),r.push(F._$),tt=v[i[i.length-2]][i[i.length-1]],i.push(tt);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:l(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:l(function(e,s){return this.yy=s||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var s=e.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:l(function(e){var s=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===h.length?this.yylloc.first_column:0)+h[h.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(e){this.unput(this.match.slice(e))},"less"),pastInput:l(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var e=this.pastInput(),s=new Array(e.length+1).join("-");return e+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/javascript-OwQmbStS.js b/apps/pythinker-code/dist-web/assets/javascript-MaMcwgI8.js similarity index 85% rename from apps/pythinker-code/dist-web/assets/javascript-OwQmbStS.js rename to apps/pythinker-code/dist-web/assets/javascript-MaMcwgI8.js index 2b3afeb57..eff25c50a 100644 --- a/apps/pythinker-code/dist-web/assets/javascript-OwQmbStS.js +++ b/apps/pythinker-code/dist-web/assets/javascript-MaMcwgI8.js @@ -1 +1 @@ -import{conf as t,language as e}from"./typescript-BJQGTNP2.js";import"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const n=t,a={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","static","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:e.operators,symbols:e.symbols,escapes:e.escapes,digits:e.digits,octaldigits:e.octaldigits,binarydigits:e.binarydigits,hexdigits:e.hexdigits,regexpctl:e.regexpctl,regexpesc:e.regexpesc,tokenizer:e.tokenizer};export{n as conf,a as language}; +import{conf as t,language as e}from"./typescript-BEp7AJTK.js";import"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const n=t,a={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","static","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:e.operators,symbols:e.symbols,escapes:e.escapes,digits:e.digits,octaldigits:e.octaldigits,binarydigits:e.binarydigits,hexdigits:e.hexdigits,regexpctl:e.regexpctl,regexpesc:e.regexpesc,tokenizer:e.tokenizer};export{n as conf,a as language}; diff --git a/apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-Bmt-4Suk.js b/apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-CYf7qu-o.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-Bmt-4Suk.js rename to apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-CYf7qu-o.js index c014453e9..8a706539e 100644 --- a/apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-Bmt-4Suk.js +++ b/apps/pythinker-code/dist-web/assets/journeyDiagram-EYS64GPL-CYf7qu-o.js @@ -1,4 +1,4 @@ -import{g as gt}from"./chunk-5VM5RSS4-BhXMeeD7.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO-CENksy_e.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,j as X,d as $t,r as Mt}from"./mermaid.core-Pmnag6hS.js";import{d as it}from"./arc-C__I0s6O.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: +import{g as gt}from"./chunk-5VM5RSS4-BjJ31Xiv.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO-d2g57_ei.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,j as X,d as $t,r as Mt}from"./mermaid.core-4ur3W-UG.js";import{d as it}from"./arc-ChDdl02F.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`: `+_.showPosition()+` Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/jsonMode-DZLSiusn.js b/apps/pythinker-code/dist-web/assets/jsonMode-B4Dmmm_Y.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/jsonMode-DZLSiusn.js rename to apps/pythinker-code/dist-web/assets/jsonMode-B4Dmmm_Y.js index 031fffff3..dfa3f39f3 100644 --- a/apps/pythinker-code/dist-web/assets/jsonMode-DZLSiusn.js +++ b/apps/pythinker-code/dist-web/assets/jsonMode-B4Dmmm_Y.js @@ -1,4 +1,4 @@ -import{c as P,l as _,e as B}from"./editor.main-1e103Orc.js";import{f as Q,g as y,C as J,H as Y,b as G,d as X,F as Z,S as $,e as K}from"./lspLanguageFeatures-DhcohILl.js";import{a as Ie,D as Ne,h as Ee,R as Le,c as Ue,i as De,j as Be,t as Re,k as Fe}from"./lspLanguageFeatures-DhcohILl.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const x=120*1e3;class C{constructor(i){this._defaults=i,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=P({moduleId:"vs/language/json/jsonWorker",createWorker:()=>new Worker(new URL("/assets/json.worker-MyEhrfQg.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...i){let t;return this._getClient().then(n=>{t=n}).then(n=>{if(this._worker)return this._worker.withSyncedResources(i)}).then(n=>t)}}function ee(e,i=!1){const t=e.length;let n=0,o="",p=0,l=16,u=0,g=0,w=0,v=0,c=0;function O(s,m){let a=0,r=0;for(;a=48&&f<=57)r=r*16+f-48;else if(f>=65&&f<=70)r=r*16+f-65+10;else if(f>=97&&f<=102)r=r*16+f-97+10;else break;n++,a++}return a=t){s+=e.substring(m,n),c=2;break}const a=e.charCodeAt(n);if(a===34){s+=e.substring(m,n),n++;break}if(a===92){if(s+=e.substring(m,n),n++,n>=t){c=2;break}switch(e.charCodeAt(n++)){case 34:s+='"';break;case 92:s+="\\";break;case 47:s+="/";break;case 98:s+="\b";break;case 102:s+="\f";break;case 110:s+=` +import{c as P,l as _,e as B}from"./editor.main-CmoCOdG5.js";import{f as Q,g as y,C as J,H as Y,b as G,d as X,F as Z,S as $,e as K}from"./lspLanguageFeatures-C-mvtNbB.js";import{a as Ie,D as Ne,h as Ee,R as Le,c as Ue,i as De,j as Be,t as Re,k as Fe}from"./lspLanguageFeatures-C-mvtNbB.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const x=120*1e3;class C{constructor(i){this._defaults=i,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=P({moduleId:"vs/language/json/jsonWorker",createWorker:()=>new Worker(new URL("/assets/json.worker-MyEhrfQg.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...i){let t;return this._getClient().then(n=>{t=n}).then(n=>{if(this._worker)return this._worker.withSyncedResources(i)}).then(n=>t)}}function ee(e,i=!1){const t=e.length;let n=0,o="",p=0,l=16,u=0,g=0,w=0,v=0,c=0;function O(s,m){let a=0,r=0;for(;a=48&&f<=57)r=r*16+f-48;else if(f>=65&&f<=70)r=r*16+f-65+10;else if(f>=97&&f<=102)r=r*16+f-97+10;else break;n++,a++}return a=t){s+=e.substring(m,n),c=2;break}const a=e.charCodeAt(n);if(a===34){s+=e.substring(m,n),n++;break}if(a===92){if(s+=e.substring(m,n),n++,n>=t){c=2;break}switch(e.charCodeAt(n++)){case 34:s+='"';break;case 92:s+="\\";break;case 47:s+="/";break;case 98:s+="\b";break;case 102:s+="\f";break;case 110:s+=` `;break;case 114:s+="\r";break;case 116:s+=" ";break;case 117:const f=O(4);f>=0?s+=String.fromCharCode(f):c=4;break;default:c=5}m=n;continue}if(a>=0&&a<=31)if(I(a)){s+=e.substring(m,n),c=2;break}else c=6;n++}return s}function D(){if(o="",c=0,p=n,g=u,v=w,n>=t)return p=t,l=17;let s=e.charCodeAt(n);if(L(s)){do n++,o+=String.fromCharCode(s),s=e.charCodeAt(n);while(L(s));return l=15}if(I(s))return n++,o+=String.fromCharCode(s),s===13&&e.charCodeAt(n)===10&&(n++,o+=` `),u++,w=n,l=14;switch(s){case 123:return n++,l=1;case 125:return n++,l=2;case 91:return n++,l=3;case 93:return n++,l=4;case 58:return n++,l=6;case 44:return n++,l=5;case 34:return n++,o=q(),l=10;case 47:const m=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n=12&&s<=15);return s}return{setPosition:U,getPosition:()=>n,scan:i?z:D,getToken:()=>l,getTokenValue:()=>o,getTokenOffset:()=>p,getTokenLength:()=>n-p,getTokenStartLine:()=>g,getTokenStartCharacter:()=>p-v,getTokenError:()=>c}}function L(e){return e===32||e===9}function I(e){return e===10||e===13}function T(e){return e>=48&&e<=57}var R;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(R||(R={}));new Array(20).fill(0).map((e,i)=>" ".repeat(i));const A=200;new Array(A).fill(0).map((e,i)=>` `+" ".repeat(i)),new Array(A).fill(0).map((e,i)=>"\r"+" ".repeat(i)),new Array(A).fill(0).map((e,i)=>`\r diff --git a/apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD-Di0cOJ8w.js b/apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD--1wLk-1R.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD-Di0cOJ8w.js rename to apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD--1wLk-1R.js index e8da535e8..cf3fc886f 100644 --- a/apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD-Di0cOJ8w.js +++ b/apps/pythinker-code/dist-web/assets/kanban-definition-3QL26DDD--1wLk-1R.js @@ -1,4 +1,4 @@ -import{_ as o,l as te,c as H,G as fe,ag as ye,ah as be,ai as me,ae as Ee,E as K,i as j,Z as _e,$ as ke,ab as Se,ac as ce,ad as le}from"./mermaid.core-Pmnag6hS.js";import{g as Ne}from"./chunk-5VM5RSS4-BhXMeeD7.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],E=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],_=[6,7,11],F=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(_,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(_,[2,19]),e(_,[2,21],{15:30,24:F}),e(_,[2,22]),e(_,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(_,[2,16],{15:37,24:F}),e(_,[2,17]),e(_,[2,18]),e(_,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(_,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Z=b.yylloc;t.push(Z);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var k,P,x,q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((k===null||typeof k>"u")&&(k=ae()),x=U[P]&&U[P][k]),typeof x>"u"||!x.length||!x[0]){var Q="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Q="Parse error on line "+(W+1)+`: +import{_ as o,l as te,c as H,G as fe,ag as ye,ah as be,ai as me,ae as Ee,E as K,i as j,Z as _e,$ as ke,ab as Se,ac as ce,ad as le}from"./mermaid.core-4ur3W-UG.js";import{g as Ne}from"./chunk-5VM5RSS4-BjJ31Xiv.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],E=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],_=[6,7,11],F=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(_,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(_,[2,19]),e(_,[2,21],{15:30,24:F}),e(_,[2,22]),e(_,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:E,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(_,[2,16],{15:37,24:F}),e(_,[2,17]),e(_,[2,18]),e(_,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(_,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Z=b.yylloc;t.push(Z);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var k,P,x,q,G={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((k===null||typeof k>"u")&&(k=ae()),x=U[P]&&U[P][k]),typeof x>"u"||!x.length||!x[0]){var Q="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Q="Parse error on line "+(W+1)+`: `+b.showPosition()+` Expecting `+X.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Q="Parse error on line "+(W+1)+": Unexpected "+(k==re?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:Z,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+k);switch(x[0]){case 1:r.push(k),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),k=null,se=b.yyleng,c=b.yytext,W=b.yylineno,Z=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],G.$=u[u.length-C],G._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(G._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),q=this.performAction.apply(G,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof q<"u")return q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(G.$),t.push(G._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/layout-WxS0y9O_.js b/apps/pythinker-code/dist-web/assets/layout-g7MtGH-g.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/layout-WxS0y9O_.js rename to apps/pythinker-code/dist-web/assets/layout-g7MtGH-g.js index b5b93496e..ed43bf487 100644 --- a/apps/pythinker-code/dist-web/assets/layout-WxS0y9O_.js +++ b/apps/pythinker-code/dist-web/assets/layout-g7MtGH-g.js @@ -1 +1 @@ -import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Ze,c0 as Un,c1 as Qe,c2 as Wn,c3 as qn,a7 as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core-Pmnag6hS.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Zn=/^[-+]0x[0-9a-f]+$/i,Qn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Qn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Zn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t2?n[2]:void 0;for(i&&k(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var Mt=Math.max;function Rt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:ir(r);return i<0&&(i=Mt(t+i,0)),Dn(e,N(n),i)}var le=At(Rt);function ln(e,n){var r=-1,t=U(e)?Array(e.length):[];return Yn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=T(e)?S:ln;return r(e,N(n))}function St(e,n){return e==null?e:Ke(e,ze(n),H)}function $t(e,n){return e&&Je(e,ze(n))}function Ft(e,n){return e>n}var Bt=Object.prototype,Gt=Bt.hasOwnProperty;function Dt(e,n){return e!=null&&Gt.call(e,n)}function hn(e,n){return e!=null&&Vn(e,n,Dt)}function vn(e,n){return en||o&&a&&f&&!u&&!d||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!d&&e=u)return f;var d=r[t];return f*(d=="desc"?-1:1)}}return e.index-n.index}function Xt(e,n,r){n.length?n=S(n,function(o){return T(o)?function(a){return Qe(a,o.length===1?o[0]:o)}:o}):n=[se];var t=-1;n=S(n,de(N));var i=ln(e,function(o,a,u){var f=S(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return Ut(i,function(o,a){return qt(o,a,r)})}function Ht(e,n){return Vt(e,n,function(r,t){return Wn(e,t)})}var Y=pr(function(e,n){return e==null?{}:Ht(e,n)}),Kt=Math.ceil,zt=Math.max;function Jt(e,n,r,t){for(var i=-1,o=zt(Kt((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function Zt(e){return function(n,r,t){return t&&typeof t!="number"&&k(n,r,t)&&(r=t=void 0),n=$(n),r===void 0?(r=n,n=0):r=$(r),t=t===void 0?n1&&k(e,n[0],n[1])?n=[]:r>2&&k(n[0],n[1],n[2])&&(n=[n[0]]),Xt(e,qe(n),[])}),Qt=0;function pe(e){var n=++Qt;return qn(e)+n}function ei(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t0;--u)if(a=n[u].dequeue(),a){t=t.concat(J(e,n,r,a,!0));break}}}return t}function J(e,n,r,t,i){var o=i?[]:void 0;return c(e.inEdges(t.v),function(a){var u=e.edge(a),f=e.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,ae(n,r,f)}),c(e.outEdges(t.v),function(a){var u=e.edge(a),f=a.w,d=e.node(f);d.in-=u,ae(n,r,d)}),e.removeNode(t.v),o}function ui(e,n){var r=new x,t=0,i=0;c(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(e.edges(),function(u){var f=r.edge(u.v,u.w)||0,d=n(u),s=f+d;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=d),t=Math.max(t,r.node(u.w).in+=d)});var o=L(i+t+3).map(function(){return new ri}),a=t+1;return c(r.nodes(),function(u){ae(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ae(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function fi(e){var n=e.graph().acyclicer==="greedy"?ai(e,r(e)):di(e);c(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,pe("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function di(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return c(e.nodes(),i),n}function si(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function I(e,n,r,t){var i;do i=pe(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function ci(e){var n=new x().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function pn(e){var n=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Re(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,d;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,d=u):(i<0&&(a=-a),f=a,d=a*o/i),{x:r+f,y:t+d}}function z(e){var n=g(L(bn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function li(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);hn(t,"rank")&&(t.rank-=n)})}function hi(e){var n=j(g(e.nodes(),function(o){return e.node(o).rank})),r=[];c(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Se(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),I(e,"border",i,n)}function bn(e){return O(g(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function vi(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function pi(e,n){return n()}function bi(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,f=!0);var d=M(n.edges(),function(s){return f===Be(e,e.node(s.v),u)&&f!==Be(e,e.node(s.w),u)});return ve(d,function(s){return A(n,s)})}function Pn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ge(e),we(e,n),ki(e,n)}function ki(e,n){var r=le(e.nodes(),function(i){return!n.node(i).parent}),t=Ii(e,r);t=t.slice(1),c(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function ji(e,n,r){return e.hasEdge(n,r)}function Be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ai(e){switch(e.graph().ranker){case"network-simplex":Ge(e);break;case"tight-tree":Ri(e);break;case"longest-path":Mi(e);break;default:Ge(e)}}var Mi=be;function Ri(e){be(e),gn(e)}function Ge(e){E(e)}function Si(e){var n=I(e,"root",{},"_root"),r=$i(e),t=O(P(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Fi(e)+1;c(e.children(),function(a){Ln(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ln(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var f=Se(e,"_bt"),d=Se(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){Ln(e,n,r,t,i,o,l);var h=e.node(l),p=h.borderTop?h.borderTop:l,v=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,_=p!==v?1:i-o[a]+1;e.setEdge(f,p,{weight:w,minlen:_,nestingEdge:!0}),e.setEdge(v,d,{weight:w,minlen:_,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function $i(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),n[t]=i}return c(e.children(),function(t){r(t,1)}),n}function Fi(e){return W(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Bi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Gi(e,n,r){var t={},i;c(r,function(o){for(var a=e.parent(o),u,f;a;){if(u=e.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){n.setEdge(f,a);return}a=u}})}function Di(e,n,r){var t=Yi(e),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return c(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(e[r](o),function(f){var d=f.v===o?f.w:f.v,s=i.edge(d,o),l=m(s)?0:s.weight;i.setEdge(d,o,{weight:e.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Yi(e){for(var n;e.hasNode(n=pe("_root")););return n}function Vi(e,n){for(var r=0,t=1;t0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=d.weight;f+=d.weight*l})),f}function Wi(e){var n={},r=M(e.nodes(),function(u){return!e.children(u).length}),t=O(g(r,function(u){return e.node(u).rank})),i=g(L(t+1),function(){return[]});function o(u){if(!hn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return c(a,o),i}function qi(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=W(t,function(o,a){var u=e.edge(a),f=e.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Xi(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Hi(t)}function Hi(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Ki(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(M(n,function(o){return!o.merged}),function(o){return Y(o,["vs","i","barycenter","weight"])})}function Ki(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function zi(e,n){var r=vi(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=R(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(Ji(!!n)),f=De(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=De(o,i,f)});var d={vs:C(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function De(e,n,r){for(var t;n.length&&(t=D(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ji(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function Nn(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=M(i,function(v){return v!==a&&v!==u}));var d=qi(e,i);c(d,function(v){if(e.children(v.v).length){var w=Nn(e,v.v,r,t);f[v.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Qi(v,w)}});var s=Xi(d,r);Zi(s,f);var l=zi(s,t);if(a&&(l.vs=C([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+p.order)/(l.weight+2),l.weight+=2}return l}function Zi(e,n){c(e,function(r){r.vs=C(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Qi(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function ea(e){var n=bn(e),r=Ye(e,L(1,n+1),"inEdges"),t=Ye(e,L(n-1,-1,-1),"outEdges"),i=Wi(e);Ve(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){na(u%2?r:t,u%4>=2),i=z(e);var d=Vi(e,i);da||u>n[f].lim));for(d=f,f=t;(f=e.parent(f))!==d;)o.push(f);return{path:i.concat(o.reverse()),lca:d}}function ia(e){var n={},r=0;function t(i){var o=r;c(e.children(i),t),n[i]={low:o,lim:r++}}return c(e.children(),t),n}function aa(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=D(o);return c(o,function(s,l){var h=ua(e,s),p=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(v){c(e.predecessors(v),function(w){var _=e.node(w),me=_.order;(med)&&Cn(r,h,s)})})}function i(o,a){var u=-1,f,d=0;return c(a,function(s,l){if(e.node(s).dummy==="border"){var h=e.predecessors(s);h.length&&(f=e.node(h[0]).order,t(a,d,l,u,f),d=l,u=f)}t(a,d,a.length,f,o.length)}),a}return W(n,i),r}function ua(e,n){if(e.node(n).dummy)return le(e.predecessors(n),function(r){return e.node(r).dummy})}function Cn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function da(e,n,r,t){var i={},o={},a={};return c(n,function(u){c(u,function(f,d){i[f]=f,o[f]=f,a[f]=d})}),c(n,function(u){var f=-1;c(u,function(d){var s=t(d);if(s.length){s=R(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),p=Math.ceil(l);h<=p;++h){var v=s[h];o[d]===d&&f{var t=r(" buildLayoutGraph",()=>_a(e));r(" runLayout",()=>ya(t,r)),r(" updateInputGraph",()=>xa(e,t))})}function ya(e,n){n(" makeSpaceForEdgeLabels",()=>ka(e)),n(" removeSelfEdges",()=>Ga(e)),n(" acyclic",()=>fi(e)),n(" nestingGraph.run",()=>Si(e)),n(" rank",()=>Ai(pn(e))),n(" injectEdgeLabelProxies",()=>ja(e)),n(" removeEmptyRanks",()=>hi(e)),n(" nestingGraph.cleanup",()=>Bi(e)),n(" normalizeRanks",()=>li(e)),n(" assignRankMinMax",()=>Aa(e)),n(" removeEdgeLabelProxies",()=>Ma(e)),n(" normalize.run",()=>xi(e)),n(" parentDummyChains",()=>ra(e)),n(" addBorderSegments",()=>bi(e)),n(" order",()=>ea(e)),n(" insertSelfEdges",()=>Da(e)),n(" adjustCoordinateSystem",()=>wi(e)),n(" position",()=>ga(e)),n(" positionSelfEdges",()=>Ya(e)),n(" removeBorderNodes",()=>Ba(e)),n(" normalize.undo",()=>Ei(e)),n(" fixupEdgeLabelCoords",()=>$a(e)),n(" undoCoordinateSystem",()=>gi(e)),n(" translateGraph",()=>Ra(e)),n(" assignNodeIntersects",()=>Sa(e)),n(" reversePoints",()=>Fa(e)),n(" acyclic.undo",()=>si(e))}function xa(e,n){c(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),c(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Oa=["nodesep","edgesep","ranksep","marginx","marginy"],Ea={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ta=["acyclicer","ranker","rankdir","align"],Pa=["width","height"],La={width:0,height:0},Na=["minlen","weight","width","height","labeloffset"],Ca={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ia=["labelpos"];function _a(e){var n=new x({multigraph:!0,compound:!0}),r=ne(e.graph());return n.setGraph(ie({},Ea,ee(r,Oa),Y(r,Ta))),c(e.nodes(),function(t){var i=ne(e.node(t));n.setNode(t,_t(ee(i,Pa),La)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=ne(e.edge(t));n.setEdge(t,ie({},Ca,ee(i,Na),Y(i,Ia)))}),n}function ka(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function ja(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};I(e,"edge-proxy",o,"_ep")}})}function Aa(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=O(n,t.maxRank))}),e.graph().maxRank=n}function Ma(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ra(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function f(d){var s=d.x,l=d.y,h=d.width,p=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-p/2),i=Math.max(i,l+p/2)}c(e.nodes(),function(d){f(e.node(d))}),c(e.edges(),function(d){var s=e.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&f(s)}),n-=a,t-=u,c(e.nodes(),function(d){var s=e.node(d);s.x-=n,s.y-=t}),c(e.edges(),function(d){var s=e.edge(d);c(s.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Sa(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(Re(t,o)),r.points.push(Re(i,a))})}function $a(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Fa(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ba(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(D(r.borderLeft)),a=e.node(D(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Ga(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Da(e){var n=z(e);c(n,function(r){var t=0;c(r,function(i,o){var a=e.node(i);a.order=o+t,c(a.selfEdges,function(u){I(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Ya(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function ee(e,n){return K(Y(e,n),Number)}function ne(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Ua as l}; +import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Ze,c0 as Un,c1 as Qe,c2 as Wn,c3 as qn,a7 as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core-4ur3W-UG.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Zn=/^[-+]0x[0-9a-f]+$/i,Qn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Qn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Zn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t2?n[2]:void 0;for(i&&k(n[0],n[1],i)&&(t=1);++r-1?i[o?n[a]:a]:void 0}}var Mt=Math.max;function Rt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:ir(r);return i<0&&(i=Mt(t+i,0)),Dn(e,N(n),i)}var le=At(Rt);function ln(e,n){var r=-1,t=U(e)?Array(e.length):[];return Yn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=T(e)?S:ln;return r(e,N(n))}function St(e,n){return e==null?e:Ke(e,ze(n),H)}function $t(e,n){return e&&Je(e,ze(n))}function Ft(e,n){return e>n}var Bt=Object.prototype,Gt=Bt.hasOwnProperty;function Dt(e,n){return e!=null&&Gt.call(e,n)}function hn(e,n){return e!=null&&Vn(e,n,Dt)}function vn(e,n){return en||o&&a&&f&&!u&&!d||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!d&&e=u)return f;var d=r[t];return f*(d=="desc"?-1:1)}}return e.index-n.index}function Xt(e,n,r){n.length?n=S(n,function(o){return T(o)?function(a){return Qe(a,o.length===1?o[0]:o)}:o}):n=[se];var t=-1;n=S(n,de(N));var i=ln(e,function(o,a,u){var f=S(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return Ut(i,function(o,a){return qt(o,a,r)})}function Ht(e,n){return Vt(e,n,function(r,t){return Wn(e,t)})}var Y=pr(function(e,n){return e==null?{}:Ht(e,n)}),Kt=Math.ceil,zt=Math.max;function Jt(e,n,r,t){for(var i=-1,o=zt(Kt((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function Zt(e){return function(n,r,t){return t&&typeof t!="number"&&k(n,r,t)&&(r=t=void 0),n=$(n),r===void 0?(r=n,n=0):r=$(r),t=t===void 0?n1&&k(e,n[0],n[1])?n=[]:r>2&&k(n[0],n[1],n[2])&&(n=[n[0]]),Xt(e,qe(n),[])}),Qt=0;function pe(e){var n=++Qt;return qn(e)+n}function ei(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t0;--u)if(a=n[u].dequeue(),a){t=t.concat(J(e,n,r,a,!0));break}}}return t}function J(e,n,r,t,i){var o=i?[]:void 0;return c(e.inEdges(t.v),function(a){var u=e.edge(a),f=e.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,ae(n,r,f)}),c(e.outEdges(t.v),function(a){var u=e.edge(a),f=a.w,d=e.node(f);d.in-=u,ae(n,r,d)}),e.removeNode(t.v),o}function ui(e,n){var r=new x,t=0,i=0;c(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(e.edges(),function(u){var f=r.edge(u.v,u.w)||0,d=n(u),s=f+d;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=d),t=Math.max(t,r.node(u.w).in+=d)});var o=L(i+t+3).map(function(){return new ri}),a=t+1;return c(r.nodes(),function(u){ae(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ae(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function fi(e){var n=e.graph().acyclicer==="greedy"?ai(e,r(e)):di(e);c(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,pe("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function di(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return c(e.nodes(),i),n}function si(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function I(e,n,r,t){var i;do i=pe(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function ci(e){var n=new x().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function pn(e){var n=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Re(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,d;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,d=u):(i<0&&(a=-a),f=a,d=a*o/i),{x:r+f,y:t+d}}function z(e){var n=g(L(bn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function li(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);hn(t,"rank")&&(t.rank-=n)})}function hi(e){var n=j(g(e.nodes(),function(o){return e.node(o).rank})),r=[];c(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;c(r,function(o,a){m(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Se(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),I(e,"border",i,n)}function bn(e){return O(g(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function vi(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function pi(e,n){return n()}function bi(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;oa.lim&&(u=a,f=!0);var d=M(n.edges(),function(s){return f===Be(e,e.node(s.v),u)&&f!==Be(e,e.node(s.w),u)});return ve(d,function(s){return A(n,s)})}function Pn(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ge(e),we(e,n),ki(e,n)}function ki(e,n){var r=le(e.nodes(),function(i){return!n.node(i).parent}),t=Ii(e,r);t=t.slice(1),c(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function ji(e,n,r){return e.hasEdge(n,r)}function Be(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function Ai(e){switch(e.graph().ranker){case"network-simplex":Ge(e);break;case"tight-tree":Ri(e);break;case"longest-path":Mi(e);break;default:Ge(e)}}var Mi=be;function Ri(e){be(e),gn(e)}function Ge(e){E(e)}function Si(e){var n=I(e,"root",{},"_root"),r=$i(e),t=O(P(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Fi(e)+1;c(e.children(),function(a){Ln(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Ln(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var f=Se(e,"_bt"),d=Se(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){Ln(e,n,r,t,i,o,l);var h=e.node(l),p=h.borderTop?h.borderTop:l,v=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,_=p!==v?1:i-o[a]+1;e.setEdge(f,p,{weight:w,minlen:_,nestingEdge:!0}),e.setEdge(v,d,{weight:w,minlen:_,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function $i(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),n[t]=i}return c(e.children(),function(t){r(t,1)}),n}function Fi(e){return W(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Bi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Gi(e,n,r){var t={},i;c(r,function(o){for(var a=e.parent(o),u,f;a;){if(u=e.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){n.setEdge(f,a);return}a=u}})}function Di(e,n,r){var t=Yi(e),i=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return c(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(e[r](o),function(f){var d=f.v===o?f.w:f.v,s=i.edge(d,o),l=m(s)?0:s.weight;i.setEdge(d,o,{weight:e.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Yi(e){for(var n;e.hasNode(n=pe("_root")););return n}function Vi(e,n){for(var r=0,t=1;t0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=d.weight;f+=d.weight*l})),f}function Wi(e){var n={},r=M(e.nodes(),function(u){return!e.children(u).length}),t=O(g(r,function(u){return e.node(u).rank})),i=g(L(t+1),function(){return[]});function o(u){if(!hn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return c(a,o),i}function qi(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=W(t,function(o,a){var u=e.edge(a),f=e.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Xi(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=M(r,function(i){return!i.indegree});return Hi(t)}function Hi(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Ki(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(M(n,function(o){return!o.merged}),function(o){return Y(o,["vs","i","barycenter","weight"])})}function Ki(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function zi(e,n){var r=vi(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=R(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(Ji(!!n)),f=De(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=De(o,i,f)});var d={vs:C(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function De(e,n,r){for(var t;n.length&&(t=D(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ji(e){return function(n,r){return n.barycenterr.barycenter?1:e?r.i-n.i:n.i-r.i}}function Nn(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=M(i,function(v){return v!==a&&v!==u}));var d=qi(e,i);c(d,function(v){if(e.children(v.v).length){var w=Nn(e,v.v,r,t);f[v.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Qi(v,w)}});var s=Xi(d,r);Zi(s,f);var l=zi(s,t);if(a&&(l.vs=C([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+p.order)/(l.weight+2),l.weight+=2}return l}function Zi(e,n){c(e,function(r){r.vs=C(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Qi(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function ea(e){var n=bn(e),r=Ye(e,L(1,n+1),"inEdges"),t=Ye(e,L(n-1,-1,-1),"outEdges"),i=Wi(e);Ve(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){na(u%2?r:t,u%4>=2),i=z(e);var d=Vi(e,i);da||u>n[f].lim));for(d=f,f=t;(f=e.parent(f))!==d;)o.push(f);return{path:i.concat(o.reverse()),lca:d}}function ia(e){var n={},r=0;function t(i){var o=r;c(e.children(i),t),n[i]={low:o,lim:r++}}return c(e.children(),t),n}function aa(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=D(o);return c(o,function(s,l){var h=ua(e,s),p=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(v){c(e.predecessors(v),function(w){var _=e.node(w),me=_.order;(med)&&Cn(r,h,s)})})}function i(o,a){var u=-1,f,d=0;return c(a,function(s,l){if(e.node(s).dummy==="border"){var h=e.predecessors(s);h.length&&(f=e.node(h[0]).order,t(a,d,l,u,f),d=l,u=f)}t(a,d,a.length,f,o.length)}),a}return W(n,i),r}function ua(e,n){if(e.node(n).dummy)return le(e.predecessors(n),function(r){return e.node(r).dummy})}function Cn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function fa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function da(e,n,r,t){var i={},o={},a={};return c(n,function(u){c(u,function(f,d){i[f]=f,o[f]=f,a[f]=d})}),c(n,function(u){var f=-1;c(u,function(d){var s=t(d);if(s.length){s=R(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),p=Math.ceil(l);h<=p;++h){var v=s[h];o[d]===d&&f{var t=r(" buildLayoutGraph",()=>_a(e));r(" runLayout",()=>ya(t,r)),r(" updateInputGraph",()=>xa(e,t))})}function ya(e,n){n(" makeSpaceForEdgeLabels",()=>ka(e)),n(" removeSelfEdges",()=>Ga(e)),n(" acyclic",()=>fi(e)),n(" nestingGraph.run",()=>Si(e)),n(" rank",()=>Ai(pn(e))),n(" injectEdgeLabelProxies",()=>ja(e)),n(" removeEmptyRanks",()=>hi(e)),n(" nestingGraph.cleanup",()=>Bi(e)),n(" normalizeRanks",()=>li(e)),n(" assignRankMinMax",()=>Aa(e)),n(" removeEdgeLabelProxies",()=>Ma(e)),n(" normalize.run",()=>xi(e)),n(" parentDummyChains",()=>ra(e)),n(" addBorderSegments",()=>bi(e)),n(" order",()=>ea(e)),n(" insertSelfEdges",()=>Da(e)),n(" adjustCoordinateSystem",()=>wi(e)),n(" position",()=>ga(e)),n(" positionSelfEdges",()=>Ya(e)),n(" removeBorderNodes",()=>Ba(e)),n(" normalize.undo",()=>Ei(e)),n(" fixupEdgeLabelCoords",()=>$a(e)),n(" undoCoordinateSystem",()=>gi(e)),n(" translateGraph",()=>Ra(e)),n(" assignNodeIntersects",()=>Sa(e)),n(" reversePoints",()=>Fa(e)),n(" acyclic.undo",()=>si(e))}function xa(e,n){c(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),c(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Oa=["nodesep","edgesep","ranksep","marginx","marginy"],Ea={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ta=["acyclicer","ranker","rankdir","align"],Pa=["width","height"],La={width:0,height:0},Na=["minlen","weight","width","height","labeloffset"],Ca={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ia=["labelpos"];function _a(e){var n=new x({multigraph:!0,compound:!0}),r=ne(e.graph());return n.setGraph(ie({},Ea,ee(r,Oa),Y(r,Ta))),c(e.nodes(),function(t){var i=ne(e.node(t));n.setNode(t,_t(ee(i,Pa),La)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=ne(e.edge(t));n.setEdge(t,ie({},Ca,ee(i,Na),Y(i,Ia)))}),n}function ka(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function ja(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};I(e,"edge-proxy",o,"_ep")}})}function Aa(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=O(n,t.maxRank))}),e.graph().maxRank=n}function Ma(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ra(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function f(d){var s=d.x,l=d.y,h=d.width,p=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-p/2),i=Math.max(i,l+p/2)}c(e.nodes(),function(d){f(e.node(d))}),c(e.edges(),function(d){var s=e.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&f(s)}),n-=a,t-=u,c(e.nodes(),function(d){var s=e.node(d);s.x-=n,s.y-=t}),c(e.edges(),function(d){var s=e.edge(d);c(s.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Sa(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(Re(t,o)),r.points.push(Re(i,a))})}function $a(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Fa(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ba(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(D(r.borderLeft)),a=e.node(D(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Ga(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Da(e){var n=z(e);c(n,function(r){var t=0;c(r,function(i,o){var a=e.node(i);a.order=o+t,c(a.selfEdges,function(u){I(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Ya(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function ee(e,n){return K(Y(e,n),Number)}function ne(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Ua as l}; diff --git a/apps/pythinker-code/dist-web/assets/linear-CJbRkaTL.js b/apps/pythinker-code/dist-web/assets/linear-CTZFHtw0.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/linear-CJbRkaTL.js rename to apps/pythinker-code/dist-web/assets/linear-CTZFHtw0.js index e6628c6e6..9d823a5e8 100644 --- a/apps/pythinker-code/dist-web/assets/linear-CJbRkaTL.js +++ b/apps/pythinker-code/dist-web/assets/linear-CTZFHtw0.js @@ -1 +1 @@ -import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-Pmnag6hS.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i>>1;t(o[l],c)<0?i=l+1:h=l}while(i>>1;t(o[l],c)<=0?i=l+1:h=l}while(ii&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/ir&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*ir&&--c),c0))return[];if(n===r)return[n];const e=r=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;ir&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t}; +import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core-4ur3W-UG.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i>>1;t(o[l],c)<0?i=l+1:h=l}while(i>>1;t(o[l],c)<=0?i=l+1:h=l}while(ii&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/ir&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*ir&&--c),c0))return[];if(n===r)return[n];const e=r=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;ir&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t}; diff --git a/apps/pythinker-code/dist-web/assets/liquid-V_YoDA7v.js b/apps/pythinker-code/dist-web/assets/liquid-DZ5uyBpf.js similarity index 96% rename from apps/pythinker-code/dist-web/assets/liquid-V_YoDA7v.js rename to apps/pythinker-code/dist-web/assets/liquid-DZ5uyBpf.js index 4d82d0ed0..e0e80966e 100644 --- a/apps/pythinker-code/dist-web/assets/liquid-V_YoDA7v.js +++ b/apps/pythinker-code/dist-web/assets/liquid-DZ5uyBpf.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,brackets:[[""],["<",">"],["{{","}}"],["{%","%}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"%",close:"%"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},l={defaultToken:"",tokenPostfix:"",builtinTags:["if","else","elseif","endif","render","assign","capture","endcapture","case","endcase","comment","endcomment","cycle","decrement","for","endfor","include","increment","layout","raw","endraw","render","tablerow","endtablerow","unless","endunless"],builtinFilters:["abs","append","at_least","at_most","capitalize","ceil","compact","date","default","divided_by","downcase","escape","escape_once","first","floor","join","json","last","lstrip","map","minus","modulo","newline_to_br","plus","prepend","remove","remove_first","replace","replace_first","reverse","round","rstrip","size","slice","sort","sort_natural","split","strip","strip_html","strip_newlines","times","truncate","truncatewords","uniq","upcase","url_decode","url_encode","where"],constants:["true","false"],operators:["==","!=",">","<",">=","<="],symbol:/[=>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[//,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],liquidState:[[/\{\{/,"delimiter.output.liquid"],[/\}\}/,{token:"delimiter.output.liquid",switchTo:"@$S2.$S3"}],[/\{\%/,"delimiter.tag.liquid"],[/raw\s*\%\}/,"delimiter.tag.liquid","@liquidRaw"],[/\%\}/,{token:"delimiter.tag.liquid",switchTo:"@$S2.$S3"}],{include:"liquidRoot"}],liquidRaw:[[/^(?!\{\%\s*endraw\s*\%\}).+/],[/\{\%/,"delimiter.tag.liquid"],[/@identifier/],[/\%\}/,{token:"delimiter.tag.liquid",next:"@root"}]],liquidRoot:[[/\d+(\.\d+)?/,"number.liquid"],[/"[^"]*"/,"string.liquid"],[/'[^']*'/,"string.liquid"],[/\s+/],[/@symbol/,{cases:{"@operators":"operator.liquid","@default":""}}],[/\./],[/@identifier/,{cases:{"@constants":"keyword.liquid","@builtinFilters":"predefined.liquid","@builtinTags":"predefined.liquid","@default":"variable.liquid"}}],[/[^}|%]/,"variable.liquid"]]}};export{r as conf,l as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,brackets:[[""],["<",">"],["{{","}}"],["{%","%}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"%",close:"%"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},l={defaultToken:"",tokenPostfix:"",builtinTags:["if","else","elseif","endif","render","assign","capture","endcapture","case","endcase","comment","endcomment","cycle","decrement","for","endfor","include","increment","layout","raw","endraw","render","tablerow","endtablerow","unless","endunless"],builtinFilters:["abs","append","at_least","at_most","capitalize","ceil","compact","date","default","divided_by","downcase","escape","escape_once","first","floor","join","json","last","lstrip","map","minus","modulo","newline_to_br","plus","prepend","remove","remove_first","replace","replace_first","reverse","round","rstrip","size","slice","sort","sort_natural","split","strip","strip_html","strip_newlines","times","truncate","truncatewords","uniq","upcase","url_decode","url_encode","where"],constants:["true","false"],operators:["==","!=",">","<",">=","<="],symbol:/[=>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[//,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],liquidState:[[/\{\{/,"delimiter.output.liquid"],[/\}\}/,{token:"delimiter.output.liquid",switchTo:"@$S2.$S3"}],[/\{\%/,"delimiter.tag.liquid"],[/raw\s*\%\}/,"delimiter.tag.liquid","@liquidRaw"],[/\%\}/,{token:"delimiter.tag.liquid",switchTo:"@$S2.$S3"}],{include:"liquidRoot"}],liquidRaw:[[/^(?!\{\%\s*endraw\s*\%\}).+/],[/\{\%/,"delimiter.tag.liquid"],[/@identifier/],[/\%\}/,{token:"delimiter.tag.liquid",next:"@root"}]],liquidRoot:[[/\d+(\.\d+)?/,"number.liquid"],[/"[^"]*"/,"string.liquid"],[/'[^']*'/,"string.liquid"],[/\s+/],[/@symbol/,{cases:{"@operators":"operator.liquid","@default":""}}],[/\./],[/@identifier/,{cases:{"@constants":"keyword.liquid","@builtinFilters":"predefined.liquid","@builtinTags":"predefined.liquid","@default":"variable.liquid"}}],[/[^}|%]/,"variable.liquid"]]}};export{r as conf,l as language}; diff --git a/apps/pythinker-code/dist-web/assets/lspLanguageFeatures-DhcohILl.js b/apps/pythinker-code/dist-web/assets/lspLanguageFeatures-C-mvtNbB.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/lspLanguageFeatures-DhcohILl.js rename to apps/pythinker-code/dist-web/assets/lspLanguageFeatures-C-mvtNbB.js index 6fe5b8af1..fc9e8ddb7 100644 --- a/apps/pythinker-code/dist-web/assets/lspLanguageFeatures-DhcohILl.js +++ b/apps/pythinker-code/dist-web/assets/lspLanguageFeatures-C-mvtNbB.js @@ -1,4 +1,4 @@ -import{R as Ge,l as x,e as w,U as Je,M as R}from"./editor.main-1e103Orc.js";var T;(function(e){function n(i){return typeof i=="string"}e.is=n})(T||(T={}));var O;(function(e){function n(i){return typeof i=="string"}e.is=n})(O||(O={}));var K;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(K||(K={}));var j;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(j||(j={}));var _;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=j.MAX_VALUE),t===Number.MAX_VALUE&&(t=j.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&o.uinteger(t.line)&&o.uinteger(t.character)}e.is=i})(_||(_={}));var h;(function(e){function n(r,t,a,u){if(o.uinteger(r)&&o.uinteger(t)&&o.uinteger(a)&&o.uinteger(u))return{start:_.create(r,t),end:_.create(a,u)};if(_.is(r)&&_.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${a}, ${u}]`)}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&_.is(t.start)&&_.is(t.end)}e.is=i})(h||(h={}));var N;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&h.is(t.range)&&(o.string(t.uri)||o.undefined(t.uri))}e.is=i})(N||(N={}));var ee;(function(e){function n(r,t,a,u){return{targetUri:r,targetRange:t,targetSelectionRange:a,originSelectionRange:u}}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&h.is(t.targetRange)&&o.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||o.undefined(t.originSelectionRange))}e.is=i})(ee||(ee={}));var S;(function(e){function n(r,t,a,u){return{red:r,green:t,blue:a,alpha:u}}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&o.numberRange(t.red,0,1)&&o.numberRange(t.green,0,1)&&o.numberRange(t.blue,0,1)&&o.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var te;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(te||(te={}));var ne;(function(e){function n(r,t,a){return{label:r,textEdit:t,additionalTextEdits:a}}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&o.string(t.label)&&(o.undefined(t.textEdit)||L.is(t))&&(o.undefined(t.additionalTextEdits)||o.typedArray(t.additionalTextEdits,L.is))}e.is=i})(ne||(ne={}));var M;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(M||(M={}));var re;(function(e){function n(r,t,a,u,s,f){const l={startLine:r,endLine:t};return o.defined(a)&&(l.startCharacter=a),o.defined(u)&&(l.endCharacter=u),o.defined(s)&&(l.kind=s),o.defined(f)&&(l.collapsedText=f),l}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&o.uinteger(t.startLine)&&o.uinteger(t.startLine)&&(o.undefined(t.startCharacter)||o.uinteger(t.startCharacter))&&(o.undefined(t.endCharacter)||o.uinteger(t.endCharacter))&&(o.undefined(t.kind)||o.string(t.kind))}e.is=i})(re||(re={}));var H;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&N.is(t.location)&&o.string(t.message)}e.is=i})(H||(H={}));var A;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(A||(A={}));var ie;(function(e){e.Unnecessary=1,e.Deprecated=2})(ie||(ie={}));var ae;(function(e){function n(i){const r=i;return o.objectLiteral(r)&&o.string(r.href)}e.is=n})(ae||(ae={}));var P;(function(e){function n(r,t,a,u,s,f){let l={range:r,message:t};return o.defined(a)&&(l.severity=a),o.defined(u)&&(l.code=u),o.defined(s)&&(l.source=s),o.defined(f)&&(l.relatedInformation=f),l}e.create=n;function i(r){var t;let a=r;return o.defined(a)&&h.is(a.range)&&o.string(a.message)&&(o.number(a.severity)||o.undefined(a.severity))&&(o.integer(a.code)||o.string(a.code)||o.undefined(a.code))&&(o.undefined(a.codeDescription)||o.string((t=a.codeDescription)===null||t===void 0?void 0:t.href))&&(o.string(a.source)||o.undefined(a.source))&&(o.undefined(a.relatedInformation)||o.typedArray(a.relatedInformation,H.is))}e.is=i})(P||(P={}));var E;(function(e){function n(r,t,...a){let u={title:r,command:t};return o.defined(a)&&a.length>0&&(u.arguments=a),u}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.title)&&o.string(t.command)}e.is=i})(E||(E={}));var L;(function(e){function n(a,u){return{range:a,newText:u}}e.replace=n;function i(a,u){return{range:{start:a,end:a},newText:u}}e.insert=i;function r(a){return{range:a,newText:""}}e.del=r;function t(a){const u=a;return o.objectLiteral(u)&&o.string(u.newText)&&h.is(u.range)}e.is=t})(L||(L={}));var W;(function(e){function n(r,t,a){const u={label:r};return t!==void 0&&(u.needsConfirmation=t),a!==void 0&&(u.description=a),u}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&o.string(t.label)&&(o.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(o.string(t.description)||t.description===void 0)}e.is=i})(W||(W={}));var I;(function(e){function n(i){const r=i;return o.string(r)}e.is=n})(I||(I={}));var oe;(function(e){function n(a,u,s){return{range:a,newText:u,annotationId:s}}e.replace=n;function i(a,u,s){return{range:{start:a,end:a},newText:u,annotationId:s}}e.insert=i;function r(a,u){return{range:a,newText:"",annotationId:u}}e.del=r;function t(a){const u=a;return L.is(u)&&(W.is(u.annotationId)||I.is(u.annotationId))}e.is=t})(oe||(oe={}));var X;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&Q.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,a){let u={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(u.options=t),a!==void 0&&(u.annotationId=a),u}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&o.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||o.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||o.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(r,t,a,u){let s={kind:"rename",oldUri:r,newUri:t};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(s.options=a),u!==void 0&&(s.annotationId=u),s}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&o.string(t.oldUri)&&o.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||o.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||o.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})(z||(z={}));var B;(function(e){function n(r,t,a){let u={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(u.options=t),a!==void 0&&(u.annotationId=a),u}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&o.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||o.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||o.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})(B||(B={}));var q;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>o.string(t.kind)?$.is(t)||z.is(t)||B.is(t):X.is(t)))}e.is=n})(q||(q={}));var ue;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)}e.is=i})(ue||(ue={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&o.integer(t.version)}e.is=i})(se||(se={}));var Q;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&(t.version===null||o.integer(t.version))}e.is=i})(Q||(Q={}));var ce;(function(e){function n(r,t,a,u){return{uri:r,languageId:t,version:a,text:u}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&o.string(t.languageId)&&o.integer(t.version)&&o.string(t.text)}e.is=i})(ce||(ce={}));var G;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(G||(G={}));var F;(function(e){function n(i){const r=i;return o.objectLiteral(i)&&G.is(r.kind)&&o.string(r.value)}e.is=n})(F||(F={}));var p;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(p||(p={}));var J;(function(e){e.PlainText=1,e.Snippet=2})(J||(J={}));var de;(function(e){e.Deprecated=1})(de||(de={}));var fe;(function(e){function n(r,t,a){return{newText:r,insert:t,replace:a}}e.create=n;function i(r){const t=r;return t&&o.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(fe||(fe={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var ge;(function(e){function n(i){const r=i;return r&&(o.string(r.detail)||r.detail===void 0)&&(o.string(r.description)||r.description===void 0)}e.is=n})(ge||(ge={}));var he;(function(e){function n(i){return{label:i}}e.create=n})(he||(he={}));var pe;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(pe||(pe={}));var y;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return o.string(t)||o.objectLiteral(t)&&o.string(t.language)&&o.string(t.value)}e.is=i})(y||(y={}));var me;(function(e){function n(i){let r=i;return!!r&&o.objectLiteral(r)&&(F.is(r.contents)||y.is(r.contents)||o.typedArray(r.contents,y.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(me||(me={}));var ve;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(ve||(ve={}));var be;(function(e){function n(i,r,...t){let a={label:i};return o.defined(r)&&(a.documentation=r),o.defined(t)?a.parameters=t:a.parameters=[],a}e.create=n})(be||(be={}));var D;(function(e){e.Text=1,e.Read=2,e.Write=3})(D||(D={}));var _e;(function(e){function n(i,r){let t={range:i};return o.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var m;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(m||(m={}));var xe;(function(e){e.Deprecated=1})(xe||(xe={}));var we;(function(e){function n(i,r,t,a,u){let s={name:i,kind:r,location:{uri:a,range:t}};return u&&(s.containerName=u),s}e.create=n})(we||(we={}));var ke;(function(e){function n(i,r,t,a){return a!==void 0?{name:i,kind:r,location:{uri:t,range:a}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var Ae;(function(e){function n(r,t,a,u,s,f){let l={name:r,detail:t,kind:a,range:u,selectionRange:s};return f!==void 0&&(l.children=f),l}e.create=n;function i(r){let t=r;return t&&o.string(t.name)&&o.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||o.string(t.detail))&&(t.deprecated===void 0||o.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(Ae||(Ae={}));var Ee;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ee||(Ee={}));var V;(function(e){e.Invoked=1,e.Automatic=2})(V||(V={}));var Le;(function(e){function n(r,t,a){let u={diagnostics:r};return t!=null&&(u.only=t),a!=null&&(u.triggerKind=a),u}e.create=n;function i(r){let t=r;return o.defined(t)&&o.typedArray(t.diagnostics,P.is)&&(t.only===void 0||o.typedArray(t.only,o.string))&&(t.triggerKind===void 0||t.triggerKind===V.Invoked||t.triggerKind===V.Automatic)}e.is=i})(Le||(Le={}));var Ie;(function(e){function n(r,t,a){let u={title:r},s=!0;return typeof t=="string"?(s=!1,u.kind=t):E.is(t)?u.command=t:u.edit=t,s&&a!==void 0&&(u.kind=a),u}e.create=n;function i(r){let t=r;return t&&o.string(t.title)&&(t.diagnostics===void 0||o.typedArray(t.diagnostics,P.is))&&(t.kind===void 0||o.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||E.is(t.command))&&(t.isPreferred===void 0||o.boolean(t.isPreferred))&&(t.edit===void 0||q.is(t.edit))}e.is=i})(Ie||(Ie={}));var Re;(function(e){function n(r,t){let a={range:r};return o.defined(t)&&(a.data=t),a}e.create=n;function i(r){let t=r;return o.defined(t)&&h.is(t.range)&&(o.undefined(t.command)||E.is(t.command))}e.is=i})(Re||(Re={}));var Me;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.uinteger(t.tabSize)&&o.boolean(t.insertSpaces)}e.is=i})(Me||(Me={}));var De;(function(e){function n(r,t,a){return{range:r,target:t,data:a}}e.create=n;function i(r){let t=r;return o.defined(t)&&h.is(t.range)&&(o.undefined(t.target)||o.string(t.target))}e.is=i})(De||(De={}));var Fe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Fe||(Fe={}));var Ce;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Ce||(Ce={}));var je;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(je||(je={}));var Ne;(function(e){function n(i){const r=i;return o.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ne||(Ne={}));var Pe;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&o.string(t.text)}e.is=i})(Pe||(Pe={}));var ye;(function(e){function n(r,t,a){return{range:r,variableName:t,caseSensitiveLookup:a}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&o.boolean(t.caseSensitiveLookup)&&(o.string(t.variableName)||t.variableName===void 0)}e.is=i})(ye||(ye={}));var Ve;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(o.string(t.expression)||t.expression===void 0)}e.is=i})(Ve||(Ve={}));var Ue;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return o.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Ue||(Ue={}));var Y;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(Y||(Y={}));var Z;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&(t.tooltip===void 0||o.string(t.tooltip)||F.is(t.tooltip))&&(t.location===void 0||N.is(t.location))&&(t.command===void 0||E.is(t.command))}e.is=i})(Z||(Z={}));var Oe;(function(e){function n(r,t,a){const u={position:r,label:t};return a!==void 0&&(u.kind=a),u}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&_.is(t.position)&&(o.string(t.label)||o.typedArray(t.label,Z.is))&&(t.kind===void 0||Y.is(t.kind))&&t.textEdits===void 0||o.typedArray(t.textEdits,L.is)&&(t.tooltip===void 0||o.string(t.tooltip)||F.is(t.tooltip))&&(t.paddingLeft===void 0||o.boolean(t.paddingLeft))&&(t.paddingRight===void 0||o.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var He;(function(e){function n(i,r,t,a){return{insertText:i,filterText:r,range:t,command:a}}e.create=n})(He||(He={}));var We;(function(e){function n(i){return{items:i}}e.create=n})(We||(We={}));var Xe;(function(e){e.Invoked=0,e.Automatic=1})(Xe||(Xe={}));var $e;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})($e||($e={}));var ze;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(ze||(ze={}));var Be;(function(e){function n(i){const r=i;return o.objectLiteral(r)&&O.is(r.uri)&&o.string(r.name)}e.is=n})(Be||(Be={}));var qe;(function(e){function n(a,u,s,f){return new nt(a,u,s,f)}e.create=n;function i(a){let u=a;return!!(o.defined(u)&&o.string(u.uri)&&(o.undefined(u.languageId)||o.string(u.languageId))&&o.uinteger(u.lineCount)&&o.func(u.getText)&&o.func(u.positionAt)&&o.func(u.offsetAt))}e.is=i;function r(a,u){let s=a.getText(),f=t(u,(d,g)=>{let b=d.range.start.line-g.range.start.line;return b===0?d.range.start.character-g.range.start.character:b}),l=s.length;for(let d=f.length-1;d>=0;d--){let g=f[d],b=a.offsetAt(g.range.start),c=a.offsetAt(g.range.end);if(c<=l)s=s.substring(0,b)+g.newText+s.substring(c,s.length);else throw new Error("Overlapping edit");l=b}return s}e.applyEdits=r;function t(a,u){if(a.length<=1)return a;const s=a.length/2|0,f=a.slice(0,s),l=a.slice(s);t(f,u),t(l,u);let d=0,g=0,b=0;for(;d0&&(u.arguments=a),u}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.title)&&o.string(t.command)}e.is=i})(E||(E={}));var L;(function(e){function n(a,u){return{range:a,newText:u}}e.replace=n;function i(a,u){return{range:{start:a,end:a},newText:u}}e.insert=i;function r(a){return{range:a,newText:""}}e.del=r;function t(a){const u=a;return o.objectLiteral(u)&&o.string(u.newText)&&h.is(u.range)}e.is=t})(L||(L={}));var W;(function(e){function n(r,t,a){const u={label:r};return t!==void 0&&(u.needsConfirmation=t),a!==void 0&&(u.description=a),u}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&o.string(t.label)&&(o.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(o.string(t.description)||t.description===void 0)}e.is=i})(W||(W={}));var I;(function(e){function n(i){const r=i;return o.string(r)}e.is=n})(I||(I={}));var oe;(function(e){function n(a,u,s){return{range:a,newText:u,annotationId:s}}e.replace=n;function i(a,u,s){return{range:{start:a,end:a},newText:u,annotationId:s}}e.insert=i;function r(a,u){return{range:a,newText:"",annotationId:u}}e.del=r;function t(a){const u=a;return L.is(u)&&(W.is(u.annotationId)||I.is(u.annotationId))}e.is=t})(oe||(oe={}));var X;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&Q.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,a){let u={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(u.options=t),a!==void 0&&(u.annotationId=a),u}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&o.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||o.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||o.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(r,t,a,u){let s={kind:"rename",oldUri:r,newUri:t};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(s.options=a),u!==void 0&&(s.annotationId=u),s}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&o.string(t.oldUri)&&o.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||o.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||o.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})(z||(z={}));var B;(function(e){function n(r,t,a){let u={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(u.options=t),a!==void 0&&(u.annotationId=a),u}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&o.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||o.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||o.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||I.is(t.annotationId))}e.is=i})(B||(B={}));var q;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>o.string(t.kind)?$.is(t)||z.is(t)||B.is(t):X.is(t)))}e.is=n})(q||(q={}));var ue;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)}e.is=i})(ue||(ue={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&o.integer(t.version)}e.is=i})(se||(se={}));var Q;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&(t.version===null||o.integer(t.version))}e.is=i})(Q||(Q={}));var ce;(function(e){function n(r,t,a,u){return{uri:r,languageId:t,version:a,text:u}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.string(t.uri)&&o.string(t.languageId)&&o.integer(t.version)&&o.string(t.text)}e.is=i})(ce||(ce={}));var G;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(G||(G={}));var F;(function(e){function n(i){const r=i;return o.objectLiteral(i)&&G.is(r.kind)&&o.string(r.value)}e.is=n})(F||(F={}));var p;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(p||(p={}));var J;(function(e){e.PlainText=1,e.Snippet=2})(J||(J={}));var de;(function(e){e.Deprecated=1})(de||(de={}));var fe;(function(e){function n(r,t,a){return{newText:r,insert:t,replace:a}}e.create=n;function i(r){const t=r;return t&&o.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(fe||(fe={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var ge;(function(e){function n(i){const r=i;return r&&(o.string(r.detail)||r.detail===void 0)&&(o.string(r.description)||r.description===void 0)}e.is=n})(ge||(ge={}));var he;(function(e){function n(i){return{label:i}}e.create=n})(he||(he={}));var pe;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(pe||(pe={}));var y;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return o.string(t)||o.objectLiteral(t)&&o.string(t.language)&&o.string(t.value)}e.is=i})(y||(y={}));var me;(function(e){function n(i){let r=i;return!!r&&o.objectLiteral(r)&&(F.is(r.contents)||y.is(r.contents)||o.typedArray(r.contents,y.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(me||(me={}));var ve;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(ve||(ve={}));var be;(function(e){function n(i,r,...t){let a={label:i};return o.defined(r)&&(a.documentation=r),o.defined(t)?a.parameters=t:a.parameters=[],a}e.create=n})(be||(be={}));var D;(function(e){e.Text=1,e.Read=2,e.Write=3})(D||(D={}));var _e;(function(e){function n(i,r){let t={range:i};return o.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var m;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(m||(m={}));var xe;(function(e){e.Deprecated=1})(xe||(xe={}));var we;(function(e){function n(i,r,t,a,u){let s={name:i,kind:r,location:{uri:a,range:t}};return u&&(s.containerName=u),s}e.create=n})(we||(we={}));var ke;(function(e){function n(i,r,t,a){return a!==void 0?{name:i,kind:r,location:{uri:t,range:a}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var Ae;(function(e){function n(r,t,a,u,s,f){let l={name:r,detail:t,kind:a,range:u,selectionRange:s};return f!==void 0&&(l.children=f),l}e.create=n;function i(r){let t=r;return t&&o.string(t.name)&&o.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||o.string(t.detail))&&(t.deprecated===void 0||o.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(Ae||(Ae={}));var Ee;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ee||(Ee={}));var V;(function(e){e.Invoked=1,e.Automatic=2})(V||(V={}));var Le;(function(e){function n(r,t,a){let u={diagnostics:r};return t!=null&&(u.only=t),a!=null&&(u.triggerKind=a),u}e.create=n;function i(r){let t=r;return o.defined(t)&&o.typedArray(t.diagnostics,P.is)&&(t.only===void 0||o.typedArray(t.only,o.string))&&(t.triggerKind===void 0||t.triggerKind===V.Invoked||t.triggerKind===V.Automatic)}e.is=i})(Le||(Le={}));var Ie;(function(e){function n(r,t,a){let u={title:r},s=!0;return typeof t=="string"?(s=!1,u.kind=t):E.is(t)?u.command=t:u.edit=t,s&&a!==void 0&&(u.kind=a),u}e.create=n;function i(r){let t=r;return t&&o.string(t.title)&&(t.diagnostics===void 0||o.typedArray(t.diagnostics,P.is))&&(t.kind===void 0||o.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||E.is(t.command))&&(t.isPreferred===void 0||o.boolean(t.isPreferred))&&(t.edit===void 0||q.is(t.edit))}e.is=i})(Ie||(Ie={}));var Re;(function(e){function n(r,t){let a={range:r};return o.defined(t)&&(a.data=t),a}e.create=n;function i(r){let t=r;return o.defined(t)&&h.is(t.range)&&(o.undefined(t.command)||E.is(t.command))}e.is=i})(Re||(Re={}));var Me;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return o.defined(t)&&o.uinteger(t.tabSize)&&o.boolean(t.insertSpaces)}e.is=i})(Me||(Me={}));var De;(function(e){function n(r,t,a){return{range:r,target:t,data:a}}e.create=n;function i(r){let t=r;return o.defined(t)&&h.is(t.range)&&(o.undefined(t.target)||o.string(t.target))}e.is=i})(De||(De={}));var Fe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return o.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Fe||(Fe={}));var Ce;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Ce||(Ce={}));var je;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(je||(je={}));var Ne;(function(e){function n(i){const r=i;return o.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ne||(Ne={}));var Pe;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&o.string(t.text)}e.is=i})(Pe||(Pe={}));var ye;(function(e){function n(r,t,a){return{range:r,variableName:t,caseSensitiveLookup:a}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&o.boolean(t.caseSensitiveLookup)&&(o.string(t.variableName)||t.variableName===void 0)}e.is=i})(ye||(ye={}));var Ve;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(o.string(t.expression)||t.expression===void 0)}e.is=i})(Ve||(Ve={}));var Ue;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return o.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Ue||(Ue={}));var Y;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(Y||(Y={}));var Z;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&(t.tooltip===void 0||o.string(t.tooltip)||F.is(t.tooltip))&&(t.location===void 0||N.is(t.location))&&(t.command===void 0||E.is(t.command))}e.is=i})(Z||(Z={}));var Oe;(function(e){function n(r,t,a){const u={position:r,label:t};return a!==void 0&&(u.kind=a),u}e.create=n;function i(r){const t=r;return o.objectLiteral(t)&&_.is(t.position)&&(o.string(t.label)||o.typedArray(t.label,Z.is))&&(t.kind===void 0||Y.is(t.kind))&&t.textEdits===void 0||o.typedArray(t.textEdits,L.is)&&(t.tooltip===void 0||o.string(t.tooltip)||F.is(t.tooltip))&&(t.paddingLeft===void 0||o.boolean(t.paddingLeft))&&(t.paddingRight===void 0||o.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var He;(function(e){function n(i,r,t,a){return{insertText:i,filterText:r,range:t,command:a}}e.create=n})(He||(He={}));var We;(function(e){function n(i){return{items:i}}e.create=n})(We||(We={}));var Xe;(function(e){e.Invoked=0,e.Automatic=1})(Xe||(Xe={}));var $e;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})($e||($e={}));var ze;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(ze||(ze={}));var Be;(function(e){function n(i){const r=i;return o.objectLiteral(r)&&O.is(r.uri)&&o.string(r.name)}e.is=n})(Be||(Be={}));var qe;(function(e){function n(a,u,s,f){return new nt(a,u,s,f)}e.create=n;function i(a){let u=a;return!!(o.defined(u)&&o.string(u.uri)&&(o.undefined(u.languageId)||o.string(u.languageId))&&o.uinteger(u.lineCount)&&o.func(u.getText)&&o.func(u.positionAt)&&o.func(u.offsetAt))}e.is=i;function r(a,u){let s=a.getText(),f=t(u,(d,g)=>{let b=d.range.start.line-g.range.start.line;return b===0?d.range.start.character-g.range.start.character:b}),l=s.length;for(let d=f.length-1;d>=0;d--){let g=f[d],b=a.offsetAt(g.range.start),c=a.offsetAt(g.range.end);if(c<=l)s=s.substring(0,b)+g.newText+s.substring(c,s.length);else throw new Error("Overlapping edit");l=b}return s}e.applyEdits=r;function t(a,u){if(a.length<=1)return a;const s=a.length/2|0,f=a.slice(0,s),l=a.slice(s);t(f,u),t(l,u);let d=0,g=0,b=0;for(;d0&&n.push(i.length),this._lineOffsets=n}return this._lineOffsets}positionAt(n){n=Math.max(Math.min(n,this._content.length),0);let i=this.getLineOffsets(),r=0,t=i.length;if(t===0)return _.create(0,n);for(;rn?t=u:r=u+1}let a=r-1;return _.create(a,n-i[a])}offsetAt(n){let i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;let r=i[n.line],t=n.line+1"u"}e.undefined=r;function t(c){return c===!0||c===!1}e.boolean=t;function a(c){return n.call(c)==="[object String]"}e.string=a;function u(c){return n.call(c)==="[object Number]"}e.number=u;function s(c,U,tt){return n.call(c)==="[object Number]"&&U<=c&&c<=tt}e.numberRange=s;function f(c){return n.call(c)==="[object Number]"&&-2147483648<=c&&c<=2147483647}e.integer=f;function l(c){return n.call(c)==="[object Number]"&&0<=c&&c<=2147483647}e.uinteger=l;function d(c){return n.call(c)==="[object Function]"}e.func=d;function g(c){return c!==null&&typeof c=="object"}e.objectLiteral=g;function b(c,U){return Array.isArray(c)&&c.every(U)}e.typedArray=b})(o||(o={}));class pt{constructor(n,i,r){this._languageId=n,this._worker=i,this._disposables=[],this._listener=Object.create(null);const t=u=>{let s=u.getLanguageId();if(s!==this._languageId)return;let f;this._listener[u.uri.toString()]=u.onDidChangeContent(()=>{window.clearTimeout(f),f=window.setTimeout(()=>this._doValidate(u.uri,s),500)}),this._doValidate(u.uri,s)},a=u=>{w.setModelMarkers(u,this._languageId,[]);let s=u.uri.toString(),f=this._listener[s];f&&(f.dispose(),delete this._listener[s])};this._disposables.push(w.onDidCreateModel(t)),this._disposables.push(w.onWillDisposeModel(a)),this._disposables.push(w.onDidChangeModelLanguage(u=>{a(u.model),t(u.model)})),this._disposables.push(r(u=>{w.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(a(s),t(s))})})),this._disposables.push({dispose:()=>{w.getModels().forEach(a);for(let u in this._listener)this._listener[u].dispose()}}),w.getModels().forEach(t)}dispose(){this._disposables.forEach(n=>n&&n.dispose()),this._disposables.length=0}_doValidate(n,i){this._worker(n).then(r=>r.doValidation(n.toString())).then(r=>{const t=r.map(u=>it(n,u));let a=w.getModel(n);a&&a.getLanguageId()===i&&w.setModelMarkers(a,i,t)}).then(void 0,r=>{console.error(r)})}}function rt(e){switch(e){case A.Error:return R.Error;case A.Warning:return R.Warning;case A.Information:return R.Info;case A.Hint:return R.Hint;default:return R.Info}}function it(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:rt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}class mt{constructor(n,i){this._worker=n,this._triggerCharacters=i}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(n,i,r,t){const a=n.uri;return this._worker(a).then(u=>u.doComplete(a.toString(),k(i))).then(u=>{if(!u)return;const s=n.getWordUntilPosition(i),f=new Ge(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn),l=u.items.map(d=>{const g={label:d.label,insertText:d.insertText||d.label,sortText:d.sortText,filterText:d.filterText,documentation:d.documentation,detail:d.detail,command:ut(d.command),range:f,kind:ot(d.kind)};return d.textEdit&&(at(d.textEdit)?g.range={insert:v(d.textEdit.insert),replace:v(d.textEdit.replace)}:g.range=v(d.textEdit.range),g.insertText=d.textEdit.newText),d.additionalTextEdits&&(g.additionalTextEdits=d.additionalTextEdits.map(C)),d.insertTextFormat===J.Snippet&&(g.insertTextRules=x.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:u.isIncomplete,suggestions:l}})}}function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Ye(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function v(e){if(e)return new Ge(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function at(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function ot(e){const n=x.CompletionItemKind;switch(e){case p.Text:return n.Text;case p.Method:return n.Method;case p.Function:return n.Function;case p.Constructor:return n.Constructor;case p.Field:return n.Field;case p.Variable:return n.Variable;case p.Class:return n.Class;case p.Interface:return n.Interface;case p.Module:return n.Module;case p.Property:return n.Property;case p.Unit:return n.Unit;case p.Value:return n.Value;case p.Enum:return n.Enum;case p.Keyword:return n.Keyword;case p.Snippet:return n.Snippet;case p.Color:return n.Color;case p.File:return n.File;case p.Reference:return n.Reference}return n.Property}function C(e){if(e)return{range:v(e.range),text:e.newText}}function ut(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}class vt{constructor(n){this._worker=n}provideHover(n,i,r){let t=n.uri;return this._worker(t).then(a=>a.doHover(t.toString(),k(i))).then(a=>{if(a)return{range:v(a.range),contents:ct(a.contents)}})}}function st(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Qe(e){return typeof e=="string"?{value:e}:st(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` `+e.value+"\n```\n"}}function ct(e){if(e)return Array.isArray(e)?e.map(Qe):[Qe(e)]}class bt{constructor(n){this._worker=n}provideDocumentHighlights(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.findDocumentHighlights(t.toString(),k(i))).then(a=>{if(a)return a.map(u=>({range:v(u.range),kind:dt(u.kind)}))})}}function dt(e){switch(e){case D.Read:return x.DocumentHighlightKind.Read;case D.Write:return x.DocumentHighlightKind.Write;case D.Text:return x.DocumentHighlightKind.Text}return x.DocumentHighlightKind.Text}class _t{constructor(n){this._worker=n}provideDefinition(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.findDefinition(t.toString(),k(i))).then(a=>{if(a)return[Ze(a)]})}}function Ze(e){return{uri:Je.parse(e.uri),range:v(e.range)}}class xt{constructor(n){this._worker=n}provideReferences(n,i,r,t){const a=n.uri;return this._worker(a).then(u=>u.findReferences(a.toString(),k(i))).then(u=>{if(u)return u.map(Ze)})}}class wt{constructor(n){this._worker=n}provideRenameEdits(n,i,r,t){const a=n.uri;return this._worker(a).then(u=>u.doRename(a.toString(),k(i),r)).then(u=>ft(u))}}function ft(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=Je.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:v(t.range),text:t.newText}})}return{edits:n}}class kt{constructor(n){this._worker=n}provideDocumentSymbols(n,i){const r=n.uri;return this._worker(r).then(t=>t.findDocumentSymbols(r.toString())).then(t=>{if(t)return t.map(a=>lt(a)?Te(a):{name:a.name,detail:"",containerName:a.containerName,kind:Ke(a.kind),range:v(a.location.range),selectionRange:v(a.location.range),tags:[]})})}}function lt(e){return"children"in e}function Te(e){return{name:e.name,detail:e.detail??"",kind:Ke(e.kind),range:v(e.range),selectionRange:v(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Te(n))}}function Ke(e){let n=x.SymbolKind;switch(e){case m.File:return n.File;case m.Module:return n.Module;case m.Namespace:return n.Namespace;case m.Package:return n.Package;case m.Class:return n.Class;case m.Method:return n.Method;case m.Property:return n.Property;case m.Field:return n.Field;case m.Constructor:return n.Constructor;case m.Enum:return n.Enum;case m.Interface:return n.Interface;case m.Function:return n.Function;case m.Variable:return n.Variable;case m.Constant:return n.Constant;case m.String:return n.String;case m.Number:return n.Number;case m.Boolean:return n.Boolean;case m.Array:return n.Array}return n.Function}class At{constructor(n){this._worker=n}provideLinks(n,i){const r=n.uri;return this._worker(r).then(t=>t.findDocumentLinks(r.toString())).then(t=>{if(t)return{links:t.map(a=>({range:v(a.range),url:a.target}))}})}}class Et{constructor(n){this._worker=n}provideDocumentFormattingEdits(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.format(t.toString(),null,et(i)).then(u=>{if(!(!u||u.length===0))return u.map(C)}))}}class Lt{constructor(n){this._worker=n,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(n,i,r,t){const a=n.uri;return this._worker(a).then(u=>u.format(a.toString(),Ye(i),et(r)).then(s=>{if(!(!s||s.length===0))return s.map(C)}))}}function et(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}class It{constructor(n){this._worker=n}provideDocumentColors(n,i){const r=n.uri;return this._worker(r).then(t=>t.findDocumentColors(r.toString())).then(t=>{if(t)return t.map(a=>({color:a.color,range:v(a.range)}))})}provideColorPresentations(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.getColorPresentations(t.toString(),i.color,Ye(i.range))).then(a=>{if(a)return a.map(u=>{let s={label:u.label};return u.textEdit&&(s.textEdit=C(u.textEdit)),u.additionalTextEdits&&(s.additionalTextEdits=u.additionalTextEdits.map(C)),s})})}}class Rt{constructor(n){this._worker=n}provideFoldingRanges(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.getFoldingRanges(t.toString(),i)).then(a=>{if(a)return a.map(u=>{const s={start:u.startLine+1,end:u.endLine+1};return typeof u.kind<"u"&&(s.kind=gt(u.kind)),s})})}}function gt(e){switch(e){case M.Comment:return x.FoldingRangeKind.Comment;case M.Imports:return x.FoldingRangeKind.Imports;case M.Region:return x.FoldingRangeKind.Region}}class Mt{constructor(n){this._worker=n}provideSelectionRanges(n,i,r){const t=n.uri;return this._worker(t).then(a=>a.getSelectionRanges(t.toString(),i.map(k))).then(a=>{if(a)return a.map(u=>{const s=[];for(;u;)s.push({range:v(u.range)}),u=u.parent;return s})})}}export{mt as C,bt as D,Rt as F,vt as H,xt as R,Mt as S,_t as a,kt as b,wt as c,It as d,pt as e,Et as f,Lt as g,At as h,k as i,Ye as j,C as k,v as t}; diff --git a/apps/pythinker-code/dist-web/assets/mdx-hT3-rC2J.js b/apps/pythinker-code/dist-web/assets/mdx-G_32mYPD.js similarity index 97% rename from apps/pythinker-code/dist-web/assets/mdx-hT3-rC2J.js rename to apps/pythinker-code/dist-web/assets/mdx-G_32mYPD.js index 5233c3ba4..470947a3a 100644 --- a/apps/pythinker-code/dist-web/assets/mdx-hT3-rC2J.js +++ b/apps/pythinker-code/dist-web/assets/mdx-G_32mYPD.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const r={comments:{blockComment:["{/*","*/}"]},brackets:[["{","}"]],autoClosingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"“",close:"”"},{open:"‘",close:"’"},{open:"`",close:"`"},{open:"{",close:"}"},{open:"(",close:")"},{open:"_",close:"_"},{open:"**",close:"**"},{open:"<",close:">"}],onEnterRules:[{beforeText:/^\s*- .+/,action:{indentAction:e.IndentAction.None,appendText:"- "}},{beforeText:/^\s*\+ .+/,action:{indentAction:e.IndentAction.None,appendText:"+ "}},{beforeText:/^\s*\* .+/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^> /,action:{indentAction:e.IndentAction.None,appendText:"> "}},{beforeText:/<\w+/,action:{indentAction:e.IndentAction.Indent}},{beforeText:/\s+>\s*$/,action:{indentAction:e.IndentAction.Indent}},{beforeText:/<\/\w+>/,action:{indentAction:e.IndentAction.Outdent}},...Array.from({length:100},(n,t)=>({beforeText:new RegExp(`^${t}\\. .+`),action:{indentAction:e.IndentAction.None,appendText:`${t+1}. `}}))]},d={defaultToken:"",tokenPostfix:".mdx",control:/[!#()*+.[\\\]_`{}\-]/,escapes:/\\@control/,tokenizer:{root:[[/^---$/,{token:"meta.content",next:"@frontmatter",nextEmbedded:"yaml"}],[/^\s*import/,{token:"keyword",next:"@import",nextEmbedded:"js"}],[/^\s*export/,{token:"keyword",next:"@export",nextEmbedded:"js"}],[/<\w+/,{token:"type.identifier",next:"@jsx"}],[/<\/?\w+>/,"type.identifier"],[/^(\s*)(>*\s*)(#{1,6}\s)/,[{token:"white"},{token:"comment"},{token:"keyword",next:"@header"}]],[/^(\s*)(>*\s*)([*+-])(\s+)/,["white","comment","keyword","white"]],[/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/,["white","comment","number","white"]],[/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/,["white","comment","number","white"]],[/^(\s*)(>*\s*)(-{3,}|\*{3,}|_{3,})$/,["white","comment","keyword"]],[/`{3,}(\s.*)?$/,{token:"string",next:"@codeblock_backtick"}],[/~{3,}(\s.*)?$/,{token:"string",next:"@codeblock_tilde"}],[/`{3,}(\S+).*$/,{token:"string",next:"@codeblock_highlight_backtick",nextEmbedded:"$1"}],[/~{3,}(\S+).*$/,{token:"string",next:"@codeblock_highlight_tilde",nextEmbedded:"$1"}],[/^(\s*)(-{4,})$/,["white","comment"]],[/^(\s*)(>+)/,["white","comment"]],{include:"content"}],content:[[/(\[)(.+)(]\()(.+)(\s+".*")(\))/,["","string.link","","type.identifier","string.link",""]],[/(\[)(.+)(]\()(.+)(\))/,["","type.identifier","","string.link",""]],[/(\[)(.+)(]\[)(.+)(])/,["","type.identifier","","type.identifier",""]],[/(\[)(.+)(]:\s+)(\S*)/,["","type.identifier","","string.link"]],[/(\[)(.+)(])/,["","type.identifier",""]],[/`.*`/,"variable.source"],[/_/,{token:"emphasis",next:"@emphasis_underscore"}],[/\*(?!\*)/,{token:"emphasis",next:"@emphasis_asterisk"}],[/\*\*/,{token:"strong",next:"@strong"}],[/{/,{token:"delimiter.bracket",next:"@expression",nextEmbedded:"js"}]],import:[[/'\s*(;|$)/,{token:"string",next:"@pop",nextEmbedded:"@pop"}]],expression:[[/{/,{token:"delimiter.bracket",next:"@expression"}],[/}/,{token:"delimiter.bracket",next:"@pop",nextEmbedded:"@pop"}]],export:[[/^\s*$/,{token:"delimiter.bracket",next:"@pop",nextEmbedded:"@pop"}]],jsx:[[/\s+/,""],[/(\w+)(=)("(?:[^"\\]|\\.)*")/,["attribute.name","operator","string"]],[/(\w+)(=)('(?:[^'\\]|\\.)*')/,["attribute.name","operator","string"]],[/(\w+(?=\s|>|={|$))/,["attribute.name"]],[/={/,{token:"delimiter.bracket",next:"@expression",nextEmbedded:"js"}],[/>/,{token:"type.identifier",next:"@pop"}]],header:[[/.$/,{token:"keyword",next:"@pop"}],{include:"content"},[/./,{token:"keyword"}]],strong:[[/\*\*/,{token:"strong",next:"@pop"}],{include:"content"},[/./,{token:"strong"}]],emphasis_underscore:[[/_/,{token:"emphasis",next:"@pop"}],{include:"content"},[/./,{token:"emphasis"}]],emphasis_asterisk:[[/\*(?!\*)/,{token:"emphasis",next:"@pop"}],{include:"content"},[/./,{token:"emphasis"}]],frontmatter:[[/^---$/,{token:"meta.content",nextEmbedded:"@pop",next:"@pop"}]],codeblock_highlight_backtick:[[/\s*`{3,}\s*$/,{token:"string",next:"@pop",nextEmbedded:"@pop"}],[/.*$/,"variable.source"]],codeblock_highlight_tilde:[[/\s*~{3,}\s*$/,{token:"string",next:"@pop",nextEmbedded:"@pop"}],[/.*$/,"variable.source"]],codeblock_backtick:[[/\s*`{3,}\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblock_tilde:[[/\s*~{3,}\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]]}};export{r as conf,d as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const r={comments:{blockComment:["{/*","*/}"]},brackets:[["{","}"]],autoClosingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"“",close:"”"},{open:"‘",close:"’"},{open:"`",close:"`"},{open:"{",close:"}"},{open:"(",close:")"},{open:"_",close:"_"},{open:"**",close:"**"},{open:"<",close:">"}],onEnterRules:[{beforeText:/^\s*- .+/,action:{indentAction:e.IndentAction.None,appendText:"- "}},{beforeText:/^\s*\+ .+/,action:{indentAction:e.IndentAction.None,appendText:"+ "}},{beforeText:/^\s*\* .+/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^> /,action:{indentAction:e.IndentAction.None,appendText:"> "}},{beforeText:/<\w+/,action:{indentAction:e.IndentAction.Indent}},{beforeText:/\s+>\s*$/,action:{indentAction:e.IndentAction.Indent}},{beforeText:/<\/\w+>/,action:{indentAction:e.IndentAction.Outdent}},...Array.from({length:100},(n,t)=>({beforeText:new RegExp(`^${t}\\. .+`),action:{indentAction:e.IndentAction.None,appendText:`${t+1}. `}}))]},d={defaultToken:"",tokenPostfix:".mdx",control:/[!#()*+.[\\\]_`{}\-]/,escapes:/\\@control/,tokenizer:{root:[[/^---$/,{token:"meta.content",next:"@frontmatter",nextEmbedded:"yaml"}],[/^\s*import/,{token:"keyword",next:"@import",nextEmbedded:"js"}],[/^\s*export/,{token:"keyword",next:"@export",nextEmbedded:"js"}],[/<\w+/,{token:"type.identifier",next:"@jsx"}],[/<\/?\w+>/,"type.identifier"],[/^(\s*)(>*\s*)(#{1,6}\s)/,[{token:"white"},{token:"comment"},{token:"keyword",next:"@header"}]],[/^(\s*)(>*\s*)([*+-])(\s+)/,["white","comment","keyword","white"]],[/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/,["white","comment","number","white"]],[/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/,["white","comment","number","white"]],[/^(\s*)(>*\s*)(-{3,}|\*{3,}|_{3,})$/,["white","comment","keyword"]],[/`{3,}(\s.*)?$/,{token:"string",next:"@codeblock_backtick"}],[/~{3,}(\s.*)?$/,{token:"string",next:"@codeblock_tilde"}],[/`{3,}(\S+).*$/,{token:"string",next:"@codeblock_highlight_backtick",nextEmbedded:"$1"}],[/~{3,}(\S+).*$/,{token:"string",next:"@codeblock_highlight_tilde",nextEmbedded:"$1"}],[/^(\s*)(-{4,})$/,["white","comment"]],[/^(\s*)(>+)/,["white","comment"]],{include:"content"}],content:[[/(\[)(.+)(]\()(.+)(\s+".*")(\))/,["","string.link","","type.identifier","string.link",""]],[/(\[)(.+)(]\()(.+)(\))/,["","type.identifier","","string.link",""]],[/(\[)(.+)(]\[)(.+)(])/,["","type.identifier","","type.identifier",""]],[/(\[)(.+)(]:\s+)(\S*)/,["","type.identifier","","string.link"]],[/(\[)(.+)(])/,["","type.identifier",""]],[/`.*`/,"variable.source"],[/_/,{token:"emphasis",next:"@emphasis_underscore"}],[/\*(?!\*)/,{token:"emphasis",next:"@emphasis_asterisk"}],[/\*\*/,{token:"strong",next:"@strong"}],[/{/,{token:"delimiter.bracket",next:"@expression",nextEmbedded:"js"}]],import:[[/'\s*(;|$)/,{token:"string",next:"@pop",nextEmbedded:"@pop"}]],expression:[[/{/,{token:"delimiter.bracket",next:"@expression"}],[/}/,{token:"delimiter.bracket",next:"@pop",nextEmbedded:"@pop"}]],export:[[/^\s*$/,{token:"delimiter.bracket",next:"@pop",nextEmbedded:"@pop"}]],jsx:[[/\s+/,""],[/(\w+)(=)("(?:[^"\\]|\\.)*")/,["attribute.name","operator","string"]],[/(\w+)(=)('(?:[^'\\]|\\.)*')/,["attribute.name","operator","string"]],[/(\w+(?=\s|>|={|$))/,["attribute.name"]],[/={/,{token:"delimiter.bracket",next:"@expression",nextEmbedded:"js"}],[/>/,{token:"type.identifier",next:"@pop"}]],header:[[/.$/,{token:"keyword",next:"@pop"}],{include:"content"},[/./,{token:"keyword"}]],strong:[[/\*\*/,{token:"strong",next:"@pop"}],{include:"content"},[/./,{token:"strong"}]],emphasis_underscore:[[/_/,{token:"emphasis",next:"@pop"}],{include:"content"},[/./,{token:"emphasis"}]],emphasis_asterisk:[[/\*(?!\*)/,{token:"emphasis",next:"@pop"}],{include:"content"},[/./,{token:"emphasis"}]],frontmatter:[[/^---$/,{token:"meta.content",nextEmbedded:"@pop",next:"@pop"}]],codeblock_highlight_backtick:[[/\s*`{3,}\s*$/,{token:"string",next:"@pop",nextEmbedded:"@pop"}],[/.*$/,"variable.source"]],codeblock_highlight_tilde:[[/\s*~{3,}\s*$/,{token:"string",next:"@pop",nextEmbedded:"@pop"}],[/.*$/,"variable.source"]],codeblock_backtick:[[/\s*`{3,}\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblock_tilde:[[/\s*~{3,}\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]]}};export{r as conf,d as language}; diff --git a/apps/pythinker-code/dist-web/assets/mermaid.core-Pmnag6hS.js b/apps/pythinker-code/dist-web/assets/mermaid.core-4ur3W-UG.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/mermaid.core-Pmnag6hS.js rename to apps/pythinker-code/dist-web/assets/mermaid.core-4ur3W-UG.js index 8749ec570..b4d5faa11 100644 --- a/apps/pythinker-code/dist-web/assets/mermaid.core-Pmnag6hS.js +++ b/apps/pythinker-code/dist-web/assets/mermaid.core-4ur3W-UG.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-CTTg6OBe.js","assets/index-BK-wRR5p.js","assets/index-Hz7Ro1k-.css","assets/purify.es-5AjVNlXF.js","assets/dagre-3AP2YEHR-BTFijvde.js","assets/layout-WxS0y9O_.js","assets/swimlanes-XN3QIQJK-CxY3Jzhb.js","assets/cose-bilkent-JH36ORCC-DJYw1bPd.js","assets/cytoscape.esm-CNiYdHpY.js","assets/c4Diagram-UCG6FXSJ-D3l3THs_.js","assets/chunk-F27PBJKO-CENksy_e.js","assets/flowDiagram-A5DVABFB-CyNh512Q.js","assets/chunk-5VM5RSS4-BhXMeeD7.js","assets/chunk-XXDRQBXY-LvYS55fD.js","assets/chunk-POPQ4Y6H-BOop7K_8.js","assets/channel-DILt7hqb.js","assets/swimlanesDiagram-VK2B7HYN-Dz6vrGDq.js","assets/erDiagram-SSCWMZ5O-BK7BwULF.js","assets/gitGraphDiagram-WWUBYQGX-CFwfjpOY.js","assets/chunk-2Q5K7J3B-BJtTXqt1.js","assets/chunk-JWPE2WC7-DvwwB7DW.js","assets/cynefin-OW5HDTMX-CwX4S6So.js","assets/ganttDiagram-EL5Y4UJY-CPhXhxrU.js","assets/linear-CJbRkaTL.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-RXCK75RN-D9yY8FD1.js","assets/pieDiagram-E7YTZNPT-BvWXdat9.js","assets/arc-C__I0s6O.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AXDQQJYC-BnL0cSU1.js","assets/xychartDiagram-S5SC5T6Z-DLFyRTkx.js","assets/requirementDiagram-EFPCY7ZU-wkrY2ays.js","assets/sequenceDiagram-WJ2MYXX4-Cacl2vKI.js","assets/classDiagram-DTDB5LWJ-Bf2t55u3.js","assets/chunk-LCL6LL3I-8Wpy_Sgd.js","assets/classDiagram-v2-JRS7N3AN-Bf2t55u3.js","assets/stateDiagram-HBIQ2CUA-DOgDo4PT.js","assets/chunk-G27WJ6UU-D54gu-ld.js","assets/stateDiagram-v2-4QOOHH4V-CF_x3j8a.js","assets/journeyDiagram-EYS64GPL-Bmt-4Suk.js","assets/timeline-definition-24CTP7MA-CE4hXwQQ.js","assets/mindmap-definition-FBJOCRG2-CO7-mhBG.js","assets/kanban-definition-3QL26DDD-Di0cOJ8w.js","assets/sankeyDiagram-P5KCCOFB-Bu30_Mr-.js","assets/diagram-Z3DM3KII-DhBfeF96.js","assets/diagram-UQ7AKVKN-CGYnSu9y.js","assets/blockDiagram-NRAW4CY4-DOMoQR_0.js","assets/diagram-S7CK7UJ4-Bry2fVtY.js","assets/architectureDiagram-5GKGNRK7-D-HOppuj.js","assets/diagram-VSXAHHWV-w7rFR6te.js","assets/ishikawaDiagram-5VMMS53U-CYM95aw7.js","assets/vennDiagram-4TSXK5OY-BpYKJWUZ.js","assets/diagram-VX7I27RA-CToQJsz-.js","assets/wardleyDiagram-VM6X3IG4-Bm8Te4ZD.js","assets/cynefinDiagram-5FMLGOSQ-Xl-hEOic.js","assets/railroadDiagram-O6MQD6OU-BL3Lwsrn.js","assets/chunk-SVP7TREG-XNRd51cY.js","assets/ebnfDiagram-PWID7BFC-Du-YMm3d.js","assets/abnfDiagram-VCTEODGH-CpEdlyYv.js","assets/pegDiagram-XKGWAZYB-D9mF9qH_.js"])))=>i.map(i=>d[i]); -import{bR as _t}from"./index-BK-wRR5p.js";import{p as Hr}from"./purify.es-5AjVNlXF.js";var cd=Object.defineProperty,g=(e,t)=>cd(e,"name",{value:t,configurable:!0}),Qy=(e,t)=>{for(var r in t)cd(e,r,{get:t[r],enumerable:!0})};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps={exports:{}},Jy=ps.exports,Dl;function tm(){return Dl||(Dl=1,(function(e,t){(function(r,i){e.exports=i()})(Jy,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",y="date",m="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var O=["th","st","nd","rd"],v=E%100;return"["+E+(O[(v-20)%10]||O[v]||O[0])+"]"}},S=function(E,O,v){var R=String(E);return!R||R.length>=O?E:""+Array(O+1-R.length).join(v)+E},T={s:S,z:function(E){var O=-E.utcOffset(),v=Math.abs(O),R=Math.floor(v/60),$=v%60;return(O<=0?"+":"-")+S(R,2,"0")+":"+S($,2,"0")},m:function E(O,v){if(O.date()1)return E(Z[0])}else{var ut=O.name;L[ut]=O,$=ut}return!R&&$&&(_=$),$||!R&&_},z=function(E,O){if(B(E))return E.clone();var v=typeof O=="object"?O:{};return v.date=E,v.args=arguments,new et(v)},I=T;I.l=X,I.i=B,I.w=function(E,O){return z(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var et=(function(){function E(v){this.$L=X(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[M]=!0}var O=E.prototype;return O.parse=function(v){this.$d=(function(R){var $=R.date,J=R.utc;if($===null)return new Date(NaN);if(I.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Z=$.match(x);if(Z){var ut=Z[2]-1||0,Ct=(Z[7]||"0").substring(0,3);return J?new Date(Date.UTC(Z[1],ut,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Ct)):new Date(Z[1],ut,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Ct)}}return new Date($)})(v),this.init()},O.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},O.$utils=function(){return I},O.isValid=function(){return this.$d.toString()!==m},O.isSame=function(v,R){var $=z(v);return this.startOf(R)<=$&&$<=this.endOf(R)},O.isAfter=function(v,R){return z(v){},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},nn=g(function(e="fatal"){let t=Pe.fatal;typeof e=="string"?e.toLowerCase()in Pe&&(t=Pe[e]):typeof e=="number"&&(t=e),P.trace=()=>{},P.debug=()=>{},P.info=()=>{},P.warn=()=>{},P.error=()=>{},P.fatal=()=>{},t<=Pe.fatal&&(P.fatal=console.error?console.error.bind(console,ne("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ne("FATAL"))),t<=Pe.error&&(P.error=console.error?console.error.bind(console,ne("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ne("ERROR"))),t<=Pe.warn&&(P.warn=console.warn?console.warn.bind(console,ne("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ne("WARN"))),t<=Pe.info&&(P.info=console.info?console.info.bind(console,ne("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ne("INFO"))),t<=Pe.debug&&(P.debug=console.debug?console.debug.bind(console,ne("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ne("DEBUG"))),t<=Pe.trace&&(P.trace=console.debug?console.debug.bind(console,ne("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ne("TRACE")))},"setLogLevel"),ne=g(e=>`%c${rm().format("ss.SSS")} : ${e} : `,"format");const ys={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;switch(i){case"r":return ys.hue2rgb(o,s,e+1/3)*255;case"g":return ys.hue2rgb(o,s,e)*255;case"b":return ys.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r),a=(s+o)/2;if(i==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(i==="s")return l*100;switch(s){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},sm={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},bt={channel:ys,lang:im,unit:sm},Ze={};for(let e=0;e<=255;e++)Ze[e]=bt.unit.dec2hex(e);const Xt={ALL:0,RGB:1,HSL:2};let om=class{constructor(){this.type=Xt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Xt.ALL}is(t){return this.type===t}};class am{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new om}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Xt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=bt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=bt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=bt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=bt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=bt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=bt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Xt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Xt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Xt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Xt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Xt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Xt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const eo=new am({r:0,g:0,b:0,a:0},"transparent"),qr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(qr.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return eo.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:o?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}${Ze[Math.round(s*255)]}`:`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}`}},cr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(cr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return bt.channel.clamp.h(parseFloat(r)*.9);case"rad":return bt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return bt.channel.clamp.h(parseFloat(r)*360)}}return bt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(cr.re);if(!r)return;const[,i,s,o,a,n]=r;return eo.set({h:cr._hue2deg(i),s:bt.channel.clamp.s(parseFloat(s)),l:bt.channel.clamp.l(parseFloat(o)),a:a?bt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${bt.lang.round(t)}, ${bt.lang.round(r)}%, ${bt.lang.round(i)}%, ${s})`:`hsl(${bt.lang.round(t)}, ${bt.lang.round(r)}%, ${bt.lang.round(i)}%)`}},Li={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Li.colors[e];if(t)return qr.parse(t)},stringify:e=>{const t=qr.stringify(e);for(const r in Li.colors)if(Li.colors[r]===t)return r}},xi={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(xi.re);if(!r)return;const[,i,s,o,a,n,l,c,h]=r;return eo.set({r:bt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:bt.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:bt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?bt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${bt.lang.round(t)}, ${bt.lang.round(r)}, ${bt.lang.round(i)}, ${bt.lang.round(s)})`:`rgb(${bt.lang.round(t)}, ${bt.lang.round(r)}, ${bt.lang.round(i)})`}},Fe={format:{keyword:Li,hex:qr,rgb:xi,rgba:xi,hsl:cr,hsla:cr},parse:e=>{if(typeof e!="string")return e;const t=qr.parse(e)||xi.parse(e)||cr.parse(e)||Li.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Xt.HSL)||e.data.r===void 0?cr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?xi.stringify(e):qr.stringify(e)},dd=(e,t)=>{const r=Fe.parse(e);for(const i in t)r[i]=bt.channel.clamp[i](t[i]);return Fe.stringify(r)},tr=(e,t,r=0,i=1)=>{if(typeof e!="number")return dd(e,{a:t});const s=eo.set({r:bt.channel.clamp.r(e),g:bt.channel.clamp.g(t),b:bt.channel.clamp.b(r),a:bt.channel.clamp.a(i)});return Fe.stringify(s)},nm=e=>{const{r:t,g:r,b:i}=Fe.parse(e),s=.2126*bt.channel.toLinear(t)+.7152*bt.channel.toLinear(r)+.0722*bt.channel.toLinear(i);return bt.lang.round(s)},lm=e=>nm(e)>=.5,xe=e=>!lm(e),ud=(e,t,r)=>{const i=Fe.parse(e),s=i[t],o=bt.channel.clamp[t](s+r);return s!==o&&(i[t]=o),Fe.stringify(i)},q=(e,t)=>ud(e,"l",t),N=(e,t)=>ud(e,"l",-t),b=(e,t)=>{const r=Fe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return dd(e,i)},hm=(e,t,r=50)=>{const{r:i,g:s,b:o,a}=Fe.parse(e),{r:n,g:l,b:c,a:h}=Fe.parse(t),d=r/100,u=d*2-1,f=a-h,m=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,x=1-m,C=i*m+n*x,k=s*m+l*x,S=o*m+c*x,T=a*d+h*(1-d);return tr(C,k,S,T)},F=(e,t=100)=>{const r=Fe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,hm(r,e,t)};var ma=g((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ma(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=ma(s[o],a,{depth:r-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Yt=ma,Ae="#ffffff",Ee="#f2f2f2",mt=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),cm=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||N(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||N(this.mainBkg,10)):(this.rowOdd=this.rowOdd||q(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||q(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},dm=g(e=>{const t=new cm;return t.calculate(e),t},"getThemeVariables"),um=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=N("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=N(this.sectionBkgColor,10),this.taskBorderColor=tr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=tr(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||q(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||N(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=q(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=q(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=q(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=F(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},fm=g(e=>{const t=new um;return t.calculate(e),t},"getThemeVariables"),gm=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=tr(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||N(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||N(this.tertiaryColor,40);for(let e=0;e{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},pm=g(e=>{const t=new gm;return t.calculate(e),t},"getThemeVariables"),ym=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=q("#cde498",10),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.primaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=N(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||N(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||N(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},mm=g(e=>{const t=new ym;return t.calculate(e),t},"getThemeVariables"),xm=class{static{g(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=q(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||q(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=q(this.contrast,55),this.border2=this.contrast,this.actorBorder=q(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Cm=g(e=>{const t=new xm;return t.calculate(e),t},"getThemeVariables"),bm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||b(e,{h:30}),this.cScale4=this.cScale4||b(e,{h:60}),this.cScale5=this.cScale5||b(e,{h:90}),this.cScale6=this.cScale6||b(e,{h:120}),this.cScale7=this.cScale7||b(e,{h:150}),this.cScale8=this.cScale8||b(e,{h:210,l:150}),this.cScale9=this.cScale9||b(e,{h:270}),this.cScale10=this.cScale10||b(e,{h:300}),this.cScale11=this.cScale11||b(e,{h:330}),this.darkMode)for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},km=g(e=>{const t=new bm;return t.calculate(e),t},"getThemeVariables"),wm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Sm=g(e=>{const t=new wm;return t.calculate(e),t},"getThemeVariables"),Tm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=mt("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},_m=g(e=>{const t=new Tm;return t.calculate(e),t},"getThemeVariables"),vm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Bm=g(e=>{const t=new vm;return t.calculate(e),t},"getThemeVariables"),Lm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Fm=g(e=>{const t=new Lm;return t.calculate(e),t},"getThemeVariables"),Mm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Am=g(e=>{const t=new Mm;return t.calculate(e),t},"getThemeVariables"),We={base:{getThemeVariables:dm},dark:{getThemeVariables:fm},default:{getThemeVariables:pm},forest:{getThemeVariables:mm},neutral:{getThemeVariables:Cm},neo:{getThemeVariables:km},"neo-dark":{getThemeVariables:Sm},redux:{getThemeVariables:_m},"redux-dark":{getThemeVariables:Bm},"redux-color":{getThemeVariables:Fm},"redux-dark-color":{getThemeVariables:Am}},jt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},fd={...jt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:We.default.getThemeVariables(),sequence:{...jt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...jt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...jt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...jt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...jt.pie,useWidth:984},xyChart:{...jt.xyChart,useWidth:void 0},requirement:{...jt.requirement,useWidth:void 0},packet:{...jt.packet},eventmodeling:{...jt.eventmodeling},treeView:{...jt.treeView,useWidth:void 0},radar:{...jt.radar},railroad:{...jt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...jt.ishikawa},sankey:{...jt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...jt.venn},cynefin:{...jt.cynefin}},gd=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...gd(e[i],"")]:[...r,t+i],[]),"keyify"),Em=new Set(gd(fd,"")),pd=fd,$m={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Om=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(P.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Ls=g(e=>{if(P.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ls(t));return}for(const t of Object.keys(e)){if(P.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Em.has(t)||e[t]==null){P.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=$m[t];i?Om(e[t],i):(P.debug("sanitizing object",t),Ls(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(P.debug("sanitizing css option",t),e[t]=yd(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}P.debug("After sanitization",e)}},"sanitizeDirective"),yd=g(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),re=Yt({},Yr),Fs,gr=[],Fi=Yt({},Yr),Ui=g((e,t)=>{let r=Yt({},e),i={};for(const s of t)Cd(s),i=Yt(i,s);if(r=Yt(r,i),i.theme&&i.theme in We){const s=Yt({},Fs),o=Yt(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in We&&(r.themeVariables=We[r.theme].getThemeVariables(o))}return Fi=r,Nm(Fi),Fi},"updateCurrentConfig"),Dm=g(e=>(re=Yt({},Yr),re=Yt(re,e),e.theme&&We[e.theme]&&(re.themeVariables=We[e.theme].getThemeVariables(e.themeVariables)),Ui(re,gr),re),"setSiteConfig"),Pm=g(e=>{Fs=Yt({},e)},"saveConfigFromInitialize"),Im=g(e=>(re=Yt(re,e),Ui(re,gr),re),"updateSiteConfig"),md=g(()=>Yt({},re),"getSiteConfig"),xd=g(e=>(Ui(Fi,[e]),Rt()),"setConfig"),Rt=g(()=>Yt({},Fi),"getConfig"),Cd=g(e=>{e&&(["secure",...re.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(P.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Cd(e[t])}))},"sanitize"),Rm=g(e=>{Ls(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),gr.push(e),Ui(re,gr)},"addDirective"),Ms=g((e=re)=>{gr=[],Ui(e,gr)},"reset"),qm={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Pl={},bd=g(e=>{Pl[e]||(P.warn(qm[e]),Pl[e]=!0)},"issueWarning"),Nm=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&bd("LAZY_LOAD_DEPRECATED")},"checkConfig"),O5=g(()=>{let e={};Fs&&(e=Yt(e,Fs));for(const t of gr)e=Yt(e,t);return e},"getUserDefinedConfig"),Kt=g(e=>(e.flowchart?.htmlLabels!=null&&bd("FLOWCHART_HTML_LABELS_DEPRECATED"),$e(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),kd=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Mi=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Wm=/\s*%%.*\n/gm,wd=class extends Error{static{g(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},pr={},ln=g(function(e,t){e=e.replace(kd,"").replace(Mi,"").replace(Wm,` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-B8XbaAIu.js","assets/index-C0iEUKAq.js","assets/index-Hz7Ro1k-.css","assets/purify.es-5AjVNlXF.js","assets/dagre-3AP2YEHR-BWn6Idgx.js","assets/layout-g7MtGH-g.js","assets/swimlanes-XN3QIQJK-DlKPgrxj.js","assets/cose-bilkent-JH36ORCC-vlSnVTfO.js","assets/cytoscape.esm-CNiYdHpY.js","assets/c4Diagram-UCG6FXSJ-DWiNeOGo.js","assets/chunk-F27PBJKO-d2g57_ei.js","assets/flowDiagram-A5DVABFB-DnEfMg9m.js","assets/chunk-5VM5RSS4-BjJ31Xiv.js","assets/chunk-XXDRQBXY-B0zDZEAk.js","assets/chunk-POPQ4Y6H-Bc64Qx3F.js","assets/channel-Ce13qtYp.js","assets/swimlanesDiagram-VK2B7HYN-iHH4fxb9.js","assets/erDiagram-SSCWMZ5O-Y2Kx4K01.js","assets/gitGraphDiagram-WWUBYQGX-B6MjdyCr.js","assets/chunk-2Q5K7J3B-By4pMuFm.js","assets/chunk-JWPE2WC7-CBKlOueZ.js","assets/cynefin-OW5HDTMX-B_2mZ5_M.js","assets/ganttDiagram-EL5Y4UJY-DHRYTGQL.js","assets/linear-CTZFHtw0.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-RXCK75RN-DnUqCcVs.js","assets/pieDiagram-E7YTZNPT-DmQ5At8v.js","assets/arc-ChDdl02F.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AXDQQJYC-D_IgCGNI.js","assets/xychartDiagram-S5SC5T6Z-BYpEl4K7.js","assets/requirementDiagram-EFPCY7ZU-CrRI3OsX.js","assets/sequenceDiagram-WJ2MYXX4-CHUJYzom.js","assets/classDiagram-DTDB5LWJ-iewAXWXR.js","assets/chunk-LCL6LL3I-BJFLBZ7h.js","assets/classDiagram-v2-JRS7N3AN-iewAXWXR.js","assets/stateDiagram-HBIQ2CUA-1JuYFASL.js","assets/chunk-G27WJ6UU-D-57FaZo.js","assets/stateDiagram-v2-4QOOHH4V-Bv7KRSeS.js","assets/journeyDiagram-EYS64GPL-CYf7qu-o.js","assets/timeline-definition-24CTP7MA-BxrqJk2T.js","assets/mindmap-definition-FBJOCRG2-Ue2jfeTc.js","assets/kanban-definition-3QL26DDD--1wLk-1R.js","assets/sankeyDiagram-P5KCCOFB-dr9T-hji.js","assets/diagram-Z3DM3KII-DQhaVd0o.js","assets/diagram-UQ7AKVKN-NCrmzyFy.js","assets/blockDiagram-NRAW4CY4-DquLxvSM.js","assets/diagram-S7CK7UJ4-CsGEy4pv.js","assets/architectureDiagram-5GKGNRK7-Cu602jjl.js","assets/diagram-VSXAHHWV-DX1w9vGD.js","assets/ishikawaDiagram-5VMMS53U-V_xG_Q39.js","assets/vennDiagram-4TSXK5OY-BrUn21V7.js","assets/diagram-VX7I27RA-Cj2f-GhL.js","assets/wardleyDiagram-VM6X3IG4-D34PRRSw.js","assets/cynefinDiagram-5FMLGOSQ-D4XXylSl.js","assets/railroadDiagram-O6MQD6OU-BQ5evXj8.js","assets/chunk-SVP7TREG-C1yhxvNc.js","assets/ebnfDiagram-PWID7BFC-CZX4bYJf.js","assets/abnfDiagram-VCTEODGH-B5EIRmLW.js","assets/pegDiagram-XKGWAZYB-pzaRoeVF.js"])))=>i.map(i=>d[i]); +import{bR as _t}from"./index-C0iEUKAq.js";import{p as Hr}from"./purify.es-5AjVNlXF.js";var cd=Object.defineProperty,g=(e,t)=>cd(e,"name",{value:t,configurable:!0}),Qy=(e,t)=>{for(var r in t)cd(e,r,{get:t[r],enumerable:!0})};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps={exports:{}},Jy=ps.exports,Dl;function tm(){return Dl||(Dl=1,(function(e,t){(function(r,i){e.exports=i()})(Jy,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",y="date",m="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var O=["th","st","nd","rd"],v=E%100;return"["+E+(O[(v-20)%10]||O[v]||O[0])+"]"}},S=function(E,O,v){var R=String(E);return!R||R.length>=O?E:""+Array(O+1-R.length).join(v)+E},T={s:S,z:function(E){var O=-E.utcOffset(),v=Math.abs(O),R=Math.floor(v/60),$=v%60;return(O<=0?"+":"-")+S(R,2,"0")+":"+S($,2,"0")},m:function E(O,v){if(O.date()1)return E(Z[0])}else{var ut=O.name;L[ut]=O,$=ut}return!R&&$&&(_=$),$||!R&&_},z=function(E,O){if(B(E))return E.clone();var v=typeof O=="object"?O:{};return v.date=E,v.args=arguments,new et(v)},I=T;I.l=X,I.i=B,I.w=function(E,O){return z(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var et=(function(){function E(v){this.$L=X(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[M]=!0}var O=E.prototype;return O.parse=function(v){this.$d=(function(R){var $=R.date,J=R.utc;if($===null)return new Date(NaN);if(I.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Z=$.match(x);if(Z){var ut=Z[2]-1||0,Ct=(Z[7]||"0").substring(0,3);return J?new Date(Date.UTC(Z[1],ut,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Ct)):new Date(Z[1],ut,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Ct)}}return new Date($)})(v),this.init()},O.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},O.$utils=function(){return I},O.isValid=function(){return this.$d.toString()!==m},O.isSame=function(v,R){var $=z(v);return this.startOf(R)<=$&&$<=this.endOf(R)},O.isAfter=function(v,R){return z(v){},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},nn=g(function(e="fatal"){let t=Pe.fatal;typeof e=="string"?e.toLowerCase()in Pe&&(t=Pe[e]):typeof e=="number"&&(t=e),P.trace=()=>{},P.debug=()=>{},P.info=()=>{},P.warn=()=>{},P.error=()=>{},P.fatal=()=>{},t<=Pe.fatal&&(P.fatal=console.error?console.error.bind(console,ne("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ne("FATAL"))),t<=Pe.error&&(P.error=console.error?console.error.bind(console,ne("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ne("ERROR"))),t<=Pe.warn&&(P.warn=console.warn?console.warn.bind(console,ne("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ne("WARN"))),t<=Pe.info&&(P.info=console.info?console.info.bind(console,ne("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ne("INFO"))),t<=Pe.debug&&(P.debug=console.debug?console.debug.bind(console,ne("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ne("DEBUG"))),t<=Pe.trace&&(P.trace=console.debug?console.debug.bind(console,ne("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ne("TRACE")))},"setLogLevel"),ne=g(e=>`%c${rm().format("ss.SSS")} : ${e} : `,"format");const ys={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;switch(i){case"r":return ys.hue2rgb(o,s,e+1/3)*255;case"g":return ys.hue2rgb(o,s,e)*255;case"b":return ys.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r),a=(s+o)/2;if(i==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(i==="s")return l*100;switch(s){case e:return((t-r)/n+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},sm={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},bt={channel:ys,lang:im,unit:sm},Ze={};for(let e=0;e<=255;e++)Ze[e]=bt.unit.dec2hex(e);const Xt={ALL:0,RGB:1,HSL:2};let om=class{constructor(){this.type=Xt.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Xt.ALL}is(t){return this.type===t}};class am{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new om}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Xt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=bt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=bt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=bt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=bt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=bt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=bt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Xt.HSL)&&r!==void 0?r:(this._ensureHSL(),bt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Xt.RGB)&&r!==void 0?r:(this._ensureRGB(),bt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Xt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Xt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Xt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Xt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Xt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Xt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const eo=new am({r:0,g:0,b:0,a:0},"transparent"),qr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(qr.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return eo.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:o?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}${Ze[Math.round(s*255)]}`:`#${Ze[Math.round(t)]}${Ze[Math.round(r)]}${Ze[Math.round(i)]}`}},cr={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(cr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return bt.channel.clamp.h(parseFloat(r)*.9);case"rad":return bt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return bt.channel.clamp.h(parseFloat(r)*360)}}return bt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(cr.re);if(!r)return;const[,i,s,o,a,n]=r;return eo.set({h:cr._hue2deg(i),s:bt.channel.clamp.s(parseFloat(s)),l:bt.channel.clamp.l(parseFloat(o)),a:a?bt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${bt.lang.round(t)}, ${bt.lang.round(r)}%, ${bt.lang.round(i)}%, ${s})`:`hsl(${bt.lang.round(t)}, ${bt.lang.round(r)}%, ${bt.lang.round(i)}%)`}},Li={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Li.colors[e];if(t)return qr.parse(t)},stringify:e=>{const t=qr.stringify(e);for(const r in Li.colors)if(Li.colors[r]===t)return r}},xi={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(xi.re);if(!r)return;const[,i,s,o,a,n,l,c,h]=r;return eo.set({r:bt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:bt.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:bt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?bt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${bt.lang.round(t)}, ${bt.lang.round(r)}, ${bt.lang.round(i)}, ${bt.lang.round(s)})`:`rgb(${bt.lang.round(t)}, ${bt.lang.round(r)}, ${bt.lang.round(i)})`}},Fe={format:{keyword:Li,hex:qr,rgb:xi,rgba:xi,hsl:cr,hsla:cr},parse:e=>{if(typeof e!="string")return e;const t=qr.parse(e)||xi.parse(e)||cr.parse(e)||Li.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Xt.HSL)||e.data.r===void 0?cr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?xi.stringify(e):qr.stringify(e)},dd=(e,t)=>{const r=Fe.parse(e);for(const i in t)r[i]=bt.channel.clamp[i](t[i]);return Fe.stringify(r)},tr=(e,t,r=0,i=1)=>{if(typeof e!="number")return dd(e,{a:t});const s=eo.set({r:bt.channel.clamp.r(e),g:bt.channel.clamp.g(t),b:bt.channel.clamp.b(r),a:bt.channel.clamp.a(i)});return Fe.stringify(s)},nm=e=>{const{r:t,g:r,b:i}=Fe.parse(e),s=.2126*bt.channel.toLinear(t)+.7152*bt.channel.toLinear(r)+.0722*bt.channel.toLinear(i);return bt.lang.round(s)},lm=e=>nm(e)>=.5,xe=e=>!lm(e),ud=(e,t,r)=>{const i=Fe.parse(e),s=i[t],o=bt.channel.clamp[t](s+r);return s!==o&&(i[t]=o),Fe.stringify(i)},q=(e,t)=>ud(e,"l",t),N=(e,t)=>ud(e,"l",-t),b=(e,t)=>{const r=Fe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return dd(e,i)},hm=(e,t,r=50)=>{const{r:i,g:s,b:o,a}=Fe.parse(e),{r:n,g:l,b:c,a:h}=Fe.parse(t),d=r/100,u=d*2-1,f=a-h,m=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,x=1-m,C=i*m+n*x,k=s*m+l*x,S=o*m+c*x,T=a*d+h*(1-d);return tr(C,k,S,T)},F=(e,t=100)=>{const r=Fe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,hm(r,e,t)};var ma=g((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ma(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=ma(s[o],a,{depth:r-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Yt=ma,Ae="#ffffff",Ee="#f2f2f2",mt=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),cm=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||N(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||N(this.mainBkg,10)):(this.rowOdd=this.rowOdd||q(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||q(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},dm=g(e=>{const t=new cm;return t.calculate(e),t},"getThemeVariables"),um=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=N("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=N(this.sectionBkgColor,10),this.taskBorderColor=tr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=tr(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||q(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||N(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=q(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=q(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=q(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=F(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},fm=g(e=>{const t=new um;return t.calculate(e),t},"getThemeVariables"),gm=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=tr(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||N(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||N(this.tertiaryColor,40);for(let e=0;e{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},pm=g(e=>{const t=new gm;return t.calculate(e),t},"getThemeVariables"),ym=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=q("#cde498",10),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.primaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=N(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||N(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||N(this.tertiaryColor,40);for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},mm=g(e=>{const t=new ym;return t.calculate(e),t},"getThemeVariables"),xm=class{static{g(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=q(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||q(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=q(this.contrast,55),this.border2=this.contrast,this.actorBorder=q(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Cm=g(e=>{const t=new xm;return t.calculate(e),t},"getThemeVariables"),bm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||b(e,{h:30}),this.cScale4=this.cScale4||b(e,{h:60}),this.cScale5=this.cScale5||b(e,{h:90}),this.cScale6=this.cScale6||b(e,{h:120}),this.cScale7=this.cScale7||b(e,{h:150}),this.cScale8=this.cScale8||b(e,{h:210,l:150}),this.cScale9=this.cScale9||b(e,{h:270}),this.cScale10=this.cScale10||b(e,{h:300}),this.cScale11=this.cScale11||b(e,{h:330}),this.darkMode)for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},km=g(e=>{const t=new bm;return t.calculate(e),t},"getThemeVariables"),wm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Sm=g(e=>{const t=new wm;return t.calculate(e),t},"getThemeVariables"),Tm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=mt("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},_m=g(e=>{const t=new Tm;return t.calculate(e),t},"getThemeVariables"),vm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Bm=g(e=>{const t=new vm;return t.calculate(e),t},"getThemeVariables"),Lm=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=mt(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=b(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||q(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Fm=g(e=>{const t=new Lm;return t.calculate(e),t},"getThemeVariables"),Mm=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=q(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=mt(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=q(F("#323D47"),10),this.border1="#ccc",this.border2=tr(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||mt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||mt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||mt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||mt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?N(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||N(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Am=g(e=>{const t=new Mm;return t.calculate(e),t},"getThemeVariables"),We={base:{getThemeVariables:dm},dark:{getThemeVariables:fm},default:{getThemeVariables:pm},forest:{getThemeVariables:mm},neutral:{getThemeVariables:Cm},neo:{getThemeVariables:km},"neo-dark":{getThemeVariables:Sm},redux:{getThemeVariables:_m},"redux-dark":{getThemeVariables:Bm},"redux-color":{getThemeVariables:Fm},"redux-dark-color":{getThemeVariables:Am}},jt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},fd={...jt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:We.default.getThemeVariables(),sequence:{...jt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...jt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...jt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...jt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...jt.pie,useWidth:984},xyChart:{...jt.xyChart,useWidth:void 0},requirement:{...jt.requirement,useWidth:void 0},packet:{...jt.packet},eventmodeling:{...jt.eventmodeling},treeView:{...jt.treeView,useWidth:void 0},radar:{...jt.radar},railroad:{...jt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...jt.ishikawa},sankey:{...jt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...jt.venn},cynefin:{...jt.cynefin}},gd=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...gd(e[i],"")]:[...r,t+i],[]),"keyify"),Em=new Set(gd(fd,"")),pd=fd,$m={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Om=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(P.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Ls=g(e=>{if(P.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ls(t));return}for(const t of Object.keys(e)){if(P.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Em.has(t)||e[t]==null){P.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=$m[t];i?Om(e[t],i):(P.debug("sanitizing object",t),Ls(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(P.debug("sanitizing css option",t),e[t]=yd(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}P.debug("After sanitization",e)}},"sanitizeDirective"),yd=g(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),re=Yt({},Yr),Fs,gr=[],Fi=Yt({},Yr),Ui=g((e,t)=>{let r=Yt({},e),i={};for(const s of t)Cd(s),i=Yt(i,s);if(r=Yt(r,i),i.theme&&i.theme in We){const s=Yt({},Fs),o=Yt(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in We&&(r.themeVariables=We[r.theme].getThemeVariables(o))}return Fi=r,Nm(Fi),Fi},"updateCurrentConfig"),Dm=g(e=>(re=Yt({},Yr),re=Yt(re,e),e.theme&&We[e.theme]&&(re.themeVariables=We[e.theme].getThemeVariables(e.themeVariables)),Ui(re,gr),re),"setSiteConfig"),Pm=g(e=>{Fs=Yt({},e)},"saveConfigFromInitialize"),Im=g(e=>(re=Yt(re,e),Ui(re,gr),re),"updateSiteConfig"),md=g(()=>Yt({},re),"getSiteConfig"),xd=g(e=>(Ui(Fi,[e]),Rt()),"setConfig"),Rt=g(()=>Yt({},Fi),"getConfig"),Cd=g(e=>{e&&(["secure",...re.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(P.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Cd(e[t])}))},"sanitize"),Rm=g(e=>{Ls(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),gr.push(e),Ui(re,gr)},"addDirective"),Ms=g((e=re)=>{gr=[],Ui(e,gr)},"reset"),qm={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Pl={},bd=g(e=>{Pl[e]||(P.warn(qm[e]),Pl[e]=!0)},"issueWarning"),Nm=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&bd("LAZY_LOAD_DEPRECATED")},"checkConfig"),O5=g(()=>{let e={};Fs&&(e=Yt(e,Fs));for(const t of gr)e=Yt(e,t);return e},"getUserDefinedConfig"),Kt=g(e=>(e.flowchart?.htmlLabels!=null&&bd("FLOWCHART_HTML_LABELS_DEPRECATED"),$e(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),kd=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Mi=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Wm=/\s*%%.*\n/gm,wd=class extends Error{static{g(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},pr={},ln=g(function(e,t){e=e.replace(kd,"").replace(Mi,"").replace(Wm,` `);for(const[r,{detector:i}]of Object.entries(pr))if(i(e,t))return r;throw new wd(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),xa=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)Sd(t,r,i)},"registerLazyLoadedDiagrams"),Sd=g((e,t,r)=>{pr[e]&&P.warn(`Detector with key ${e} already exists. Overwriting.`),pr[e]={detector:t,loader:r},P.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),zm=g(e=>pr[e].loader,"getDiagramLoader"),Gi=//gi,Hm=g(e=>e?vd(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Ym=(()=>{let e=!1;return()=>{e||(Td(),e=!0)}})();function Td(){const e="data-temp-href-target";Hr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Hr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(Td,"setupDompurifyHooks");var _d=g(e=>(Ym(),Hr.sanitize(e)),"removeScript"),Il=g((e,t)=>{if(Kt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=_d(e):r!=="loose"&&(e=vd(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=Xm(e))}return e},"sanitizeMore"),le=g((e,t)=>e&&(t.dompurifyConfig?e=Hr.sanitize(Il(e,t),t.dompurifyConfig).toString():e=Hr.sanitize(Il(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),jm=g((e,t)=>typeof e=="string"?le(e,t):e.flat().map(r=>le(r,t)),"sanitizeTextOrArray"),Um=g(e=>Gi.test(e),"hasBreaks"),Gm=g(e=>e.split(Gi),"splitBreaks"),Xm=g(e=>e.replace(/#br#/g,"
        "),"placeholderToBreak"),vd=g(e=>e.replace(Gi,"#br#"),"breakToPlaceholder"),Vm=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Zm=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Km=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Rl=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),Qm=g((e,t)=>{const r=Ca(e,"~"),i=Ca(t,"~");return r===1&&i===1},"shouldCombineSets"),Jm=g(e=>{const t=Ca(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),o=i.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)i[s]="<",i[o]=">",s=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),ql=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ba=/\$\$(.*?)\$\$/g,Di=g(e=>(e.match(ba)?.length??0)>0,"hasKatex"),D5=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Bd(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),t0=g(async(e,t)=>{if(!Di(e))return e;if(!(ql()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ba,"MathML is unsupported in this environment.");{const{default:r}=await _t(async()=>{const{default:s}=await import("./katex-HP8lGamR.js");return{default:s}},[]),i=t.forceLegacyMathML||!ql()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Gi).map(s=>Di(s)?`
        ${s}
        `:`
        ${s}
        `).join("").replace(ba,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Bd=g(async(e,t)=>le(await t0(e,t),t),"renderKatexSanitized"),Xi={getRows:Hm,sanitizeText:le,sanitizeTextOrArray:jm,hasBreaks:Um,splitBreaks:Gm,lineBreakRegex:Gi,removeScript:_d,getUrl:Vm,evaluate:$e,getMax:Zm,getMin:Km},e0=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),r0=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Ld=g(function(e,t,r,i){const s=r0(t,r,i);e0(e,s)},"configureSvgSize"),i0=g(function(e,t,r,i){const s=t.node().getBBox(),o=s.width,a=s.height;P.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;P.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=a+r*2,P.info(`Calculated bounds: ${n}x${l}`),Ld(t,l,n,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ms={};function ka(e){return[...e.cssRules].map(t=>t.cssText).join(` `)}g(ka,"cssStyleSheetToString");var s0=g((e,t,r,i)=>{let s="";return e in ms&&ms[e]?s=ms[e]({...r,svgId:i}):P.warn(`No theme found for ${e}`),`& { font-family: ${r.fontFamily}; @@ -265,7 +265,7 @@ ${s.join(` L0,20`)},"requirement_arrow"),jw=g((e,t,r)=>{const i=Rt(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),Uw=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Gw=g((e,t,r)=>{const i=Rt(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Xw={extension:vw,composition:Bw,aggregation:Lw,dependency:Fw,lollipop:Mw,point:Aw,circle:Ew,cross:$w,barb:Ow,barbNeo:Dw,only_one:Pw,zero_or_one:Iw,one_or_more:Rw,zero_or_more:qw,only_one_neo:Nw,zero_or_one_neo:Ww,one_or_more_neo:zw,zero_or_more_neo:Hw,requirement_arrow:Yw,requirement_contains:Uw,requirement_arrow_neo:jw,requirement_contains_neo:Gw},rp=_w,ip=typeof global=="object"&&global&&global.Object===Object&&global,Vw=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ip||Vw||Function("return this")(),Me=Ue.Symbol,sp=Object.prototype,Zw=sp.hasOwnProperty,Kw=sp.toString,mi=Me?Me.toStringTag:void 0;function Qw(e){var t=Zw.call(e,mi),r=e[mi];try{e[mi]=void 0;var i=!0}catch{}var s=Kw.call(e);return i&&(t?e[mi]=r:delete e[mi]),s}var Jw=Object.prototype,tS=Jw.toString;function eS(e){return tS.call(e)}var rS="[object Null]",iS="[object Undefined]",sc=Me?Me.toStringTag:void 0;function Qr(e){return e==null?e===void 0?iS:rS:sc&&sc in Object(e)?Qw(e):eS(e)}function Cr(e){return e!=null&&typeof e=="object"}var sS="[object Symbol]";function el(e){return typeof e=="symbol"||Cr(e)&&Qr(e)==sS}function op(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r0){if(++t>=SS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vi(e){return function(){return e}}var lc=(function(){try{var e=_r(Object,"defineProperty");return e({},"",{}),e}catch{}})(),BS=lc?function(e,t){return lc(e,"toString",{configurable:!0,enumerable:!1,value:vi(t),writable:!0})}:yo,LS=vS(BS);function FS(e,t){for(var r=-1,i=e==null?0:e.length;++r-1}var DS=9007199254740991,PS=/^(?:0|[1-9]\d*)$/;function np(e,t){var r=typeof e;return t=t??DS,!!t&&(r=="number"||r!="symbol"&&PS.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=qS}function mo(e){return e!=null&&il(e.length)&&!Ks(e)}var NS=Object.prototype;function hp(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||NS;return e===r}function WS(e,t){for(var r=-1,i=Array(e);++r-1}function GT(e,t){var r=this.__data__,i=Co(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function Ge(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tn))return!1;var c=o.get(e),h=o.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,f=r&$_?new zi:void 0;for(o.set(e,t),o.set(t,e);++d=Ev){var c=Av(e);if(c)return nl(c);a=!1,s=xp,l=new zi}else l=n;t:for(;++i1?s.setNode(o,r):s.setNode(o)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=nr,this._children[t]={},this._children[nr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],ar(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),ar(ve(this._in[t]),r),delete this._in[t],delete this._preds[t],ar(ve(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ir(r))r=nr;else{r+="";for(var i=r;!Ir(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==nr)return r}}children(t){if(Ir(t)&&(t=nr),this._isCompound){var r=this._children[t];if(r)return ve(r)}else{if(t===nr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return ve(r)}successors(t){var r=this._sucs[t];if(r)return ve(r)}neighbors(t){var r=this.predecessors(t);if(r)return Ov(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;ar(this._nodes,function(a,n){t(n)&&r.setNode(n,a)}),ar(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,i.edge(a))});var s={};function o(a){var n=i.parent(a);return n===void 0||r.hasNode(n)?(s[a]=n,n):n in s?s[n]:o(n)}return this._isCompound&&ar(r.nodes(),function(a){r.setParent(a,o(a))}),r}setDefaultEdgeLabel(t){return Ks(t)||(t=vi(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return jo(this._edgeObjs)}setPath(t,r){var i=this,s=arguments;return Fv(t,function(o,a){return s.length>1?i.setEdge(o,a,r):i.setEdge(o,a),a}),this}setEdge(){var t,r,i,s,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,i=a.name,arguments.length===2&&(s=arguments[1],o=!0)):(t=a,r=arguments[1],i=arguments[3],arguments.length>2&&(s=arguments[2],o=!0)),t=""+t,r=""+r,Ir(i)||(i=""+i);var n=Bi(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n))return o&&(this._edgeLabels[n]=s),this;if(!Ir(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[n]=o?s:this._defaultEdgeLabelFn(t,r,i);var l=Pv(this._isDirected,t,r,i);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[n]=l,Mc(this._preds[r],t),Mc(this._sucs[t],r),this._in[r][n]=l,this._out[t][n]=l,this._edgeCount++,this}edge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i);return this._edgeLabels[s]}hasEdge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,s)}removeEdge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i),o=this._edgeObjs[s];return o&&(t=o.v,r=o.w,delete this._edgeLabels[s],delete this._edgeObjs[s],Ac(this._preds[r],t),Ac(this._sucs[t],r),delete this._in[r][s],delete this._out[t][s],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var s=jo(i);return r?us(s,function(o){return o.v===r}):s}}outEdges(t,r){var i=this._out[t];if(i){var s=jo(i);return r?us(s,function(o){return o.w===r}):s}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}}wo.prototype._nodeCount=0;wo.prototype._edgeCount=0;function Mc(e,t){e[t]?e[t]++:e[t]=1}function Ac(e,t){--e[t]||delete e[t]}function Bi(e,t,r,i){var s=""+t,o=""+r;if(!e&&s>o){var a=s;s=o,o=a}return s+Fc+o+Fc+(Ir(i)?Dv:i)}function Pv(e,t,r,i){var s=""+t,o=""+r;if(!e&&s>o){var a=s;s=o,o=a}var n={v:s,w:o};return i&&(n.name=i),n}function Uo(e,t){return Bi(e,t.v,t.w,t.name)}function Sp(e,{edgePathsClass:t="edges edgePath"}={}){const r=e.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),s=r.insert("g").attr("class",t),o=r.insert("g").attr("class","edgeLabels"),a=r.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:a,rootGroups:r}}g(Sp,"createLayoutElementGroups");async function Tp(e,t){if(t.label){const{shapeSvg:r,bbox:i}=await ct(e,t);t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}g(Tp,"measureGroupLabel");async function _p(e,t,r){const i=await Jn(e,t,r),s=i.node()?.getBBox()??{width:0,height:0};return t.width=s.width,t.height=s.height,i}g(_p,"insertMeasuredNode");async function vp(e,t){const r=new wo({multigraph:!0,compound:!0}),i=[...t.edges],s=vt(),o=Sp(e),{edgeLabels:a,nodes:n}=o,l=new Map,c=e.node()!=null;await Promise.all(t.nodes.map(async h=>{if(h.isGroup)c&&await Tp(n,h),r.setNode(h.id,{...h});else{if(c){const d=await _p(n,h,{config:s,dir:h.dir});l.set(h.id,d)}r.setNode(h.id,{...h})}}));for(const h of i)c&&Kg(h)&&await tl(a,h),r.setEdge(h.start,h.end,{...h},h.id),t.edges.some(u=>u.id===h.id)||t.edges.push(h);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:h}=await _t(async()=>{const{captureNodeSizes:d}=await import("./sizeCapture-X5ZJPWSS-CTTg6OBe.js");return{captureNodeSizes:d}},__vite__mapDeps([0,1,2,3]));h(e,t)}return{graph:r,groups:o,nodeElements:l}}g(vp,"createGraphWithElements");var Ft=new Map,ur=new Map,Bp=new Map,Iv=g(()=>{ur.clear(),Bp.clear(),Ft.clear()},"clear"),Hi=g((e,t)=>{const r=ur.get(t)||[];return P.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),Rv=g((e,t)=>{const r=ur.get(t)||[];return P.info("Descendants of ",t," is ",r),P.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||Hi(e.v,t)||Hi(e.w,t)||r.includes(e.w):(P.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Lp=g((e,t,r,i)=>{P.debug("Copying children of ",e,"root",i,"data",t.node(e),i);const s=t.children(e)||[];e!==i&&s.push(e),P.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(o=>{if(t.children(o).length>0)Lp(o,t,r,i);else{const a=t.node(o);P.info("cp ",o," to ",i," with parent ",e),r.setNode(o,a),i!==t.parent(o)&&(P.debug("Setting parent",o,t.parent(o)),r.setParent(o,t.parent(o))),e!==i&&o!==e?(P.debug("Setting parent",o,e),r.setParent(o,e)):(P.info("In copy ",e,"root",i,"data",t.node(e),i),P.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e));const n=t.edges(o);P.debug("Copying Edges",n),n.forEach(l=>{P.info("Edge",l);const c=t.edge(l.v,l.w,l.name);P.info("Edge data",c,i);try{Rv(l,i)?(P.info("Copying as ",l.v,l.w,c,l.name),r.setEdge(l.v,l.w,c,l.name),P.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):P.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",i," clusterId:",e)}catch(h){P.error(h)}})}P.debug("Removing node",o),t.removeNode(o)})},"copy"),Fp=g((e,t)=>{const r=t.children(e);let i=[...r];for(const s of r)Bp.set(s,e),i=[...i,...Fp(s,t)];return i},"extractDescendants"),qv=g((e,t,r)=>{const i=e.edges().filter(l=>l.v===t||l.w===t),s=e.edges().filter(l=>l.v===r||l.w===r),o=i.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),a=s.map(l=>({v:l.v,w:l.w}));return o.filter(l=>a.some(c=>l.v===c.v&&l.w===c.w))},"findCommonEdges"),Js=g((e,t,r)=>{const i=t.children(e);if(P.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(const o of i){const a=Js(o,t,r),n=qv(t,r,a);if(a)if(n.length>0)s=a;else return a}return s},"findNonClusterChild"),Ec=g(e=>!Ft.has(e)||!Ft.get(e).externalConnections?e:Ft.has(e)?Ft.get(e).id:e,"getAnchorId"),rM=g((e,t)=>{if(!e||t>10){P.debug("Opting out, no graph ");return}else P.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(P.debug("Cluster identified",r," Replacement id in edges: ",Js(r,e,r)),ur.set(r,Fp(r,e)),Ft.set(r,{id:Js(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const i=e.children(r),s=e.edges();i.length>0?(P.debug("Cluster identified",r,ur),s.forEach(o=>{const a=Hi(o.v,r),n=Hi(o.w,r);a^n&&(P.debug("Edge: ",o," leaves cluster ",r),P.debug("Descendants of XXX ",r,": ",ur.get(r)),Ft.get(r).externalConnections=!0)})):P.debug("Not a cluster ",r,ur)});for(let r of Ft.keys()){const i=Ft.get(r).id,s=e.parent(i);s!==r&&Ft.has(s)&&!Ft.get(s).externalConnections&&(Ft.get(r).id=s);const o=e.edges().some(a=>a.v===r);if(i&&Ft.get(r)?.externalConnections&&o&&Ep(e,i,r)){const a=Nv(e,r,e.parent(i));a&&(Ft.get(r).id=a)}}e.edges().forEach(function(r){const i=e.edge(r);P.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),P.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let s=r.v,o=r.w;if(P.debug("Fix XXX",Ft,"ids:",r.v,r.w,"Translating: ",Ft.get(r.v)," --- ",Ft.get(r.w)),Ft.get(r.v)||Ft.get(r.w)){if(P.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),s=Ec(r.v),o=Ec(r.w),e.removeEdge(r.v,r.w,r.name),s!==r.v){const a=e.parent(s);Ft.get(a).externalConnections=!0,i.fromCluster=r.v}if(o!==r.w){const a=e.parent(o);Ft.get(a).externalConnections=!0,i.toCluster=r.w}P.debug("Fix Replacing with XXX",s,o,r.name),e.setEdge(s,o,i,r.name)}}),Mp(e,0),P.trace(Ft)},"adjustClustersAndEdges"),Mp=g((e,t)=>{if(t>10){P.error("Bailing out");return}let r=e.nodes(),i=!1;for(const s of r){const o=e.children(s);i=i||o.length>0}if(!i){P.debug("Done, no node has children",e.nodes());return}P.debug("Nodes = ",r,t);for(const s of r)if(P.debug("Extracting node",s,Ft,Ft.has(s)&&!Ft.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",t),!Ft.has(s))P.debug("Not a cluster",s,t);else if(!Ft.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){P.debug("Cluster without external connections, without a parent and with children",s,t);let a=e.graph().rankdir==="TB"?"LR":"TB";Ft.get(s)?.clusterData?.dir&&(a=Ft.get(s).clusterData.dir,P.debug("Fixing dir",Ft.get(s).clusterData.dir,a));const n=new wo({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Lp(s,e,n,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:Ft.get(s).clusterData,label:Ft.get(s).label,graph:n})}else P.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Ft.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),t),P.debug(Ft);r=e.nodes(),P.debug("New list of nodes",r);for(const s of r){const o=e.node(s);P.debug(" Now next level",s,o),o?.clusterNode&&Mp(o.graph,t+1)}},"extractor"),Ap=g((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{const s=e.children(i),o=Ap(e,s);r=[...r,...o]}),r},"sorter"),iM=g(e=>Ap(e,e.children()),"sortNodesByHierarchy"),Ep=g((e,t,r)=>{let i=e.parent(t);for(;i&&i!==r;){const s=Ft.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),Nv=g((e,t,r)=>{const i=e.children(t)??[];for(const s of i){if(s===r||Hi(s,r))continue;const o=Js(s,e,t);if(o&&!Ep(e,o,t))return o}return null},"findSafeAnchorNode");function $p({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:i,afterPaint:s,paintOptions:o}){const a=t??dl;return g(async function(l,c,h,d){const u=c.select("g");rp(u,l.markers,l.type,l.diagramId),cl();const f={element:u,helpers:h,options:d};f.preparedLayout=await e?.(l,f);const y=await a(l,f),m=await r(l,f),x={...f,measure:y};i?await i(l,x,m):await ul(l,x,o),await s?.(l,x,m)},"render")}g($p,"createCommonLayoutRenderer");function cl(){sw(),xw(),uw(),Iv()}g(cl,"clearLayoutRenderState");async function dl(e,{element:t}){return await vp(t,e)}g(dl,"defaultMeasureLayout");async function ul(e,t,r={}){const{measure:i}=t,{groups:s}=i;for(const a of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(a,t)||await Op(s,a,t,r);const o=Pp(e.nodes);for(const a of e.edges)Ip(a,r)||await Rp(s,a,o,e,r,t)}g(ul,"paintLayoutData");async function Op(e,t,r,i){t.clusterNode?Jh(t):Dp(t,r,i)?await Zg(e.clusters,t):Jh(t)}g(Op,"paintLayoutNode");function Dp(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}g(Dp,"shouldPaintAsCluster");function Pp(e){const t=new Map;for(const r of e)r?.id&&t.set(r.id,r);return t}g(Pp,"buildNodeLookup");function Ip(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}g(Ip,"shouldSkipPaintEdge");async function Rp(e,t,r,i,s,o){const a=Jg(e.edgePaths,{...t},s.clusterDb??new Map,i.type,Qa(t.start,t,r,o,s),Qa(t.end,t,r,o,s),i.diagramId,qp(t,s));Kg(t)&&(Gr.has(t.id)||await tl(e.edgeLabels,t),Np(t,a))}g(Rp,"paintLayoutEdge");function Qa(e,t,r,i,s){return s.getEdgeNode?.(e,t,i)??(e?r.get(e)??{}:{})}g(Qa,"getRenderedNode");function qp(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}g(qp,"shouldSkipIntersect");function Np(e,t){const r=t?.updatedPath??t?.originalPath,i=Rt(),{subGraphTitleTotalMargin:s}=go({flowchart:i.flowchart??{}});if(e.label){const o=Gr.get(e.id);let a=e.x,n=e.y;if(r){const l=Zt.calcLabelPosition(r);P.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t?.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e?.startLabelLeft){const o=Nt.get(e.id).startLeft;let a=e?.x,n=e?.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Nt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Nt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Nt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}}g(Np,"positionRenderedEdgeLabel");function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Wp,"getDefaultExportFromCjs");var Gt={},fs={},Ve={},$c;function Jr(){if($c)return Ve;$c=1;function e(a){return typeof a>"u"||a===null}g(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}g(t,"isObject");function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}g(r,"toArray");function i(a,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Gw=g((e,t,r)=>{const i=Rt(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Xw={extension:vw,composition:Bw,aggregation:Lw,dependency:Fw,lollipop:Mw,point:Aw,circle:Ew,cross:$w,barb:Ow,barbNeo:Dw,only_one:Pw,zero_or_one:Iw,one_or_more:Rw,zero_or_more:qw,only_one_neo:Nw,zero_or_one_neo:Ww,one_or_more_neo:zw,zero_or_more_neo:Hw,requirement_arrow:Yw,requirement_contains:Uw,requirement_arrow_neo:jw,requirement_contains_neo:Gw},rp=_w,ip=typeof global=="object"&&global&&global.Object===Object&&global,Vw=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ip||Vw||Function("return this")(),Me=Ue.Symbol,sp=Object.prototype,Zw=sp.hasOwnProperty,Kw=sp.toString,mi=Me?Me.toStringTag:void 0;function Qw(e){var t=Zw.call(e,mi),r=e[mi];try{e[mi]=void 0;var i=!0}catch{}var s=Kw.call(e);return i&&(t?e[mi]=r:delete e[mi]),s}var Jw=Object.prototype,tS=Jw.toString;function eS(e){return tS.call(e)}var rS="[object Null]",iS="[object Undefined]",sc=Me?Me.toStringTag:void 0;function Qr(e){return e==null?e===void 0?iS:rS:sc&&sc in Object(e)?Qw(e):eS(e)}function Cr(e){return e!=null&&typeof e=="object"}var sS="[object Symbol]";function el(e){return typeof e=="symbol"||Cr(e)&&Qr(e)==sS}function op(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r0){if(++t>=SS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vi(e){return function(){return e}}var lc=(function(){try{var e=_r(Object,"defineProperty");return e({},"",{}),e}catch{}})(),BS=lc?function(e,t){return lc(e,"toString",{configurable:!0,enumerable:!1,value:vi(t),writable:!0})}:yo,LS=vS(BS);function FS(e,t){for(var r=-1,i=e==null?0:e.length;++r-1}var DS=9007199254740991,PS=/^(?:0|[1-9]\d*)$/;function np(e,t){var r=typeof e;return t=t??DS,!!t&&(r=="number"||r!="symbol"&&PS.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=qS}function mo(e){return e!=null&&il(e.length)&&!Ks(e)}var NS=Object.prototype;function hp(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||NS;return e===r}function WS(e,t){for(var r=-1,i=Array(e);++r-1}function GT(e,t){var r=this.__data__,i=Co(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function Ge(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tn))return!1;var c=o.get(e),h=o.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,f=r&$_?new zi:void 0;for(o.set(e,t),o.set(t,e);++d=Ev){var c=Av(e);if(c)return nl(c);a=!1,s=xp,l=new zi}else l=n;t:for(;++i1?s.setNode(o,r):s.setNode(o)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=nr,this._children[t]={},this._children[nr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],ar(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),ar(ve(this._in[t]),r),delete this._in[t],delete this._preds[t],ar(ve(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ir(r))r=nr;else{r+="";for(var i=r;!Ir(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==nr)return r}}children(t){if(Ir(t)&&(t=nr),this._isCompound){var r=this._children[t];if(r)return ve(r)}else{if(t===nr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return ve(r)}successors(t){var r=this._sucs[t];if(r)return ve(r)}neighbors(t){var r=this.predecessors(t);if(r)return Ov(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;ar(this._nodes,function(a,n){t(n)&&r.setNode(n,a)}),ar(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,i.edge(a))});var s={};function o(a){var n=i.parent(a);return n===void 0||r.hasNode(n)?(s[a]=n,n):n in s?s[n]:o(n)}return this._isCompound&&ar(r.nodes(),function(a){r.setParent(a,o(a))}),r}setDefaultEdgeLabel(t){return Ks(t)||(t=vi(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return jo(this._edgeObjs)}setPath(t,r){var i=this,s=arguments;return Fv(t,function(o,a){return s.length>1?i.setEdge(o,a,r):i.setEdge(o,a),a}),this}setEdge(){var t,r,i,s,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,i=a.name,arguments.length===2&&(s=arguments[1],o=!0)):(t=a,r=arguments[1],i=arguments[3],arguments.length>2&&(s=arguments[2],o=!0)),t=""+t,r=""+r,Ir(i)||(i=""+i);var n=Bi(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n))return o&&(this._edgeLabels[n]=s),this;if(!Ir(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[n]=o?s:this._defaultEdgeLabelFn(t,r,i);var l=Pv(this._isDirected,t,r,i);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[n]=l,Mc(this._preds[r],t),Mc(this._sucs[t],r),this._in[r][n]=l,this._out[t][n]=l,this._edgeCount++,this}edge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i);return this._edgeLabels[s]}hasEdge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,s)}removeEdge(t,r,i){var s=arguments.length===1?Uo(this._isDirected,arguments[0]):Bi(this._isDirected,t,r,i),o=this._edgeObjs[s];return o&&(t=o.v,r=o.w,delete this._edgeLabels[s],delete this._edgeObjs[s],Ac(this._preds[r],t),Ac(this._sucs[t],r),delete this._in[r][s],delete this._out[t][s],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var s=jo(i);return r?us(s,function(o){return o.v===r}):s}}outEdges(t,r){var i=this._out[t];if(i){var s=jo(i);return r?us(s,function(o){return o.w===r}):s}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}}wo.prototype._nodeCount=0;wo.prototype._edgeCount=0;function Mc(e,t){e[t]?e[t]++:e[t]=1}function Ac(e,t){--e[t]||delete e[t]}function Bi(e,t,r,i){var s=""+t,o=""+r;if(!e&&s>o){var a=s;s=o,o=a}return s+Fc+o+Fc+(Ir(i)?Dv:i)}function Pv(e,t,r,i){var s=""+t,o=""+r;if(!e&&s>o){var a=s;s=o,o=a}var n={v:s,w:o};return i&&(n.name=i),n}function Uo(e,t){return Bi(e,t.v,t.w,t.name)}function Sp(e,{edgePathsClass:t="edges edgePath"}={}){const r=e.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),s=r.insert("g").attr("class",t),o=r.insert("g").attr("class","edgeLabels"),a=r.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:a,rootGroups:r}}g(Sp,"createLayoutElementGroups");async function Tp(e,t){if(t.label){const{shapeSvg:r,bbox:i}=await ct(e,t);t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}g(Tp,"measureGroupLabel");async function _p(e,t,r){const i=await Jn(e,t,r),s=i.node()?.getBBox()??{width:0,height:0};return t.width=s.width,t.height=s.height,i}g(_p,"insertMeasuredNode");async function vp(e,t){const r=new wo({multigraph:!0,compound:!0}),i=[...t.edges],s=vt(),o=Sp(e),{edgeLabels:a,nodes:n}=o,l=new Map,c=e.node()!=null;await Promise.all(t.nodes.map(async h=>{if(h.isGroup)c&&await Tp(n,h),r.setNode(h.id,{...h});else{if(c){const d=await _p(n,h,{config:s,dir:h.dir});l.set(h.id,d)}r.setNode(h.id,{...h})}}));for(const h of i)c&&Kg(h)&&await tl(a,h),r.setEdge(h.start,h.end,{...h},h.id),t.edges.some(u=>u.id===h.id)||t.edges.push(h);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:h}=await _t(async()=>{const{captureNodeSizes:d}=await import("./sizeCapture-X5ZJPWSS-B8XbaAIu.js");return{captureNodeSizes:d}},__vite__mapDeps([0,1,2,3]));h(e,t)}return{graph:r,groups:o,nodeElements:l}}g(vp,"createGraphWithElements");var Ft=new Map,ur=new Map,Bp=new Map,Iv=g(()=>{ur.clear(),Bp.clear(),Ft.clear()},"clear"),Hi=g((e,t)=>{const r=ur.get(t)||[];return P.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),Rv=g((e,t)=>{const r=ur.get(t)||[];return P.info("Descendants of ",t," is ",r),P.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||Hi(e.v,t)||Hi(e.w,t)||r.includes(e.w):(P.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Lp=g((e,t,r,i)=>{P.debug("Copying children of ",e,"root",i,"data",t.node(e),i);const s=t.children(e)||[];e!==i&&s.push(e),P.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(o=>{if(t.children(o).length>0)Lp(o,t,r,i);else{const a=t.node(o);P.info("cp ",o," to ",i," with parent ",e),r.setNode(o,a),i!==t.parent(o)&&(P.debug("Setting parent",o,t.parent(o)),r.setParent(o,t.parent(o))),e!==i&&o!==e?(P.debug("Setting parent",o,e),r.setParent(o,e)):(P.info("In copy ",e,"root",i,"data",t.node(e),i),P.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e));const n=t.edges(o);P.debug("Copying Edges",n),n.forEach(l=>{P.info("Edge",l);const c=t.edge(l.v,l.w,l.name);P.info("Edge data",c,i);try{Rv(l,i)?(P.info("Copying as ",l.v,l.w,c,l.name),r.setEdge(l.v,l.w,c,l.name),P.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):P.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",i," clusterId:",e)}catch(h){P.error(h)}})}P.debug("Removing node",o),t.removeNode(o)})},"copy"),Fp=g((e,t)=>{const r=t.children(e);let i=[...r];for(const s of r)Bp.set(s,e),i=[...i,...Fp(s,t)];return i},"extractDescendants"),qv=g((e,t,r)=>{const i=e.edges().filter(l=>l.v===t||l.w===t),s=e.edges().filter(l=>l.v===r||l.w===r),o=i.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),a=s.map(l=>({v:l.v,w:l.w}));return o.filter(l=>a.some(c=>l.v===c.v&&l.w===c.w))},"findCommonEdges"),Js=g((e,t,r)=>{const i=t.children(e);if(P.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(const o of i){const a=Js(o,t,r),n=qv(t,r,a);if(a)if(n.length>0)s=a;else return a}return s},"findNonClusterChild"),Ec=g(e=>!Ft.has(e)||!Ft.get(e).externalConnections?e:Ft.has(e)?Ft.get(e).id:e,"getAnchorId"),rM=g((e,t)=>{if(!e||t>10){P.debug("Opting out, no graph ");return}else P.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(P.debug("Cluster identified",r," Replacement id in edges: ",Js(r,e,r)),ur.set(r,Fp(r,e)),Ft.set(r,{id:Js(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const i=e.children(r),s=e.edges();i.length>0?(P.debug("Cluster identified",r,ur),s.forEach(o=>{const a=Hi(o.v,r),n=Hi(o.w,r);a^n&&(P.debug("Edge: ",o," leaves cluster ",r),P.debug("Descendants of XXX ",r,": ",ur.get(r)),Ft.get(r).externalConnections=!0)})):P.debug("Not a cluster ",r,ur)});for(let r of Ft.keys()){const i=Ft.get(r).id,s=e.parent(i);s!==r&&Ft.has(s)&&!Ft.get(s).externalConnections&&(Ft.get(r).id=s);const o=e.edges().some(a=>a.v===r);if(i&&Ft.get(r)?.externalConnections&&o&&Ep(e,i,r)){const a=Nv(e,r,e.parent(i));a&&(Ft.get(r).id=a)}}e.edges().forEach(function(r){const i=e.edge(r);P.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),P.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let s=r.v,o=r.w;if(P.debug("Fix XXX",Ft,"ids:",r.v,r.w,"Translating: ",Ft.get(r.v)," --- ",Ft.get(r.w)),Ft.get(r.v)||Ft.get(r.w)){if(P.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),s=Ec(r.v),o=Ec(r.w),e.removeEdge(r.v,r.w,r.name),s!==r.v){const a=e.parent(s);Ft.get(a).externalConnections=!0,i.fromCluster=r.v}if(o!==r.w){const a=e.parent(o);Ft.get(a).externalConnections=!0,i.toCluster=r.w}P.debug("Fix Replacing with XXX",s,o,r.name),e.setEdge(s,o,i,r.name)}}),Mp(e,0),P.trace(Ft)},"adjustClustersAndEdges"),Mp=g((e,t)=>{if(t>10){P.error("Bailing out");return}let r=e.nodes(),i=!1;for(const s of r){const o=e.children(s);i=i||o.length>0}if(!i){P.debug("Done, no node has children",e.nodes());return}P.debug("Nodes = ",r,t);for(const s of r)if(P.debug("Extracting node",s,Ft,Ft.has(s)&&!Ft.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",t),!Ft.has(s))P.debug("Not a cluster",s,t);else if(!Ft.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){P.debug("Cluster without external connections, without a parent and with children",s,t);let a=e.graph().rankdir==="TB"?"LR":"TB";Ft.get(s)?.clusterData?.dir&&(a=Ft.get(s).clusterData.dir,P.debug("Fixing dir",Ft.get(s).clusterData.dir,a));const n=new wo({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Lp(s,e,n,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:Ft.get(s).clusterData,label:Ft.get(s).label,graph:n})}else P.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Ft.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),t),P.debug(Ft);r=e.nodes(),P.debug("New list of nodes",r);for(const s of r){const o=e.node(s);P.debug(" Now next level",s,o),o?.clusterNode&&Mp(o.graph,t+1)}},"extractor"),Ap=g((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{const s=e.children(i),o=Ap(e,s);r=[...r,...o]}),r},"sorter"),iM=g(e=>Ap(e,e.children()),"sortNodesByHierarchy"),Ep=g((e,t,r)=>{let i=e.parent(t);for(;i&&i!==r;){const s=Ft.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),Nv=g((e,t,r)=>{const i=e.children(t)??[];for(const s of i){if(s===r||Hi(s,r))continue;const o=Js(s,e,t);if(o&&!Ep(e,o,t))return o}return null},"findSafeAnchorNode");function $p({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:i,afterPaint:s,paintOptions:o}){const a=t??dl;return g(async function(l,c,h,d){const u=c.select("g");rp(u,l.markers,l.type,l.diagramId),cl();const f={element:u,helpers:h,options:d};f.preparedLayout=await e?.(l,f);const y=await a(l,f),m=await r(l,f),x={...f,measure:y};i?await i(l,x,m):await ul(l,x,o),await s?.(l,x,m)},"render")}g($p,"createCommonLayoutRenderer");function cl(){sw(),xw(),uw(),Iv()}g(cl,"clearLayoutRenderState");async function dl(e,{element:t}){return await vp(t,e)}g(dl,"defaultMeasureLayout");async function ul(e,t,r={}){const{measure:i}=t,{groups:s}=i;for(const a of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(a,t)||await Op(s,a,t,r);const o=Pp(e.nodes);for(const a of e.edges)Ip(a,r)||await Rp(s,a,o,e,r,t)}g(ul,"paintLayoutData");async function Op(e,t,r,i){t.clusterNode?Jh(t):Dp(t,r,i)?await Zg(e.clusters,t):Jh(t)}g(Op,"paintLayoutNode");function Dp(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}g(Dp,"shouldPaintAsCluster");function Pp(e){const t=new Map;for(const r of e)r?.id&&t.set(r.id,r);return t}g(Pp,"buildNodeLookup");function Ip(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}g(Ip,"shouldSkipPaintEdge");async function Rp(e,t,r,i,s,o){const a=Jg(e.edgePaths,{...t},s.clusterDb??new Map,i.type,Qa(t.start,t,r,o,s),Qa(t.end,t,r,o,s),i.diagramId,qp(t,s));Kg(t)&&(Gr.has(t.id)||await tl(e.edgeLabels,t),Np(t,a))}g(Rp,"paintLayoutEdge");function Qa(e,t,r,i,s){return s.getEdgeNode?.(e,t,i)??(e?r.get(e)??{}:{})}g(Qa,"getRenderedNode");function qp(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}g(qp,"shouldSkipIntersect");function Np(e,t){const r=t?.updatedPath??t?.originalPath,i=Rt(),{subGraphTitleTotalMargin:s}=go({flowchart:i.flowchart??{}});if(e.label){const o=Gr.get(e.id);let a=e.x,n=e.y;if(r){const l=Zt.calcLabelPosition(r);P.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t?.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e?.startLabelLeft){const o=Nt.get(e.id).startLeft;let a=e?.x,n=e?.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Nt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Nt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Nt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=Zt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}}g(Np,"positionRenderedEdgeLabel");function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Wp,"getDefaultExportFromCjs");var Gt={},fs={},Ve={},$c;function Jr(){if($c)return Ve;$c=1;function e(a){return typeof a>"u"||a===null}g(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}g(t,"isObject");function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}g(r,"toArray");function i(a,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;cd&&(c=" ... ",o=n-d+c.length),a-n>d&&(h=" ...",a=n+d-h.length),{str:c+s.slice(o,a).replace(/\t/g,"→")+h,pos:n-o+c.length}}g(t,"getLine");function r(s,o){return e.repeat(" ",o-s.length)+s}g(r,"padStart");function i(s,o){if(o=Object.create(o||null),!s.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=a.exec(s.buffer);)l.push(c.index),n.push(c.index+c[0].length),s.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(s.line+o.linesAfter,l.length).toString().length,f=o.maxLength-(o.indent+u+3);for(let m=1;m<=o.linesBefore&&!(h-m<0);m++){const x=t(s.buffer,n[h-m],l[h-m],s.position-(n[h]-n[h-m]),f);d=e.repeat(" ",o.indent)+r((s.line-m+1).toString(),u)+" | "+x.str+` `+d}const y=t(s.buffer,n[h],l[h],s.position,f);d+=e.repeat(" ",o.indent)+r((s.line+1).toString(),u)+" | "+y.str+` @@ -296,8 +296,8 @@ ${s.join(` `+w.slice(U,Q),U=Q+1),V=lt;return ot+=` `,w.length-U>D&&V>U?ot+=w.slice(U,V)+` `+w.slice(V+1):ot+=w.slice(U),ot.slice(1)}g(ue,"foldLine");function ai(w){let D="",K=0;for(let j=0;j=65536?j+=2:j++){K=Ot(w,j);const U=E[K];!U&&ht(K)?(D+=w[j],K>=65536&&(D+=w[j+1])):D+=U||$(K)}return D}g(ai,"escapeString");function Fr(w,D,K){let j="";const U=w.tag;for(let Q=0,V=K.length;Q"u"&&Y(w,D,null,!1,!1))&&(j!==""&&(j+=","+(w.condenseFlow?"":" ")),j+=w.dump)}w.tag=U,w.dump="["+j+"]"}g(Fr,"writeFlowSequence");function Mr(w,D,K,j){let U="";const Q=w.tag;for(let V=0,lt=K.length;V"u"&&Y(w,D+1,null,!0,!0,!1,!0))&&((!j||U!=="")&&(U+=xt(w,D)),w.dump&&n===w.dump.charCodeAt(0)?U+="-":U+="- ",U+=w.dump)}w.tag=Q,w.dump=U||"[]"}g(Mr,"writeBlockSequence");function ni(w,D,K){let j="";const U=w.tag,Q=Object.keys(K);for(let V=0,lt=Q.length;V1024&&(ot+="? "),ot+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),Y(w,D,gt,!1,!1)&&(ot+=w.dump,j+=ot))}w.tag=U,w.dump="{"+j+"}"}g(ni,"writeFlowMapping");function p(w,D,K,j){let U="";const Q=w.tag,V=Object.keys(K);if(w.sortKeys===!0)V.sort();else if(typeof w.sortKeys=="function")V.sort(w.sortKeys);else if(w.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let lt=0,ot=V.length;lt1024;Dt&&(w.dump&&n===w.dump.charCodeAt(0)?ft+="?":ft+="? "),ft+=w.dump,Dt&&(ft+=xt(w,D)),Y(w,D+1,Lt,!0,Dt)&&(w.dump&&n===w.dump.charCodeAt(0)?ft+=":":ft+=": ",ft+=w.dump,U+=ft)}w.tag=Q,w.dump=U||"{}"}g(p,"writeBlockMapping");function A(w,D,K){const j=K?w.explicitTypes:w.implicitTypes;for(let U=0,Q=j.length;U tag resolver accepts not "'+lt+'" style');w.dump=ot}return!0}}return!1}g(A,"detectType");function Y(w,D,K,j,U,Q,V){w.tag=null,w.dump=K,A(w,K,!1)||A(w,K,!0);const lt=i.call(w.dump),ot=j;j&&(j=w.flowLevel<0||w.flowLevel>D);const ft=lt==="[object Object]"||lt==="[object Array]";let gt,Lt;if(ft&&(gt=w.duplicates.indexOf(K),Lt=gt!==-1),(w.tag!==null&&w.tag!=="?"||Lt||w.indent!==2&&D>0)&&(U=!1),Lt&&w.usedDuplicates[gt])w.dump="*ref_"+gt;else{if(ft&&Lt&&!w.usedDuplicates[gt]&&(w.usedDuplicates[gt]=!0),lt==="[object Object]")j&&Object.keys(w.dump).length!==0?(p(w,D,w.dump,U),Lt&&(w.dump="&ref_"+gt+w.dump)):(ni(w,D,w.dump),Lt&&(w.dump="&ref_"+gt+" "+w.dump));else if(lt==="[object Array]")j&&w.dump.length!==0?(w.noArrayIndent&&!V&&D>0?Mr(w,D-1,w.dump,U):Mr(w,D,w.dump,U),Lt&&(w.dump="&ref_"+gt+w.dump)):(Fr(w,D,w.dump),Lt&&(w.dump="&ref_"+gt+" "+w.dump));else if(lt==="[object String]")w.tag!=="?"&&si(w,w.dump,D,Q,ot);else{if(lt==="[object Undefined]")return!1;if(w.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+lt)}if(w.tag!==null&&w.tag!=="?"){let Dt=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");w.tag[0]==="!"?Dt="!"+Dt:Dt.slice(0,18)==="tag:yaml.org,2002:"?Dt="!!"+Dt.slice(18):Dt="!<"+Dt+">",w.dump=Dt+" "+w.dump}}return!0}g(Y,"writeNode");function G(w,D){const K=[],j=[];W(w,K,j);const U=j.length;for(let Q=0;Q{for(const t of e)Yi[t.name]=t},"registerLayoutLoaders"),Uv=g(()=>{Up([{name:"dagre",loader:g(async()=>await _t(()=>import("./dagre-3AP2YEHR-BTFijvde.js"),__vite__mapDeps([4,5,1,2,3])),"loader")},{name:"swimlane",loader:g(async()=>await _t(()=>import("./swimlanes-XN3QIQJK-CxY3Jzhb.js"),__vite__mapDeps([6,1,2,3])),"loader")},{name:"cose-bilkent",loader:g(async()=>await _t(()=>import("./cose-bilkent-JH36ORCC-DJYw1bPd.js"),__vite__mapDeps([7,8,1,2,3])),"loader")}])},"registerDefaultLayoutLoaders");Uv();var yM=g(async(e,t)=>{if(!(e.layoutAlgorithm in Yi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const d=h.domId||h.id;h.domId=`${e.diagramId}-${d}`}const r=Yi[e.layoutAlgorithm],i=await r.loader(),{theme:s,themeVariables:o}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=o,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),a){const h=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,jv,{algorithm:r.algorithm})},"render"),mM=g((e="",{fallback:t="dagre"}={})=>{if(e in Yi)return e;if(t in Yi)return P.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Ml="comm",Gp="rule",Xp="decl",Gv="@media",Xv="@import",Vv="@supports",Zv="@namespace",Ja="@keyframes",Vp="@layer",Kv="@scope",Qv=Math.abs,Oi=String.fromCharCode;function Zp(e){return e.trim()}function tn(e,t,r){return e.replace(t,r)}function zr(e,t){return e.charCodeAt(t)|0}function Xr(e,t,r){return e.slice(t,r)}function _e(e){return e.length}function Kp(e){return e.length}function gs(e,t){return t.push(e),e}var To=1,Vr=1,Qp=0,he=0,Wt=0,ei="";function Al(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:To,column:Vr,length:a,return:"",siblings:n}}function Jv(){return Wt}function tB(){return Wt=he>0?zr(ei,--he):0,Vr--,Wt===10&&(Vr=1,To--),Wt}function me(){return Wt=he2||ji(Wt)>3?"":" "}function sB(e,t){for(;--t&&me()&&!(Wt<48||Wt>102||Wt>57&&Wt<65||Wt>70&&Wt<97););return _o(e,vs()+(t<6&&Je()==32&&me()==32))}function en(e){for(;me();)switch(Wt){case e:return he;case 34:case 39:e!==34&&e!==39&&en(Wt);break;case 40:e===41&&en(e);break;case 92:me();break}return he}function oB(e,t){for(;me()&&e+Wt!==57;)if(e+Wt===84&&Je()===47)break;return"/*"+_o(t,he-1)+"*"+Oi(e===47?e:me())}function aB(e){for(;!ji(Je());)me();return _o(e,he)}function nB(e){return rB(Bs("",null,null,null,[""],e=eB(e),0,[0],e))}function Bs(e,t,r,i,s,o,a,n,l){for(var c=0,h=0,d=a,u=0,f=0,y=0,m=1,x=1,C=1,k=0,S=0,T="",_=s,L=o,M=i,B=T;x;)switch(y=S,S=me()){case 40:y!=108&&zr(B,d-1)==58?(k++,B+="("):B+=pa(S);break;case 41:k--,B+=")";break;case 34:case 39:case 91:B+=pa(S);break;case 9:case 10:case 13:case 32:if(k>0){B+=Oi(S);break}B+=iB(y);break;case 92:B+=sB(vs()-1,7);continue;case 47:switch(Je()){case 42:case 47:gs(lB(oB(me(),vs()),t,r,l),l),(ji(y||1)==5||ji(Je()||1)==5)&&_e(B)&&Xr(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=_e(B)*C;case 125*m:case 59:case 0:if(k>0&&S){B+=Oi(S);break}switch(S){case 0:case 125:x=0;case 59+h:C==-1&&(B=tn(B,/\f/g,"")),f>0&&(_e(B)-d||m===0)&&gs(f>32?od(B+";",i,r,d-1,l):od(tn(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(gs(M=sd(B,t,r,c,h,s,n,T,_=[],L=[],d,o),o),S===123)if(h===0)Bs(B,t,M,M,_,o,d,n,L);else{switch(u){case 99:if(zr(B,3)===110)break;case 108:if(zr(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Bs(e,M,M,i&&gs(sd(e,M,M,0,0,s,n,T,s,_=[],d,L),L),s,L,d,n,i?_:L):Bs(B,M,M,M,[""],L,0,n,L)}}c=h=f=0,m=C=1,T=B="",d=a;break;case 58:d=1+_e(B),f=y;default:if(m<1){if(S==123)--m;else if(S==125&&m++==0&&tB()==125)continue}switch(B+=Oi(S),S*m){case 38:C=h>0?1:(B+="\f",-1);break;case 44:if(k>0)break;n[c++]=(_e(B)-1)*C,C=1;break;case 64:Je()===45&&(B+=pa(me())),u=Je(),h=d=_e(T=B+=aB(vs())),S++;break;case 45:y===45&&_e(B)==2&&(m=0)}}return o}function sd(e,t,r,i,s,o,a,n,l,c,h,d){for(var u=s-1,f=s===0?o:[""],y=Kp(f),m=0,x=0,C=0;m0?f[k]+" "+S:tn(S,/&\f/g,f[k])))&&(l[C++]=T);return Al(e,t,r,s===0?Gp:n,l,c,h,d)}function lB(e,t,r,i){return Al(e,t,r,Ml,Oi(Jv()),Xr(e,2,-2),0,i)}function od(e,t,r,i,s){return Al(e,t,r,Xp,Xr(e,0,i),Xr(e,i+1,-1),i,s)}function rn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),uB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./c4Diagram-UCG6FXSJ-D3l3THs_.js");return{diagram:t}},__vite__mapDeps([9,10,1,2,3]));return{id:Jp,diagram:e}},"loader"),fB={id:Jp,detector:dB,loader:uB},gB=fB,ty="flowchart",pB=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),yB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-CyNh512Q.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:ty,diagram:e}},"loader"),mB={id:ty,detector:pB,loader:yB},xB=mB,ey="flowchart-v2",CB=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),bB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-CyNh512Q.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:ey,diagram:e}},"loader"),kB={id:ey,detector:CB,loader:bB},wB=kB,ry="swimlane",SB=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),TB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./swimlanesDiagram-VK2B7HYN-Dz6vrGDq.js");return{diagram:t}},__vite__mapDeps([16,11,12,13,14,10,3,15,1,2]));return{id:ry,diagram:e}},"loader"),_B={id:ry,detector:SB,loader:TB},vB=_B,iy="er",BB=g(e=>/^\s*erDiagram/.test(e),"detector"),LB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./erDiagram-SSCWMZ5O-BK7BwULF.js");return{diagram:t}},__vite__mapDeps([17,13,14,15,1,2,3]));return{id:iy,diagram:e}},"loader"),FB={id:iy,detector:BB,loader:LB},MB=FB,sy="gitGraph",AB=g(e=>/^\s*gitGraph/.test(e),"detector"),EB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./gitGraphDiagram-WWUBYQGX-CFwfjpOY.js");return{diagram:t}},__vite__mapDeps([18,19,20,21,1,2,3]));return{id:sy,diagram:e}},"loader"),$B={id:sy,detector:AB,loader:EB},OB=$B,oy="gantt",DB=g(e=>/^\s*gantt/.test(e),"detector"),PB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ganttDiagram-EL5Y4UJY-CPhXhxrU.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,1,2,3]));return{id:oy,diagram:e}},"loader"),IB={id:oy,detector:DB,loader:PB},RB=IB,ay="info",qB=g(e=>/^\s*info/.test(e),"detector"),NB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./infoDiagram-RXCK75RN-D9yY8FD1.js");return{diagram:t}},__vite__mapDeps([26,21,1,2,3]));return{id:ay,diagram:e}},"loader"),WB={id:ay,detector:qB,loader:NB},ny="pie",zB=g(e=>/^\s*pie/.test(e),"detector"),HB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./pieDiagram-E7YTZNPT-BvWXdat9.js");return{diagram:t}},__vite__mapDeps([27,20,21,1,2,28,29,24,3]));return{id:ny,diagram:e}},"loader"),YB={id:ny,detector:zB,loader:HB},ly="quadrantChart",jB=g(e=>/^\s*quadrantChart/.test(e),"detector"),UB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./quadrantDiagram-AXDQQJYC-BnL0cSU1.js");return{diagram:t}},__vite__mapDeps([30,23,24,25,1,2,3]));return{id:ly,diagram:e}},"loader"),GB={id:ly,detector:jB,loader:UB},XB=GB,hy="xychart",VB=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),ZB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./xychartDiagram-S5SC5T6Z-DLFyRTkx.js");return{diagram:t}},__vite__mapDeps([31,24,29,23,25,1,2,3]));return{id:hy,diagram:e}},"loader"),KB={id:hy,detector:VB,loader:ZB},QB=KB,cy="requirement",JB=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),tL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./requirementDiagram-EFPCY7ZU-wkrY2ays.js");return{diagram:t}},__vite__mapDeps([32,13,14,1,2,3]));return{id:cy,diagram:e}},"loader"),eL={id:cy,detector:JB,loader:tL},rL=eL,dy="sequence",iL=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),sL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./sequenceDiagram-WJ2MYXX4-Cacl2vKI.js");return{diagram:t}},__vite__mapDeps([33,19,10,1,2,3]));return{id:dy,diagram:e}},"loader"),oL={id:dy,detector:iL,loader:sL},aL=oL,uy="class",nL=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),lL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./classDiagram-DTDB5LWJ-Bf2t55u3.js");return{diagram:t}},__vite__mapDeps([34,35,12,13,14,10,3,1,2]));return{id:uy,diagram:e}},"loader"),hL={id:uy,detector:nL,loader:lL},cL=hL,fy="classDiagram",dL=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),uL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./classDiagram-v2-JRS7N3AN-Bf2t55u3.js");return{diagram:t}},__vite__mapDeps([36,35,12,13,14,10,3,1,2]));return{id:fy,diagram:e}},"loader"),fL={id:fy,detector:dL,loader:uL},gL=fL,gy="state",pL=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),yL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./stateDiagram-HBIQ2CUA-DOgDo4PT.js");return{diagram:t}},__vite__mapDeps([37,38,13,14,10,3,5,1,2]));return{id:gy,diagram:e}},"loader"),mL={id:gy,detector:pL,loader:yL},xL=mL,py="stateDiagram",CL=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),bL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4QOOHH4V-CF_x3j8a.js");return{diagram:t}},__vite__mapDeps([39,38,13,14,10,3,1,2]));return{id:py,diagram:e}},"loader"),kL={id:py,detector:CL,loader:bL},wL=kL,yy="journey",SL=g(e=>/^\s*journey/.test(e),"detector"),TL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./journeyDiagram-EYS64GPL-Bmt-4Suk.js");return{diagram:t}},__vite__mapDeps([40,12,10,28,1,2,3]));return{id:yy,diagram:e}},"loader"),_L={id:yy,detector:SL,loader:TL},vL=_L,BL=g((e,t,r)=>{P.debug(`rendering svg for syntax error -`);const i=Xb(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),Ld(i,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"),my={draw:BL},LL=my,FL={db:{},renderer:my,parser:{parse:g(()=>{},"parse")}},ML=FL,xy="flowchart-elk",AL=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),EL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-CyNh512Q.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:xy,diagram:e}},"loader"),$L={id:xy,detector:AL,loader:EL},OL=$L,Cy="timeline",DL=g(e=>/^\s*timeline/.test(e),"detector"),PL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA-CE4hXwQQ.js");return{diagram:t}},__vite__mapDeps([41,28,1,2,3]));return{id:Cy,diagram:e}},"loader"),IL={id:Cy,detector:DL,loader:PL},RL=IL,by="mindmap",qL=g(e=>/^\s*mindmap/.test(e),"detector"),NL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./mindmap-definition-FBJOCRG2-CO7-mhBG.js");return{diagram:t}},__vite__mapDeps([42,13,14,1,2,3]));return{id:by,diagram:e}},"loader"),WL={id:by,detector:qL,loader:NL},zL=WL,ky="kanban",HL=g(e=>/^\s*kanban/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./kanban-definition-3QL26DDD-Di0cOJ8w.js");return{diagram:t}},__vite__mapDeps([43,12,1,2,3]));return{id:ky,diagram:e}},"loader"),jL={id:ky,detector:HL,loader:YL},UL=jL,wy="sankey",GL=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),XL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB-Bu30_Mr-.js");return{diagram:t}},__vite__mapDeps([44,29,24,1,2,3]));return{id:wy,diagram:e}},"loader"),VL={id:wy,detector:GL,loader:XL},ZL=VL,Sy="packet",KL=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),QL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII-DhBfeF96.js");return{diagram:t}},__vite__mapDeps([45,20,21,1,2,3]));return{id:Sy,diagram:e}},"loader"),JL={id:Sy,detector:KL,loader:QL},Ty="radar",tF=g(e=>/^\s*radar-beta/.test(e),"detector"),eF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN-CGYnSu9y.js");return{diagram:t}},__vite__mapDeps([46,20,21,1,2,3]));return{id:Ty,diagram:e}},"loader"),rF={id:Ty,detector:tF,loader:eF},_y="block",iF=g(e=>/^\s*block(-beta)?/.test(e),"detector"),sF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./blockDiagram-NRAW4CY4-DOMoQR_0.js");return{diagram:t}},__vite__mapDeps([47,12,15,1,2,3]));return{id:_y,diagram:e}},"loader"),oF={id:_y,detector:iF,loader:sF},aF=oF,vy="treeView",nF=g(e=>/^\s*treeView-beta/.test(e),"detector"),lF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4-Bry2fVtY.js");return{diagram:t}},__vite__mapDeps([48,19,20,21,1,2,3]));return{id:vy,diagram:e}},"loader"),hF={id:vy,detector:nF,loader:lF},cF=hF,By="architecture",dF=g(e=>/^\s*architecture/.test(e),"detector"),uF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./architectureDiagram-5GKGNRK7-D-HOppuj.js");return{diagram:t}},__vite__mapDeps([49,20,21,1,2,8,3]));return{id:By,diagram:e}},"loader"),fF={id:By,detector:dF,loader:uF},gF=fF,Ly="eventmodeling",pF=g(e=>/^\s*eventmodeling/.test(e),"detector"),yF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-VSXAHHWV-w7rFR6te.js");return{diagram:t}},__vite__mapDeps([50,20,21,1,2,3]));return{id:Ly,diagram:e}},"loader"),mF={id:Ly,detector:pF,loader:yF},xF=mF,Fy="ishikawa",CF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),bF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ishikawaDiagram-5VMMS53U-CYM95aw7.js");return{diagram:t}},__vite__mapDeps([51,1,2,3]));return{id:Fy,diagram:e}},"loader"),kF={id:Fy,detector:CF,loader:bF},My="venn",wF=g(e=>/^\s*venn-beta/.test(e),"detector"),SF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./vennDiagram-4TSXK5OY-BpYKJWUZ.js");return{diagram:t}},__vite__mapDeps([52,1,2,3]));return{id:My,diagram:e}},"loader"),TF={id:My,detector:wF,loader:SF},_F=TF,Ay="treemap",vF=g(e=>/^\s*treemap/.test(e),"detector"),BF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-VX7I27RA-CToQJsz-.js");return{diagram:t}},__vite__mapDeps([53,20,14,21,1,2,25,29,24,3]));return{id:Ay,diagram:e}},"loader"),LF={id:Ay,detector:vF,loader:BF},Ey="wardley",FF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),MF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./wardleyDiagram-VM6X3IG4-Bm8Te4ZD.js");return{diagram:t}},__vite__mapDeps([54,20,21,1,2,3]));return{id:Ey,diagram:e}},"loader"),AF={id:Ey,detector:FF,loader:MF},EF=AF,$y="cynefin",$F=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),OF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./cynefinDiagram-5FMLGOSQ-Xl-hEOic.js");return{diagram:t}},__vite__mapDeps([55,20,21,1,2,3]));return{id:$y,diagram:e}},"loader"),DF={id:$y,detector:$F,loader:OF},Oy="railroad",PF=g(e=>/^\s*railroad-beta/i.test(e),"detector"),IF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./railroadDiagram-O6MQD6OU-BL3Lwsrn.js");return{diagram:t}},__vite__mapDeps([56,57,20,21,1,2,3]));return{id:Oy,diagram:e}},"loader"),RF={id:Oy,detector:PF,loader:IF},Dy="railroadEbnf",qF=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),NF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ebnfDiagram-PWID7BFC-Du-YMm3d.js");return{diagram:t}},__vite__mapDeps([58,57,20,21,1,2,3]));return{id:Dy,diagram:e}},"loader"),WF={id:Dy,detector:qF,loader:NF},Py="railroadAbnf",zF=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),HF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./abnfDiagram-VCTEODGH-CpEdlyYv.js");return{diagram:t}},__vite__mapDeps([59,57,20,21,1,2,3]));return{id:Py,diagram:e}},"loader"),YF={id:Py,detector:zF,loader:HF},Iy="railroadPeg",jF=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),UF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./pegDiagram-XKGWAZYB-D9mF9qH_.js");return{diagram:t}},__vite__mapDeps([60,57,20,21,1,2,3]));return{id:Iy,diagram:e}},"loader"),GF={id:Iy,detector:jF,loader:UF},ad=!1,vo=g(()=>{ad||(ad=!0,Es("error",ML,e=>e.toLowerCase().trim()==="error"),Es("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new 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:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),xa(OL,zL,gF),xa(gB,UL,gL,cL,MB,RB,WB,YB,rL,aL,vB,wB,xB,RL,OB,wL,xL,vL,XB,ZL,JL,QB,aF,xF,cF,rF,kF,LF,RF,WF,YF,GF,_F,EF,DF))},"addDiagrams"),XF=g(async()=>{P.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(pr).map(async([r,{detector:i,loader:s}])=>{if(s)try{wa(r)}catch{try{const{diagram:o,id:a}=await s();Es(a,o,i)}catch(o){throw P.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete pr[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){P.error(`Failed to load ${t.length} external diagrams`);for(const r of t)P.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),VF="graphics-document document";function Ry(e,t){e.attr("role",VF),t!==""&&e.attr("aria-roledescription",t)}g(Ry,"setA11yDiagramInfo");function qy(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}g(qy,"addSVGa11yTitleDescription");var sn=class Ny{constructor(t,r,i,s,o){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=o}static{g(this,"Diagram")}static async fromText(t,r={}){const i=Rt(),s=ln(t,i);t=yk(t)+` +`:""}return g(tt,"dump2"),ga.dump=tt,ga}g(Yp,"requireDumper");var id;function jp(){if(id)return Gt;id=1;const e=Hp(),t=Yp();function r(i,s){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return g(r,"renamed"),Gt.Type=Qt(),Gt.Schema=fl(),Gt.FAILSAFE_SCHEMA=ml(),Gt.JSON_SCHEMA=wl(),Gt.CORE_SCHEMA=Sl(),Gt.DEFAULT_SCHEMA=So(),Gt.load=e.load,Gt.loadAll=e.loadAll,Gt.dump=t.dump,Gt.YAMLException=ti(),Gt.types={binary:vl(),float:kl(),map:yl(),null:xl(),pairs:Ll(),set:Fl(),timestamp:Tl(),bool:Cl(),int:bl(),merge:_l(),omap:Bl(),seq:pl(),str:gl()},Gt.safeLoad=r("safeLoad","load"),Gt.safeLoadAll=r("safeLoadAll","loadAll"),Gt.safeDump=r("safeDump","dump"),Gt}g(jp,"requireJsYaml");var Wv=jp(),zv=Wp(Wv),{Type:sM,Schema:oM,FAILSAFE_SCHEMA:aM,JSON_SCHEMA:Hv,CORE_SCHEMA:nM,DEFAULT_SCHEMA:lM,load:Yv,loadAll:hM,dump:cM,YAMLException:dM,types:uM,safeLoad:fM,safeLoadAll:gM,safeDump:pM}=zv,jv={common:Xi,getConfig:Rt,insertCluster:Zg,insertEdge:Jg,insertEdgeLabel:tl,insertMarkers:rp,insertNode:Jn,interpolateToCurve:Mn,labelHelper:ct,log:P,positionEdgeLabel:Cw},Yi={},Up=g(e=>{for(const t of e)Yi[t.name]=t},"registerLayoutLoaders"),Uv=g(()=>{Up([{name:"dagre",loader:g(async()=>await _t(()=>import("./dagre-3AP2YEHR-BWn6Idgx.js"),__vite__mapDeps([4,5,1,2,3])),"loader")},{name:"swimlane",loader:g(async()=>await _t(()=>import("./swimlanes-XN3QIQJK-DlKPgrxj.js"),__vite__mapDeps([6,1,2,3])),"loader")},{name:"cose-bilkent",loader:g(async()=>await _t(()=>import("./cose-bilkent-JH36ORCC-vlSnVTfO.js"),__vite__mapDeps([7,8,1,2,3])),"loader")}])},"registerDefaultLayoutLoaders");Uv();var yM=g(async(e,t)=>{if(!(e.layoutAlgorithm in Yi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const d=h.domId||h.id;h.domId=`${e.diagramId}-${d}`}const r=Yi[e.layoutAlgorithm],i=await r.loader(),{theme:s,themeVariables:o}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=o,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),a){const h=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,jv,{algorithm:r.algorithm})},"render"),mM=g((e="",{fallback:t="dagre"}={})=>{if(e in Yi)return e;if(t in Yi)return P.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Ml="comm",Gp="rule",Xp="decl",Gv="@media",Xv="@import",Vv="@supports",Zv="@namespace",Ja="@keyframes",Vp="@layer",Kv="@scope",Qv=Math.abs,Oi=String.fromCharCode;function Zp(e){return e.trim()}function tn(e,t,r){return e.replace(t,r)}function zr(e,t){return e.charCodeAt(t)|0}function Xr(e,t,r){return e.slice(t,r)}function _e(e){return e.length}function Kp(e){return e.length}function gs(e,t){return t.push(e),e}var To=1,Vr=1,Qp=0,he=0,Wt=0,ei="";function Al(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:To,column:Vr,length:a,return:"",siblings:n}}function Jv(){return Wt}function tB(){return Wt=he>0?zr(ei,--he):0,Vr--,Wt===10&&(Vr=1,To--),Wt}function me(){return Wt=he2||ji(Wt)>3?"":" "}function sB(e,t){for(;--t&&me()&&!(Wt<48||Wt>102||Wt>57&&Wt<65||Wt>70&&Wt<97););return _o(e,vs()+(t<6&&Je()==32&&me()==32))}function en(e){for(;me();)switch(Wt){case e:return he;case 34:case 39:e!==34&&e!==39&&en(Wt);break;case 40:e===41&&en(e);break;case 92:me();break}return he}function oB(e,t){for(;me()&&e+Wt!==57;)if(e+Wt===84&&Je()===47)break;return"/*"+_o(t,he-1)+"*"+Oi(e===47?e:me())}function aB(e){for(;!ji(Je());)me();return _o(e,he)}function nB(e){return rB(Bs("",null,null,null,[""],e=eB(e),0,[0],e))}function Bs(e,t,r,i,s,o,a,n,l){for(var c=0,h=0,d=a,u=0,f=0,y=0,m=1,x=1,C=1,k=0,S=0,T="",_=s,L=o,M=i,B=T;x;)switch(y=S,S=me()){case 40:y!=108&&zr(B,d-1)==58?(k++,B+="("):B+=pa(S);break;case 41:k--,B+=")";break;case 34:case 39:case 91:B+=pa(S);break;case 9:case 10:case 13:case 32:if(k>0){B+=Oi(S);break}B+=iB(y);break;case 92:B+=sB(vs()-1,7);continue;case 47:switch(Je()){case 42:case 47:gs(lB(oB(me(),vs()),t,r,l),l),(ji(y||1)==5||ji(Je()||1)==5)&&_e(B)&&Xr(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=_e(B)*C;case 125*m:case 59:case 0:if(k>0&&S){B+=Oi(S);break}switch(S){case 0:case 125:x=0;case 59+h:C==-1&&(B=tn(B,/\f/g,"")),f>0&&(_e(B)-d||m===0)&&gs(f>32?od(B+";",i,r,d-1,l):od(tn(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(gs(M=sd(B,t,r,c,h,s,n,T,_=[],L=[],d,o),o),S===123)if(h===0)Bs(B,t,M,M,_,o,d,n,L);else{switch(u){case 99:if(zr(B,3)===110)break;case 108:if(zr(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Bs(e,M,M,i&&gs(sd(e,M,M,0,0,s,n,T,s,_=[],d,L),L),s,L,d,n,i?_:L):Bs(B,M,M,M,[""],L,0,n,L)}}c=h=f=0,m=C=1,T=B="",d=a;break;case 58:d=1+_e(B),f=y;default:if(m<1){if(S==123)--m;else if(S==125&&m++==0&&tB()==125)continue}switch(B+=Oi(S),S*m){case 38:C=h>0?1:(B+="\f",-1);break;case 44:if(k>0)break;n[c++]=(_e(B)-1)*C,C=1;break;case 64:Je()===45&&(B+=pa(me())),u=Je(),h=d=_e(T=B+=aB(vs())),S++;break;case 45:y===45&&_e(B)==2&&(m=0)}}return o}function sd(e,t,r,i,s,o,a,n,l,c,h,d){for(var u=s-1,f=s===0?o:[""],y=Kp(f),m=0,x=0,C=0;m0?f[k]+" "+S:tn(S,/&\f/g,f[k])))&&(l[C++]=T);return Al(e,t,r,s===0?Gp:n,l,c,h,d)}function lB(e,t,r,i){return Al(e,t,r,Ml,Oi(Jv()),Xr(e,2,-2),0,i)}function od(e,t,r,i,s){return Al(e,t,r,Xp,Xr(e,0,i),Xr(e,i+1,-1),i,s)}function rn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),uB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./c4Diagram-UCG6FXSJ-DWiNeOGo.js");return{diagram:t}},__vite__mapDeps([9,10,1,2,3]));return{id:Jp,diagram:e}},"loader"),fB={id:Jp,detector:dB,loader:uB},gB=fB,ty="flowchart",pB=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),yB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-DnEfMg9m.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:ty,diagram:e}},"loader"),mB={id:ty,detector:pB,loader:yB},xB=mB,ey="flowchart-v2",CB=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),bB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-DnEfMg9m.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:ey,diagram:e}},"loader"),kB={id:ey,detector:CB,loader:bB},wB=kB,ry="swimlane",SB=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),TB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./swimlanesDiagram-VK2B7HYN-iHH4fxb9.js");return{diagram:t}},__vite__mapDeps([16,11,12,13,14,10,3,15,1,2]));return{id:ry,diagram:e}},"loader"),_B={id:ry,detector:SB,loader:TB},vB=_B,iy="er",BB=g(e=>/^\s*erDiagram/.test(e),"detector"),LB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./erDiagram-SSCWMZ5O-Y2Kx4K01.js");return{diagram:t}},__vite__mapDeps([17,13,14,15,1,2,3]));return{id:iy,diagram:e}},"loader"),FB={id:iy,detector:BB,loader:LB},MB=FB,sy="gitGraph",AB=g(e=>/^\s*gitGraph/.test(e),"detector"),EB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./gitGraphDiagram-WWUBYQGX-B6MjdyCr.js");return{diagram:t}},__vite__mapDeps([18,19,20,21,1,2,3]));return{id:sy,diagram:e}},"loader"),$B={id:sy,detector:AB,loader:EB},OB=$B,oy="gantt",DB=g(e=>/^\s*gantt/.test(e),"detector"),PB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ganttDiagram-EL5Y4UJY-DHRYTGQL.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,1,2,3]));return{id:oy,diagram:e}},"loader"),IB={id:oy,detector:DB,loader:PB},RB=IB,ay="info",qB=g(e=>/^\s*info/.test(e),"detector"),NB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./infoDiagram-RXCK75RN-DnUqCcVs.js");return{diagram:t}},__vite__mapDeps([26,21,1,2,3]));return{id:ay,diagram:e}},"loader"),WB={id:ay,detector:qB,loader:NB},ny="pie",zB=g(e=>/^\s*pie/.test(e),"detector"),HB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./pieDiagram-E7YTZNPT-DmQ5At8v.js");return{diagram:t}},__vite__mapDeps([27,20,21,1,2,28,29,24,3]));return{id:ny,diagram:e}},"loader"),YB={id:ny,detector:zB,loader:HB},ly="quadrantChart",jB=g(e=>/^\s*quadrantChart/.test(e),"detector"),UB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./quadrantDiagram-AXDQQJYC-D_IgCGNI.js");return{diagram:t}},__vite__mapDeps([30,23,24,25,1,2,3]));return{id:ly,diagram:e}},"loader"),GB={id:ly,detector:jB,loader:UB},XB=GB,hy="xychart",VB=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),ZB=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./xychartDiagram-S5SC5T6Z-BYpEl4K7.js");return{diagram:t}},__vite__mapDeps([31,24,29,23,25,1,2,3]));return{id:hy,diagram:e}},"loader"),KB={id:hy,detector:VB,loader:ZB},QB=KB,cy="requirement",JB=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),tL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./requirementDiagram-EFPCY7ZU-CrRI3OsX.js");return{diagram:t}},__vite__mapDeps([32,13,14,1,2,3]));return{id:cy,diagram:e}},"loader"),eL={id:cy,detector:JB,loader:tL},rL=eL,dy="sequence",iL=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),sL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./sequenceDiagram-WJ2MYXX4-CHUJYzom.js");return{diagram:t}},__vite__mapDeps([33,19,10,1,2,3]));return{id:dy,diagram:e}},"loader"),oL={id:dy,detector:iL,loader:sL},aL=oL,uy="class",nL=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),lL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./classDiagram-DTDB5LWJ-iewAXWXR.js");return{diagram:t}},__vite__mapDeps([34,35,12,13,14,10,3,1,2]));return{id:uy,diagram:e}},"loader"),hL={id:uy,detector:nL,loader:lL},cL=hL,fy="classDiagram",dL=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),uL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./classDiagram-v2-JRS7N3AN-iewAXWXR.js");return{diagram:t}},__vite__mapDeps([36,35,12,13,14,10,3,1,2]));return{id:fy,diagram:e}},"loader"),fL={id:fy,detector:dL,loader:uL},gL=fL,gy="state",pL=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),yL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./stateDiagram-HBIQ2CUA-1JuYFASL.js");return{diagram:t}},__vite__mapDeps([37,38,13,14,10,3,5,1,2]));return{id:gy,diagram:e}},"loader"),mL={id:gy,detector:pL,loader:yL},xL=mL,py="stateDiagram",CL=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),bL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4QOOHH4V-Bv7KRSeS.js");return{diagram:t}},__vite__mapDeps([39,38,13,14,10,3,1,2]));return{id:py,diagram:e}},"loader"),kL={id:py,detector:CL,loader:bL},wL=kL,yy="journey",SL=g(e=>/^\s*journey/.test(e),"detector"),TL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./journeyDiagram-EYS64GPL-CYf7qu-o.js");return{diagram:t}},__vite__mapDeps([40,12,10,28,1,2,3]));return{id:yy,diagram:e}},"loader"),_L={id:yy,detector:SL,loader:TL},vL=_L,BL=g((e,t,r)=>{P.debug(`rendering svg for syntax error +`);const i=Xb(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),Ld(i,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"),my={draw:BL},LL=my,FL={db:{},renderer:my,parser:{parse:g(()=>{},"parse")}},ML=FL,xy="flowchart-elk",AL=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),EL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./flowDiagram-A5DVABFB-DnEfMg9m.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([11,12,13,14,10,3,15]));return{id:xy,diagram:e}},"loader"),$L={id:xy,detector:AL,loader:EL},OL=$L,Cy="timeline",DL=g(e=>/^\s*timeline/.test(e),"detector"),PL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA-BxrqJk2T.js");return{diagram:t}},__vite__mapDeps([41,28,1,2,3]));return{id:Cy,diagram:e}},"loader"),IL={id:Cy,detector:DL,loader:PL},RL=IL,by="mindmap",qL=g(e=>/^\s*mindmap/.test(e),"detector"),NL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./mindmap-definition-FBJOCRG2-Ue2jfeTc.js");return{diagram:t}},__vite__mapDeps([42,13,14,1,2,3]));return{id:by,diagram:e}},"loader"),WL={id:by,detector:qL,loader:NL},zL=WL,ky="kanban",HL=g(e=>/^\s*kanban/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./kanban-definition-3QL26DDD--1wLk-1R.js");return{diagram:t}},__vite__mapDeps([43,12,1,2,3]));return{id:ky,diagram:e}},"loader"),jL={id:ky,detector:HL,loader:YL},UL=jL,wy="sankey",GL=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),XL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB-dr9T-hji.js");return{diagram:t}},__vite__mapDeps([44,29,24,1,2,3]));return{id:wy,diagram:e}},"loader"),VL={id:wy,detector:GL,loader:XL},ZL=VL,Sy="packet",KL=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),QL=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII-DQhaVd0o.js");return{diagram:t}},__vite__mapDeps([45,20,21,1,2,3]));return{id:Sy,diagram:e}},"loader"),JL={id:Sy,detector:KL,loader:QL},Ty="radar",tF=g(e=>/^\s*radar-beta/.test(e),"detector"),eF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN-NCrmzyFy.js");return{diagram:t}},__vite__mapDeps([46,20,21,1,2,3]));return{id:Ty,diagram:e}},"loader"),rF={id:Ty,detector:tF,loader:eF},_y="block",iF=g(e=>/^\s*block(-beta)?/.test(e),"detector"),sF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./blockDiagram-NRAW4CY4-DquLxvSM.js");return{diagram:t}},__vite__mapDeps([47,12,15,1,2,3]));return{id:_y,diagram:e}},"loader"),oF={id:_y,detector:iF,loader:sF},aF=oF,vy="treeView",nF=g(e=>/^\s*treeView-beta/.test(e),"detector"),lF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4-CsGEy4pv.js");return{diagram:t}},__vite__mapDeps([48,19,20,21,1,2,3]));return{id:vy,diagram:e}},"loader"),hF={id:vy,detector:nF,loader:lF},cF=hF,By="architecture",dF=g(e=>/^\s*architecture/.test(e),"detector"),uF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./architectureDiagram-5GKGNRK7-Cu602jjl.js");return{diagram:t}},__vite__mapDeps([49,20,21,1,2,8,3]));return{id:By,diagram:e}},"loader"),fF={id:By,detector:dF,loader:uF},gF=fF,Ly="eventmodeling",pF=g(e=>/^\s*eventmodeling/.test(e),"detector"),yF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-VSXAHHWV-DX1w9vGD.js");return{diagram:t}},__vite__mapDeps([50,20,21,1,2,3]));return{id:Ly,diagram:e}},"loader"),mF={id:Ly,detector:pF,loader:yF},xF=mF,Fy="ishikawa",CF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),bF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ishikawaDiagram-5VMMS53U-V_xG_Q39.js");return{diagram:t}},__vite__mapDeps([51,1,2,3]));return{id:Fy,diagram:e}},"loader"),kF={id:Fy,detector:CF,loader:bF},My="venn",wF=g(e=>/^\s*venn-beta/.test(e),"detector"),SF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./vennDiagram-4TSXK5OY-BrUn21V7.js");return{diagram:t}},__vite__mapDeps([52,1,2,3]));return{id:My,diagram:e}},"loader"),TF={id:My,detector:wF,loader:SF},_F=TF,Ay="treemap",vF=g(e=>/^\s*treemap/.test(e),"detector"),BF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./diagram-VX7I27RA-Cj2f-GhL.js");return{diagram:t}},__vite__mapDeps([53,20,14,21,1,2,25,29,24,3]));return{id:Ay,diagram:e}},"loader"),LF={id:Ay,detector:vF,loader:BF},Ey="wardley",FF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),MF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./wardleyDiagram-VM6X3IG4-D34PRRSw.js");return{diagram:t}},__vite__mapDeps([54,20,21,1,2,3]));return{id:Ey,diagram:e}},"loader"),AF={id:Ey,detector:FF,loader:MF},EF=AF,$y="cynefin",$F=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),OF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./cynefinDiagram-5FMLGOSQ-D4XXylSl.js");return{diagram:t}},__vite__mapDeps([55,20,21,1,2,3]));return{id:$y,diagram:e}},"loader"),DF={id:$y,detector:$F,loader:OF},Oy="railroad",PF=g(e=>/^\s*railroad-beta/i.test(e),"detector"),IF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./railroadDiagram-O6MQD6OU-BQ5evXj8.js");return{diagram:t}},__vite__mapDeps([56,57,20,21,1,2,3]));return{id:Oy,diagram:e}},"loader"),RF={id:Oy,detector:PF,loader:IF},Dy="railroadEbnf",qF=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),NF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./ebnfDiagram-PWID7BFC-CZX4bYJf.js");return{diagram:t}},__vite__mapDeps([58,57,20,21,1,2,3]));return{id:Dy,diagram:e}},"loader"),WF={id:Dy,detector:qF,loader:NF},Py="railroadAbnf",zF=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),HF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./abnfDiagram-VCTEODGH-B5EIRmLW.js");return{diagram:t}},__vite__mapDeps([59,57,20,21,1,2,3]));return{id:Py,diagram:e}},"loader"),YF={id:Py,detector:zF,loader:HF},Iy="railroadPeg",jF=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),UF=g(async()=>{const{diagram:e}=await _t(async()=>{const{diagram:t}=await import("./pegDiagram-XKGWAZYB-pzaRoeVF.js");return{diagram:t}},__vite__mapDeps([60,57,20,21,1,2,3]));return{id:Iy,diagram:e}},"loader"),GF={id:Iy,detector:jF,loader:UF},ad=!1,vo=g(()=>{ad||(ad=!0,Es("error",ML,e=>e.toLowerCase().trim()==="error"),Es("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new 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:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),xa(OL,zL,gF),xa(gB,UL,gL,cL,MB,RB,WB,YB,rL,aL,vB,wB,xB,RL,OB,wL,xL,vL,XB,ZL,JL,QB,aF,xF,cF,rF,kF,LF,RF,WF,YF,GF,_F,EF,DF))},"addDiagrams"),XF=g(async()=>{P.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(pr).map(async([r,{detector:i,loader:s}])=>{if(s)try{wa(r)}catch{try{const{diagram:o,id:a}=await s();Es(a,o,i)}catch(o){throw P.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete pr[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){P.error(`Failed to load ${t.length} external diagrams`);for(const r of t)P.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),VF="graphics-document document";function Ry(e,t){e.attr("role",VF),t!==""&&e.attr("aria-roledescription",t)}g(Ry,"setA11yDiagramInfo");function qy(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}g(qy,"addSVGa11yTitleDescription");var sn=class Ny{constructor(t,r,i,s,o){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=o}static{g(this,"Diagram")}static async fromText(t,r={}){const i=Rt(),s=ln(t,i);t=yk(t)+` `;try{wa(s)}catch{const c=zm(s);if(!c)throw new wd(`Diagram ${s} not found.`);const{id:h,diagram:d}=await c();Es(h,d)}const{db:o,parser:a,renderer:n,init:l}=wa(s);return a.parser&&(a.parser.yy=o),o.clear?.(),l?.(i),r.title&&o.setDiagramTitle?.(r.title),await a.parse(t),new Ny(s,t,o,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},nd=[],ZF=g(()=>{nd.forEach(e=>{e()}),nd=[]},"attachFunctions"),KF=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Wy(e){const t=e.match(kd);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` `):t[2];let s=Yv(i,{schema:Hv})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}g(Wy,"extractFrontMatter");var QF=g(e=>e.replace(/\r\n?/g,` diff --git a/apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-CO7-mhBG.js b/apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-Ue2jfeTc.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-CO7-mhBG.js rename to apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-Ue2jfeTc.js index d6ceb30fe..ec1d08cf1 100644 --- a/apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-CO7-mhBG.js +++ b/apps/pythinker-code/dist-web/assets/mindmap-definition-FBJOCRG2-Ue2jfeTc.js @@ -1,4 +1,4 @@ -import{g as oe}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as ae}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as l,l as C,x as ce,y as le,A as he,E as G,c as B,i as F,b3 as de,ab as ge,ac as ue,ad as pe}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,z,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`: +import{g as oe}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as ae}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as l,l as C,x as ce,y as le,A as he,E as G,c as B,i as F,b3 as de,ab as ge,ac as ue,ad as pe}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,z,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`: `+y.showPosition()+` Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(S[0]){case 1:o.push(b),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),b=null,K=y.yyleng,u=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},se&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof z<"u")return z;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},te=(function(){var D={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-D9mF9qH_.js b/apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-pzaRoeVF.js similarity index 87% rename from apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-D9mF9qH_.js rename to apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-pzaRoeVF.js index 74b8d0cd3..56c751f36 100644 --- a/apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-D9mF9qH_.js +++ b/apps/pythinker-code/dist-web/assets/pegDiagram-XKGWAZYB-pzaRoeVF.js @@ -1 +1 @@ -import{g as l,r as m,d as a}from"./chunk-SVP7TREG-XNRd51cY.js";import{p}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as t,l as o}from"./mermaid.core-Pmnag6hS.js";import{M as u,d as c}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; +import{g as l,r as m,d as a}from"./chunk-SVP7TREG-C1yhxvNc.js";import{p}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as t,l as o}from"./mermaid.core-4ur3W-UG.js";import{M as u,d as c}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-BvWXdat9.js b/apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-DmQ5At8v.js similarity index 94% rename from apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-BvWXdat9.js rename to apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-DmQ5At8v.js index 30522e4d0..b2988e9e9 100644 --- a/apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-BvWXdat9.js +++ b/apps/pythinker-code/dist-web/assets/pieDiagram-E7YTZNPT-DmQ5At8v.js @@ -1,4 +1,4 @@ -import{p as at}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{S as T,K as P,b2 as rt,g as nt,s as it,a as ot,b as st,q as lt,p as ct,_ as g,l as B,c as ut,D as dt,G as gt,a2 as pt,d as ht,r as ft,E as mt}from"./mermaid.core-Pmnag6hS.js";import{p as vt}from"./cynefin-OW5HDTMX-CwX4S6So.js";import{d as X}from"./arc-C__I0s6O.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(P),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),z=Math.min(P,Math.max(-P,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(z)/s,p.apply(this,arguments)),u=L*(z<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(z-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),B.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),Et=g(()=>V,"getShowData"),Z={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:Et},zt=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);B.debug(n),zt(n,Z)},"parse")},Rt=g(t=>` +import{p as at}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{S as T,K as P,b2 as rt,g as nt,s as it,a as ot,b as st,q as lt,p as ct,_ as g,l as B,c as ut,D as dt,G as gt,a2 as pt,d as ht,r as ft,E as mt}from"./mermaid.core-4ur3W-UG.js";import{p as vt}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import{d as X}from"./arc-ChDdl02F.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(P),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),z=Math.min(P,Math.max(-P,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(z)/s,p.apply(this,arguments)),u=L*(z<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(z-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),B.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),Et=g(()=>V,"getShowData"),Z={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:Et},zt=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);B.debug(n),zt(n,Z)},"parse")},Rt=g(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; diff --git a/apps/pythinker-code/dist-web/assets/python-Bt9WTZOE.js b/apps/pythinker-code/dist-web/assets/python-C976vrQl.js similarity index 96% rename from apps/pythinker-code/dist-web/assets/python-Bt9WTZOE.js rename to apps/pythinker-code/dist-web/assets/python-C976vrQl.js index e15d1e0ec..a42819094 100644 --- a/apps/pythinker-code/dist-web/assets/python-Bt9WTZOE.js +++ b/apps/pythinker-code/dist-web/assets/python-C976vrQl.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const i={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async|match|case).*?:\\s*$"),action:{indentAction:e.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},r={defaultToken:"",tokenPostfix:".python",keywords:["False","None","True","_","and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","match","nonlocal","not","or","pass","print","raise","return","try","type","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","self","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/[,:;]/,"delimiter"],[/[{}\[\]()]/,"@brackets"],[/@[a-zA-Z_]\w*/,"tag"],[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]],numbers:[[/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/,"number"]],strings:[[/'$/,"string.escape","@popall"],[/f'{1,3}/,"string.escape","@fStringBody"],[/'/,"string.escape","@stringBody"],[/"$/,"string.escape","@popall"],[/f"{1,3}/,"string.escape","@fDblStringBody"],[/"/,"string.escape","@dblStringBody"]],fStringBody:[[/[^\\'\{\}]+$/,"string","@popall"],[/[^\\'\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],stringBody:[[/[^\\']+$/,"string","@popall"],[/[^\\']+/,"string"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],fDblStringBody:[[/[^\\"\{\}]+$/,"string","@popall"],[/[^\\"\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],dblStringBody:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],fStringDetail:[[/[:][^}]+/,"string"],[/[!][ars]/,"string"],[/=/,"string"],[/\}/,"identifier","@pop"]]}};export{i as conf,r as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const i={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async|match|case).*?:\\s*$"),action:{indentAction:e.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},r={defaultToken:"",tokenPostfix:".python",keywords:["False","None","True","_","and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","match","nonlocal","not","or","pass","print","raise","return","try","type","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","self","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/[,:;]/,"delimiter"],[/[{}\[\]()]/,"@brackets"],[/@[a-zA-Z_]\w*/,"tag"],[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]],numbers:[[/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/,"number"]],strings:[[/'$/,"string.escape","@popall"],[/f'{1,3}/,"string.escape","@fStringBody"],[/'/,"string.escape","@stringBody"],[/"$/,"string.escape","@popall"],[/f"{1,3}/,"string.escape","@fDblStringBody"],[/"/,"string.escape","@dblStringBody"]],fStringBody:[[/[^\\'\{\}]+$/,"string","@popall"],[/[^\\'\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],stringBody:[[/[^\\']+$/,"string","@popall"],[/[^\\']+/,"string"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],fDblStringBody:[[/[^\\"\{\}]+$/,"string","@popall"],[/[^\\"\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],dblStringBody:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],fStringDetail:[[/[:][^}]+/,"string"],[/[!][ars]/,"string"],[/=/,"string"],[/\}/,"identifier","@pop"]]}};export{i as conf,r as language}; diff --git a/apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-BnL0cSU1.js b/apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-D_IgCGNI.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-BnL0cSU1.js rename to apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-D_IgCGNI.js index 4e2f64fcd..8dc25f65a 100644 --- a/apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-BnL0cSU1.js +++ b/apps/pythinker-code/dist-web/assets/quadrantDiagram-AXDQQJYC-D_IgCGNI.js @@ -1,4 +1,4 @@ -import{s as Se,g as _e,q as ee,p as Ae,a as ke,b as Fe,_ as r,c as Et,l as qt,j as vt,d as Pe,r as ve,E as z,i as Ce,X as Le}from"./mermaid.core-Pmnag6hS.js";import{l as te}from"./linear-CJbRkaTL.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],m=[1,37],b=[1,36],y=[1,38],T=[1,35],q=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],X=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Xt=[1,73],Ht=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Xt,12:Ht,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Xt,12:Ht,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,qe=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var me=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`: +import{s as Se,g as _e,q as ee,p as Ae,a as ke,b as Fe,_ as r,c as Et,l as qt,j as vt,d as Pe,r as ve,E as z,i as Ce,X as Le}from"./mermaid.core-4ur3W-UG.js";import{l as te}from"./linear-CTZFHtw0.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],m=[1,37],b=[1,36],y=[1,38],T=[1,35],q=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],X=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Xt=[1,73],Ht=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:m,5:b,10:y,12:T,13:q,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,10:y,12:T,13:q,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Xt,12:Ht,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Xt,12:Ht,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:m,5:b,10:y,12:T,13:q,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:m,5:b,8:X,10:y,12:T,13:q,14:g,15:k,18:H,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,qe=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var me=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`: `+D.showPosition()+` Expecting `+yt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Pt="Parse error on line "+(gt+1)+": Unexpected "+(B==Zt?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Pt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:kt,expected:yt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:u.push(B),A.push(D.yytext),e.push(D.yylloc),u.push(W[1]),B=null,Kt=D.yyleng,n=D.yytext,gt=D.yylineno,kt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=A[A.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},me&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Ft=this.performAction.apply(rt,[n,Kt,gt,j.yy,W[1],A,e].concat(qe)),typeof Ft<"u")return Ft;M&&(u=u.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),u.push(this.productions_[W[1]][0]),A.push(rt.$),e.push(rt._$),$t=ht[u[u.length-2]][u[u.length-1]],u.push($t);break;case 3:return!0}}return!0},"parse")},ye=(function(){var Y={EOF:1,parseError:r(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:r(function(s,l){return this.yy=l||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var l=s.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r(function(s){var l=s.length,u=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),l=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BL3Lwsrn.js b/apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BQ5evXj8.js similarity index 84% rename from apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BL3Lwsrn.js rename to apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BQ5evXj8.js index 7ccb2ceea..a8832a9af 100644 --- a/apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BL3Lwsrn.js +++ b/apps/pythinker-code/dist-web/assets/railroadDiagram-O6MQD6OU-BQ5evXj8.js @@ -1 +1 @@ -import{g as s,r as l,d as t}from"./chunk-SVP7TREG-XNRd51cY.js";import{p as m}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{_ as n,l as i}from"./mermaid.core-Pmnag6hS.js";import{M as p,c as u}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; +import{g as s,r as l,d as t}from"./chunk-SVP7TREG-C1yhxvNc.js";import{p as m}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{_ as n,l as i}from"./mermaid.core-4ur3W-UG.js";import{M as p,c as u}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/razor-B1yVkJwa.js b/apps/pythinker-code/dist-web/assets/razor-C5EZiuVm.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/razor-B1yVkJwa.js rename to apps/pythinker-code/dist-web/assets/razor-C5EZiuVm.js index 2e98d847d..344d127e0 100644 --- a/apps/pythinker-code/dist-web/assets/razor-B1yVkJwa.js +++ b/apps/pythinker-code/dist-web/assets/razor-C5EZiuVm.js @@ -1 +1 @@ -import{l as t}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},n={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/@@@@/],[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],razorInSimpleState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3"}]],razorInEmbeddedState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],razorBlockCommentTopLevel:[[/\*@/,"@rematch","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorBlockComment:[[/\*@/,"comment.cs","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorRootTopLevel:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/[})]/,"@rematch","@pop"],{include:"razorCommon"}],razorRoot:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/\}/,"delimiter.bracket.cs","@pop"],[/\)/,"delimiter.parenthesis.cs","@pop"],{include:"razorCommon"}],razorCommon:[[/[a-zA-Z_]\w*/,{cases:{"@razorKeywords":{token:"keyword.cs"},"@default":"identifier.cs"}}],[/[\[\]]/,"delimiter.array.cs"],[/[ \t\r\n]+/],[/\/\/.*$/,"comment.cs"],[/@\*/,"comment.cs","@razorBlockComment"],[/"([^"]*)"/,"string.cs"],[/'([^']*)'/,"string.cs"],[/(<)([\w\-]+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<\/)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/,"delimiter.cs"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.cs"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.cs"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.cs"],[/0[0-7']*[0-7]/,"number.octal.cs"],[/0[bB][0-1']*[0-1]/,"number.binary.cs"],[/\d[\d']*/,"number.cs"],[/\d/,"number.cs"]]},razorKeywords:["abstract","as","async","await","base","bool","break","by","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","descending","explicit","event","extern","else","enum","false","finally","fixed","float","for","foreach","from","goto","group","if","implicit","in","int","interface","internal","into","is","lock","long","nameof","new","null","namespace","object","operator","out","override","orderby","params","private","protected","public","readonly","ref","return","switch","struct","sbyte","sealed","short","sizeof","stackalloc","static","string","select","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","when","while","where","yield","model","inject"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/};export{i as conf,n as language}; +import{l as t}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},n={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/@@@@/],[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],razorInSimpleState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3"}]],razorInEmbeddedState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],razorBlockCommentTopLevel:[[/\*@/,"@rematch","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorBlockComment:[[/\*@/,"comment.cs","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorRootTopLevel:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/[})]/,"@rematch","@pop"],{include:"razorCommon"}],razorRoot:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/\}/,"delimiter.bracket.cs","@pop"],[/\)/,"delimiter.parenthesis.cs","@pop"],{include:"razorCommon"}],razorCommon:[[/[a-zA-Z_]\w*/,{cases:{"@razorKeywords":{token:"keyword.cs"},"@default":"identifier.cs"}}],[/[\[\]]/,"delimiter.array.cs"],[/[ \t\r\n]+/],[/\/\/.*$/,"comment.cs"],[/@\*/,"comment.cs","@razorBlockComment"],[/"([^"]*)"/,"string.cs"],[/'([^']*)'/,"string.cs"],[/(<)([\w\-]+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<\/)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/,"delimiter.cs"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.cs"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.cs"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.cs"],[/0[0-7']*[0-7]/,"number.octal.cs"],[/0[bB][0-1']*[0-1]/,"number.binary.cs"],[/\d[\d']*/,"number.cs"],[/\d/,"number.cs"]]},razorKeywords:["abstract","as","async","await","base","bool","break","by","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","descending","explicit","event","extern","else","enum","false","finally","fixed","float","for","foreach","from","goto","group","if","implicit","in","int","interface","internal","into","is","lock","long","nameof","new","null","namespace","object","operator","out","override","orderby","params","private","protected","public","readonly","ref","return","switch","struct","sbyte","sealed","short","sizeof","stackalloc","static","string","select","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","when","while","where","yield","model","inject"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/};export{i as conf,n as language}; diff --git a/apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-wkrY2ays.js b/apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-CrRI3OsX.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-wkrY2ays.js rename to apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-CrRI3OsX.js index c05d98a59..a00d50fc7 100644 --- a/apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-wkrY2ays.js +++ b/apps/pythinker-code/dist-web/assets/requirementDiagram-EFPCY7ZU-CrRI3OsX.js @@ -1,4 +1,4 @@ -import{g as ze}from"./chunk-XXDRQBXY-LvYS55fD.js";import{s as Ge}from"./chunk-POPQ4Y6H-BOop7K_8.js";import{_ as u,A as Ye,b as Xe,a as Je,s as Ze,g as et,p as tt,q as st,c as Te,l as Ne,r as it,v as rt,x as nt,y as at,z as lt}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var qe=(function(){var e=u(function($,r,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=r);return n},"o"),f=[1,3],h=[1,4],o=[1,5],i=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:u(function(r,n,l,s,m,t,me){var a=t.length-1;switch(m){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:f,9:h,11:o,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:f,9:h,11:o,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:f,9:h,11:o,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:u(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:u(function(r){var n=this,l=[0],s=[],m=[null],t=[],me=this.table,a="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),z={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(z.yy[Se]=this.yy[Se]);y.setInput(r,z.yy),z.yy.lexer=y,z.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){l.length=l.length-2*I,m.length=m.length-I,t.length=t.length-I}u(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=n.symbols_[I]||I),I}u(Pe,"lex");for(var b,G,N,Ie,J={},ge,F,Ue,ye;;){if(G=l[l.length-1],this.defaultActions[G]?N=this.defaultActions[G]:((b===null||typeof b>"u")&&(b=Pe()),N=me[G]&&me[G][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[G])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`: +import{g as ze}from"./chunk-XXDRQBXY-B0zDZEAk.js";import{s as Ge}from"./chunk-POPQ4Y6H-Bc64Qx3F.js";import{_ as u,A as Ye,b as Xe,a as Je,s as Ze,g as et,p as tt,q as st,c as Te,l as Ne,r as it,v as rt,x as nt,y as at,z as lt}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var qe=(function(){var e=u(function($,r,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=r);return n},"o"),f=[1,3],h=[1,4],o=[1,5],i=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:u(function(r,n,l,s,m,t,me){var a=t.length-1;switch(m){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:f,9:h,11:o,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:f,9:h,11:o,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:f,9:h,11:o,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:h,11:o,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:u(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:u(function(r){var n=this,l=[0],s=[],m=[null],t=[],me=this.table,a="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),z={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(z.yy[Se]=this.yy[Se]);y.setInput(r,z.yy),z.yy.lexer=y,z.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){l.length=l.length-2*I,m.length=m.length-I,t.length=t.length-I}u(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=n.symbols_[I]||I),I}u(Pe,"lex");for(var b,G,N,Ie,J={},ge,F,Ue,ye;;){if(G=l[l.length-1],this.defaultActions[G]?N=this.defaultActions[G]:((b===null||typeof b>"u")&&(b=Pe()),N=me[G]&&me[G][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[G])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`: `+y.showPosition()+` Expecting `+ye.join(", ")+", got '"+(this.terminals_[b]||b)+"'":ke="Parse error on line "+(Re+1)+": Unexpected "+(b==$e?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(ke,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:be,expected:ye})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+b);switch(N[0]){case 1:l.push(b),m.push(y.yytext),t.push(y.yylloc),l.push(N[1]),b=null,Fe=y.yyleng,a=y.yytext,Re=y.yylineno,be=y.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=m[m.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Ie=this.performAction.apply(J,[a,Fe,Re,z.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(l=l.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[l[l.length-2]][l[l.length-1]],l.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:u(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:u(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:u(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(r){this.unput(this.match.slice(r))},"less"),pastInput:u(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-Bu30_Mr-.js b/apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-dr9T-hji.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-Bu30_Mr-.js rename to apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-dr9T-hji.js index 6d61fa46f..f2cc85c40 100644 --- a/apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-Bu30_Mr-.js +++ b/apps/pythinker-code/dist-web/assets/sankeyDiagram-P5KCCOFB-dr9T-hji.js @@ -1,4 +1,4 @@ -import{p as kt,q as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,b7 as St,j as G,ae as wt,r as Lt,k as Et}from"./mermaid.core-Pmnag6hS.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return q(t.source,i.source)||t.index-i.index}function ct(t,i){return q(t.target,i.target)||t.index-i.index}function q(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function Dt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=jt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;rc.length)-1)),$(f);for(let c=0;c0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),j(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,z=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,z+=U}if(!(z>0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),j(p,c)}}function j(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function D({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,zt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>zt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function qt(t){return[t.source.x1,t.y0]}function Ht(t){return[t.target.x0,t.y1]}function Xt(){return Yt().source(qt).target(Ht)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;d.push(j);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function D(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(D,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=D()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +import{p as kt,q as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,b7 as St,j as G,ae as wt,r as Lt,k as Et}from"./mermaid.core-4ur3W-UG.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";import"./init-Gi6I4Gst.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return q(t.source,i.source)||t.index-i.index}function ct(t,i){return q(t.target,i.target)||t.index-i.index}function q(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function Dt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=jt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;rc.length)-1)),$(f);for(let c=0;c0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),j(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,z=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,z+=U}if(!(z>0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,D(b)}a===void 0&&p.sort(q),j(p,c)}}function j(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function D({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,zt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>zt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function qt(t){return[t.source.x1,t.y0]}function Ht(t){return[t.target.x0,t.y1]}function Xt(){return Yt().source(qt).target(Ht)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;d.push(j);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function D(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(D,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=D()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: `+S.showPosition()+` Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},R&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),n=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat($)),typeof n<"u")return n;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:y(function(o,a){return this.yy=a||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var a=o.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:y(function(o){var a=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var o=this.pastInput(),a=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-Cacl2vKI.js b/apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-CHUJYzom.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-Cacl2vKI.js rename to apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-CHUJYzom.js index 0364d4b26..be44d4f3c 100644 --- a/apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-Cacl2vKI.js +++ b/apps/pythinker-code/dist-web/assets/sequenceDiagram-WJ2MYXX4-CHUJYzom.js @@ -1,4 +1,4 @@ -import{I as tr}from"./chunk-2Q5K7J3B-BJtTXqt1.js";import{_ as x,Y as er,c as $,j as Vt,l as at,o as Ce,d as rr,e as ar,k as N,b as ke,s as sr,p as ir,a as nr,g as or,q as cr,Z as lr,$ as hr,r as dr,i as Yt,z as Z,a0 as Q,a1 as Pt,a2 as Me,a3 as Tr,A as Kt,a4 as pr,a5 as Be}from"./mermaid.core-Pmnag6hS.js";import{a as Er,g as ae,b as dt,d as ur,c as se,e as ie}from"./chunk-F27PBJKO-CENksy_e.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var te=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],u=[1,14],d=[1,15],p=[1,17],_=[1,18],E=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],H=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],kt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],ne=[1,87],oe=[1,88],ce=[1,89],le=[1,90],he=[1,91],de=[1,92],Te=[1,93],pe=[1,94],Ee=[1,95],ue=[1,96],fe=[1,97],_e=[1,98],ge=[1,99],xe=[1,100],Ie=[1,101],ye=[1,102],Re=[1,103],Oe=[1,104],Le=[1,105],be=[2,78],St=[4,5,17,51,53,54],Dt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Gt=[5,52],F=[70,71,72,73],ot=[1,151],Xt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,c,wt){var h=c.length-1;switch(z){case 3:return y.apply(c[h]),c[h];case 4:case 10:this.$=[];break;case 5:case 11:c[h-1].push(c[h]),this.$=c[h-1];break;case 6:case 7:case 12:case 13:this.$=c[h];break;case 8:case 9:case 14:this.$=[];break;case 16:c[h].type="createParticipant",this.$=c[h];break;case 17:c[h-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[h-2])}),c[h-1].push({type:"boxEnd",boxText:c[h-2]}),this.$=c[h-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-2]),sequenceIndexStep:Number(c[h-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-1].actor};break;case 30:y.setDiagramTitle(c[h].substring(6)),this.$=c[h].substring(6);break;case 31:y.setDiagramTitle(c[h].substring(7)),this.$=c[h].substring(7);break;case 32:this.$=c[h].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[h].trim(),y.setAccDescription(this.$);break;case 35:c[h-1].unshift({type:"loopStart",loopText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.LOOP_START}),c[h-1].push({type:"loopEnd",loopText:c[h-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[h-1];break;case 36:c[h-1].unshift({type:"rectStart",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_START}),c[h-1].push({type:"rectEnd",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[h-1];break;case 37:c[h-1].unshift({type:"optStart",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_START}),c[h-1].push({type:"optEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[h-1];break;case 38:c[h-1].unshift({type:"altStart",altText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.ALT_START}),c[h-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[h-1];break;case 39:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 40:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 41:c[h-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.CRITICAL_START}),c[h-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[h-1];break;case 42:c[h-1].unshift({type:"breakStart",breakText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_START}),c[h-1].push({type:"breakEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[h-1];break;case 44:this.$=c[h-3].concat([{type:"option",optionText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[h]]);break;case 46:this.$=c[h-3].concat([{type:"and",parText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.PAR_AND},c[h]]);break;case 48:this.$=c[h-3].concat([{type:"else",altText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.ALT_ELSE},c[h]]);break;case 49:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 50:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 51:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 52:case 57:c[h-1].draw="actor",c[h-1].type="addParticipant",this.$=c[h-1];break;case 53:c[h-1].type="destroyParticipant",this.$=c[h-1];break;case 54:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 55:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 56:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 58:this.$=[c[h-1],{type:"addNote",placement:c[h-2],actor:c[h-1].actor,text:c[h]}];break;case 59:c[h-2]=[].concat(c[h-1],c[h-1]).slice(0,2),c[h-2][0]=c[h-2][0].actor,c[h-2][1]=c[h-2][1].actor,this.$=[c[h-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[h-2].slice(0,2),text:c[h]}];break;case 60:this.$=[c[h-1],{type:"addLinks",actor:c[h-1].actor,text:c[h]}];break;case 61:this.$=[c[h-1],{type:"addALink",actor:c[h-1].actor,text:c[h]}];break;case 62:this.$=[c[h-1],{type:"addProperties",actor:c[h-1].actor,text:c[h]}];break;case 63:this.$=[c[h-1],{type:"addDetails",actor:c[h-1].actor,text:c[h]}];break;case 66:this.$=[c[h-2],c[h]];break;case 67:this.$=c[h];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor}];break;case 71:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-4].actor}];break;case 72:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor}];break;case 73:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-4].actor}];break;case 74:this.$=[c[h-5],c[h-1],{type:"addMessage",from:c[h-5].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-5].actor}];break;case 75:this.$=[c[h-3],c[h-1],{type:"addMessage",from:c[h-3].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h]}];break;case 76:this.$={type:"addParticipant",actor:c[h-1],config:c[h]};break;case 77:this.$=c[h-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[h]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[h].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:Y},{69:78,72:[1,79],78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],be),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(Dt,i,{7:120}),e(Dt,i,{7:121}),e(Dt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ut,i,{43:125,7:126}),e(Ut,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Dt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Gt,be,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,161],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,162],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,163],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,47],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,45],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,43],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,171],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Gt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:U,53:G,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(St,[2,12]),e(me,i,{7:124,41:201}),e(Ut,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Gt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],c=[],wt=this.table,h="",Ct=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(gt.yy[Jt]=this.yy[Jt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Zt=J.yylloc;c.push(Zt);var $e=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(it){P.length=P.length-2*it,z.length=z.length-it,c.length=c.length-it}x(je,"popStack");function Ne(){var it;return it=y.pop()||J.lex()||we,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Ne,"lex");for(var rt,xt,ct,Qt,Lt={},Mt,Tt,Pe,Bt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=wt[xt]&&wt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var $t="";Bt=[];for(Mt in wt[xt])this.terminals_[Mt]&&Mt>Ze&&Bt.push("'"+this.terminals_[Mt]+"'");J.showPosition?$t="Parse error on line "+(Ct+1)+`: +import{I as tr}from"./chunk-2Q5K7J3B-By4pMuFm.js";import{_ as x,Y as er,c as $,j as Vt,l as at,o as Ce,d as rr,e as ar,k as N,b as ke,s as sr,p as ir,a as nr,g as or,q as cr,Z as lr,$ as hr,r as dr,i as Yt,z as Z,a0 as Q,a1 as Pt,a2 as Me,a3 as Tr,A as Kt,a4 as pr,a5 as Be}from"./mermaid.core-4ur3W-UG.js";import{a as Er,g as ae,b as dt,d as ur,c as se,e as ie}from"./chunk-F27PBJKO-d2g57_ei.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var te=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],u=[1,14],d=[1,15],p=[1,17],_=[1,18],E=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],H=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],kt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],ne=[1,87],oe=[1,88],ce=[1,89],le=[1,90],he=[1,91],de=[1,92],Te=[1,93],pe=[1,94],Ee=[1,95],ue=[1,96],fe=[1,97],_e=[1,98],ge=[1,99],xe=[1,100],Ie=[1,101],ye=[1,102],Re=[1,103],Oe=[1,104],Le=[1,105],be=[2,78],St=[4,5,17,51,53,54],Dt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Gt=[5,52],F=[70,71,72,73],ot=[1,151],Xt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,c,wt){var h=c.length-1;switch(z){case 3:return y.apply(c[h]),c[h];case 4:case 10:this.$=[];break;case 5:case 11:c[h-1].push(c[h]),this.$=c[h-1];break;case 6:case 7:case 12:case 13:this.$=c[h];break;case 8:case 9:case 14:this.$=[];break;case 16:c[h].type="createParticipant",this.$=c[h];break;case 17:c[h-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[h-2])}),c[h-1].push({type:"boxEnd",boxText:c[h-2]}),this.$=c[h-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-2]),sequenceIndexStep:Number(c[h-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-1].actor};break;case 30:y.setDiagramTitle(c[h].substring(6)),this.$=c[h].substring(6);break;case 31:y.setDiagramTitle(c[h].substring(7)),this.$=c[h].substring(7);break;case 32:this.$=c[h].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[h].trim(),y.setAccDescription(this.$);break;case 35:c[h-1].unshift({type:"loopStart",loopText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.LOOP_START}),c[h-1].push({type:"loopEnd",loopText:c[h-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[h-1];break;case 36:c[h-1].unshift({type:"rectStart",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_START}),c[h-1].push({type:"rectEnd",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[h-1];break;case 37:c[h-1].unshift({type:"optStart",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_START}),c[h-1].push({type:"optEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[h-1];break;case 38:c[h-1].unshift({type:"altStart",altText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.ALT_START}),c[h-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[h-1];break;case 39:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 40:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 41:c[h-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.CRITICAL_START}),c[h-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[h-1];break;case 42:c[h-1].unshift({type:"breakStart",breakText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_START}),c[h-1].push({type:"breakEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[h-1];break;case 44:this.$=c[h-3].concat([{type:"option",optionText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[h]]);break;case 46:this.$=c[h-3].concat([{type:"and",parText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.PAR_AND},c[h]]);break;case 48:this.$=c[h-3].concat([{type:"else",altText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.ALT_ELSE},c[h]]);break;case 49:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 50:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 51:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 52:case 57:c[h-1].draw="actor",c[h-1].type="addParticipant",this.$=c[h-1];break;case 53:c[h-1].type="destroyParticipant",this.$=c[h-1];break;case 54:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 55:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 56:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 58:this.$=[c[h-1],{type:"addNote",placement:c[h-2],actor:c[h-1].actor,text:c[h]}];break;case 59:c[h-2]=[].concat(c[h-1],c[h-1]).slice(0,2),c[h-2][0]=c[h-2][0].actor,c[h-2][1]=c[h-2][1].actor,this.$=[c[h-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[h-2].slice(0,2),text:c[h]}];break;case 60:this.$=[c[h-1],{type:"addLinks",actor:c[h-1].actor,text:c[h]}];break;case 61:this.$=[c[h-1],{type:"addALink",actor:c[h-1].actor,text:c[h]}];break;case 62:this.$=[c[h-1],{type:"addProperties",actor:c[h-1].actor,text:c[h]}];break;case 63:this.$=[c[h-1],{type:"addDetails",actor:c[h-1].actor,text:c[h]}];break;case 66:this.$=[c[h-2],c[h]];break;case 67:this.$=c[h];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor}];break;case 71:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-4].actor}];break;case 72:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor}];break;case 73:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-4].actor}];break;case 74:this.$=[c[h-5],c[h-1],{type:"addMessage",from:c[h-5].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-5].actor}];break;case 75:this.$=[c[h-3],c[h-1],{type:"addMessage",from:c[h-3].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h]}];break;case 76:this.$={type:"addParticipant",actor:c[h-1],config:c[h]};break;case 77:this.$=c[h-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[h]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[h].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:Y},{69:78,72:[1,79],78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],be),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(Dt,i,{7:120}),e(Dt,i,{7:121}),e(Dt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ut,i,{43:125,7:126}),e(Ut,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Dt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Gt,be,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,161],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,162],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,163],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,47],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,45],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,43],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,171],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:H,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Gt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:U,53:G,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(St,[2,12]),e(me,i,{7:124,41:201}),e(Ut,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Gt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],c=[],wt=this.table,h="",Ct=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(gt.yy[Jt]=this.yy[Jt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Zt=J.yylloc;c.push(Zt);var $e=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(it){P.length=P.length-2*it,z.length=z.length-it,c.length=c.length-it}x(je,"popStack");function Ne(){var it;return it=y.pop()||J.lex()||we,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Ne,"lex");for(var rt,xt,ct,Qt,Lt={},Mt,Tt,Pe,Bt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=wt[xt]&&wt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var $t="";Bt=[];for(Mt in wt[xt])this.terminals_[Mt]&&Mt>Ze&&Bt.push("'"+this.terminals_[Mt]+"'");J.showPosition?$t="Parse error on line "+(Ct+1)+`: `+J.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":$t="Parse error on line "+(Ct+1)+": Unexpected "+(rt==we?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError($t,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Zt,expected:Bt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),c.push(J.yylloc),P.push(ct[1]),rt=null,Se=J.yyleng,h=J.yytext,Ct=J.yylineno,Zt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},$e&&(Lt._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Qt=this.performAction.apply(Lt,[h,Se,Ct,gt.yy,ct[1],z,c].concat(Qe)),typeof Qt<"u")return Qt;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),c.push(Lt._$),Pe=wt[P[P.length-2]][P[P.length-1]],P.push(Pe);break;case 3:return!0}}return!0},"parse")},Je=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var z=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-CTTg6OBe.js b/apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-B8XbaAIu.js similarity index 86% rename from apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-CTTg6OBe.js rename to apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-B8XbaAIu.js index d1a1faaf6..5d0a0bfbe 100644 --- a/apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-CTTg6OBe.js +++ b/apps/pythinker-code/dist-web/assets/sizeCapture-X5ZJPWSS-B8XbaAIu.js @@ -1 +1 @@ -import{_ as o}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; +import{_ as o}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; diff --git a/apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-DOgDo4PT.js b/apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-1JuYFASL.js similarity index 96% rename from apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-DOgDo4PT.js rename to apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-1JuYFASL.js index 8b2f4ab11..8b4f3ebc3 100644 --- a/apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-DOgDo4PT.js +++ b/apps/pythinker-code/dist-web/assets/stateDiagram-HBIQ2CUA-1JuYFASL.js @@ -1 +1 @@ -import{s as R,a as W,S as N}from"./chunk-G27WJ6UU-D54gu-ld.js";import{_ as f,c as t,j as H,l as S,d as P,a7 as _,k as z,a8 as U,a9 as C,a4 as F,z as O}from"./mermaid.core-Pmnag6hS.js";import{l as J}from"./layout-WxS0y9O_.js";import"./chunk-XXDRQBXY-LvYS55fD.js";import"./chunk-POPQ4Y6H-BOop7K_8.js";import"./chunk-F27PBJKO-CENksy_e.js";import"./purify.es-5AjVNlXF.js";import"./index-BK-wRR5p.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
        ");p=p.replace(/\n/g,"
        ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&j(n),(i.type==="fork"||i.type==="join")&&q(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(C),p=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");G(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,p)=>{const a=new _({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ht={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram}; +import{s as R,a as W,S as N}from"./chunk-G27WJ6UU-D-57FaZo.js";import{_ as f,c as t,j as H,l as S,d as P,a7 as _,k as z,a8 as U,a9 as C,a4 as F,z as O}from"./mermaid.core-4ur3W-UG.js";import{l as J}from"./layout-g7MtGH-g.js";import"./chunk-XXDRQBXY-B0zDZEAk.js";import"./chunk-POPQ4Y6H-Bc64Qx3F.js";import"./chunk-F27PBJKO-d2g57_ei.js";import"./purify.es-5AjVNlXF.js";import"./index-C0iEUKAq.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
        ");p=p.replace(/\n/g,"
        ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&j(n),(i.type==="fork"||i.type==="join")&&q(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),A=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(C),p=e.append("path").attr("d",l(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}A++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");G(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),G=f((e,i,d,c,n,l,p)=>{const a=new _({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ht={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ht as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-Bv7KRSeS.js b/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-Bv7KRSeS.js new file mode 100644 index 000000000..f18f531cf --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-Bv7KRSeS.js @@ -0,0 +1 @@ +import{s as r,b as e,a,S as s}from"./chunk-G27WJ6UU-D-57FaZo.js";import{_ as i}from"./mermaid.core-4ur3W-UG.js";import"./chunk-XXDRQBXY-B0zDZEAk.js";import"./chunk-POPQ4Y6H-Bc64Qx3F.js";import"./chunk-F27PBJKO-d2g57_ei.js";import"./purify.es-5AjVNlXF.js";import"./index-C0iEUKAq.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-CF_x3j8a.js b/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-CF_x3j8a.js deleted file mode 100644 index 048a10a8f..000000000 --- a/apps/pythinker-code/dist-web/assets/stateDiagram-v2-4QOOHH4V-CF_x3j8a.js +++ /dev/null @@ -1 +0,0 @@ -import{s as r,b as e,a,S as s}from"./chunk-G27WJ6UU-D54gu-ld.js";import{_ as i}from"./mermaid.core-Pmnag6hS.js";import"./chunk-XXDRQBXY-LvYS55fD.js";import"./chunk-POPQ4Y6H-BOop7K_8.js";import"./chunk-F27PBJKO-CENksy_e.js";import"./purify.es-5AjVNlXF.js";import"./index-BK-wRR5p.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-CxY3Jzhb.js b/apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-DlKPgrxj.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-CxY3Jzhb.js rename to apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-DlKPgrxj.js index b0cb0d851..a0aa358e0 100644 --- a/apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-CxY3Jzhb.js +++ b/apps/pythinker-code/dist-web/assets/swimlanes-XN3QIQJK-DlKPgrxj.js @@ -1 +1 @@ -import{ap as Cr,l as In,_ as d,aA as To}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var Ao=5,Xe=1e-5,Ye=1e-6;function Ue(t){const e=[];for(let n=0;n=1-Ye||C<=Ye||C>=1-Ye?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:C}}d(Bo,"segmentIntersection");function Sn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(Sn,"isHorizontalSeg");function ko(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Fo,"getArcSweepFlag");var vr=.001;function _o(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&To[e.arrowTypeStart];if(o){const r=t[0],a=t[1],l=Math.atan2(a.y-r.y,a.x-r.x);n[0].x=r.x+o*Math.cos(l),n[0].y=r.y+o*Math.sin(l)}const s=e.arrowTypeEnd&&To[e.arrowTypeEnd];if(s){const r=t.length,a=t[r-2],l=t[r-1],f=Math.atan2(l.y-a.y,l.x-a.x);n[r-1].x=l.x-s*Math.cos(f),n[r-1].y=l.y-s*Math.sin(f)}return n}d(_o,"applyMarkerOffsets");function Do(t,e,n,o,s){const r=t.point.x,a=t.point.y,l={x:r-e*t.r,y:a-n*t.r},f={x:r+e*t.r,y:a+n*t.r},i=[`L${Ae(l)}`];return s==="arc"?i.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${Ae(f)}`):i.push(`M${Ae(f)}`),i}d(Do,"emitJump");function Cn(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=n.x-e.x,l=n.y-e.y,f=Math.hypot(s,r),i=Math.hypot(a,l);if(f0){const E=Cn(s[i-1],s[i],s[i+1]??s[i],Ao);E&&(c=E.cutLen)}let y=x,v=null;r&&iE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-c,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Go,"decodeDataPoints");function $o(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const i of e)s.set(i.id,i);const r=[],a=new Map;for(const i of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(i.id):i.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;a.set(i.id,x);const h=Go(x.getAttribute("data-points"))??i.points;r.push({...i,points:h})}const l=ko(r);if(l.length===0)return;const f=new Map;for(const i of l){const g=f.get(i.jumpEdgeId)??[];g.push(i),f.set(i.jumpEdgeId,g)}for(const i of r){const g=f.get(i.id);if(!g||g.length===0)continue;const C=s.get(i.id)?.curve;if(C!==void 0&&!Yo(C))continue;const h=a.get(i.id);if(!h)continue;if(C===void 0){const E=h.getAttribute("d")??"";if(!Xo(E))continue}const p=h.getAttribute("style")??"",c=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=c?Number.parseFloat(c[1]):null,v=c?Number.parseFloat(c[2]):null,M=Ho(i,g,n);if(h.setAttribute("d",M),y!==null&&v!==null&&typeof h.getTotalLength=="function"){const E=h.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,I=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");h.setAttribute("style",I)}}}d($o,"applyLineJumpsToSvg");function zo(t,{measure:e}){const n=t.config?.swimlane?.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(r=>Array.isArray(r.points)&&r.points.length>=2).map(r=>({id:r.id,points:r.points,curve:r.curve,arrowTypeStart:r.arrowTypeStart,arrowTypeEnd:r.arrowTypeEnd}));$o(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}d(zo,"applySwimlaneLineJumps");var yn="__swimlane_default__",Lr=21,wo=20;function vn(t){return Math.max(t.padding??wo,wo)}d(vn,"topLaneHorizontalPadding");function Vo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const a=n-s/2,l=Math.min(r,n+s/2),f=Math.min(Lr,Math.max(0,l-a)),i=a+f;if(i<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:a,bottom:i}}d(Vo,"assignTopLaneTitleRect");function jo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===yn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:yn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=yn}d(jo,"prepareLayoutForSwimlanes");function Uo(t){const e=new Map;for(const f of t.nodes??[])e.set(f.id,f);const n=[];for(const f of t.edges??[]){const i=typeof f.start=="string"?f.start:void 0,g=typeof f.end=="string"?f.end:void 0;!i||!g||f.labelNodeId||n.push({id:f.id,src:i,dst:g,ref:f})}const o=t.nodes??[],s=o.filter(f=>f.isGroup),r=o.filter(f=>!f.isGroup);return{nodes:[...[...s].reverse(),...r].map(f=>f.id),edges:n,layout:t,nodeById:e}}d(Uo,"toGraphView");function Wo(t,e,n,o){const{layout:s}=t,r=t.nodeById,a=o?.layerGap??100,l=o?.nodeGap??40;let f=0;for(const C of e.layers){let h=0;for(const p of C){const c=r.get(p);if(!c){h++;continue}c.layer=f,c.order=h;const y=n.x[p]??h*l,v=n.y[p]??f*a;c.x=y,c.y=v,h++}f++}const i=s.nodes??[],g=new Map,x=[];for(const C of i){if(!C?.isGroup)continue;C.parentId||x.push(C);const h=i.filter(M=>M.parentId===C.id);let p=1/0,c=-1/0,y=1/0,v=-1/0;for(const M of h){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,I=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),c=Math.max(c,E+m/2),y=Math.min(y,T-I/2),v=Math.max(v,T+I/2))}if(p===1/0||y===1/0)C.x=C.x??0,C.y=C.y??0,C.width=C.width??0,C.height=C.height??0;else{const M=C.padding??20,E=C.parentId?M:2*vn(C),T=M,m=Math.max(0,c-p)+E,I=Math.max(0,v-y)+T,w=(p+c)/2,R=(y+v)/2;C.x=w,C.y=R,C.width=m,C.height=I,g.set(C.id,{minX:p,maxX:c,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let C=1/0,h=-1/0,p=0;for(const c of x){const y=c.padding??20;y>p&&(p=y);const v=g.get(c.id);v&&(C=Math.min(C,v.minY),h=Math.max(h,v.maxY))}if(C!==1/0&&h!==-1/0){const c=Math.max(0,h-C),v=Math.max(p,36),M=c+2*v,E=(C+h)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=C;const T=[...x].sort((k,O)=>{const F=k.x??0,H=O.x??0;return F-H}),m=[],I=[],w=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const F=Math.max(0,O.maxX-O.minX)+2*vn(k),H=(O.minX+O.maxX)/2;m.push(k.id),I.push(H),w.push(F)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],w[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:we(e,n,o,s)}:void 0}d(eo,"measuredNodeRect");function no(t){if(t.isGroup)return;const e=eo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(no,"nodeBoundsInfoFor");function oe(t,e,n=_t){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function At(t,e,n=_t){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(At,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=_t){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=_t){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function oo(t,e=_t){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&At(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:At(n,o,e)&&Tt(o,s,e)&&At(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(oo,"classifyThreeSegmentRoute");function on(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),a=Math.min(t.y,e.y),l=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ae.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(qo,"rectContainsRect");function We(t,e){return t.lefte.left&&t.tope.top}d(We,"rectsOverlap");function Ln(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Ln,"inflateRect");function we(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(we,"rectFromCenterSize");function qt(t){return eo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function ro(t,e,n,o,s,r=_t){const a=e==="left"||e==="right",l=o==="left"||o==="right";if(a&&l){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!a&&!l){if(e===o){if(ft(t,n,r))return;const C=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:C},{x:n.x,y:C},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(a&&!l){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const f=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return f&&i?[t,{x:t.x,y:n.y},n]:void 0}d(ro,"buildOrthogonalPortPath");function io(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(io,"buildSameSideTrackPath");function sn(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=no(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(sn,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=no(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function Jo(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,a=o.width??0,l=o.height??0;n.push({nodeId:o.id,...we(s,r,a,l)})}return n}d(Jo,"collectLayoutNodeRects");function co(t,e,n=_t){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),a=e.get(s);if(!(!r||!a))return{srcId:o,dstId:s,srcInfo:r,dstInfo:a,collinearX:Math.abs(r.cx-a.cx)p||Cv)return!1;const M=Math.abs(c-g.a.x)s:r&&l&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(Zo,"sameAxisSegmentsOverlap");function Ke(t,e,n,o,{epsilon:s=_t,skipDegenerateOther:r=!1}={}){for(const a of n){if(a===o||a.isLayoutOnly)continue;const l=a.points;if(!(!l||l.length<2))for(let f=0;fC+s&&pc+s&&xo+_t&&t=2?e[e.length-2]:void 0,f=(a?ft(a,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(f)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ts(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Tr=.5,Ro=4;function lo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const a=es(t[s],t[r],e);return n?[a,...t.slice(s)]:[...t.slice(0,s+1),a]}d(Tn,"clipEndpoint");function ns(t,e){for(const n of t){const o=lo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Tn(s,o.srcRect,!0)),o.dstRect&&(s=Tn(s,o.dstRect,!1)),s=ae(qe(s)),s=fo(s,o.srcRect,o.dstRect),o.edge.points=ae(qe(s))}}d(ns,"clipEdgeEndpointsToNodeBoundaries");function An(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(An,"snapEndpointToBoundary");function Je(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(os,"intersectRanges");function Rn(t,e){return e==="left"||e==="right"?Ze(t.top,t.bottom):Ze(t.left,t.right)}d(Rn,"clearanceRangeForSide");function Qe(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?os(r):void 0}d(ss,"straightClearanceRange");function Nn(t,e,n,o,s){const r=ss(t,e,n,o,s);if(!r)return;const a=s?t.y:t.x,l=Math.min(r.hi,Math.max(r.lo,a));if(!(Math.abs(l-a)({...l}));for(let l=e;l>=0&&l=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(Bn,"leavesOutward");function kn(t,e,n){if(t.length<3)return t;if(n){const r=Pn(t[0],t[1],e);return r&&Bn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Pn(t[o-1],t[o],e);return s&&Bn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(kn,"collapseOwnBorderStub");function cs(t,e,n){let o=t;if(e){const r=Je(o,0,1);if(r){const a=An(r,o[0],e);a!==o[0]&&(o=[a,...o.slice(1)])}o=kn(o,e,!0)}if(n){const r=o.length-1,a=Je(o,r,-1);if(a){const l=An(a,o[r],n,!0);l!==o[r]&&(o=[...o.slice(0,r),l])}o=kn(o,n,!1)}const s=fo(o,e,n);return s!==o||o.length===2?s:(e&&(o=On(o,e,!0)),n&&(o=On(o,n,!1)),o)}d(cs,"snapAndCollapseEndpoints");function Fn(t,e){for(const n of t){const o=lo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=cs(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const a=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=a}}d(Fn,"prepareEdgeEndpointsForRenderer");function uo(t){return new Map(t.map(e=>[e.id,e]))}d(uo,"buildNodeMap");function as(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(as,"resolveTopLevelGroupId");function _n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(_n,"groupDepth");function ho(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const a=r.x,l=r.y;if(typeof a!="number"||typeof l!="number")continue;const f=r.width??0,i=r.height??0;e=Math.min(e,a-f/2),n=Math.max(n,a+f/2),o=Math.min(o,l-i/2),s=Math.max(s,l+i/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(ho,"boundsForChildren");function ls(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ls,"applyGroupBounds");function fs(t){const e=uo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>_n(s,e)-_n(o,e));for(const o of n){const s=t.filter(a=>a.parentId===o.id),r=ho(s);r&&ls(o,r)}}d(fs,"recomputeNestedGroupBounds");function tn(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(f=>!f.isGroup);let r=1/0,a=-1/0;for(const f of s){const i=f[e];typeof i=="number"&&(r=Math.min(r,i),a=Math.max(a,i))}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const l=d(f=>r+a-f,"mirror");for(const f of n){const i=f[e];typeof i=="number"&&(f[e]=l(i));const g=f.groupTitleRect;g&&(f.groupTitleRect=e==="x"?{...g,left:l(g.right),right:l(g.left)}:{...g,top:l(g.bottom),bottom:l(g.top)})}for(const f of o)for(const i of f.points??[])i[e]=l(i[e]);return!0}d(tn,"mirrorAxis");function ds(t){return(t.nodes??[]).some(n=>!n.isGroup)?tn(t,"y"):!0}d(ds,"applyBtDirectionTransform");function us(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,a=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-a)*C+l,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-a)*C+l,mt=j-r;G.x=dt,G.y=mt}fs(n);const h=n.filter(P=>P.isGroup&&!P.parentId);if(h.length===0)return e==="RL"&&tn(t,"x"),!0;const p=uo(n),c=new Map;for(const P of n){if(P.isGroup)continue;const G=as(P,p);if(!G)continue;const j=c.get(G)??[];j.push(P),c.set(G,j)}let y=0;for(const P of h){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of h){const G=c.get(P.id)??[],j=ho(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),I=T+2*m,w=l+I,O=(M+E)/2-I/2-l,F=O+w/2,H=Math.max(y,l);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PC.cy?v.bottom:v.top,H=C.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:F},T={x:H,y:l.y},m={x:l.x,y:l.y}}else{const F=h.cx>C.cx?v.right:v.left,H=C.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:F,y:H},T={x:l.x,y:H},m={x:l.x,y:l.y}}const I=oe(E,T,se),w=oe(T,m,se);if(I&&w||!I&&wt(E,T,o,[g],1)||!w&&wt(T,m,o,[x],1))continue;const R=!I&&Ke(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!w&&Ke(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){I?y=[T,m]:w?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(hs,"portSwapToLShape");function gs(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values());for(const l of t){if(l.isLayoutOnly)continue;const f=l.points;if(!f||f.length<4)continue;const i=pt(f,.001);if(i.length<4)continue;const g=i.length-1,x=i[g],C=i[g-1],h=i[g-2],p=x.x-C.x,c=x.y-C.y,y=Math.hypot(p,c);if(y>=10||y<.001)continue;const v=C.x-h.x,M=C.y-h.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(C,x,.001),m=At(C,x,.001),I=Tt(h,C,.001),w=At(h,C,.001);if(!(T&&w||m&&I))continue;const R=l.end,k=l.start,O=R?e.get(R):void 0;if(!O)continue;const F=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(w){const W=M<0;G={x:F,y:h.y},j={x:F,y:W?P.bottom:P.top}}else{const W=v>0;G={x:h.x,y:H},j={x:W?P.right:P.left,y:H}}if(wt(G,j,r,R?[R]:[],-2)||wt(G,j,a,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&so(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===l||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=i[g-3],et=[k,R].filter(at=>!!at);if(wt(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...i.slice(0,g-2),G,j];l.points=Pt;const Q=l.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(gs,"collapseShortTerminalStub");var Z=.001,Ft=8,it=Re,xn=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function ps(t,e){const s=d((h,p)=>{const c=h.x??0,y=h.y??0,v=p.x-c,M=p.y-y;let E=(h.width??0)/2,T=(h.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:c+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:c+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((h,p)=>{const c=pt(h.points??[]);if(c.length<2)return;const y=p?h.start:h.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?c[0]:c[c.length-1],T=p?c[1]:c[c.length-2],m=s(v,E);let I=E;if(xn(T,m)&&(I=T),ft(m,I,Z))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,I.y),max:Math.max(m.y,I.y),boundary:m,railEnd:I,rect:M};if(ht(m,I,Z))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,I.x),max:Math.max(m.x,I.x),boundary:m,railEnd:I,rect:M}},"terminalLaneFor"),a=d((h,p)=>Math.max(0,Math.min(h.max,p.max)-Math.max(h.min,p.min)),"projectedOverlapLength"),l=d((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:h.orientation==="H"?(Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1)&&ft(h.boundary,p.boundary,1):(Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1)&&ht(h.boundary,p.boundary,1),"sameTerminalFace"),f=d((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:a(h,p)>=Ft&&Math.abs(h.coord-p.coord)<.5,"exactTerminalLaneConflict"),i=d((h,p)=>{if(h.nodeId!==p.nodeId||h.orientation!==p.orientation||h.orientation!=="H"||h.atStart===p.atStart)return!1;const c=a(h,p);if(c2*y?!1:l(h,p)&&Math.abs(h.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((h,p)=>{const c=pt(h.edge.points??[]);if(c.length<2)return;const y=h.orientation==="V"?{x:h.boundary.x+p,y:h.boundary.y}:{x:h.boundary.x,y:h.boundary.y+p},v=h.orientation==="V"?{x:h.railEnd.x+p,y:h.railEnd.y}:{x:h.railEnd.x,y:h.railEnd.y+p};if(!d(()=>Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1?ht(y,h.boundary,Z)&&y.x>=h.rect.left+1&&y.x<=h.rect.right-1:Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1?ft(y,h.boundary,Z)&&y.y>=h.rect.top+1&&y.y<=h.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(h.atStart){const I=c.length>1&&oe(c[1],h.railEnd,Z),w=c.slice(I?2:1),R=w[0];return R&&!xn(R,v)?void 0:[y,v,...w]}const E=c.length>1&&oe(c[c.length-2],h.railEnd,Z),T=c.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!xn(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(h=>{const p=h.edge,c=pt(p.points??[]);if(c.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,I=E.x??0,w=E.y??0,[R,k]=c;return ht(R,k,Z)&&Math.abs(m-w)<1&&Math.abs(T-I)>1||ft(R,k,Z)&&Math.abs(T-I)<1&&Math.abs(m-w)>1},"laneIsStraightCollinearConnector"),C=[-7,7,-14,14,-21,21];for(let h=0;h<8;h++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let c=!1;for(let y=0;y{const R=x(I),k=x(w);return R!==k?Number(R)-Number(k):+!w.atStart-+!I.atStart});for(const I of m){for(const w of C){const R=g(I,w);if(!R)continue;const k=r({...I.edge,points:R},I.atStart);if(!(!k||p.some(O=>O.edge!==I.edge&&(f(k,O)||T&&i(k,O))))){I.edge.points=R,c=!0;break}}if(c)break}}if(!c)return}}d(ps,"separateSharedRenderedTerminalLanes");function ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((l,f)=>{const i=l.start,g=l.end,x=it(f);if(x.length!==f.length-1)return!1;const C=[i,g].filter(h=>!!h);for(const h of x)if(wt(h.a,h.b,o,C,-2)||wt(h.a,h.b,s,[],-2))return!1;for(const h of t){if(h===l||h.isLayoutOnly)continue;const p=h.points;if(!(!p||p.length<2)){for(const c of x)for(const y of it(pt(p)))if(ce(c,y,.5)>=Ft||le(c.a,c.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),a=d((l,f)=>{if(f+4>=l.length)return;const i=l[f],g=l[f+1],x=l[f+2],C=l[f+3],h=l[f+4],p=Tt(i,g)&&At(g,x)&&Tt(x,C)&&At(C,h)&&ft(i,C,Z)&&ft(i,h,Z)&&ft(g,x,Z)&&(g.x-i.x)*(C.x-x.x)<0,c=At(i,g)&&Tt(g,x)&&At(x,C)&&Tt(C,h)&&ht(i,C,Z)&&ht(i,h,Z)&&ht(g,x,Z)&&(g.y-i.y)*(C.y-x.y)<0;if(p||c)return pt([...l.slice(0,f+1),h,...l.slice(f+5)]);if(f+5>=l.length)return;const y=l[f+5],v=At(i,g)&&Tt(g,x)&&At(x,C)&&Tt(C,h)&&At(h,y)&&ft(i,h,Z)&&ft(i,y,Z)&&ft(x,C,Z)&&(x.x-g.x)*(h.x-C.x)<0,M=Tt(i,g)&&At(g,x)&&Tt(x,C)&&At(C,h)&&Tt(h,y)&&ht(i,h,Z)&&ht(i,y,Z)&&ht(x,C,Z)&&(x.y-g.y)*(h.y-C.y)<0;if(!(!v&&!M))return pt([...l.slice(0,f+1),y,...l.slice(f+6)])},"withoutDogleg");for(let l=0;l<8;l++){let f=!1;for(const i of t){if(i.isLayoutOnly)continue;const g=pt(i.points??[]);for(let x=0;x<=g.length-5;x++){const C=a(g,x);if(!(!C||!r(i,C))){i.points=C,f=!0;break}}if(f)break}if(!f)return}}d(ms,"collapseRedundantRectangularDoglegs");function Dn(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values()),l=t.filter(p=>!p.isLayoutOnly),f=d((p,c,y)=>pt(p===c?y??[]:p.points??[]),"pointsFor"),i=d((p,c)=>{let y=0;for(let v=0;v{const c=it(p);if(c.length!==3)return;const y=c[1];if(!(c[0].horizontal===y.horizontal||c[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return c.horizontal?zt(c.a.x,c.b.x,M.left,M.right)>=Ft&&c.a.y>=M.top-2&&c.a.y<=M.bottom+2:zt(c.a.y,c.b.y,M.top,M.bottom)>=Ft&&c.a.x>=M.left-2&&c.a.x<=M.right+2})},"blockingRectsFor"),C=d((p,c,y)=>{const v=p.map(E=>({...E}));if(c.horizontal)v[c.index].y=y,v[c.index+1].y=y;else if(c.vertical)v[c.index].x=y,v[c.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),h=d((p,c,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(c);if(M.length!==c.length-1)return!1;for(const E of M)if(wt(E.a,E.b,r,v,-2)||wt(E.a,E.b,a,[],-2))return!1;for(const E of l)if(E!==p){for(const T of M)for(const m of it(f(E)))if(ce(T,m,.5)>=Ft)return!1}return i(p,c)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const c=i();let y=!1;for(const v of l){const M=f(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(I=>I.rect.top))-20,Math.max(...T.map(I=>I.rect.bottom))+20]:[Math.min(...T.map(I=>I.rect.left))-20,Math.max(...T.map(I=>I.rect.right))+20];for(const I of m){const w=C(M,E.segment,I);if(!(!w||!h(v,w,c))){v.points=w,y=!0;break}}if(y)break}if(!y)return}}d(Dn,"liftObstacleHuggingSameSideRails");function Hn(t,e){const o=d(f=>{const i=f.groupTitleRect;if(!(!i||typeof i.left!="number"||typeof i.right!="number"||typeof i.top!="number"||typeof i.bottom!="number"||!Number.isFinite(i.left)||!Number.isFinite(i.right)||!Number.isFinite(i.top)||!Number.isFinite(i.bottom)||i.right<=i.left||i.bottom<=i.top))return{left:i.left,right:i.right,top:i.top,bottom:i.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId)return;const i=f.direction,g=typeof i=="string"?i.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(f),C=f.y,h=f.height;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(c<=0||p{if(!f.horizontal)return!1;const g=f.a.y;return g<=i.top+Z||g>=i.bottom-Z?!1:zt(f.a.x,f.b.x,i.left,i.right)>=Ft},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let l=0;for(const f of t){if(f.isLayoutOnly)continue;const i=pt(f.points??[]);for(const g of it(i))for(const x of a)r(g,x.rect)&&(l=Math.max(l,x.rect.bottom-g.a.y+4))}if(!(l<=Z))for(const f of a){const i=f.node.y,g=f.node.height;typeof i!="number"||typeof g!="number"||!Number.isFinite(i)||!Number.isFinite(g)||g<=0||(f.node.y=i-l/2,f.node.height=g+l,f.node.groupTitleRect={...f.rect,top:f.rect.top-l,bottom:f.rect.bottom-l})}}d(Hn,"liftTopLaneTitleBandsAboveRails");function Xn(t,e){const o=d(i=>{const g=i.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(i=>{if(!i.isGroup||i.parentId||i.direction!=="LR")return;const x=o(i),C=i.x,h=i.width;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(p<=0||c{if(!i.vertical)return!1;const x=i.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(i.a.y,i.b.y,g.top,g.bottom)>=Ft},"verticalSegmentIntersectsTitle"),a=d((i,g)=>{if(!i.horizontal)return!1;const x=i.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(i.a.x,i.b.x,g.left,g.right)>=Ft},"horizontalSegmentIntersectsTitle"),l=[...e.values()].map(s).filter(i=>!!i);if(l.length===0)return;let f=0;for(const i of t){if(i.isLayoutOnly)continue;const g=pt(i.points??[]);for(const x of it(g))for(const C of l)if(r(x,C.rect))f=Math.max(f,C.rect.right-x.a.x+4);else if(a(x,C.rect)){const h=Math.min(x.a.x,x.b.x);f=Math.max(f,C.rect.right-h+4)}}if(!(f<=Z))for(const i of l){const g=i.node.x,x=i.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(i.node.x=g-f/2,i.node.width=x+f,i.node.groupTitleRect={...i.rect,left:i.rect.left-f,right:i.rect.right-f})}}d(Xn,"shiftLeftLaneTitleBandsLeftOfRails");function ys(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,c=new Map)=>pt(c.get(p)??p.points??[]),"replacementPointsFor"),a=d((p=new Map)=>{let c=0;for(let y=0;ys.reduce((c,y)=>c+Qt(r(y,p)),0),"totalBends"),f=d(p=>{const c=r(p);if(c.length<4)return;const y=c[c.length-2],v=c[c.length-1];if(!(!Tt(y,v,Z)&&!At(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),i=d((p,c)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:c.tailStart.y};else if(At(v,M,Z))E={x:c.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,c.tailStart,c.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(c))if(wt(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,c,y)=>{for(const v of s)if(v!==p){for(const M of it(c))for(const E of it(r(v,y)))if(ce(M,E,.5)>=Ft)return!0}return!1},"pathHasSharedTrack"),C=d((p,c,y)=>!g(p,c)&&!x(p,c,y),"candidateIsSafe"),h=d(()=>{const p=new Map;for(const c of s){const y=c.end;if(!y||!e.has(y)||r(c).length<4)continue;const M=p.get(y)??[];M.push(c),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const c=a();if(c===0)return;const y=l();let v,M=c,E=y;for(const T of h().values())for(let m=0;m=c||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(ys,"swapDestinationTerminalTailsToReduceCrossings");function xs(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values()),l=t.filter(T=>!T.isLayoutOnly),f=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),i=d((T=new Map)=>{let m=0;for(let I=0;Il.reduce((m,I)=>m+Qt(f(I,T)),0),"totalBends"),x=d(T=>{const m=T.start,I=T.end,w=m?e.get(m):void 0,R=I?e.get(I):void 0,k=w?qt(w):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),C=d((T,m,I)=>{if(I.index<=0||I.index+1>=m.length-1)return;const w=x(T);if(w){if(I.vertical){const R=I.a.x,k=Math.min(w.src.left,w.dst.left),O=Math.max(w.src.right,w.dst.right),F=RO+Z?"right":void 0;return F?{edge:T,points:m,segmentIndex:I.index,axis:"vertical",side:F,coord:R,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const R=I.a.y,k=Math.min(w.src.top,w.dst.top),O=Math.max(w.src.bottom,w.dst.bottom),F=RO+Z?"bottom":void 0;return F?{edge:T,points:m,segmentIndex:I.index,axis:"horizontal",side:F,coord:R,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),h=d(()=>{const T=[];for(const m of l){const I=f(m);for(const w of it(I)){const R=C(m,I,w);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=Ft,"railsInteract"),c=d(T=>{const m=[],I=new Set;for(const w of T){if(I.has(w))continue;const R=[w],k=[];for(I.add(w);R.length>0;){const O=R.pop();k.push(O);for(const F of T)!I.has(F)&&p(O,F)&&(I.add(F),R.push(F))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const I of T)m.some(w=>Math.abs(w-I.coord){const m=T.map(R=>R.coord),I=y(T),w=[];if(T.length<=6){const R=new Array(I.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((F,H)=>Math.abs(F-m[H])>=Z)&&w.push([...k]);return}for(const[F,H]of I.entries())R[F]||(R[F]=!0,k.push(H),O(),k.pop(),R[F]=!1)},"visit");return O(),w}for(let R=0;R{const I=new Map;for(const[R,k]of T.entries()){const O=m[R],F=I.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(F[k.segmentIndex].x=O,F[k.segmentIndex+1].x=O):(F[k.segmentIndex].y=O,F[k.segmentIndex+1].y=O),I.set(k.edge,F)}const w=new Map;for(const[R,k]of I){const O=ae(pt(k));if(it(O).length!==O.length-1)return;w.set(R,O)}return w},"replacementsForAssignment"),E=d(T=>{for(const[m,I]of T){const w=[m.start,m.end].filter(R=>!!R);for(const R of it(I))if(wt(R.a,R.b,r,w,-2)||wt(R.a,R.b,a,[],-2))return!1}for(let m=0;m=Ft)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=i();if(m===0)return;let I,w=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of c(h()))for(const F of v(O)){const H=M(O,F);if(!H||!E(H))continue;const P=i(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(F[mt]-dt.coord),0);P>w||P===w&&(G>R||G===R&&j>=k)||(I=H,w=P,R=G,k=j)}if(!I)return;for(const[O,F]of I)O.points=F}}d(xs,"reassignCrossingExternalRailChannels");function bs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(h=>!h.isLayoutOnly),a=d((h,p,c)=>pt(h===p?c??[]:h.points??[]),"pointsFor"),l=d(h=>it(h).reduce((p,c)=>{const y=c.a.x-c.b.x,v=c.a.y-c.b.y;return p+Math.hypot(y,v)},0),"pathLength"),f=d((h,p)=>{let c=0;for(let y=0;y{if(h.horizontal){const c=h.a.y;return(Math.abs(c-p.top)<1||Math.abs(c-p.bottom)<1)&&zt(h.a.x,h.b.x,p.left,p.right)>=Ft}if(h.vertical){const c=h.a.x;return(Math.abs(c-p.left)<1||Math.abs(c-p.right)<1)&&zt(h.a.y,h.b.y,p.top,p.bottom)>=Ft}return!1},"segmentRunsAlongRectBorder"),g=d(h=>{const p=[h.start,h.end].filter(y=>!!y),c=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&c.push(M)}return c},"endpointRectsFor"),x=d((h,p)=>{if(p+3>=h.length)return[];const c=h[p],y=h[p+1],v=h[p+2],M=h[p+3],E=Tt(c,y,Z)&&At(y,v,Z)&&Tt(v,M,Z),T=At(c,y,Z)&&Tt(y,v,Z)&&At(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-c.x)!==Math.sign(M.x-v.x):Math.sign(y.y-c.y)!==Math.sign(M.y-v.y)))return[];const I=ft(c,M,Z)||ht(c,M,Z)?[]:[{x:c.x,y:M.y},{x:M.x,y:c.y}],w=I.length===0?[[...h.slice(0,p+1),...h.slice(p+3)]]:I.map(k=>[...h.slice(0,p+1),k,...h.slice(p+3)]),R=new Set;return w.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(F=>oe(F,M,Z)))return!1;const O=k.map(F=>`${F.x.toFixed(3)},${F.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),C=d((h,p,c)=>{const y=[h.start,h.end].filter(M=>!!M),v=g(h);for(const M of it(p))if(wt(M.a,M.b,o,y,-2)||wt(M.a,M.b,s,[],-2)||v.some(E=>i(M,E)))return!1;for(const M of r)if(M!==h){for(const E of it(p))for(const T of it(a(M)))if(ce(E,T,.5)>=Ft)return!1}return f(h,p)<=c},"candidateIsSafe");for(let h=0;h<8;h++){const p=f();let c,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=a(T),I=Qt(m,Z),w=l(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),F=l(k);if(!(Ov||P===v&&(O>M||O===M&&F>=E)||(c=T,y=k,v=P,M=O,E=F)}}if(!c||!y)return;c.points=y}}d(bs,"shortcutRedundantOrthogonalJogs");function Ms(t,e){const a=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const _=N.x??0,D=N.y??0,V=qt(N);V&&a.push({id:String(N.id??""),cx:_,cy:D,rect:V})}if(a.length===0)return;const l=new Map(a.map(N=>[N.id,N])),f=a.map(N=>({id:N.id,rect:N.rect})),i=["top","bottom","left","right"],g={top:Math.min(...a.map(N=>N.rect.top))-20,bottom:Math.max(...a.map(N=>N.rect.bottom))+20,left:Math.min(...a.map(N=>N.rect.left))-20,right:Math.max(...a.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),C=new Map(x.map((N,_)=>[N,_])),h=d(N=>{const _=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+_*20*V);return D},"outwardTracksForSide"),p=d((N,_=new Map)=>pt(_.get(N)??N.points??[]),"replacementPointsFor"),c=d((N,_)=>{let D=0;for(const V of N)for(const u of _)le(V.a,V.b,u.a,u.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,_)=>c(it(N),it(_)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let _=0;const D=[],V=new Set,u=[],b=d(S=>{V.has(S)||(V.add(S),u.push(S))},"addEdge");for(let S=0;S0&&(_+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return u.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),{count:_,pairs:D,edgeSet:V,edges:u}},"crossingSnapshot"),M=d((N,_)=>{const D=new Set(_.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let u=0;for(let b=0;b{const _=new Map;for(const u of N.pairs){const b=_.get(u.first)??new Set;b.add(u.second),_.set(u.first,b);const S=_.get(u.second)??new Set;S.add(u.first),_.set(u.second,S)}const D=[],V=new Set;for(const u of N.edges){if(V.has(u))continue;const b=[u],S=[];for(V.add(u);b.length>0;){const L=b.pop();S.push(L);for(const A of _.get(L)??[])V.has(A)||(V.add(A),b.push(A))}S.sort((L,A)=>(C.get(L)??0)-(C.get(A)??0)),S.length>1&&D.push(S)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(_=>!!_),"endpointIdsFor"),m=d(N=>{const _=[];for(const D of E(N)){const V=new Set(D),u=new Set(D.flatMap(S=>T(S))),b=[...D];for(const S of x)V.has(S)||T(S).some(L=>u.has(L))&&b.push(S);b.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),_.push(b)}return _},"pairSearchGroups"),I=d((N,_,D)=>M(N,new Map([[_,D]])),"crossingCountWithSingleReplacement"),w=d(N=>{const _=new Map;for(const D of N.pairs)_.set(D.first,(_.get(D.first)??0)+D.count),_.set(D.second,(_.get(D.second)??0)+D.count);return _},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((_,D,V)=>{const u=N[V];return _+Math.abs(D.x-u.x)+Math.abs(D.y-u.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((_,D)=>_+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((_,D)=>_+R(p(D,N)),0),"totalLength"),F=d((N,_,D=new Map)=>{const V=it(_);for(const u of x)if(u!==N){for(const b of V)for(const S of it(p(u,D)))if(ce(b,S,.5)>=Ft)return!0}return!1},"pathHasSegmentConflict"),H=d((N,_)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(_))if(wt(V.a,V.b,f,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,_)=>{const D=ae(pt(_));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,_,D)=>{switch(_){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,_,D,V)=>{const u=D==="left"||D==="top"?-1:1,b=[j(_,D,V),g[D]];for(const S of b)for(let L=0;L<=2;L++)P(N,io(_,D,V,S+u*20*L))},"addSameSideCandidates"),dt=d((N,_,D,V,u)=>{for(const b of h(D))for(const S of h(u))P(N,[_,{x:b,y:_.y},{x:b,y:S},{x:V.x,y:S},V])},"addHorizontalToVerticalCandidates"),mt=d((N,_,D,V,u)=>{for(const b of h(D))for(const S of h(u))P(N,[_,{x:_.x,y:b},{x:S,y:b},{x:S,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,_,D,V,u)=>{const b=[...h("top"),...h("bottom")];for(const S of h(D))for(const L of h(u))for(const A of b)P(N,[_,{x:S,y:_.y},{x:S,y:A},{x:L,y:A},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,_,D,V,u)=>{const b=[...h("left"),...h("right")];for(const S of h(D))for(const L of h(u))for(const A of b)P(N,[_,{x:_.x,y:S},{x:A,y:S},{x:A,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const _=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(u=>`${u.x.toFixed(3)},${u.y.toFixed(3)}`).join("|");return _.has(V)||D.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,_,D,V)=>{const u=[],b=ro(N,_,D,V,20,Z);b&&P(u,b),_===V&&J(u,N,_,D);const S=G(_),L=G(V);return S&&!L?dt(u,N,_,D,V):!S&&L?mt(u,N,_,D,V):S?kt(u,N,_,D,V):Pt(u,N,_,D,V),Q(u)},"buildCandidatesForSides"),et=d((N,_,D,V)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Ie(V,S),A=S==="top"||S==="bottom"?h(S):b;for(const B of u){P(N,[_,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of A)P(N,[_,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,_,D,V)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Ie(V,S),A=S==="left"||S==="right"?h(S):u;for(const B of b){P(N,[_,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of A)P(N,[_,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const _=N.start,D=N.end,V=D?l.get(D):void 0;if(!_||!V)return[];const u=pt(N.points??[]);if(u.length<4)return[];const b=u[0],S=u[1],L=[];return At(b,S,Z)?et(L,b,S,V):Tt(b,S,Z)&&at(L,b,S,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const _=N.start,D=N.end,V=_?l.get(_):void 0,u=D?l.get(D):void 0;if(!V||!u)return[];const b=[];for(const S of i){const L=Ie(V,S);for(const A of i)b.push(...W(L,S,Ie(u,A),A))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,_,D)=>{const V=new Set;for(const u of x){if(u===N)continue;const b=D.get(u)??it(p(u));_.some(S=>b.some(L=>ce(S,L,.5)>=Ft))&&V.add(u)}return V},"sharedTrackConflictsFor"),jt=d((N,_,D,V)=>{const u=new Set;return xt(N).map(S=>ae(pt(S))).filter(S=>{if(H(N,S))return!1;const L=S.map(A=>`${A.x.toFixed(3)},${A.y.toFixed(3)}`).join("|");return u.has(L)||S.length<2?!1:(u.add(L),!0)}).map(S=>{const L=it(S);let A=0;for(const B of x)B!==N&&(A+=c(L,D.get(B)??it(p(B))));return{candidate:S,candidateSegments:L,crossings:_.count-(V.get(N)??0)+A,bends:Qt(S,Z),totalBends:Qt(S),length:R(S)}}).filter(({crossings:S})=>S<=_.count).sort((S,L)=>S.crossings-L.crossings||S.bends-L.bends||S.length-L.length).slice(0,48).map(S=>({path:S.candidate,segments:S.candidateSegments,sharedTrackConflicts:Vt(N,S.candidateSegments,D),totalBends:S.totalBends,length:S.length}))},"pairCandidatesFor"),Ut=d((N,_,D,V,u,b)=>{let S=0;for(const A of N.pairs)(A.first===_||A.second===_||A.first===V||A.second===V)&&(S+=A.count);let L=c(D.segments,u.segments);for(const A of x){if(A===_||A===V)continue;const B=b.get(A)??it(p(A));L+=c(D.segments,B)+c(u.segments,B)}return N.count-S+L},"pairCrossingCount"),te=d((N,_)=>{for(const D of N.sharedTrackConflicts)if(D!==_)return!1;return!0},"conflictsOnlyWith"),Se=d((N,_)=>N.segments.some(D=>_.segments.some(V=>ce(D,V,.5)>=Ft)),"candidatesShareTrack"),de=d((N,_,D,V)=>te(_,D.edge)&&te(V,N.edge)&&!Se(_,V),"pairCandidatesAreCompatible"),Ce=d((N,_,D,V,u)=>{const b=Ut(N.current,_.edge,D,V.edge,u,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[_.edge,D.path],[V.edge,u.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(_.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+u.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(_.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+u.length}},"scorePairReplacement"),an=d((N,_)=>N.crossings<_.crossings||N.crossings===_.crossings&&(N.bends<_.bends||N.bends===_.bends&&N.length<_.length),"pairScoreIsBetter"),ln=d((N,_,D,V)=>{let u=V;for(const b of _.candidates)for(const S of D.candidates){if(!de(_,b,D,S))continue;const L=Ce(N,_,b,D,S);L&&an(L,u)&&(u=L)}return u},"bestScoreForOptionPair"),fn=d(N=>{const _=k(),D=O(),V=vt(),u=w(N),b=new Map(x.map(q=>[q,Qt(p(q))])),S=new Map(x.map(q=>[q,R(p(q))])),L=new Map,A=m(N);for(const q of A)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,u);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:_,length:D};const U={current:N,currentBends:_,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:S,baseSegments:V};for(const q of A){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const _=v(),D=_.count;if(D===0)return;let V,u,b=D,S=Number.POSITIVE_INFINITY;for(const A of _.edges){const B=Qt(p(A),Z);for(const U of xt(A)){const q=H(A,U),z=!q&&F(A,U),Y=I(_,A,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=S||(V=A,u=U,b=Y,S=ot)}}if(V&&u){V.points=u;continue}const L=fn(_);if(!L)return;for(const[A,B]of L)A.points=B}}d(Ms,"resolveRenderedOrthogonalCrossings");var pe=.001,Rr=8;function Is(t,e){const{nodeInfoById:n,realNodeRects:o}=sn(e),s=["top","bottom","left","right"],r=20,a={top:Math.min(...o.map(c=>c.rect.top))-r,bottom:Math.max(...o.map(c=>c.rect.bottom))+r,left:Math.min(...o.map(c=>c.rect.left))-r,right:Math.max(...o.map(c=>c.rect.right))+r},l=d((c,y,v,M)=>{const E=[],T=ro(c,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(io(c,y,v,a[y])),E},"buildOrthogonalPathCandidates"),f=d((c,y)=>{for(let v=0;v{let M=0;const E=Re(c,pe),T=y.start,m=y.end;for(const I of t){if(I===y||I.isLayoutOnly)continue;const w=I.start,R=I.end;if(!v&&T&&m&&(w===T||w===m||R===T||R===m))continue;const k=I.points;if(!(!k||k.length<2))for(const O of E)for(const F of Re(k,pe)){if(ao(O.a,O.b,F.a,F.b,pe,pe)){M++;continue}ce(O,F,pe)>=Rr&&M++}}return M},"pathConflictCount"),g=4,x=d((c,y)=>{const v=Math.abs(c.y-y.rect.top),M=Math.abs(c.y-y.rect.bottom),E=Math.abs(c.x-y.rect.left),T=Math.abs(c.x-y.rect.right);let m="top",I=v;return M{const M=C.get(c)??[];M.push({side:y,edgeId:v}),C.set(c,M)},"addFaceClaim");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points??[];if(y.length<1)continue;const v=c.id??"",M=c.start,E=c.end;if(M){const T=n.get(M);T&&h(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&h(E,x(y[y.length-1],T),v)}}const p=d((c,y,v)=>C.get(c)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=i(J,c,!0);if(mt>O||mt===O&&dt>=F)continue;O=mt,F=dt,k=J;continue}i(J,c)>R||dtG.edgeId!==I));const P=C.get(E);P&&C.set(E,P.filter(G=>G.edgeId!==I)),h(M,x(k[0],T),I),h(E,x(k[k.length-1],m),I)}}}d(Is,"simplifyDetouredEdges");var Kt=.001,No=10,$e=7;function Yn(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const a=r.x-s.x,l=r.y-s.y;if(!(Math.abs(a)+Math.abs(l)r&&We(t,Ss(r)))}d(Gn,"labelOverlapsOwnMarker");function Ve(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const c=p.points;if(!(!c||c.length<2))for(let y=0;y{const y=Ln(c,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&We(y,M))return!0;return!1},"labelOverlapsForeignNode"),i=d((p,c)=>{const y=Ln(c,r);for(const v of n)if(v.edgeId!==p&&on(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,c,y)=>f(p,y)||i(c,y),"labelOverlapsAnything"),x=[],C=d(p=>{for(const{id:c,rect:y}of s)if(qo(y,p))return c},"findContainingLane"),h=d((p,c)=>x.some(y=>y.labelId!==p&&We(c,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const c=p.labelNodeId;if(!c)continue;const y=e.get(c);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,w=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===w,gt=et.orientation===w;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],F=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=we(Q.midX,Q.midY,M,E),et=C(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+a,xt=at.rect.right-M/2-a,vt=at.rect.top+E/2+a,Vt=at.rect.bottom-E/2-a;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=we(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+l;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of F){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!Gn(xt.rect,v)&&!h(c,xt.rect)&&!g(c,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!Gn(vt.rect,v)&&!h(c,vt.rect)&&!f(c,vt.rect)&&(et||!i(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(I)??(I.lengthet.labelId===c);W>=0?x[W]={labelId:c,rect:Q}:x.push({labelId:c,rect:Q})}}}d(Ve,"anchorLabelsToPolyline");var bn=1e-6,Nr=8,Oo=Nr/2,Or=3;function $n(t,e){return t{const g=$n(l,f);let x=0;const C=d(h=>{if(!h)return;const p=s.get(h);if(!p)return;const c=i==="x"?p.w/2:p.h/2;c>x&&(x=c)},"consider");C(a.labelNodeId);for(const h of t){if(h===a||h.isLayoutOnly)continue;const p=h.start,c=h.end;!p||!c||$n(p,c)===g&&C(h.labelNodeId)}return x>0?x+Or:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const l=a.points;if(!oo(l,bn))continue;const f=co(a,n,bn);if(!f)continue;const{srcId:i,dstId:g,srcInfo:x,dstInfo:C,collinearX:h,collinearY:p}=f;if(h===p)continue;let c,y;if(h){const m=C.cy>x.cy;c={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:C.cx,y:m?C.rect.top:C.rect.bottom}}else{const m=C.cx>x.cx;c={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?C.rect.left:C.rect.right,y:C.cy}}if(wt(c,y,o,[i,g],1))continue;const M=r(a,i,g,h?"x":"y"),E=M>Oo?M:Oo,T=[0,E,-E];for(const m of T){const I={...c},w={...y};if(h){if(I.x+=m,w.x+=m,I.x<=x.rect.left||I.x>=x.rect.right||w.x<=C.rect.left||w.x>=C.rect.right)continue}else if(I.y+=m,w.y+=m,I.y<=x.rect.top||I.y>=x.rect.bottom||w.y<=C.rect.top||w.y>=C.rect.bottom)continue;if(!wt(I,w,o,[i,g],1)&&!Ke(I,w,t,a,{epsilon:bn})){a.points=[I,w];break}}}}d(Cs,"straightenCollinearSiblingDetours");function zn(t,e){const{realNodeRects:f,labelNodeRects:i}=me(e.values()),g=d((m,I)=>Re(I,.001).map(w=>({...w,edge:m,interior:w.index>=1&&w.index<=I.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const I of t){if(I.isLayoutOnly)continue;const w=I.points;!w||w.length<2||m.push(...g(I,pt(w)))}return m},"allSegments"),C=d((m,I)=>m.horizontal&&I.horizontal?zt(m.a.x,m.b.x,I.a.x,I.b.x)>=8&&Math.abs(m.a.y-I.a.y)<7:m.vertical&&I.vertical?zt(m.a.y,m.b.y,I.a.y,I.b.y)>=8&&Math.abs(m.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),h=d((m,I)=>{const w=m.start,R=m.end,k=g(m,I);if(k.length!==I.length-1)return!1;const O=[w,R].filter(H=>!!H),F=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(wt(H.a,H.b,f,O,-2)||wt(H.a,H.b,i,F,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(C(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,I)=>{const w=pt(m.edge.points??[]);if(w.length<4||m.index>=w.length-1)return;const R=w.map(k=>({...k}));if(m.horizontal)R[m.index].y+=I,R[m.index+1].y+=I;else if(m.vertical)R[m.index].x+=I,R[m.index+1].x+=I;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),c=d((m,I)=>({x:m.x??(I.left+I.right)/2,y:m.y??(I.top+I.bottom)/2}),"nodeCenter"),y=d(m=>{const I=m.edge,w=pt(I.points??[]);if(w.length!==4||m.index!==1)return;const R=I.start?e.get(I.start):void 0,k=I.end?e.get(I.end):void 0,O=R?qt(R):void 0,F=k?qt(k):void 0,H=w.slice(m.index+2);if(!(!R||!k||!O||!F||H.length===0))return{sourceCenter:c(R,O),targetCenter:c(k,F),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,I,w,R,k,O)=>{const F=R.y>=w.y,H=F?k.bottom:k.top,P=H+(F?20:-20);if(F&&m.b.y<=P+.001||!F&&m.b.y>=P-.001)return;const G=m.a.x+I;return pt([{x:w.x,y:H},{x:w.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,I,w,R,k,O)=>{const F=R.x>=w.x,H=F?k.right:k.left,P=H+(F?20:-20);if(F&&m.b.x<=P+.001||!F&&m.b.x>=P-.001)return;const G=m.a.y+I;return pt([{x:H,y:w.y},{x:P,y:w.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,I)=>{const w=y(m);if(w){if(m.vertical)return v(m,I,w.sourceCenter,w.targetCenter,w.sourceRect,w.tail);if(m.horizontal)return M(m,I,w.sourceCenter,w.targetCenter,w.sourceRect,w.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const I=x();let w=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&h(P.edge,j)){P.edge.points=j,w=!0;break}const J=E(P,G);if(J&&h(P.edge,J)){P.edge.points=J,w=!0;break}}if(w)break}}if(!w)return}}d(zn,"nudgeSharedInteriorSubpaths");function vs(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,l=o.y-n.y,f=s*l-r*a;if(Math.abs(f)<1e-10)return!1;const i=n.x-t.x,g=n.y-t.y,x=(i*l-g*a)/f,C=(i*r-g*s)/f,h=.01;return x>h&&x<1-h&&C>h&&C<1-h}d(vs,"segmentsIntersect");function Ls(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=Jo(e),r=[];for(const l of n){if(l.isLayoutOnly)continue;const f=l.points;if(!f||f.length<2)continue;const i=l.start,g=l.end,x=l.labelNodeId,C=l.id??`${i}->${g}`;for(const h of s)if(!(h.nodeId===i||h.nodeId===g)&&!(x&&h.nodeId===x)){for(let p=0;p0){const l=o.filter(i=>i.type==="edge-node-overlap").length,f=o.filter(i=>i.type==="edge-edge-crossing").length;In.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${l} edge-node overlap(s), ${f} edge crossing(s)`);for(const i of o)In.warn(`[SWIMLANE_VALIDATE] ${i.type}: ${i.detail}`)}return o}d(Ls,"validateSwimlanesLayout");function Es(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(l=>!l.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!us(t,e)||e==="BT"&&s.length>0&&!ds(t))return;for(const l of o){if(l.isLayoutOnly)continue;const f=l.points;!f||f.length<2||(l.points=ae(qe(f)))}Is(o,n),Cs(o,n),hs(o,n);const r=new Map;for(const l of n)r.set(String(l.id),l);Ve(o,r),ns(o,r),gs(o,r),zn(o,r),ps(o,r),ms(o,r),Dn(o,r),ys(o,r);const a=d(()=>{Ms(o,r),xs(o,r),bs(o,r),Ve(o,r),Fn(o,r),Dn(o,r),Ve(o,r),Fn(o,r)},"finalizeRenderedEdges");a(),zn(o,r),a(),Hn(o,r),Xn(o,r),Hn(o,r),Xn(o,r)}d(Es,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const a=`${r.id}:${r.src}->${r.dst}`;n.has(a)||(n.add(a),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function go(t,e){return t.edges.filter(n=>n.dst===e)}d(go,"incoming");function Ts(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ts,"buildSuccessorMap");function po(t){const e=Ts(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(po,"buildSortedSuccessorMap");function mo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(mo,"buildInDegreeMap");function yo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(yo,"sortedZeroInDegreeNodes");function rn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(rn,"buildPredecessorSuccessorMaps");function xo(t,e,n,o){let s=0;for(const a of t.nodes)o?.skipGroups&&t.nodeById.get(a)?.isGroup||(s=Math.max(s,n[a]??0));const r=Array.from({length:s+1},()=>[]);for(const a of e)o?.skipGroups&&t.nodeById.get(a)?.isGroup||r[Math.max(0,n[a]??0)].push(a);return r}d(xo,"buildLayersFromRanks");function Pe(t){const e=mo(t),n=yo(e),o=[],s=po(t);for(;n.length;){const r=n.shift();o.push(r);for(const a of s.get(r)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let l=0;for(;l{if(s-o<=1)return 0;const r=o+s>>1;let a=n(o,r)+n(r,s),l=o,f=r,i=o;for(;l=s||lx.dst===C.dst?x.id.localeCompare(C.id):x.dst.localeCompare(C.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const C=x.dst;o[C]===0?r(C):o[C]===1&&s.push(x)}o[g]=2},"dfs"),a=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of a)o[g]===0&&r(g);const l=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),f=e.edges.map(g=>l.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:f,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(As,"removeCycles_DFS");function ws(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const l=n(r)??r;return e.set(o,l),l},"resolve");for(const o of t.nodes)n(o);return e}d(ws,"buildTopLaneMap");function fe(t){const e=ws(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function cn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(cn,"buildTopLaneOrder");function Mo(t,e){const n=cn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const a of e)!o.has(a)||s.has(a)||(s.add(a),r.push(a));for(const a of n)s.has(a)||r.push(a);return r}d(Mo,"resolveTopLaneOrder");var Pr={EPSILON:1e-6},en={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Po={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Rs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=rn(n);for(const m of r.values())m.sort((I,w)=>I.localeCompare(w));const a=Pe(n)??[...n.nodes].sort((m,I)=>m.localeCompare(I)),l=new Map;for(const[m,I]of a.entries())l.set(I,m);const f=new Map,i=new Map;for(const m of n.nodes)i.set(m,[]);for(const m of a){const I=(r.get(m)??[]).filter(w=>f.has(w));if(I.length>0){const w=Ns(m,I,{laneOf:o,rankHint:s,topoIndex:l});f.set(m,w),i.get(w).push(m)}else f.has(m)||f.set(m,null)}for(const m of n.nodes)f.has(m)||f.set(m,null);const g=new Set;for(const m of n.nodes)(f.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,I)=>{const w=l.get(m)??0,R=l.get(I)??0;return w===R?m.localeCompare(I):w-R}),C=Os(n),h=new Map;for(const[m,I]of C.entries())h.set(m,[...I].sort((w,R)=>w.localeCompare(R)));const p=Ps(h),c=Bs(h),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of c)for(const I of m.nodes){const w=y.get(I);w?w.push(m.id):y.set(I,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const I of i.get(m)??[])T(I);M.push(m)}},"walk");for(const m of x)T(m);for(const m of a)T(m);return{parent:f,children:i,roots:x,componentOf:p,blocks:c,nodeBlocks:y,adjacency:h,preorder:v,postorder:M,topologicalOrder:a}}d(Rs,"buildDrivingTree");function Ns(t,e,n){const o=n.laneOf(t);return[...e].sort((r,a)=>{const l=n.laneOf(r),f=n.laneOf(a),i=l!=null&&l===o,g=f!=null&&f===o;if(i!==g)return i?-1:1;const x=n.rankHint?.[r],C=n.rankHint?.[a];if(x!=null&&C!=null&&x!==C)return C-x;const h=n.topoIndex.get(r)??0,p=n.topoIndex.get(a)??0;return h!==p?h-p:r.localeCompare(a)})[0]}d(Ns,"chooseParent");function Os(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Os,"buildAdjacency");function Ps(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const a of t.get(r)??[])e.has(a)||s.push(a)}}n++}return e}d(Ps,"assignComponents");function Bs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const a=d((l,f)=>{e.set(l,++r),n.set(l,r);for(const i of t.get(l)??[])i!==f&&(e.has(i)?(e.get(i)??0)<(e.get(l)??0)&&(o.push([l,i]),n.set(l,Math.min(n.get(l)??r,e.get(i)??r))):(o.push([l,i]),a(i,l),n.set(l,Math.min(n.get(l)??r,n.get(i)??r)),(n.get(i)??0)>=(e.get(l)??0)&&s.push(ks(l,i,o,s.length))))},"visit");for(const l of t.keys())e.has(l)||a(l,null);return s}d(Bs,"computeBlocks");function ks(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const a=n.pop();if(s.push(a),r.add(a[0]),r.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(ks,"popBlock");function Fs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,a=new Array(r).fill(-1),l=new Array(r).fill(0),f=[],i=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(a[T]=-1,l[T]=0,i.has(M)||(i.add(M),f.push(M)))}for(;f.length>0;){const M=f.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(i.has(m))continue;const I=s.get(m);I!=null&&(a[I]=E,l[I]=l[E]+1,i.add(m),f.push(m))}}for(const M of o){if(i.has(M))continue;const E=s.get(M);E!=null&&(a[E]=-1,l[E]=0,i.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;l[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const I=x[m][M],w=x[m][E];I===-1||w===-1||I!==w&&(M=I,E=w)}return x[0][M]},"lcaIndex"),h=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],I=e[T];if(m==null||I==null||(m>I&&([E,T]=[T,E],[m,I]=[I,m]),m==null||I==null||m===I))continue;const w=s.get(E),R=s.get(T);if(w==null||R==null)continue;const k=C(w,R);if(k===-1)continue;const O=h[k];for(let F=m;F{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:h[E],m=T?new Map(T):new Map,I=n.children.get(M)??[];for(const w of I){const R=v(w),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let F=R.get(k)??0;const H=e[w];H!=null&&H>k&&(F+=1),O.set(w,F)}c(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Fs,"computeSubtreeCrossCounts");function _s(t,e,n){const o=new Map,s=d(r=>{let a=n[r]??0;const l=[...e.get(r)??[]];l.sort(Io(n));for(const f of l){s(f);const i=o.get(f);i!=null&&(a=Math.min(a,i))}o.set(r,a)},"annotate");for(const r of t)s(r);return o}d(_s,"annotateMinimumLayers");function Io(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Io,"compareByRankThenId");function Ds(t,e,n,o){let s=0;for(const f of e){const i=n[f]??0;i>s&&(s=i)}const r=Array.from({length:s+1},()=>[]),a=new Set,l=d(f=>{if(a.has(f))return;a.add(f);const i=n[f]??0;r[i]||(r[i]=[]),r[i].push(f);for(const g of o(f))l(g)},"emit");for(const f of t)l(f);for(const f of e)if(!a.has(f)){const i=n[f]??0;r[i]||(r[i]=[]),r[i].push(f),a.add(f)}return r}d(Ds,"emitNodesInTreeOrder");function Hs(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Hs,"deduplicateLayers");function Xs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const a=e[s]??0,l=[],f=[],i=n.get(s);for(const g of r){const x=o.get(g)??a;x>a?l.push({child:g,min:x}):f.push(g)}return l.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),f.sort((g,x)=>{const C=i?.get(g)??0,h=i?.get(x)??0;if(C!==h)return C-h;const p=o.get(g)??a,c=o.get(x)??a;return p!==c?p-c:g.localeCompare(x)}),[...l.map(g=>g.child),...f]}}d(Xs,"createChildOrderer");function nn(t,e,n){const o=Rs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const a=Fs(t,e,o),l=[...r].sort(Io(e)),f=_s(l,s,e),i=Xs(s,e,a,f);let g=Ds(l,t.nodes,e,i);return g=Hs(g),g}d(nn,"buildMultitreeLayerOrder");function Ys(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),a=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&a.push(r.get(l.dst));return bo(a)}d(Ys,"countCrossingsBetweenAdjacent");function Vn(t,e,n){const o=[];for(const r of e){const a=n[r.src],l=n[r.dst];if(a==null||l==null||a===l)continue;let f=r.src,i=r.dst,g=a,x=l;a>l&&(f=r.dst,i=r.src,g=l,x=a);for(let C=g;C(n[C]??0)-(n[x]??0));for(const x of g){const C=n[x]??0;if(C===0)continue;let h=0;for(const v of o.get(x)??[])h=Math.max(h,(n[v]??0)+1);if(h>=C)continue;const p=C;n[x]=h;const c=nn(t,n,s),y=Vn(c,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const a=t.edges.filter(c=>c.src===s);if(a.length===0)continue;let l=!1,f=0;for(const c of a){const y=n(c.dst);y==null||y===r?l=!0:f++}if(f===0||l)continue;let i=0,g=!1;for(const c of t.edges){if(c.dst!==s)continue;const y=n(c.src);y&&(y===r?g=!0:i++)}if(i>0||!g)continue;const x=e[s]??0,C=x+f;let h=0;for(const c of t.edges)c.dst===s&&(h=Math.max(h,(e[c.src]??0)+1));const p=Math.max(x,h,C);p!==x&&(e[s]=p)}}d($s,"adjustCrossLaneSources");function zs(t,e){const n=ye(t),o=Pe(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let a=Object.create(null);for(const f of o){const i=go(n,f),g=e?.ignoreCrossLaneEdges?i.filter(x=>{const C=r(x.src),h=r(f);return!C||!h?!0:C===h}):i;if(g.length===0)a[f]=0;else if(s&&g.length===1){const x=g[0].src,C=r(x),h=r(f);C!==h?a[f]=a[x]??0:a[f]=(a[x]??0)+1}else{let x=-1/0;for(const C of g)x=Math.max(x,(a[C.src]??0)+1);a[f]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(a=Gs(n,a)),e?.ignoreCrossLaneEdges&&$s(n,a),{layers:nn(n,a,r),rankOf:a,dummy:new Set}}d(zs,"assignLayers_LongestPath");function Vs(t,e){const n=ye(t),s={...zs(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:a,succs:l}=rn(n,p=>{if(e?.ignoreCrossLaneEdges){const c=r(p.src),y=r(p.dst);if(c&&y&&c!==y)return!1}return!0}),f=Pe(n)??[...n.nodes],i=[...f].reverse(),g=d((p,c)=>{let y=0;for(const E of a.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=l.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,c)),Math.min(Math.max(c,y),v)},"clampFeasible"),x=en.GRAVITY_ITERATIONS,C=d(p=>{let c=!1;for(const y of p){const v=a.get(y)??[],M=l.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((w,R)=>w+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((w,R)=>w+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),I=g(y,m);I!==s[y]&&(s[y]=I,c=!0)}return c},"relaxOrder");for(let p=0;p0){const y=Math.min(...c.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:xo(n,f,s),rankOf:s,dummy:new Set}}d(Vs,"assignLayers_Gravity");function js(t){const e=mo(t),n=po(t);let o=yo(e);const s=[];for(;o.length>0;){const r=[];for(const a of o){s.push(a);for(const l of n.get(a)??[])e.set(l,(e.get(l)??0)-1),(e.get(l)??0)===0&&r.push(l)}o=r.sort((a,l)=>a.localeCompare(l))}return s.length===t.nodes.length?s:null}d(js,"topoSortByGenerationIfAcyclic");function Us(t,e){const n=ye(t),o=e?.direction==="LR"?js(n)??[...n.nodes].sort():Pe(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),a=Object.create(null),l=new Map,f=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const C=go(n,g);let h=0;if(C.length>0)for(const v of C){const M=v.src,E=a[M]??0;h=Math.max(h,E+f(M,g))}const p=r(g),c=l.get(p)??0,y=Math.max(h,c);a[g]=y,l.set(p,y+1)}return{layers:xo(n,o,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}d(Us,"assignLayers_LaneAwareCompact");function Ws(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(h=>[...h]),r=new Set(t.dummy?[...t.dummy]:[]);let a=0;const l=new Map(n.nodeById),f=d(h=>{const p=`placeholder-${a++}`,c={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(l.set(p,c),r.add(p);s.length<=h;)s.push([]);return s[h].push(p),o[p]=h,p},"addDummyAt"),i=[...n.edges].sort((h,p)=>h.id===p.id?h.src===p.src?h.dst.localeCompare(p.dst):h.src.localeCompare(p.src):h.id.localeCompare(p.id)),g=[];for(const h of i){const p=o[h.src]??0,c=o[h.dst]??0;if(c-p<=1){g.push(h);continue}let y=h.src;for(let M=p+1,E=0;M!n.nodes.includes(h))],edges:g,layout:n.layout,nodeById:l};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:C}}d(Ws,"makeProperLayering");function jn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(jn,"median");function Un(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Un,"barycenter");function Ks(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Ks,"neighborPositionsFor");function qs(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(qs,"currentOrderTieBreak");function Wn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),a=Ne(e),l=[];for(const i of n)o.has(i.src)&&s.has(i.dst)&&l.push({u:r.get(i.src),v:a.get(i.dst)});l.sort((i,g)=>i.u===g.u?i.v-g.v:i.u-g.u);const f=l.map(i=>i.v);return bo(f)}d(Wn,"countCrossingsBetweenAdjacent");function je(t,e,n){return[...t].sort((o,s)=>{const r=jn(e.get(o)??[]),a=jn(e.get(s)??[]);return r===a?qs(o,s,n):isFinite(r)?isFinite(a)?r-a:-1:1})}d(je,"sortByHeuristic");function Kn(t,e,n,o,s,r){const a=Ne(t),l=Ne(e),f=Ks(e,a,n,o);if(!s||!r||r.length===0)return je(e,f,l);const i=new Map;for(const C of e){const h=s(C),p=i.get(h)??[];p.push(C),i.set(h,p)}const g=[];for(const C of r){const h=i.get(C);if(!h||h.length===0)continue;const p=je(h,f,l);g.push(...p)}const x=i.get(null);if(x&&x.length>0){const C=je(x,f,l);for(const h of C){const p=Un(f.get(h)??[]);let c=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Un(f.get(v)??[]);if(pa.has(c.src)&&l.has(c.dst)),g=f?n.filter(c=>l.has(c.src)&&f.has(c.dst)):void 0,x=d(c=>{let y=Wn(t,c,i);return g&&o&&(y+=Wn(c,o,g)),y},"crossingScore"),C=s?new Map:null;if(s&&C)for(const c of e)C.set(c,s(c));let h=!0,p=x(r);for(;h;){h=!1;for(let c=0;c+1[...l]),s=e.edges,r=fe(e),a=Mo(e,n?.laneOrder);for(let l=0;l<3;l++){for(let f=1;f=0;f--)o[f]=Kn(o[f+1],o[f],s,"up",r,a),o[f]=qn(o[f+1],o[f],s,o[f-1],r)}return{layers:o}}d(Js,"orderLayers");function Zs(t,e,n){const o=n?.layerGap??Po.DEFAULT_LAYER_GAP,s=n?.nodeGap??Po.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,a=n?.direction??"TB",l=a==="LR"||a==="RL",f=t.layers,i=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),C=d(O=>x(O)?.width??0,"getWidth"),h=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),c=Mo(e,n?.laneOrder),y=f.map(O=>O.reduce((F,H)=>Math.max(F,h(H)),0)),v=[];if(l)for(let O=0;O+1Math.max(mt,C(kt)),0),H=f[O+1].reduce((mt,kt)=>Math.max(mt,C(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(F+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of f)for(const F of O)M.add(p(F));const E=M.has(null),T=c.filter(O=>M.has(O)),m=[...E?[null]:[],...T],I=Object.create(null);for(const O of T)I[O]=0;E&&(I.null=0);for(const O of f){const F=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(F[G]||=[]).push(P)}for(const[P,G]of Object.entries(F)){const j=G.reduce((J,dt)=>J+C(dt),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+C(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const w=new Map;{const O=m.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PC(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];i[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const F=O.ref.id;k.has(F)||k.set(F,[]),k.get(F).push(O)}for(const[,O]of k){if(O.length===0)continue;const F=O[0].ref,H=F.start,P=F.end;if(H==null||P==null)continue;const G=Math.round(((i[H]??0)+(i[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(i[J]=G)}}return{x:i,y:g}}d(Zs,"assignCoordinates");var Qs=8;function tr(t){let e=2166136261;for(let n=0;n>>0}d(tr,"hashString");function er(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(er,"mulberry32");function nr(t,e){const n=[...t],o=er(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(nr,"deterministicShuffle");function or(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(or,"sourceDistance");function Jn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:a}of e){const l=n.get(s),f=n.get(r);l==null||f==null||(o+=a*Math.abs(l-f))}return o}d(Jn,"laneArrangementCost");function sr(t){const e=cn(t);if(e.length<2)return[];const n=new Map(e.map((r,a)=>[r,a])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const a=typeof r.start=="string"?r.start:void 0,l=typeof r.end=="string"?r.end:void 0;if(!a||!l||!t.nodeById.has(a)||!t.nodeById.has(l))continue;const f=o(a),i=o(l);if(!f||!i||f===i)continue;const g=n.get(f),x=n.get(i);if(g==null||x==null)continue;const[C,h]=g<=x?[f,i]:[i,f],p=`${C}\0${h}`,c=s.get(p);c?c.weight++:s.set(p,{a:C,b:h,weight:1})}return[...s.values()]}d(sr,"buildWeightedLaneEdges");function Zn(t,e,n){const o=[...t];let s=Jn(o,e),r=!0,a=0;const l=Math.max(1,o.length);for(;r&&as.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:a})=>`${s}:${r}:${a}`).join("|");return tr(`${t.join("|")}#${o}#${n}`)}d(ir,"seedForRestart");function cr(t,e={}){const n=cn(t);if(n.length<2)return n;const o=sr(t);if(o.length===0)return n;const s=new Map(n.map((l,f)=>[l,f]));let r=Zn(n,o,s);const a=Math.max(0,e.restarts??Qs);for(let l=0;lct&&f*3>=l?a>0?"bottom":"top":l>ct?r>0?"right":"left":n}d(Qn,"chooseOrthogonalSide");function to(t,e){return Math.abs(t.to-e.from)u.isGroup&&!u.parentId);for(const u of i){const b={id:u.id},S=d(L=>{a.set(L.id,b),n.filter(A=>A.parentId===L.id).forEach(S)},"assignLane");S(u)}const g=n.filter(u=>!u.isGroup&&!u.isEdgeLabel).map(u=>{const b=u.width??10,S=u.height??10,L=u.x??0,A=u.y??0,B=Br;return{nodeId:u.id,minX:L-b/2-B,maxX:L+b/2+B,minY:A-S/2-B,maxY:A+S/2+B,visualXHalfExtent:f?S/2+B:b/2+B}}),x=d((u,b,S,L)=>{let A=l.find(B=>B.orientation===u&&Math.abs(B.coord-b)<1);return A||(A={id:`pipe-${u}-${b.toFixed(0)}`,orientation:u,coord:b,spanMin:S,spanMax:L,tracks:[]},l.push(A)),A.spanMin=Math.min(A.spanMin,S),A.spanMax=Math.max(A.spanMax,L),A},"getOrAddPipe"),C=d((u,b)=>{const S=u.width??10,L=u.height??10,A=u.x??0,B=u.y??0;switch(b){case"top":return{x:A,y:B-L/2};case"bottom":return{x:A,y:B+L/2};case"left":return{x:A-S/2,y:B};case"right":return{x:A+S/2,y:B}}},"portForSide"),h=d((u,b,S)=>C(u,Qn(u,b,S?"bottom":"top")),"getOrthogonalPort"),p=[],c=[],y=new Set,v=1e3,M=d((u,b,S)=>{if(p.length===0)return 0;const L=Math.abs(b.y-S.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(A){const U=b.x,q=Math.min(b.y,S.y)-ct,z=Math.max(b.y,S.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===u||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((u,b)=>{if(!u.start||!u.end)return{idx:b,crossLane:0,dx:0,dy:0};const S=r.get(u.start),L=r.get(u.end),A=a.get(u.start),B=a.get(u.end),U=A&&B&&A.id!==B.id?1:0,q=S&&L?Math.abs((L.x??0)-(S.x??0)):0,z=S&&L?Math.abs((L.y??0)-(S.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((u,b)=>{if(u.crossLane!==b.crossLane)return b.crossLane-u.crossLane;const S=u.dx+u.dy,L=b.dx+b.dy;return Math.abs(S-L)>1?S-L:u.idx-b.idx}).map(u=>u.idx),T=d((u,b,S,L)=>{const A=Math.min(u.x,b.x),B=Math.max(u.x,b.x),U=Math.min(u.y,b.y),q=Math.max(u.y,b.y);return!!g.find(Y=>S&&Y.nodeId===S||L&&Y.nodeId===L?!1:Math.abs(u.x-b.x)>ct?Y.minYu.y&&Y.maxX>A&&Y.minXu.x&&Y.maxY>U&&Y.minYQn(u,b,"bottom"),"determineSide"),R=new Map;for(const[u,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const A=(L.x??0)-(S.x??0),B=(L.y??0)-(S.y??0);R.set(u,{edgeIdx:u,srcId:b.start,dstId:b.end,srcSide:w(S,{x:L.x??0,y:L.y??0}),dstSide:w(L,{x:S.x??0,y:S.y??0}),absDx:Math.abs(A),absDy:Math.abs(B),dxSign:Math.sign(A),dySign:Math.sign(B)})}const k=d(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.absDx===0?1/0:u.absDy/u.absDx:u.absDy===0?1/0:u.absDx/u.absDy,"preferenceStrength"),O=d(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.dxSign>=0?"right":"left":u.dySign>=0?"bottom":"top","secondarySide"),F=new Map;for(const u of R.values()){const b=`${u.srcId}:${u.srcSide}`;F.has(b)||F.set(b,[]),F.get(b).push(u)}const H=new Map,P=d((u,b)=>`${u}:${b}`,"loadKey");for(const u of R.values())H.set(P(u.srcId,u.srcSide),(H.get(P(u.srcId,u.srcSide))??0)+1),H.set(P(u.dstId,u.dstSide),(H.get(P(u.dstId,u.dstSide))??0)+1);for(const u of F.values())if(!(u.length<2)){u.sort((b,S)=>{const L=k(b),A=k(S);return Math.abs(L-A)>1e-9?A-L:b.edgeIdx-S.edgeIdx});for(let b=1;b=A||(H.set(P(S.srcId,S.srcSide),A-1),H.set(P(S.srcId,L),B+1),S.srcSide=L)}}const G=d(u=>{const b=u?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const u of R.values())j.has(u.dstId)||j.set(u.dstId,new Set),j.get(u.dstId).add(u.dstSide);for(const u of R.values()){if(!G(r.get(u.srcId)))continue;const b=j.get(u.srcId);if(!b?.has(u.srcSide))continue;const S=O(u);if(b.has(S)||(H.get(P(u.srcId,S))??0)>0)continue;const L=H.get(P(u.srcId,u.srcSide))??0;H.set(P(u.srcId,u.srcSide),Math.max(0,L-1)),H.set(P(u.srcId,S),1),u.srcSide=S}for(const u of R.values()){const{edgeIdx:b,srcId:S,dstId:L,srcSide:A,dstSide:B}=u,U=r.get(S),q=r.get(L),z=`${S}:${A}:src`,Y=A==="top"||A==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[u,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const S=u.split(":"),L=S.slice(0,-2).join(":"),A=S[S.length-2],B=S[S.length-1],U=r.get(L);if(!U)continue;const z=A==="left"||A==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,dn=`${Dt.edgeIdx}:${B}`;J.set(dn,Jt)}}const mt=d(u=>!!s[u]?.labelNodeId,"edgeHasLabelNode"),kt=d((u,b)=>u?(m.get(`${u}:${b}:src`)??[]).some(({edgeIdx:S})=>mt(S))||(m.get(`${u}:${b}:dst`)??[]).some(({edgeIdx:S})=>mt(S)):!1,"faceHasLabelNode"),Pt=d((u,b,S)=>b==="top"||b==="bottom"?{x:u.x+S,y:u.y}:{x:u.x,y:u.y+S},"applyPortOffset"),Q=d((u,b,S)=>{const L=R.get(u),A={x:S.x??0,y:S.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??w(b,A),q=L?.dstSide??w(S,B);let z=L?C(b,L.srcSide):h(b,A,!0),Y=L?C(S,L.dstSide):h(S,B,!1);const ot=J.get(`${u}:src`),rt=J.get(`${u}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const u of E){const b=s[u];if(c[u]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const{pSrcPort:A,pDstPort:B,srcSide:U,dstSide:q}=Q(u,S,L),z={...A},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=A.y>(S.y??0);z.y=X?A.y+ne:A.y-ne}else{const X=A.x>(S.x??0);z.x=X?A.x+ne:A.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(A,S,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,A.y+ne):Math.max(X.maxY+2,A.y-ne);yt=[{x:A.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(A,S,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,A.x+ne):Math.max(X.maxX+2,A.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:A.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,S,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,S,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=I.get(b.start??"")??0,ut=I.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(A,B,b.start,b.end)){b.points=[{...A},{...z},{...Y},{...B}],y.add(u);const Mt=K?"horizontal":"vertical",$t=K?A.y:A.x,It=K?Math.min(A.x,B.x):Math.min(A.y,B.y),St=K?Math.max(A.x,B.x):Math.max(A.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${u}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:u,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const dn=x("vertical",z.x,z.y,z.y);z.x=dn.coord;const hr=x("vertical",Y.x,Y.y,Y.y);Y.x=hr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-ze),he=Math.max(he,X.maxX+ze),ve=Math.min(ve,X.minY-ze),Le=Math.max(Le,X.maxY+ze))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const gr=l.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),pr=l.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),Be=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),ke=Be(z.x,z.y),So=Be(Y.x,Y.y),Fe=new Map,un=new Map,hn=new Map,_e=new Set,xe=[];Fe.set(ke,0),hn.set(ke,"n"),xe.push({key:ke,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),_e.add(ke);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),gn={x:Y.x,y:z.y},mr=ge(z,gn),yr=ge(gn,Y),xr=mr||yr,pn={x:z.x,y:Y.y},br=ge(z,pn),Mr=ge(pn,Y);if(xr?br||Mr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(_e.delete(X.key),X.key===So){let ut=So,Yt=Y;for(Ht=[Yt];un.has(ut);){const ee=un.get(ut);Ht.unshift(ee),Yt=ee,ut=Be(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=pr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=gr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&mn<-5||Ee<-10&&mn>5)&&(St=Math.abs(mn)*100),(Wt>10&&De<-5||Wt<-10&&De>5)&&(St+=Math.abs(De)*50);let Co=0;const vo=hn.get(X.key)??"n",Lo=Math.abs(De)>ct?"h":"v";vo!=="n"&&vo!==Lo&&(Co=50);const Ir=$t+It+St+Co,He=(Fe.get(X.key)??1/0)+Ir,Eo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(He<(Fe.get(Mt)??1/0))if(un.set(Mt,X.pt),Fe.set(Mt,He),hn.set(Mt,Lo),!_e.has(Mt))xe.push({key:Mt,f:He+Eo,pt:ut}),_e.add(Mt);else{const Zt=xe.findIndex(Sr=>Sr.key===Mt);Zt!==-1&&(xe[Zt].f=He+Eo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(f&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xu.from{const A=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,u)),B=!S.segments.some(U=>(U.edgeIndex!==u.edgeIndex||U.segmentIndex!==u.segmentIndex)&&W(U,b));return A&&B?(u.trackIndex=L.index,b.trackIndex=S.index,S.segments=[...S.segments.filter(U=>U.edgeIndex!==u.edgeIndex||U.segmentIndex!==u.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(u=>{const b=u.tracks.length;return u.tracks[b]={index:b,coord:u.coord,segments:[]},b},"createNewTrack"),gt=d((u,b)=>{const S=u.pipe.tracks[u.trackIndex];S.segments=S.segments.filter(A=>A.edgeIndex!==u.edgeIndex||A.segmentIndex!==u.segmentIndex),u.trackIndex=b,u.pipe.tracks[b].segments.push({edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to})},"moveSegmentToTrack"),xt=d((u,b)=>{const S=c[u.edgeIndex];for(const L of S){const A=p[L];A.pipe===u.pipe&>(A,b)}},"moveSegmentChainToTrack"),vt=d(u=>{const b=c[u.edgeIndex],S=b.indexOf(p.indexOf(u)),L=[];return S>0&&L.push(p[b[S-1]]),S{if(u.orientation===b.orientation)return!1;const S=u.orientation==="horizontal"?u:b,L=u.orientation==="horizontal"?b:u;return L.pipe.coord>S.from&&L.pipe.coordL.from&&S.pipe.coord{for(const S of u.tracks)if(!S.segments.some(A=>(A.edgeIndex!==b.edgeIndex||A.segmentIndex!==b.segmentIndex)&&W(A,b)))return S.index;return-1},"findAvailableTrack"),Ut=d((u,b)=>{if(u.trackIndex===b.trackIndex)return W(u,b);const S=vt(u),L=vt(b);return S.some(A=>L.some(B=>Vt(A,B)))},"segmentsConflict"),te=d((u,b,S)=>{if(et(u,b,u.pipe.tracks[u.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(u.pipe,b);S(b,L!==-1?L:at(u.pipe))},"resolveTrackConflict"),Se=d(u=>{let b=0;for(let S=0;S{if(de.has(u))return de.get(u);const b=c[u];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(u,q),q}const L=p[b[0]].pipe.coord;let A=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(A-L),U={dest:A,deviation:B,base:L,delta:A-L};return de.set(u,U),U},"getDestInfo"),an=d(()=>{let u=0;const b=new Map;for(const[L,A]of s.entries())c[L].length!==0&&A.start&&(b.has(A.start)||b.set(A.start,[]),b.get(A.start).push(L));const S=d(L=>{const A=s[L];if(!A.start||!A.end)return 0;const B=r.get(A.start),U=r.get(A.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=S(B),ot=S(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=c[B].length,st=c[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=c[B][0],yt=c[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const A=L.map(B=>p[c[B][0]]);u+=Se(A)}return u},"fixSourceHandleCrossings"),ln=d(()=>{let u=0;const b=new Map;for(const[S,L]of s.entries())c[S].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(S));for(const S of b.values()){S.sort((A,B)=>{const U=d(Y=>{const ot=c[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(A),z=U(B);return Math.abs(q-z)>.1?q-z:A-B});const L=S.map(A=>p[c[A][c[A].length-1]]);u+=Se(L)}return u},"fixTargetHandleCrossings"),fn=d(()=>{let u=0;for(const b of l){const S=[];for(const L of b.tracks)for(const A of L.segments){const B=c[A.edgeIndex].find(U=>p[U].segmentIndex===A.segmentIndex);B!==void 0&&S.push(p[B])}S.sort((L,A)=>L.edgeIndex-A.edgeIndex||L.segmentIndex-A.segmentIndex);for(let L=0;L{L.segments.forEach(A=>{b.push({edgeIndex:A.edgeIndex,segmentIndex:A.segmentIndex,trackIndex:L.index,from:A.from,to:A.to})})}),b.sort((L,A)=>L.from-A.from);const S=[];if(b.length>0){let L=[b[0]],A=b[0].to;for(let B=1;BA.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...A].filter(tt=>(B.get(tt)??0)<-1),q=[...A].filter(tt=>(B.get(tt)??0)>1),z=[...A].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?u.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,u.coord-ot*Mn);if(z.length===0&&A.size>0){const tt=[...A].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,u.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,u.coord+yt*Rt*Mn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,u.coord+st*Mn)}}for(const[u,b]of s.entries()){const S=c[u]??[];if(S.length===0)continue;const L=[],A=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(u,A,B),z=S.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:to(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,to(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const u of s){const b=u.__originalEdge;b&&u.points&&(b.points=u.points)}t.edges=(t.edges??[]).filter(u=>!u.isLayoutOnly);const V=d((u,b)=>{const S=b.x??0,L=b.y??0,A=b.width??0,B=b.height??0;if(A<=0||B<=0)return u;const U=S-A/2,q=S+A/2,z=L-B/2,Y=L+B/2;if(u.xq||u.yY)return u;const ot=u.x-U,rt=q-u.x,st=u.y-z,tt=Y-u.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:u.y}:yt===rt?{x:q,y:u.y}:yt===st?{x:u.x,y:z}:{x:u.x,y:Y}},"nodeBoundaryClamp");for(const u of t.edges){const b=u.points;if(!b||b.length<2)continue;const S=u.start,L=u.end,A=S?r.get(S):void 0,B=L?r.get(L):void 0;A&&(b[0]=V(b[0],A)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(lr,"routeEdgesOrthogonal");function fr(t){return t.direction??"TB"}d(fr,"getSwimlaneDirection");function dr(t){const e=Uo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,a=t.config.swimlane?.automaticLaneOrdering??!1,l=fr(t),{ordered:f,coordinates:i}=ar(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:a,direction:l});Wo(e,f,i,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;lr(t,l);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Es(t,l),Ls(t),l}d(dr,"runSwimlaneLayoutCore");function ur(t){jo(t);const e=Ko(t);t.nodes=e.nodes,t.edges=e.edges}d(ur,"prepareSwimlaneLayout");var Hr=Cr({prepareLayout:ur,runLayoutCore:dr,afterPaint:zo});export{Hr as render}; +import{ap as Cr,l as In,_ as d,aA as To}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var Ao=5,Xe=1e-5,Ye=1e-6;function Ue(t){const e=[];for(let n=0;n=1-Ye||C<=Ye||C>=1-Ye?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:C}}d(Bo,"segmentIntersection");function Sn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(Sn,"isHorizontalSeg");function ko(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Fo,"getArcSweepFlag");var vr=.001;function _o(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&To[e.arrowTypeStart];if(o){const r=t[0],a=t[1],l=Math.atan2(a.y-r.y,a.x-r.x);n[0].x=r.x+o*Math.cos(l),n[0].y=r.y+o*Math.sin(l)}const s=e.arrowTypeEnd&&To[e.arrowTypeEnd];if(s){const r=t.length,a=t[r-2],l=t[r-1],f=Math.atan2(l.y-a.y,l.x-a.x);n[r-1].x=l.x-s*Math.cos(f),n[r-1].y=l.y-s*Math.sin(f)}return n}d(_o,"applyMarkerOffsets");function Do(t,e,n,o,s){const r=t.point.x,a=t.point.y,l={x:r-e*t.r,y:a-n*t.r},f={x:r+e*t.r,y:a+n*t.r},i=[`L${Ae(l)}`];return s==="arc"?i.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${Ae(f)}`):i.push(`M${Ae(f)}`),i}d(Do,"emitJump");function Cn(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=n.x-e.x,l=n.y-e.y,f=Math.hypot(s,r),i=Math.hypot(a,l);if(f0){const E=Cn(s[i-1],s[i],s[i+1]??s[i],Ao);E&&(c=E.cutLen)}let y=x,v=null;r&&iE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-c,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Go,"decodeDataPoints");function $o(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const i of e)s.set(i.id,i);const r=[],a=new Map;for(const i of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(i.id):i.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;a.set(i.id,x);const h=Go(x.getAttribute("data-points"))??i.points;r.push({...i,points:h})}const l=ko(r);if(l.length===0)return;const f=new Map;for(const i of l){const g=f.get(i.jumpEdgeId)??[];g.push(i),f.set(i.jumpEdgeId,g)}for(const i of r){const g=f.get(i.id);if(!g||g.length===0)continue;const C=s.get(i.id)?.curve;if(C!==void 0&&!Yo(C))continue;const h=a.get(i.id);if(!h)continue;if(C===void 0){const E=h.getAttribute("d")??"";if(!Xo(E))continue}const p=h.getAttribute("style")??"",c=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=c?Number.parseFloat(c[1]):null,v=c?Number.parseFloat(c[2]):null,M=Ho(i,g,n);if(h.setAttribute("d",M),y!==null&&v!==null&&typeof h.getTotalLength=="function"){const E=h.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,I=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");h.setAttribute("style",I)}}}d($o,"applyLineJumpsToSvg");function zo(t,{measure:e}){const n=t.config?.swimlane?.lineHops;if(n===!1)return;const o=n==="gap"?"gap":"arc",s=t.edges.filter(r=>Array.isArray(r.points)&&r.points.length>=2).map(r=>({id:r.id,points:r.points,curve:r.curve,arrowTypeStart:r.arrowTypeStart,arrowTypeEnd:r.arrowTypeEnd}));$o(e.groups.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}d(zo,"applySwimlaneLineJumps");var yn="__swimlane_default__",Lr=21,wo=20;function vn(t){return Math.max(t.padding??wo,wo)}d(vn,"topLaneHorizontalPadding");function Vo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const a=n-s/2,l=Math.min(r,n+s/2),f=Math.min(Lr,Math.max(0,l-a)),i=a+f;if(i<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:a,bottom:i}}d(Vo,"assignTopLaneTitleRect");function jo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===yn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:yn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=yn}d(jo,"prepareLayoutForSwimlanes");function Uo(t){const e=new Map;for(const f of t.nodes??[])e.set(f.id,f);const n=[];for(const f of t.edges??[]){const i=typeof f.start=="string"?f.start:void 0,g=typeof f.end=="string"?f.end:void 0;!i||!g||f.labelNodeId||n.push({id:f.id,src:i,dst:g,ref:f})}const o=t.nodes??[],s=o.filter(f=>f.isGroup),r=o.filter(f=>!f.isGroup);return{nodes:[...[...s].reverse(),...r].map(f=>f.id),edges:n,layout:t,nodeById:e}}d(Uo,"toGraphView");function Wo(t,e,n,o){const{layout:s}=t,r=t.nodeById,a=o?.layerGap??100,l=o?.nodeGap??40;let f=0;for(const C of e.layers){let h=0;for(const p of C){const c=r.get(p);if(!c){h++;continue}c.layer=f,c.order=h;const y=n.x[p]??h*l,v=n.y[p]??f*a;c.x=y,c.y=v,h++}f++}const i=s.nodes??[],g=new Map,x=[];for(const C of i){if(!C?.isGroup)continue;C.parentId||x.push(C);const h=i.filter(M=>M.parentId===C.id);let p=1/0,c=-1/0,y=1/0,v=-1/0;for(const M of h){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,I=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),c=Math.max(c,E+m/2),y=Math.min(y,T-I/2),v=Math.max(v,T+I/2))}if(p===1/0||y===1/0)C.x=C.x??0,C.y=C.y??0,C.width=C.width??0,C.height=C.height??0;else{const M=C.padding??20,E=C.parentId?M:2*vn(C),T=M,m=Math.max(0,c-p)+E,I=Math.max(0,v-y)+T,w=(p+c)/2,R=(y+v)/2;C.x=w,C.y=R,C.width=m,C.height=I,g.set(C.id,{minX:p,maxX:c,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let C=1/0,h=-1/0,p=0;for(const c of x){const y=c.padding??20;y>p&&(p=y);const v=g.get(c.id);v&&(C=Math.min(C,v.minY),h=Math.max(h,v.maxY))}if(C!==1/0&&h!==-1/0){const c=Math.max(0,h-C),v=Math.max(p,36),M=c+2*v,E=(C+h)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=C;const T=[...x].sort((k,O)=>{const F=k.x??0,H=O.x??0;return F-H}),m=[],I=[],w=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const F=Math.max(0,O.maxX-O.minX)+2*vn(k),H=(O.minX+O.maxX)/2;m.push(k.id),I.push(H),w.push(F)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],w[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:we(e,n,o,s)}:void 0}d(eo,"measuredNodeRect");function no(t){if(t.isGroup)return;const e=eo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(no,"nodeBoundsInfoFor");function oe(t,e,n=_t){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function At(t,e,n=_t){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(At,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=_t){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=_t){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function oo(t,e=_t){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&At(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:At(n,o,e)&&Tt(o,s,e)&&At(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(oo,"classifyThreeSegmentRoute");function on(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),a=Math.min(t.y,e.y),l=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ae.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(qo,"rectContainsRect");function We(t,e){return t.lefte.left&&t.tope.top}d(We,"rectsOverlap");function Ln(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Ln,"inflateRect");function we(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(we,"rectFromCenterSize");function qt(t){return eo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function ro(t,e,n,o,s,r=_t){const a=e==="left"||e==="right",l=o==="left"||o==="right";if(a&&l){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!a&&!l){if(e===o){if(ft(t,n,r))return;const C=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:C},{x:n.x,y:C},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(a&&!l){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const f=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return f&&i?[t,{x:t.x,y:n.y},n]:void 0}d(ro,"buildOrthogonalPortPath");function io(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(io,"buildSameSideTrackPath");function sn(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=no(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(sn,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=no(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function Jo(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,a=o.width??0,l=o.height??0;n.push({nodeId:o.id,...we(s,r,a,l)})}return n}d(Jo,"collectLayoutNodeRects");function co(t,e,n=_t){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),a=e.get(s);if(!(!r||!a))return{srcId:o,dstId:s,srcInfo:r,dstInfo:a,collinearX:Math.abs(r.cx-a.cx)p||Cv)return!1;const M=Math.abs(c-g.a.x)s:r&&l&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(Zo,"sameAxisSegmentsOverlap");function Ke(t,e,n,o,{epsilon:s=_t,skipDegenerateOther:r=!1}={}){for(const a of n){if(a===o||a.isLayoutOnly)continue;const l=a.points;if(!(!l||l.length<2))for(let f=0;fC+s&&pc+s&&xo+_t&&t=2?e[e.length-2]:void 0,f=(a?ft(a,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(f)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ts(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Tr=.5,Ro=4;function lo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const a=es(t[s],t[r],e);return n?[a,...t.slice(s)]:[...t.slice(0,s+1),a]}d(Tn,"clipEndpoint");function ns(t,e){for(const n of t){const o=lo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Tn(s,o.srcRect,!0)),o.dstRect&&(s=Tn(s,o.dstRect,!1)),s=ae(qe(s)),s=fo(s,o.srcRect,o.dstRect),o.edge.points=ae(qe(s))}}d(ns,"clipEdgeEndpointsToNodeBoundaries");function An(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(An,"snapEndpointToBoundary");function Je(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(os,"intersectRanges");function Rn(t,e){return e==="left"||e==="right"?Ze(t.top,t.bottom):Ze(t.left,t.right)}d(Rn,"clearanceRangeForSide");function Qe(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?os(r):void 0}d(ss,"straightClearanceRange");function Nn(t,e,n,o,s){const r=ss(t,e,n,o,s);if(!r)return;const a=s?t.y:t.x,l=Math.min(r.hi,Math.max(r.lo,a));if(!(Math.abs(l-a)({...l}));for(let l=e;l>=0&&l=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(Bn,"leavesOutward");function kn(t,e,n){if(t.length<3)return t;if(n){const r=Pn(t[0],t[1],e);return r&&Bn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Pn(t[o-1],t[o],e);return s&&Bn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(kn,"collapseOwnBorderStub");function cs(t,e,n){let o=t;if(e){const r=Je(o,0,1);if(r){const a=An(r,o[0],e);a!==o[0]&&(o=[a,...o.slice(1)])}o=kn(o,e,!0)}if(n){const r=o.length-1,a=Je(o,r,-1);if(a){const l=An(a,o[r],n,!0);l!==o[r]&&(o=[...o.slice(0,r),l])}o=kn(o,n,!1)}const s=fo(o,e,n);return s!==o||o.length===2?s:(e&&(o=On(o,e,!0)),n&&(o=On(o,n,!1)),o)}d(cs,"snapAndCollapseEndpoints");function Fn(t,e){for(const n of t){const o=lo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=cs(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const a=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=a}}d(Fn,"prepareEdgeEndpointsForRenderer");function uo(t){return new Map(t.map(e=>[e.id,e]))}d(uo,"buildNodeMap");function as(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(as,"resolveTopLevelGroupId");function _n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(_n,"groupDepth");function ho(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const a=r.x,l=r.y;if(typeof a!="number"||typeof l!="number")continue;const f=r.width??0,i=r.height??0;e=Math.min(e,a-f/2),n=Math.max(n,a+f/2),o=Math.min(o,l-i/2),s=Math.max(s,l+i/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(ho,"boundsForChildren");function ls(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ls,"applyGroupBounds");function fs(t){const e=uo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>_n(s,e)-_n(o,e));for(const o of n){const s=t.filter(a=>a.parentId===o.id),r=ho(s);r&&ls(o,r)}}d(fs,"recomputeNestedGroupBounds");function tn(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(f=>!f.isGroup);let r=1/0,a=-1/0;for(const f of s){const i=f[e];typeof i=="number"&&(r=Math.min(r,i),a=Math.max(a,i))}if(!Number.isFinite(r)||!Number.isFinite(a))return!1;const l=d(f=>r+a-f,"mirror");for(const f of n){const i=f[e];typeof i=="number"&&(f[e]=l(i));const g=f.groupTitleRect;g&&(f.groupTitleRect=e==="x"?{...g,left:l(g.right),right:l(g.left)}:{...g,top:l(g.bottom),bottom:l(g.top)})}for(const f of o)for(const i of f.points??[])i[e]=l(i[e]);return!0}d(tn,"mirrorAxis");function ds(t){return(t.nodes??[]).some(n=>!n.isGroup)?tn(t,"y"):!0}d(ds,"applyBtDirectionTransform");function us(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,a=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-a)*C+l,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-a)*C+l,mt=j-r;G.x=dt,G.y=mt}fs(n);const h=n.filter(P=>P.isGroup&&!P.parentId);if(h.length===0)return e==="RL"&&tn(t,"x"),!0;const p=uo(n),c=new Map;for(const P of n){if(P.isGroup)continue;const G=as(P,p);if(!G)continue;const j=c.get(G)??[];j.push(P),c.set(G,j)}let y=0;for(const P of h){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of h){const G=c.get(P.id)??[],j=ho(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),I=T+2*m,w=l+I,O=(M+E)/2-I/2-l,F=O+w/2,H=Math.max(y,l);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PC.cy?v.bottom:v.top,H=C.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:F},T={x:H,y:l.y},m={x:l.x,y:l.y}}else{const F=h.cx>C.cx?v.right:v.left,H=C.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:F,y:H},T={x:l.x,y:H},m={x:l.x,y:l.y}}const I=oe(E,T,se),w=oe(T,m,se);if(I&&w||!I&&wt(E,T,o,[g],1)||!w&&wt(T,m,o,[x],1))continue;const R=!I&&Ke(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!w&&Ke(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){I?y=[T,m]:w?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(hs,"portSwapToLShape");function gs(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values());for(const l of t){if(l.isLayoutOnly)continue;const f=l.points;if(!f||f.length<4)continue;const i=pt(f,.001);if(i.length<4)continue;const g=i.length-1,x=i[g],C=i[g-1],h=i[g-2],p=x.x-C.x,c=x.y-C.y,y=Math.hypot(p,c);if(y>=10||y<.001)continue;const v=C.x-h.x,M=C.y-h.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(C,x,.001),m=At(C,x,.001),I=Tt(h,C,.001),w=At(h,C,.001);if(!(T&&w||m&&I))continue;const R=l.end,k=l.start,O=R?e.get(R):void 0;if(!O)continue;const F=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(w){const W=M<0;G={x:F,y:h.y},j={x:F,y:W?P.bottom:P.top}}else{const W=v>0;G={x:h.x,y:H},j={x:W?P.right:P.left,y:H}}if(wt(G,j,r,R?[R]:[],-2)||wt(G,j,a,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&so(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===l||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=i[g-3],et=[k,R].filter(at=>!!at);if(wt(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...i.slice(0,g-2),G,j];l.points=Pt;const Q=l.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(gs,"collapseShortTerminalStub");var Z=.001,Ft=8,it=Re,xn=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function ps(t,e){const s=d((h,p)=>{const c=h.x??0,y=h.y??0,v=p.x-c,M=p.y-y;let E=(h.width??0)/2,T=(h.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:c+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:c+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((h,p)=>{const c=pt(h.points??[]);if(c.length<2)return;const y=p?h.start:h.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?c[0]:c[c.length-1],T=p?c[1]:c[c.length-2],m=s(v,E);let I=E;if(xn(T,m)&&(I=T),ft(m,I,Z))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,I.y),max:Math.max(m.y,I.y),boundary:m,railEnd:I,rect:M};if(ht(m,I,Z))return{edge:h,edgeId:String(h.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,I.x),max:Math.max(m.x,I.x),boundary:m,railEnd:I,rect:M}},"terminalLaneFor"),a=d((h,p)=>Math.max(0,Math.min(h.max,p.max)-Math.max(h.min,p.min)),"projectedOverlapLength"),l=d((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:h.orientation==="H"?(Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1)&&ft(h.boundary,p.boundary,1):(Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1)&&ht(h.boundary,p.boundary,1),"sameTerminalFace"),f=d((h,p)=>h.nodeId!==p.nodeId||h.orientation!==p.orientation?!1:a(h,p)>=Ft&&Math.abs(h.coord-p.coord)<.5,"exactTerminalLaneConflict"),i=d((h,p)=>{if(h.nodeId!==p.nodeId||h.orientation!==p.orientation||h.orientation!=="H"||h.atStart===p.atStart)return!1;const c=a(h,p);if(c2*y?!1:l(h,p)&&Math.abs(h.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((h,p)=>{const c=pt(h.edge.points??[]);if(c.length<2)return;const y=h.orientation==="V"?{x:h.boundary.x+p,y:h.boundary.y}:{x:h.boundary.x,y:h.boundary.y+p},v=h.orientation==="V"?{x:h.railEnd.x+p,y:h.railEnd.y}:{x:h.railEnd.x,y:h.railEnd.y+p};if(!d(()=>Math.abs(h.boundary.y-h.rect.top)<1||Math.abs(h.boundary.y-h.rect.bottom)<1?ht(y,h.boundary,Z)&&y.x>=h.rect.left+1&&y.x<=h.rect.right-1:Math.abs(h.boundary.x-h.rect.left)<1||Math.abs(h.boundary.x-h.rect.right)<1?ft(y,h.boundary,Z)&&y.y>=h.rect.top+1&&y.y<=h.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(h.atStart){const I=c.length>1&&oe(c[1],h.railEnd,Z),w=c.slice(I?2:1),R=w[0];return R&&!xn(R,v)?void 0:[y,v,...w]}const E=c.length>1&&oe(c[c.length-2],h.railEnd,Z),T=c.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!xn(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(h=>{const p=h.edge,c=pt(p.points??[]);if(c.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,I=E.x??0,w=E.y??0,[R,k]=c;return ht(R,k,Z)&&Math.abs(m-w)<1&&Math.abs(T-I)>1||ft(R,k,Z)&&Math.abs(T-I)<1&&Math.abs(m-w)>1},"laneIsStraightCollinearConnector"),C=[-7,7,-14,14,-21,21];for(let h=0;h<8;h++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let c=!1;for(let y=0;y{const R=x(I),k=x(w);return R!==k?Number(R)-Number(k):+!w.atStart-+!I.atStart});for(const I of m){for(const w of C){const R=g(I,w);if(!R)continue;const k=r({...I.edge,points:R},I.atStart);if(!(!k||p.some(O=>O.edge!==I.edge&&(f(k,O)||T&&i(k,O))))){I.edge.points=R,c=!0;break}}if(c)break}}if(!c)return}}d(ps,"separateSharedRenderedTerminalLanes");function ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((l,f)=>{const i=l.start,g=l.end,x=it(f);if(x.length!==f.length-1)return!1;const C=[i,g].filter(h=>!!h);for(const h of x)if(wt(h.a,h.b,o,C,-2)||wt(h.a,h.b,s,[],-2))return!1;for(const h of t){if(h===l||h.isLayoutOnly)continue;const p=h.points;if(!(!p||p.length<2)){for(const c of x)for(const y of it(pt(p)))if(ce(c,y,.5)>=Ft||le(c.a,c.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),a=d((l,f)=>{if(f+4>=l.length)return;const i=l[f],g=l[f+1],x=l[f+2],C=l[f+3],h=l[f+4],p=Tt(i,g)&&At(g,x)&&Tt(x,C)&&At(C,h)&&ft(i,C,Z)&&ft(i,h,Z)&&ft(g,x,Z)&&(g.x-i.x)*(C.x-x.x)<0,c=At(i,g)&&Tt(g,x)&&At(x,C)&&Tt(C,h)&&ht(i,C,Z)&&ht(i,h,Z)&&ht(g,x,Z)&&(g.y-i.y)*(C.y-x.y)<0;if(p||c)return pt([...l.slice(0,f+1),h,...l.slice(f+5)]);if(f+5>=l.length)return;const y=l[f+5],v=At(i,g)&&Tt(g,x)&&At(x,C)&&Tt(C,h)&&At(h,y)&&ft(i,h,Z)&&ft(i,y,Z)&&ft(x,C,Z)&&(x.x-g.x)*(h.x-C.x)<0,M=Tt(i,g)&&At(g,x)&&Tt(x,C)&&At(C,h)&&Tt(h,y)&&ht(i,h,Z)&&ht(i,y,Z)&&ht(x,C,Z)&&(x.y-g.y)*(h.y-C.y)<0;if(!(!v&&!M))return pt([...l.slice(0,f+1),y,...l.slice(f+6)])},"withoutDogleg");for(let l=0;l<8;l++){let f=!1;for(const i of t){if(i.isLayoutOnly)continue;const g=pt(i.points??[]);for(let x=0;x<=g.length-5;x++){const C=a(g,x);if(!(!C||!r(i,C))){i.points=C,f=!0;break}}if(f)break}if(!f)return}}d(ms,"collapseRedundantRectangularDoglegs");function Dn(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values()),l=t.filter(p=>!p.isLayoutOnly),f=d((p,c,y)=>pt(p===c?y??[]:p.points??[]),"pointsFor"),i=d((p,c)=>{let y=0;for(let v=0;v{const c=it(p);if(c.length!==3)return;const y=c[1];if(!(c[0].horizontal===y.horizontal||c[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return c.horizontal?zt(c.a.x,c.b.x,M.left,M.right)>=Ft&&c.a.y>=M.top-2&&c.a.y<=M.bottom+2:zt(c.a.y,c.b.y,M.top,M.bottom)>=Ft&&c.a.x>=M.left-2&&c.a.x<=M.right+2})},"blockingRectsFor"),C=d((p,c,y)=>{const v=p.map(E=>({...E}));if(c.horizontal)v[c.index].y=y,v[c.index+1].y=y;else if(c.vertical)v[c.index].x=y,v[c.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),h=d((p,c,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(c);if(M.length!==c.length-1)return!1;for(const E of M)if(wt(E.a,E.b,r,v,-2)||wt(E.a,E.b,a,[],-2))return!1;for(const E of l)if(E!==p){for(const T of M)for(const m of it(f(E)))if(ce(T,m,.5)>=Ft)return!1}return i(p,c)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const c=i();let y=!1;for(const v of l){const M=f(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(I=>I.rect.top))-20,Math.max(...T.map(I=>I.rect.bottom))+20]:[Math.min(...T.map(I=>I.rect.left))-20,Math.max(...T.map(I=>I.rect.right))+20];for(const I of m){const w=C(M,E.segment,I);if(!(!w||!h(v,w,c))){v.points=w,y=!0;break}}if(y)break}if(!y)return}}d(Dn,"liftObstacleHuggingSameSideRails");function Hn(t,e){const o=d(f=>{const i=f.groupTitleRect;if(!(!i||typeof i.left!="number"||typeof i.right!="number"||typeof i.top!="number"||typeof i.bottom!="number"||!Number.isFinite(i.left)||!Number.isFinite(i.right)||!Number.isFinite(i.top)||!Number.isFinite(i.bottom)||i.right<=i.left||i.bottom<=i.top))return{left:i.left,right:i.right,top:i.top,bottom:i.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId)return;const i=f.direction,g=typeof i=="string"?i.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(f),C=f.y,h=f.height;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(c<=0||p{if(!f.horizontal)return!1;const g=f.a.y;return g<=i.top+Z||g>=i.bottom-Z?!1:zt(f.a.x,f.b.x,i.left,i.right)>=Ft},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let l=0;for(const f of t){if(f.isLayoutOnly)continue;const i=pt(f.points??[]);for(const g of it(i))for(const x of a)r(g,x.rect)&&(l=Math.max(l,x.rect.bottom-g.a.y+4))}if(!(l<=Z))for(const f of a){const i=f.node.y,g=f.node.height;typeof i!="number"||typeof g!="number"||!Number.isFinite(i)||!Number.isFinite(g)||g<=0||(f.node.y=i-l/2,f.node.height=g+l,f.node.groupTitleRect={...f.rect,top:f.rect.top-l,bottom:f.rect.bottom-l})}}d(Hn,"liftTopLaneTitleBandsAboveRails");function Xn(t,e){const o=d(i=>{const g=i.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(i=>{if(!i.isGroup||i.parentId||i.direction!=="LR")return;const x=o(i),C=i.x,h=i.width;if(!x||typeof C!="number"||typeof h!="number"||!Number.isFinite(C)||!Number.isFinite(h)||h<=0)return;const p=x.right-x.left,c=x.bottom-x.top;if(!(p<=0||c{if(!i.vertical)return!1;const x=i.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(i.a.y,i.b.y,g.top,g.bottom)>=Ft},"verticalSegmentIntersectsTitle"),a=d((i,g)=>{if(!i.horizontal)return!1;const x=i.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(i.a.x,i.b.x,g.left,g.right)>=Ft},"horizontalSegmentIntersectsTitle"),l=[...e.values()].map(s).filter(i=>!!i);if(l.length===0)return;let f=0;for(const i of t){if(i.isLayoutOnly)continue;const g=pt(i.points??[]);for(const x of it(g))for(const C of l)if(r(x,C.rect))f=Math.max(f,C.rect.right-x.a.x+4);else if(a(x,C.rect)){const h=Math.min(x.a.x,x.b.x);f=Math.max(f,C.rect.right-h+4)}}if(!(f<=Z))for(const i of l){const g=i.node.x,x=i.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(i.node.x=g-f/2,i.node.width=x+f,i.node.groupTitleRect={...i.rect,left:i.rect.left-f,right:i.rect.right-f})}}d(Xn,"shiftLeftLaneTitleBandsLeftOfRails");function ys(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,c=new Map)=>pt(c.get(p)??p.points??[]),"replacementPointsFor"),a=d((p=new Map)=>{let c=0;for(let y=0;ys.reduce((c,y)=>c+Qt(r(y,p)),0),"totalBends"),f=d(p=>{const c=r(p);if(c.length<4)return;const y=c[c.length-2],v=c[c.length-1];if(!(!Tt(y,v,Z)&&!At(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),i=d((p,c)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:c.tailStart.y};else if(At(v,M,Z))E={x:c.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,c.tailStart,c.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,c)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(c))if(wt(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,c,y)=>{for(const v of s)if(v!==p){for(const M of it(c))for(const E of it(r(v,y)))if(ce(M,E,.5)>=Ft)return!0}return!1},"pathHasSharedTrack"),C=d((p,c,y)=>!g(p,c)&&!x(p,c,y),"candidateIsSafe"),h=d(()=>{const p=new Map;for(const c of s){const y=c.end;if(!y||!e.has(y)||r(c).length<4)continue;const M=p.get(y)??[];M.push(c),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const c=a();if(c===0)return;const y=l();let v,M=c,E=y;for(const T of h().values())for(let m=0;m=c||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(ys,"swapDestinationTerminalTailsToReduceCrossings");function xs(t,e){const{realNodeRects:r,labelNodeRects:a}=me(e.values()),l=t.filter(T=>!T.isLayoutOnly),f=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),i=d((T=new Map)=>{let m=0;for(let I=0;Il.reduce((m,I)=>m+Qt(f(I,T)),0),"totalBends"),x=d(T=>{const m=T.start,I=T.end,w=m?e.get(m):void 0,R=I?e.get(I):void 0,k=w?qt(w):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),C=d((T,m,I)=>{if(I.index<=0||I.index+1>=m.length-1)return;const w=x(T);if(w){if(I.vertical){const R=I.a.x,k=Math.min(w.src.left,w.dst.left),O=Math.max(w.src.right,w.dst.right),F=RO+Z?"right":void 0;return F?{edge:T,points:m,segmentIndex:I.index,axis:"vertical",side:F,coord:R,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const R=I.a.y,k=Math.min(w.src.top,w.dst.top),O=Math.max(w.src.bottom,w.dst.bottom),F=RO+Z?"bottom":void 0;return F?{edge:T,points:m,segmentIndex:I.index,axis:"horizontal",side:F,coord:R,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),h=d(()=>{const T=[];for(const m of l){const I=f(m);for(const w of it(I)){const R=C(m,I,w);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=Ft,"railsInteract"),c=d(T=>{const m=[],I=new Set;for(const w of T){if(I.has(w))continue;const R=[w],k=[];for(I.add(w);R.length>0;){const O=R.pop();k.push(O);for(const F of T)!I.has(F)&&p(O,F)&&(I.add(F),R.push(F))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const I of T)m.some(w=>Math.abs(w-I.coord){const m=T.map(R=>R.coord),I=y(T),w=[];if(T.length<=6){const R=new Array(I.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((F,H)=>Math.abs(F-m[H])>=Z)&&w.push([...k]);return}for(const[F,H]of I.entries())R[F]||(R[F]=!0,k.push(H),O(),k.pop(),R[F]=!1)},"visit");return O(),w}for(let R=0;R{const I=new Map;for(const[R,k]of T.entries()){const O=m[R],F=I.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(F[k.segmentIndex].x=O,F[k.segmentIndex+1].x=O):(F[k.segmentIndex].y=O,F[k.segmentIndex+1].y=O),I.set(k.edge,F)}const w=new Map;for(const[R,k]of I){const O=ae(pt(k));if(it(O).length!==O.length-1)return;w.set(R,O)}return w},"replacementsForAssignment"),E=d(T=>{for(const[m,I]of T){const w=[m.start,m.end].filter(R=>!!R);for(const R of it(I))if(wt(R.a,R.b,r,w,-2)||wt(R.a,R.b,a,[],-2))return!1}for(let m=0;m=Ft)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=i();if(m===0)return;let I,w=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of c(h()))for(const F of v(O)){const H=M(O,F);if(!H||!E(H))continue;const P=i(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(F[mt]-dt.coord),0);P>w||P===w&&(G>R||G===R&&j>=k)||(I=H,w=P,R=G,k=j)}if(!I)return;for(const[O,F]of I)O.points=F}}d(xs,"reassignCrossingExternalRailChannels");function bs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(h=>!h.isLayoutOnly),a=d((h,p,c)=>pt(h===p?c??[]:h.points??[]),"pointsFor"),l=d(h=>it(h).reduce((p,c)=>{const y=c.a.x-c.b.x,v=c.a.y-c.b.y;return p+Math.hypot(y,v)},0),"pathLength"),f=d((h,p)=>{let c=0;for(let y=0;y{if(h.horizontal){const c=h.a.y;return(Math.abs(c-p.top)<1||Math.abs(c-p.bottom)<1)&&zt(h.a.x,h.b.x,p.left,p.right)>=Ft}if(h.vertical){const c=h.a.x;return(Math.abs(c-p.left)<1||Math.abs(c-p.right)<1)&&zt(h.a.y,h.b.y,p.top,p.bottom)>=Ft}return!1},"segmentRunsAlongRectBorder"),g=d(h=>{const p=[h.start,h.end].filter(y=>!!y),c=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&c.push(M)}return c},"endpointRectsFor"),x=d((h,p)=>{if(p+3>=h.length)return[];const c=h[p],y=h[p+1],v=h[p+2],M=h[p+3],E=Tt(c,y,Z)&&At(y,v,Z)&&Tt(v,M,Z),T=At(c,y,Z)&&Tt(y,v,Z)&&At(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-c.x)!==Math.sign(M.x-v.x):Math.sign(y.y-c.y)!==Math.sign(M.y-v.y)))return[];const I=ft(c,M,Z)||ht(c,M,Z)?[]:[{x:c.x,y:M.y},{x:M.x,y:c.y}],w=I.length===0?[[...h.slice(0,p+1),...h.slice(p+3)]]:I.map(k=>[...h.slice(0,p+1),k,...h.slice(p+3)]),R=new Set;return w.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(F=>oe(F,M,Z)))return!1;const O=k.map(F=>`${F.x.toFixed(3)},${F.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),C=d((h,p,c)=>{const y=[h.start,h.end].filter(M=>!!M),v=g(h);for(const M of it(p))if(wt(M.a,M.b,o,y,-2)||wt(M.a,M.b,s,[],-2)||v.some(E=>i(M,E)))return!1;for(const M of r)if(M!==h){for(const E of it(p))for(const T of it(a(M)))if(ce(E,T,.5)>=Ft)return!1}return f(h,p)<=c},"candidateIsSafe");for(let h=0;h<8;h++){const p=f();let c,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=a(T),I=Qt(m,Z),w=l(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),F=l(k);if(!(Ov||P===v&&(O>M||O===M&&F>=E)||(c=T,y=k,v=P,M=O,E=F)}}if(!c||!y)return;c.points=y}}d(bs,"shortcutRedundantOrthogonalJogs");function Ms(t,e){const a=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const _=N.x??0,D=N.y??0,V=qt(N);V&&a.push({id:String(N.id??""),cx:_,cy:D,rect:V})}if(a.length===0)return;const l=new Map(a.map(N=>[N.id,N])),f=a.map(N=>({id:N.id,rect:N.rect})),i=["top","bottom","left","right"],g={top:Math.min(...a.map(N=>N.rect.top))-20,bottom:Math.max(...a.map(N=>N.rect.bottom))+20,left:Math.min(...a.map(N=>N.rect.left))-20,right:Math.max(...a.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),C=new Map(x.map((N,_)=>[N,_])),h=d(N=>{const _=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+_*20*V);return D},"outwardTracksForSide"),p=d((N,_=new Map)=>pt(_.get(N)??N.points??[]),"replacementPointsFor"),c=d((N,_)=>{let D=0;for(const V of N)for(const u of _)le(V.a,V.b,u.a,u.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,_)=>c(it(N),it(_)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let _=0;const D=[],V=new Set,u=[],b=d(S=>{V.has(S)||(V.add(S),u.push(S))},"addEdge");for(let S=0;S0&&(_+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return u.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),{count:_,pairs:D,edgeSet:V,edges:u}},"crossingSnapshot"),M=d((N,_)=>{const D=new Set(_.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let u=0;for(let b=0;b{const _=new Map;for(const u of N.pairs){const b=_.get(u.first)??new Set;b.add(u.second),_.set(u.first,b);const S=_.get(u.second)??new Set;S.add(u.first),_.set(u.second,S)}const D=[],V=new Set;for(const u of N.edges){if(V.has(u))continue;const b=[u],S=[];for(V.add(u);b.length>0;){const L=b.pop();S.push(L);for(const A of _.get(L)??[])V.has(A)||(V.add(A),b.push(A))}S.sort((L,A)=>(C.get(L)??0)-(C.get(A)??0)),S.length>1&&D.push(S)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(_=>!!_),"endpointIdsFor"),m=d(N=>{const _=[];for(const D of E(N)){const V=new Set(D),u=new Set(D.flatMap(S=>T(S))),b=[...D];for(const S of x)V.has(S)||T(S).some(L=>u.has(L))&&b.push(S);b.sort((S,L)=>(C.get(S)??0)-(C.get(L)??0)),_.push(b)}return _},"pairSearchGroups"),I=d((N,_,D)=>M(N,new Map([[_,D]])),"crossingCountWithSingleReplacement"),w=d(N=>{const _=new Map;for(const D of N.pairs)_.set(D.first,(_.get(D.first)??0)+D.count),_.set(D.second,(_.get(D.second)??0)+D.count);return _},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((_,D,V)=>{const u=N[V];return _+Math.abs(D.x-u.x)+Math.abs(D.y-u.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((_,D)=>_+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((_,D)=>_+R(p(D,N)),0),"totalLength"),F=d((N,_,D=new Map)=>{const V=it(_);for(const u of x)if(u!==N){for(const b of V)for(const S of it(p(u,D)))if(ce(b,S,.5)>=Ft)return!0}return!1},"pathHasSegmentConflict"),H=d((N,_)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(_))if(wt(V.a,V.b,f,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,_)=>{const D=ae(pt(_));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,_,D)=>{switch(_){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,_,D,V)=>{const u=D==="left"||D==="top"?-1:1,b=[j(_,D,V),g[D]];for(const S of b)for(let L=0;L<=2;L++)P(N,io(_,D,V,S+u*20*L))},"addSameSideCandidates"),dt=d((N,_,D,V,u)=>{for(const b of h(D))for(const S of h(u))P(N,[_,{x:b,y:_.y},{x:b,y:S},{x:V.x,y:S},V])},"addHorizontalToVerticalCandidates"),mt=d((N,_,D,V,u)=>{for(const b of h(D))for(const S of h(u))P(N,[_,{x:_.x,y:b},{x:S,y:b},{x:S,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,_,D,V,u)=>{const b=[...h("top"),...h("bottom")];for(const S of h(D))for(const L of h(u))for(const A of b)P(N,[_,{x:S,y:_.y},{x:S,y:A},{x:L,y:A},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,_,D,V,u)=>{const b=[...h("left"),...h("right")];for(const S of h(D))for(const L of h(u))for(const A of b)P(N,[_,{x:_.x,y:S},{x:A,y:S},{x:A,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const _=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(u=>`${u.x.toFixed(3)},${u.y.toFixed(3)}`).join("|");return _.has(V)||D.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,_,D,V)=>{const u=[],b=ro(N,_,D,V,20,Z);b&&P(u,b),_===V&&J(u,N,_,D);const S=G(_),L=G(V);return S&&!L?dt(u,N,_,D,V):!S&&L?mt(u,N,_,D,V):S?kt(u,N,_,D,V):Pt(u,N,_,D,V),Q(u)},"buildCandidatesForSides"),et=d((N,_,D,V)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Ie(V,S),A=S==="top"||S==="bottom"?h(S):b;for(const B of u){P(N,[_,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of A)P(N,[_,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,_,D,V)=>{const u=[...h("left"),...h("right")],b=[...h("top"),...h("bottom")];for(const S of i){const L=Ie(V,S),A=S==="left"||S==="right"?h(S):u;for(const B of b){P(N,[_,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of A)P(N,[_,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const _=N.start,D=N.end,V=D?l.get(D):void 0;if(!_||!V)return[];const u=pt(N.points??[]);if(u.length<4)return[];const b=u[0],S=u[1],L=[];return At(b,S,Z)?et(L,b,S,V):Tt(b,S,Z)&&at(L,b,S,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const _=N.start,D=N.end,V=_?l.get(_):void 0,u=D?l.get(D):void 0;if(!V||!u)return[];const b=[];for(const S of i){const L=Ie(V,S);for(const A of i)b.push(...W(L,S,Ie(u,A),A))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,_,D)=>{const V=new Set;for(const u of x){if(u===N)continue;const b=D.get(u)??it(p(u));_.some(S=>b.some(L=>ce(S,L,.5)>=Ft))&&V.add(u)}return V},"sharedTrackConflictsFor"),jt=d((N,_,D,V)=>{const u=new Set;return xt(N).map(S=>ae(pt(S))).filter(S=>{if(H(N,S))return!1;const L=S.map(A=>`${A.x.toFixed(3)},${A.y.toFixed(3)}`).join("|");return u.has(L)||S.length<2?!1:(u.add(L),!0)}).map(S=>{const L=it(S);let A=0;for(const B of x)B!==N&&(A+=c(L,D.get(B)??it(p(B))));return{candidate:S,candidateSegments:L,crossings:_.count-(V.get(N)??0)+A,bends:Qt(S,Z),totalBends:Qt(S),length:R(S)}}).filter(({crossings:S})=>S<=_.count).sort((S,L)=>S.crossings-L.crossings||S.bends-L.bends||S.length-L.length).slice(0,48).map(S=>({path:S.candidate,segments:S.candidateSegments,sharedTrackConflicts:Vt(N,S.candidateSegments,D),totalBends:S.totalBends,length:S.length}))},"pairCandidatesFor"),Ut=d((N,_,D,V,u,b)=>{let S=0;for(const A of N.pairs)(A.first===_||A.second===_||A.first===V||A.second===V)&&(S+=A.count);let L=c(D.segments,u.segments);for(const A of x){if(A===_||A===V)continue;const B=b.get(A)??it(p(A));L+=c(D.segments,B)+c(u.segments,B)}return N.count-S+L},"pairCrossingCount"),te=d((N,_)=>{for(const D of N.sharedTrackConflicts)if(D!==_)return!1;return!0},"conflictsOnlyWith"),Se=d((N,_)=>N.segments.some(D=>_.segments.some(V=>ce(D,V,.5)>=Ft)),"candidatesShareTrack"),de=d((N,_,D,V)=>te(_,D.edge)&&te(V,N.edge)&&!Se(_,V),"pairCandidatesAreCompatible"),Ce=d((N,_,D,V,u)=>{const b=Ut(N.current,_.edge,D,V.edge,u,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[_.edge,D.path],[V.edge,u.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(_.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+u.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(_.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+u.length}},"scorePairReplacement"),an=d((N,_)=>N.crossings<_.crossings||N.crossings===_.crossings&&(N.bends<_.bends||N.bends===_.bends&&N.length<_.length),"pairScoreIsBetter"),ln=d((N,_,D,V)=>{let u=V;for(const b of _.candidates)for(const S of D.candidates){if(!de(_,b,D,S))continue;const L=Ce(N,_,b,D,S);L&&an(L,u)&&(u=L)}return u},"bestScoreForOptionPair"),fn=d(N=>{const _=k(),D=O(),V=vt(),u=w(N),b=new Map(x.map(q=>[q,Qt(p(q))])),S=new Map(x.map(q=>[q,R(p(q))])),L=new Map,A=m(N);for(const q of A)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,u);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:_,length:D};const U={current:N,currentBends:_,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:S,baseSegments:V};for(const q of A){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const _=v(),D=_.count;if(D===0)return;let V,u,b=D,S=Number.POSITIVE_INFINITY;for(const A of _.edges){const B=Qt(p(A),Z);for(const U of xt(A)){const q=H(A,U),z=!q&&F(A,U),Y=I(_,A,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=S||(V=A,u=U,b=Y,S=ot)}}if(V&&u){V.points=u;continue}const L=fn(_);if(!L)return;for(const[A,B]of L)A.points=B}}d(Ms,"resolveRenderedOrthogonalCrossings");var pe=.001,Rr=8;function Is(t,e){const{nodeInfoById:n,realNodeRects:o}=sn(e),s=["top","bottom","left","right"],r=20,a={top:Math.min(...o.map(c=>c.rect.top))-r,bottom:Math.max(...o.map(c=>c.rect.bottom))+r,left:Math.min(...o.map(c=>c.rect.left))-r,right:Math.max(...o.map(c=>c.rect.right))+r},l=d((c,y,v,M)=>{const E=[],T=ro(c,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(io(c,y,v,a[y])),E},"buildOrthogonalPathCandidates"),f=d((c,y)=>{for(let v=0;v{let M=0;const E=Re(c,pe),T=y.start,m=y.end;for(const I of t){if(I===y||I.isLayoutOnly)continue;const w=I.start,R=I.end;if(!v&&T&&m&&(w===T||w===m||R===T||R===m))continue;const k=I.points;if(!(!k||k.length<2))for(const O of E)for(const F of Re(k,pe)){if(ao(O.a,O.b,F.a,F.b,pe,pe)){M++;continue}ce(O,F,pe)>=Rr&&M++}}return M},"pathConflictCount"),g=4,x=d((c,y)=>{const v=Math.abs(c.y-y.rect.top),M=Math.abs(c.y-y.rect.bottom),E=Math.abs(c.x-y.rect.left),T=Math.abs(c.x-y.rect.right);let m="top",I=v;return M{const M=C.get(c)??[];M.push({side:y,edgeId:v}),C.set(c,M)},"addFaceClaim");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points??[];if(y.length<1)continue;const v=c.id??"",M=c.start,E=c.end;if(M){const T=n.get(M);T&&h(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&h(E,x(y[y.length-1],T),v)}}const p=d((c,y,v)=>C.get(c)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const c of t){if(c.isLayoutOnly)continue;const y=c.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=i(J,c,!0);if(mt>O||mt===O&&dt>=F)continue;O=mt,F=dt,k=J;continue}i(J,c)>R||dtG.edgeId!==I));const P=C.get(E);P&&C.set(E,P.filter(G=>G.edgeId!==I)),h(M,x(k[0],T),I),h(E,x(k[k.length-1],m),I)}}}d(Is,"simplifyDetouredEdges");var Kt=.001,No=10,$e=7;function Yn(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const a=r.x-s.x,l=r.y-s.y;if(!(Math.abs(a)+Math.abs(l)r&&We(t,Ss(r)))}d(Gn,"labelOverlapsOwnMarker");function Ve(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const c=p.points;if(!(!c||c.length<2))for(let y=0;y{const y=Ln(c,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&We(y,M))return!0;return!1},"labelOverlapsForeignNode"),i=d((p,c)=>{const y=Ln(c,r);for(const v of n)if(v.edgeId!==p&&on(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,c,y)=>f(p,y)||i(c,y),"labelOverlapsAnything"),x=[],C=d(p=>{for(const{id:c,rect:y}of s)if(qo(y,p))return c},"findContainingLane"),h=d((p,c)=>x.some(y=>y.labelId!==p&&We(c,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const c=p.labelNodeId;if(!c)continue;const y=e.get(c);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,w=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===w,gt=et.orientation===w;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],F=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=we(Q.midX,Q.midY,M,E),et=C(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+a,xt=at.rect.right-M/2-a,vt=at.rect.top+E/2+a,Vt=at.rect.bottom-E/2-a;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=we(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+l;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of F){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!Gn(xt.rect,v)&&!h(c,xt.rect)&&!g(c,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!Gn(vt.rect,v)&&!h(c,vt.rect)&&!f(c,vt.rect)&&(et||!i(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(I)??(I.lengthet.labelId===c);W>=0?x[W]={labelId:c,rect:Q}:x.push({labelId:c,rect:Q})}}}d(Ve,"anchorLabelsToPolyline");var bn=1e-6,Nr=8,Oo=Nr/2,Or=3;function $n(t,e){return t{const g=$n(l,f);let x=0;const C=d(h=>{if(!h)return;const p=s.get(h);if(!p)return;const c=i==="x"?p.w/2:p.h/2;c>x&&(x=c)},"consider");C(a.labelNodeId);for(const h of t){if(h===a||h.isLayoutOnly)continue;const p=h.start,c=h.end;!p||!c||$n(p,c)===g&&C(h.labelNodeId)}return x>0?x+Or:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const l=a.points;if(!oo(l,bn))continue;const f=co(a,n,bn);if(!f)continue;const{srcId:i,dstId:g,srcInfo:x,dstInfo:C,collinearX:h,collinearY:p}=f;if(h===p)continue;let c,y;if(h){const m=C.cy>x.cy;c={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:C.cx,y:m?C.rect.top:C.rect.bottom}}else{const m=C.cx>x.cx;c={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?C.rect.left:C.rect.right,y:C.cy}}if(wt(c,y,o,[i,g],1))continue;const M=r(a,i,g,h?"x":"y"),E=M>Oo?M:Oo,T=[0,E,-E];for(const m of T){const I={...c},w={...y};if(h){if(I.x+=m,w.x+=m,I.x<=x.rect.left||I.x>=x.rect.right||w.x<=C.rect.left||w.x>=C.rect.right)continue}else if(I.y+=m,w.y+=m,I.y<=x.rect.top||I.y>=x.rect.bottom||w.y<=C.rect.top||w.y>=C.rect.bottom)continue;if(!wt(I,w,o,[i,g],1)&&!Ke(I,w,t,a,{epsilon:bn})){a.points=[I,w];break}}}}d(Cs,"straightenCollinearSiblingDetours");function zn(t,e){const{realNodeRects:f,labelNodeRects:i}=me(e.values()),g=d((m,I)=>Re(I,.001).map(w=>({...w,edge:m,interior:w.index>=1&&w.index<=I.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const I of t){if(I.isLayoutOnly)continue;const w=I.points;!w||w.length<2||m.push(...g(I,pt(w)))}return m},"allSegments"),C=d((m,I)=>m.horizontal&&I.horizontal?zt(m.a.x,m.b.x,I.a.x,I.b.x)>=8&&Math.abs(m.a.y-I.a.y)<7:m.vertical&&I.vertical?zt(m.a.y,m.b.y,I.a.y,I.b.y)>=8&&Math.abs(m.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),h=d((m,I)=>{const w=m.start,R=m.end,k=g(m,I);if(k.length!==I.length-1)return!1;const O=[w,R].filter(H=>!!H),F=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(wt(H.a,H.b,f,O,-2)||wt(H.a,H.b,i,F,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(C(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,I)=>{const w=pt(m.edge.points??[]);if(w.length<4||m.index>=w.length-1)return;const R=w.map(k=>({...k}));if(m.horizontal)R[m.index].y+=I,R[m.index+1].y+=I;else if(m.vertical)R[m.index].x+=I,R[m.index+1].x+=I;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),c=d((m,I)=>({x:m.x??(I.left+I.right)/2,y:m.y??(I.top+I.bottom)/2}),"nodeCenter"),y=d(m=>{const I=m.edge,w=pt(I.points??[]);if(w.length!==4||m.index!==1)return;const R=I.start?e.get(I.start):void 0,k=I.end?e.get(I.end):void 0,O=R?qt(R):void 0,F=k?qt(k):void 0,H=w.slice(m.index+2);if(!(!R||!k||!O||!F||H.length===0))return{sourceCenter:c(R,O),targetCenter:c(k,F),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,I,w,R,k,O)=>{const F=R.y>=w.y,H=F?k.bottom:k.top,P=H+(F?20:-20);if(F&&m.b.y<=P+.001||!F&&m.b.y>=P-.001)return;const G=m.a.x+I;return pt([{x:w.x,y:H},{x:w.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,I,w,R,k,O)=>{const F=R.x>=w.x,H=F?k.right:k.left,P=H+(F?20:-20);if(F&&m.b.x<=P+.001||!F&&m.b.x>=P-.001)return;const G=m.a.y+I;return pt([{x:H,y:w.y},{x:P,y:w.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,I)=>{const w=y(m);if(w){if(m.vertical)return v(m,I,w.sourceCenter,w.targetCenter,w.sourceRect,w.tail);if(m.horizontal)return M(m,I,w.sourceCenter,w.targetCenter,w.sourceRect,w.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const I=x();let w=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&h(P.edge,j)){P.edge.points=j,w=!0;break}const J=E(P,G);if(J&&h(P.edge,J)){P.edge.points=J,w=!0;break}}if(w)break}}if(!w)return}}d(zn,"nudgeSharedInteriorSubpaths");function vs(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,l=o.y-n.y,f=s*l-r*a;if(Math.abs(f)<1e-10)return!1;const i=n.x-t.x,g=n.y-t.y,x=(i*l-g*a)/f,C=(i*r-g*s)/f,h=.01;return x>h&&x<1-h&&C>h&&C<1-h}d(vs,"segmentsIntersect");function Ls(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=Jo(e),r=[];for(const l of n){if(l.isLayoutOnly)continue;const f=l.points;if(!f||f.length<2)continue;const i=l.start,g=l.end,x=l.labelNodeId,C=l.id??`${i}->${g}`;for(const h of s)if(!(h.nodeId===i||h.nodeId===g)&&!(x&&h.nodeId===x)){for(let p=0;p0){const l=o.filter(i=>i.type==="edge-node-overlap").length,f=o.filter(i=>i.type==="edge-edge-crossing").length;In.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${l} edge-node overlap(s), ${f} edge crossing(s)`);for(const i of o)In.warn(`[SWIMLANE_VALIDATE] ${i.type}: ${i.detail}`)}return o}d(Ls,"validateSwimlanesLayout");function Es(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(l=>!l.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!us(t,e)||e==="BT"&&s.length>0&&!ds(t))return;for(const l of o){if(l.isLayoutOnly)continue;const f=l.points;!f||f.length<2||(l.points=ae(qe(f)))}Is(o,n),Cs(o,n),hs(o,n);const r=new Map;for(const l of n)r.set(String(l.id),l);Ve(o,r),ns(o,r),gs(o,r),zn(o,r),ps(o,r),ms(o,r),Dn(o,r),ys(o,r);const a=d(()=>{Ms(o,r),xs(o,r),bs(o,r),Ve(o,r),Fn(o,r),Dn(o,r),Ve(o,r),Fn(o,r)},"finalizeRenderedEdges");a(),zn(o,r),a(),Hn(o,r),Xn(o,r),Hn(o,r),Xn(o,r)}d(Es,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const a=`${r.id}:${r.src}->${r.dst}`;n.has(a)||(n.add(a),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function go(t,e){return t.edges.filter(n=>n.dst===e)}d(go,"incoming");function Ts(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ts,"buildSuccessorMap");function po(t){const e=Ts(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(po,"buildSortedSuccessorMap");function mo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(mo,"buildInDegreeMap");function yo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(yo,"sortedZeroInDegreeNodes");function rn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(rn,"buildPredecessorSuccessorMaps");function xo(t,e,n,o){let s=0;for(const a of t.nodes)o?.skipGroups&&t.nodeById.get(a)?.isGroup||(s=Math.max(s,n[a]??0));const r=Array.from({length:s+1},()=>[]);for(const a of e)o?.skipGroups&&t.nodeById.get(a)?.isGroup||r[Math.max(0,n[a]??0)].push(a);return r}d(xo,"buildLayersFromRanks");function Pe(t){const e=mo(t),n=yo(e),o=[],s=po(t);for(;n.length;){const r=n.shift();o.push(r);for(const a of s.get(r)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let l=0;for(;l{if(s-o<=1)return 0;const r=o+s>>1;let a=n(o,r)+n(r,s),l=o,f=r,i=o;for(;l=s||lx.dst===C.dst?x.id.localeCompare(C.id):x.dst.localeCompare(C.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const C=x.dst;o[C]===0?r(C):o[C]===1&&s.push(x)}o[g]=2},"dfs"),a=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of a)o[g]===0&&r(g);const l=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),f=e.edges.map(g=>l.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:f,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(As,"removeCycles_DFS");function ws(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const l=n(r)??r;return e.set(o,l),l},"resolve");for(const o of t.nodes)n(o);return e}d(ws,"buildTopLaneMap");function fe(t){const e=ws(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function cn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(cn,"buildTopLaneOrder");function Mo(t,e){const n=cn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const a of e)!o.has(a)||s.has(a)||(s.add(a),r.push(a));for(const a of n)s.has(a)||r.push(a);return r}d(Mo,"resolveTopLaneOrder");var Pr={EPSILON:1e-6},en={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Po={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Rs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=rn(n);for(const m of r.values())m.sort((I,w)=>I.localeCompare(w));const a=Pe(n)??[...n.nodes].sort((m,I)=>m.localeCompare(I)),l=new Map;for(const[m,I]of a.entries())l.set(I,m);const f=new Map,i=new Map;for(const m of n.nodes)i.set(m,[]);for(const m of a){const I=(r.get(m)??[]).filter(w=>f.has(w));if(I.length>0){const w=Ns(m,I,{laneOf:o,rankHint:s,topoIndex:l});f.set(m,w),i.get(w).push(m)}else f.has(m)||f.set(m,null)}for(const m of n.nodes)f.has(m)||f.set(m,null);const g=new Set;for(const m of n.nodes)(f.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,I)=>{const w=l.get(m)??0,R=l.get(I)??0;return w===R?m.localeCompare(I):w-R}),C=Os(n),h=new Map;for(const[m,I]of C.entries())h.set(m,[...I].sort((w,R)=>w.localeCompare(R)));const p=Ps(h),c=Bs(h),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of c)for(const I of m.nodes){const w=y.get(I);w?w.push(m.id):y.set(I,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const I of i.get(m)??[])T(I);M.push(m)}},"walk");for(const m of x)T(m);for(const m of a)T(m);return{parent:f,children:i,roots:x,componentOf:p,blocks:c,nodeBlocks:y,adjacency:h,preorder:v,postorder:M,topologicalOrder:a}}d(Rs,"buildDrivingTree");function Ns(t,e,n){const o=n.laneOf(t);return[...e].sort((r,a)=>{const l=n.laneOf(r),f=n.laneOf(a),i=l!=null&&l===o,g=f!=null&&f===o;if(i!==g)return i?-1:1;const x=n.rankHint?.[r],C=n.rankHint?.[a];if(x!=null&&C!=null&&x!==C)return C-x;const h=n.topoIndex.get(r)??0,p=n.topoIndex.get(a)??0;return h!==p?h-p:r.localeCompare(a)})[0]}d(Ns,"chooseParent");function Os(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Os,"buildAdjacency");function Ps(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const a of t.get(r)??[])e.has(a)||s.push(a)}}n++}return e}d(Ps,"assignComponents");function Bs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const a=d((l,f)=>{e.set(l,++r),n.set(l,r);for(const i of t.get(l)??[])i!==f&&(e.has(i)?(e.get(i)??0)<(e.get(l)??0)&&(o.push([l,i]),n.set(l,Math.min(n.get(l)??r,e.get(i)??r))):(o.push([l,i]),a(i,l),n.set(l,Math.min(n.get(l)??r,n.get(i)??r)),(n.get(i)??0)>=(e.get(l)??0)&&s.push(ks(l,i,o,s.length))))},"visit");for(const l of t.keys())e.has(l)||a(l,null);return s}d(Bs,"computeBlocks");function ks(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const a=n.pop();if(s.push(a),r.add(a[0]),r.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(ks,"popBlock");function Fs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,a=new Array(r).fill(-1),l=new Array(r).fill(0),f=[],i=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(a[T]=-1,l[T]=0,i.has(M)||(i.add(M),f.push(M)))}for(;f.length>0;){const M=f.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(i.has(m))continue;const I=s.get(m);I!=null&&(a[I]=E,l[I]=l[E]+1,i.add(m),f.push(m))}}for(const M of o){if(i.has(M))continue;const E=s.get(M);E!=null&&(a[E]=-1,l[E]=0,i.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;l[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const I=x[m][M],w=x[m][E];I===-1||w===-1||I!==w&&(M=I,E=w)}return x[0][M]},"lcaIndex"),h=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],I=e[T];if(m==null||I==null||(m>I&&([E,T]=[T,E],[m,I]=[I,m]),m==null||I==null||m===I))continue;const w=s.get(E),R=s.get(T);if(w==null||R==null)continue;const k=C(w,R);if(k===-1)continue;const O=h[k];for(let F=m;F{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:h[E],m=T?new Map(T):new Map,I=n.children.get(M)??[];for(const w of I){const R=v(w),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let F=R.get(k)??0;const H=e[w];H!=null&&H>k&&(F+=1),O.set(w,F)}c(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Fs,"computeSubtreeCrossCounts");function _s(t,e,n){const o=new Map,s=d(r=>{let a=n[r]??0;const l=[...e.get(r)??[]];l.sort(Io(n));for(const f of l){s(f);const i=o.get(f);i!=null&&(a=Math.min(a,i))}o.set(r,a)},"annotate");for(const r of t)s(r);return o}d(_s,"annotateMinimumLayers");function Io(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Io,"compareByRankThenId");function Ds(t,e,n,o){let s=0;for(const f of e){const i=n[f]??0;i>s&&(s=i)}const r=Array.from({length:s+1},()=>[]),a=new Set,l=d(f=>{if(a.has(f))return;a.add(f);const i=n[f]??0;r[i]||(r[i]=[]),r[i].push(f);for(const g of o(f))l(g)},"emit");for(const f of t)l(f);for(const f of e)if(!a.has(f)){const i=n[f]??0;r[i]||(r[i]=[]),r[i].push(f),a.add(f)}return r}d(Ds,"emitNodesInTreeOrder");function Hs(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Hs,"deduplicateLayers");function Xs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const a=e[s]??0,l=[],f=[],i=n.get(s);for(const g of r){const x=o.get(g)??a;x>a?l.push({child:g,min:x}):f.push(g)}return l.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),f.sort((g,x)=>{const C=i?.get(g)??0,h=i?.get(x)??0;if(C!==h)return C-h;const p=o.get(g)??a,c=o.get(x)??a;return p!==c?p-c:g.localeCompare(x)}),[...l.map(g=>g.child),...f]}}d(Xs,"createChildOrderer");function nn(t,e,n){const o=Rs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const a=Fs(t,e,o),l=[...r].sort(Io(e)),f=_s(l,s,e),i=Xs(s,e,a,f);let g=Ds(l,t.nodes,e,i);return g=Hs(g),g}d(nn,"buildMultitreeLayerOrder");function Ys(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),a=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&a.push(r.get(l.dst));return bo(a)}d(Ys,"countCrossingsBetweenAdjacent");function Vn(t,e,n){const o=[];for(const r of e){const a=n[r.src],l=n[r.dst];if(a==null||l==null||a===l)continue;let f=r.src,i=r.dst,g=a,x=l;a>l&&(f=r.dst,i=r.src,g=l,x=a);for(let C=g;C(n[C]??0)-(n[x]??0));for(const x of g){const C=n[x]??0;if(C===0)continue;let h=0;for(const v of o.get(x)??[])h=Math.max(h,(n[v]??0)+1);if(h>=C)continue;const p=C;n[x]=h;const c=nn(t,n,s),y=Vn(c,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const a=t.edges.filter(c=>c.src===s);if(a.length===0)continue;let l=!1,f=0;for(const c of a){const y=n(c.dst);y==null||y===r?l=!0:f++}if(f===0||l)continue;let i=0,g=!1;for(const c of t.edges){if(c.dst!==s)continue;const y=n(c.src);y&&(y===r?g=!0:i++)}if(i>0||!g)continue;const x=e[s]??0,C=x+f;let h=0;for(const c of t.edges)c.dst===s&&(h=Math.max(h,(e[c.src]??0)+1));const p=Math.max(x,h,C);p!==x&&(e[s]=p)}}d($s,"adjustCrossLaneSources");function zs(t,e){const n=ye(t),o=Pe(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let a=Object.create(null);for(const f of o){const i=go(n,f),g=e?.ignoreCrossLaneEdges?i.filter(x=>{const C=r(x.src),h=r(f);return!C||!h?!0:C===h}):i;if(g.length===0)a[f]=0;else if(s&&g.length===1){const x=g[0].src,C=r(x),h=r(f);C!==h?a[f]=a[x]??0:a[f]=(a[x]??0)+1}else{let x=-1/0;for(const C of g)x=Math.max(x,(a[C.src]??0)+1);a[f]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(a=Gs(n,a)),e?.ignoreCrossLaneEdges&&$s(n,a),{layers:nn(n,a,r),rankOf:a,dummy:new Set}}d(zs,"assignLayers_LongestPath");function Vs(t,e){const n=ye(t),s={...zs(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:a,succs:l}=rn(n,p=>{if(e?.ignoreCrossLaneEdges){const c=r(p.src),y=r(p.dst);if(c&&y&&c!==y)return!1}return!0}),f=Pe(n)??[...n.nodes],i=[...f].reverse(),g=d((p,c)=>{let y=0;for(const E of a.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=l.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,c)),Math.min(Math.max(c,y),v)},"clampFeasible"),x=en.GRAVITY_ITERATIONS,C=d(p=>{let c=!1;for(const y of p){const v=a.get(y)??[],M=l.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((w,R)=>w+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((w,R)=>w+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),I=g(y,m);I!==s[y]&&(s[y]=I,c=!0)}return c},"relaxOrder");for(let p=0;p0){const y=Math.min(...c.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:xo(n,f,s),rankOf:s,dummy:new Set}}d(Vs,"assignLayers_Gravity");function js(t){const e=mo(t),n=po(t);let o=yo(e);const s=[];for(;o.length>0;){const r=[];for(const a of o){s.push(a);for(const l of n.get(a)??[])e.set(l,(e.get(l)??0)-1),(e.get(l)??0)===0&&r.push(l)}o=r.sort((a,l)=>a.localeCompare(l))}return s.length===t.nodes.length?s:null}d(js,"topoSortByGenerationIfAcyclic");function Us(t,e){const n=ye(t),o=e?.direction==="LR"?js(n)??[...n.nodes].sort():Pe(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),a=Object.create(null),l=new Map,f=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const C=go(n,g);let h=0;if(C.length>0)for(const v of C){const M=v.src,E=a[M]??0;h=Math.max(h,E+f(M,g))}const p=r(g),c=l.get(p)??0,y=Math.max(h,c);a[g]=y,l.set(p,y+1)}return{layers:xo(n,o,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}d(Us,"assignLayers_LaneAwareCompact");function Ws(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(h=>[...h]),r=new Set(t.dummy?[...t.dummy]:[]);let a=0;const l=new Map(n.nodeById),f=d(h=>{const p=`placeholder-${a++}`,c={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(l.set(p,c),r.add(p);s.length<=h;)s.push([]);return s[h].push(p),o[p]=h,p},"addDummyAt"),i=[...n.edges].sort((h,p)=>h.id===p.id?h.src===p.src?h.dst.localeCompare(p.dst):h.src.localeCompare(p.src):h.id.localeCompare(p.id)),g=[];for(const h of i){const p=o[h.src]??0,c=o[h.dst]??0;if(c-p<=1){g.push(h);continue}let y=h.src;for(let M=p+1,E=0;M!n.nodes.includes(h))],edges:g,layout:n.layout,nodeById:l};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:C}}d(Ws,"makeProperLayering");function jn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(jn,"median");function Un(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Un,"barycenter");function Ks(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Ks,"neighborPositionsFor");function qs(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(qs,"currentOrderTieBreak");function Wn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),a=Ne(e),l=[];for(const i of n)o.has(i.src)&&s.has(i.dst)&&l.push({u:r.get(i.src),v:a.get(i.dst)});l.sort((i,g)=>i.u===g.u?i.v-g.v:i.u-g.u);const f=l.map(i=>i.v);return bo(f)}d(Wn,"countCrossingsBetweenAdjacent");function je(t,e,n){return[...t].sort((o,s)=>{const r=jn(e.get(o)??[]),a=jn(e.get(s)??[]);return r===a?qs(o,s,n):isFinite(r)?isFinite(a)?r-a:-1:1})}d(je,"sortByHeuristic");function Kn(t,e,n,o,s,r){const a=Ne(t),l=Ne(e),f=Ks(e,a,n,o);if(!s||!r||r.length===0)return je(e,f,l);const i=new Map;for(const C of e){const h=s(C),p=i.get(h)??[];p.push(C),i.set(h,p)}const g=[];for(const C of r){const h=i.get(C);if(!h||h.length===0)continue;const p=je(h,f,l);g.push(...p)}const x=i.get(null);if(x&&x.length>0){const C=je(x,f,l);for(const h of C){const p=Un(f.get(h)??[]);let c=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Un(f.get(v)??[]);if(pa.has(c.src)&&l.has(c.dst)),g=f?n.filter(c=>l.has(c.src)&&f.has(c.dst)):void 0,x=d(c=>{let y=Wn(t,c,i);return g&&o&&(y+=Wn(c,o,g)),y},"crossingScore"),C=s?new Map:null;if(s&&C)for(const c of e)C.set(c,s(c));let h=!0,p=x(r);for(;h;){h=!1;for(let c=0;c+1[...l]),s=e.edges,r=fe(e),a=Mo(e,n?.laneOrder);for(let l=0;l<3;l++){for(let f=1;f=0;f--)o[f]=Kn(o[f+1],o[f],s,"up",r,a),o[f]=qn(o[f+1],o[f],s,o[f-1],r)}return{layers:o}}d(Js,"orderLayers");function Zs(t,e,n){const o=n?.layerGap??Po.DEFAULT_LAYER_GAP,s=n?.nodeGap??Po.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,a=n?.direction??"TB",l=a==="LR"||a==="RL",f=t.layers,i=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),C=d(O=>x(O)?.width??0,"getWidth"),h=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),c=Mo(e,n?.laneOrder),y=f.map(O=>O.reduce((F,H)=>Math.max(F,h(H)),0)),v=[];if(l)for(let O=0;O+1Math.max(mt,C(kt)),0),H=f[O+1].reduce((mt,kt)=>Math.max(mt,C(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(F+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of f)for(const F of O)M.add(p(F));const E=M.has(null),T=c.filter(O=>M.has(O)),m=[...E?[null]:[],...T],I=Object.create(null);for(const O of T)I[O]=0;E&&(I.null=0);for(const O of f){const F=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(F[G]||=[]).push(P)}for(const[P,G]of Object.entries(F)){const j=G.reduce((J,dt)=>J+C(dt),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+C(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const w=new Map;{const O=m.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PC(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];i[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const F=O.ref.id;k.has(F)||k.set(F,[]),k.get(F).push(O)}for(const[,O]of k){if(O.length===0)continue;const F=O[0].ref,H=F.start,P=F.end;if(H==null||P==null)continue;const G=Math.round(((i[H]??0)+(i[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(i[J]=G)}}return{x:i,y:g}}d(Zs,"assignCoordinates");var Qs=8;function tr(t){let e=2166136261;for(let n=0;n>>0}d(tr,"hashString");function er(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(er,"mulberry32");function nr(t,e){const n=[...t],o=er(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(nr,"deterministicShuffle");function or(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(or,"sourceDistance");function Jn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:a}of e){const l=n.get(s),f=n.get(r);l==null||f==null||(o+=a*Math.abs(l-f))}return o}d(Jn,"laneArrangementCost");function sr(t){const e=cn(t);if(e.length<2)return[];const n=new Map(e.map((r,a)=>[r,a])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const a=typeof r.start=="string"?r.start:void 0,l=typeof r.end=="string"?r.end:void 0;if(!a||!l||!t.nodeById.has(a)||!t.nodeById.has(l))continue;const f=o(a),i=o(l);if(!f||!i||f===i)continue;const g=n.get(f),x=n.get(i);if(g==null||x==null)continue;const[C,h]=g<=x?[f,i]:[i,f],p=`${C}\0${h}`,c=s.get(p);c?c.weight++:s.set(p,{a:C,b:h,weight:1})}return[...s.values()]}d(sr,"buildWeightedLaneEdges");function Zn(t,e,n){const o=[...t];let s=Jn(o,e),r=!0,a=0;const l=Math.max(1,o.length);for(;r&&as.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:a})=>`${s}:${r}:${a}`).join("|");return tr(`${t.join("|")}#${o}#${n}`)}d(ir,"seedForRestart");function cr(t,e={}){const n=cn(t);if(n.length<2)return n;const o=sr(t);if(o.length===0)return n;const s=new Map(n.map((l,f)=>[l,f]));let r=Zn(n,o,s);const a=Math.max(0,e.restarts??Qs);for(let l=0;lct&&f*3>=l?a>0?"bottom":"top":l>ct?r>0?"right":"left":n}d(Qn,"chooseOrthogonalSide");function to(t,e){return Math.abs(t.to-e.from)u.isGroup&&!u.parentId);for(const u of i){const b={id:u.id},S=d(L=>{a.set(L.id,b),n.filter(A=>A.parentId===L.id).forEach(S)},"assignLane");S(u)}const g=n.filter(u=>!u.isGroup&&!u.isEdgeLabel).map(u=>{const b=u.width??10,S=u.height??10,L=u.x??0,A=u.y??0,B=Br;return{nodeId:u.id,minX:L-b/2-B,maxX:L+b/2+B,minY:A-S/2-B,maxY:A+S/2+B,visualXHalfExtent:f?S/2+B:b/2+B}}),x=d((u,b,S,L)=>{let A=l.find(B=>B.orientation===u&&Math.abs(B.coord-b)<1);return A||(A={id:`pipe-${u}-${b.toFixed(0)}`,orientation:u,coord:b,spanMin:S,spanMax:L,tracks:[]},l.push(A)),A.spanMin=Math.min(A.spanMin,S),A.spanMax=Math.max(A.spanMax,L),A},"getOrAddPipe"),C=d((u,b)=>{const S=u.width??10,L=u.height??10,A=u.x??0,B=u.y??0;switch(b){case"top":return{x:A,y:B-L/2};case"bottom":return{x:A,y:B+L/2};case"left":return{x:A-S/2,y:B};case"right":return{x:A+S/2,y:B}}},"portForSide"),h=d((u,b,S)=>C(u,Qn(u,b,S?"bottom":"top")),"getOrthogonalPort"),p=[],c=[],y=new Set,v=1e3,M=d((u,b,S)=>{if(p.length===0)return 0;const L=Math.abs(b.y-S.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(A){const U=b.x,q=Math.min(b.y,S.y)-ct,z=Math.max(b.y,S.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===u||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((u,b)=>{if(!u.start||!u.end)return{idx:b,crossLane:0,dx:0,dy:0};const S=r.get(u.start),L=r.get(u.end),A=a.get(u.start),B=a.get(u.end),U=A&&B&&A.id!==B.id?1:0,q=S&&L?Math.abs((L.x??0)-(S.x??0)):0,z=S&&L?Math.abs((L.y??0)-(S.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((u,b)=>{if(u.crossLane!==b.crossLane)return b.crossLane-u.crossLane;const S=u.dx+u.dy,L=b.dx+b.dy;return Math.abs(S-L)>1?S-L:u.idx-b.idx}).map(u=>u.idx),T=d((u,b,S,L)=>{const A=Math.min(u.x,b.x),B=Math.max(u.x,b.x),U=Math.min(u.y,b.y),q=Math.max(u.y,b.y);return!!g.find(Y=>S&&Y.nodeId===S||L&&Y.nodeId===L?!1:Math.abs(u.x-b.x)>ct?Y.minYu.y&&Y.maxX>A&&Y.minXu.x&&Y.maxY>U&&Y.minYQn(u,b,"bottom"),"determineSide"),R=new Map;for(const[u,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const A=(L.x??0)-(S.x??0),B=(L.y??0)-(S.y??0);R.set(u,{edgeIdx:u,srcId:b.start,dstId:b.end,srcSide:w(S,{x:L.x??0,y:L.y??0}),dstSide:w(L,{x:S.x??0,y:S.y??0}),absDx:Math.abs(A),absDy:Math.abs(B),dxSign:Math.sign(A),dySign:Math.sign(B)})}const k=d(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.absDx===0?1/0:u.absDy/u.absDx:u.absDy===0?1/0:u.absDx/u.absDy,"preferenceStrength"),O=d(u=>u.srcSide==="top"||u.srcSide==="bottom"?u.dxSign>=0?"right":"left":u.dySign>=0?"bottom":"top","secondarySide"),F=new Map;for(const u of R.values()){const b=`${u.srcId}:${u.srcSide}`;F.has(b)||F.set(b,[]),F.get(b).push(u)}const H=new Map,P=d((u,b)=>`${u}:${b}`,"loadKey");for(const u of R.values())H.set(P(u.srcId,u.srcSide),(H.get(P(u.srcId,u.srcSide))??0)+1),H.set(P(u.dstId,u.dstSide),(H.get(P(u.dstId,u.dstSide))??0)+1);for(const u of F.values())if(!(u.length<2)){u.sort((b,S)=>{const L=k(b),A=k(S);return Math.abs(L-A)>1e-9?A-L:b.edgeIdx-S.edgeIdx});for(let b=1;b=A||(H.set(P(S.srcId,S.srcSide),A-1),H.set(P(S.srcId,L),B+1),S.srcSide=L)}}const G=d(u=>{const b=u?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const u of R.values())j.has(u.dstId)||j.set(u.dstId,new Set),j.get(u.dstId).add(u.dstSide);for(const u of R.values()){if(!G(r.get(u.srcId)))continue;const b=j.get(u.srcId);if(!b?.has(u.srcSide))continue;const S=O(u);if(b.has(S)||(H.get(P(u.srcId,S))??0)>0)continue;const L=H.get(P(u.srcId,u.srcSide))??0;H.set(P(u.srcId,u.srcSide),Math.max(0,L-1)),H.set(P(u.srcId,S),1),u.srcSide=S}for(const u of R.values()){const{edgeIdx:b,srcId:S,dstId:L,srcSide:A,dstSide:B}=u,U=r.get(S),q=r.get(L),z=`${S}:${A}:src`,Y=A==="top"||A==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[u,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const S=u.split(":"),L=S.slice(0,-2).join(":"),A=S[S.length-2],B=S[S.length-1],U=r.get(L);if(!U)continue;const z=A==="left"||A==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,dn=`${Dt.edgeIdx}:${B}`;J.set(dn,Jt)}}const mt=d(u=>!!s[u]?.labelNodeId,"edgeHasLabelNode"),kt=d((u,b)=>u?(m.get(`${u}:${b}:src`)??[]).some(({edgeIdx:S})=>mt(S))||(m.get(`${u}:${b}:dst`)??[]).some(({edgeIdx:S})=>mt(S)):!1,"faceHasLabelNode"),Pt=d((u,b,S)=>b==="top"||b==="bottom"?{x:u.x+S,y:u.y}:{x:u.x,y:u.y+S},"applyPortOffset"),Q=d((u,b,S)=>{const L=R.get(u),A={x:S.x??0,y:S.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??w(b,A),q=L?.dstSide??w(S,B);let z=L?C(b,L.srcSide):h(b,A,!0),Y=L?C(S,L.dstSide):h(S,B,!1);const ot=J.get(`${u}:src`),rt=J.get(`${u}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const u of E){const b=s[u];if(c[u]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const S=r.get(b.start),L=r.get(b.end);if(!S||!L)continue;const{pSrcPort:A,pDstPort:B,srcSide:U,dstSide:q}=Q(u,S,L),z={...A},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=A.y>(S.y??0);z.y=X?A.y+ne:A.y-ne}else{const X=A.x>(S.x??0);z.x=X?A.x+ne:A.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(A,S,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,A.y+ne):Math.max(X.maxY+2,A.y-ne);yt=[{x:A.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(A,S,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,A.x+ne):Math.max(X.maxX+2,A.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:A.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,S,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,S,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=I.get(b.start??"")??0,ut=I.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(A,B,b.start,b.end)){b.points=[{...A},{...z},{...Y},{...B}],y.add(u);const Mt=K?"horizontal":"vertical",$t=K?A.y:A.x,It=K?Math.min(A.x,B.x):Math.min(A.y,B.y),St=K?Math.max(A.x,B.x):Math.max(A.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${u}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:u,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const dn=x("vertical",z.x,z.y,z.y);z.x=dn.coord;const hr=x("vertical",Y.x,Y.y,Y.y);Y.x=hr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-ze),he=Math.max(he,X.maxX+ze),ve=Math.min(ve,X.minY-ze),Le=Math.max(Le,X.maxY+ze))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const gr=l.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),pr=l.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),Be=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),ke=Be(z.x,z.y),So=Be(Y.x,Y.y),Fe=new Map,un=new Map,hn=new Map,_e=new Set,xe=[];Fe.set(ke,0),hn.set(ke,"n"),xe.push({key:ke,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),_e.add(ke);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),gn={x:Y.x,y:z.y},mr=ge(z,gn),yr=ge(gn,Y),xr=mr||yr,pn={x:z.x,y:Y.y},br=ge(z,pn),Mr=ge(pn,Y);if(xr?br||Mr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(_e.delete(X.key),X.key===So){let ut=So,Yt=Y;for(Ht=[Yt];un.has(ut);){const ee=un.get(ut);Ht.unshift(ee),Yt=ee,ut=Be(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=pr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=gr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&mn<-5||Ee<-10&&mn>5)&&(St=Math.abs(mn)*100),(Wt>10&&De<-5||Wt<-10&&De>5)&&(St+=Math.abs(De)*50);let Co=0;const vo=hn.get(X.key)??"n",Lo=Math.abs(De)>ct?"h":"v";vo!=="n"&&vo!==Lo&&(Co=50);const Ir=$t+It+St+Co,He=(Fe.get(X.key)??1/0)+Ir,Eo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(He<(Fe.get(Mt)??1/0))if(un.set(Mt,X.pt),Fe.set(Mt,He),hn.set(Mt,Lo),!_e.has(Mt))xe.push({key:Mt,f:He+Eo,pt:ut}),_e.add(Mt);else{const Zt=xe.findIndex(Sr=>Sr.key===Mt);Zt!==-1&&(xe[Zt].f=He+Eo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(f&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xu.from{const A=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,u)),B=!S.segments.some(U=>(U.edgeIndex!==u.edgeIndex||U.segmentIndex!==u.segmentIndex)&&W(U,b));return A&&B?(u.trackIndex=L.index,b.trackIndex=S.index,S.segments=[...S.segments.filter(U=>U.edgeIndex!==u.edgeIndex||U.segmentIndex!==u.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(u=>{const b=u.tracks.length;return u.tracks[b]={index:b,coord:u.coord,segments:[]},b},"createNewTrack"),gt=d((u,b)=>{const S=u.pipe.tracks[u.trackIndex];S.segments=S.segments.filter(A=>A.edgeIndex!==u.edgeIndex||A.segmentIndex!==u.segmentIndex),u.trackIndex=b,u.pipe.tracks[b].segments.push({edgeIndex:u.edgeIndex,segmentIndex:u.segmentIndex,from:u.from,to:u.to})},"moveSegmentToTrack"),xt=d((u,b)=>{const S=c[u.edgeIndex];for(const L of S){const A=p[L];A.pipe===u.pipe&>(A,b)}},"moveSegmentChainToTrack"),vt=d(u=>{const b=c[u.edgeIndex],S=b.indexOf(p.indexOf(u)),L=[];return S>0&&L.push(p[b[S-1]]),S{if(u.orientation===b.orientation)return!1;const S=u.orientation==="horizontal"?u:b,L=u.orientation==="horizontal"?b:u;return L.pipe.coord>S.from&&L.pipe.coordL.from&&S.pipe.coord{for(const S of u.tracks)if(!S.segments.some(A=>(A.edgeIndex!==b.edgeIndex||A.segmentIndex!==b.segmentIndex)&&W(A,b)))return S.index;return-1},"findAvailableTrack"),Ut=d((u,b)=>{if(u.trackIndex===b.trackIndex)return W(u,b);const S=vt(u),L=vt(b);return S.some(A=>L.some(B=>Vt(A,B)))},"segmentsConflict"),te=d((u,b,S)=>{if(et(u,b,u.pipe.tracks[u.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(u.pipe,b);S(b,L!==-1?L:at(u.pipe))},"resolveTrackConflict"),Se=d(u=>{let b=0;for(let S=0;S{if(de.has(u))return de.get(u);const b=c[u];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(u,q),q}const L=p[b[0]].pipe.coord;let A=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(A-L),U={dest:A,deviation:B,base:L,delta:A-L};return de.set(u,U),U},"getDestInfo"),an=d(()=>{let u=0;const b=new Map;for(const[L,A]of s.entries())c[L].length!==0&&A.start&&(b.has(A.start)||b.set(A.start,[]),b.get(A.start).push(L));const S=d(L=>{const A=s[L];if(!A.start||!A.end)return 0;const B=r.get(A.start),U=r.get(A.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=S(B),ot=S(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=c[B].length,st=c[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=c[B][0],yt=c[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const A=L.map(B=>p[c[B][0]]);u+=Se(A)}return u},"fixSourceHandleCrossings"),ln=d(()=>{let u=0;const b=new Map;for(const[S,L]of s.entries())c[S].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(S));for(const S of b.values()){S.sort((A,B)=>{const U=d(Y=>{const ot=c[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(A),z=U(B);return Math.abs(q-z)>.1?q-z:A-B});const L=S.map(A=>p[c[A][c[A].length-1]]);u+=Se(L)}return u},"fixTargetHandleCrossings"),fn=d(()=>{let u=0;for(const b of l){const S=[];for(const L of b.tracks)for(const A of L.segments){const B=c[A.edgeIndex].find(U=>p[U].segmentIndex===A.segmentIndex);B!==void 0&&S.push(p[B])}S.sort((L,A)=>L.edgeIndex-A.edgeIndex||L.segmentIndex-A.segmentIndex);for(let L=0;L{L.segments.forEach(A=>{b.push({edgeIndex:A.edgeIndex,segmentIndex:A.segmentIndex,trackIndex:L.index,from:A.from,to:A.to})})}),b.sort((L,A)=>L.from-A.from);const S=[];if(b.length>0){let L=[b[0]],A=b[0].to;for(let B=1;BA.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...A].filter(tt=>(B.get(tt)??0)<-1),q=[...A].filter(tt=>(B.get(tt)??0)>1),z=[...A].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?u.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,u.coord-ot*Mn);if(z.length===0&&A.size>0){const tt=[...A].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,u.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,u.coord+yt*Rt*Mn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,u.coord+st*Mn)}}for(const[u,b]of s.entries()){const S=c[u]??[];if(S.length===0)continue;const L=[],A=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(u,A,B),z=S.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:to(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,to(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const u of s){const b=u.__originalEdge;b&&u.points&&(b.points=u.points)}t.edges=(t.edges??[]).filter(u=>!u.isLayoutOnly);const V=d((u,b)=>{const S=b.x??0,L=b.y??0,A=b.width??0,B=b.height??0;if(A<=0||B<=0)return u;const U=S-A/2,q=S+A/2,z=L-B/2,Y=L+B/2;if(u.xq||u.yY)return u;const ot=u.x-U,rt=q-u.x,st=u.y-z,tt=Y-u.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:u.y}:yt===rt?{x:q,y:u.y}:yt===st?{x:u.x,y:z}:{x:u.x,y:Y}},"nodeBoundaryClamp");for(const u of t.edges){const b=u.points;if(!b||b.length<2)continue;const S=u.start,L=u.end,A=S?r.get(S):void 0,B=L?r.get(L):void 0;A&&(b[0]=V(b[0],A)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(lr,"routeEdgesOrthogonal");function fr(t){return t.direction??"TB"}d(fr,"getSwimlaneDirection");function dr(t){const e=Uo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,a=t.config.swimlane?.automaticLaneOrdering??!1,l=fr(t),{ordered:f,coordinates:i}=ar(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:a,direction:l});Wo(e,f,i,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;lr(t,l);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Es(t,l),Ls(t),l}d(dr,"runSwimlaneLayoutCore");function ur(t){jo(t);const e=Ko(t);t.nodes=e.nodes,t.edges=e.edges}d(ur,"prepareSwimlaneLayout");var Hr=Cr({prepareLayout:ur,runLayoutCore:dr,afterPaint:zo});export{Hr as render}; diff --git a/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-Dz6vrGDq.js b/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-Dz6vrGDq.js deleted file mode 100644 index 7270fcaab..000000000 --- a/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-Dz6vrGDq.js +++ /dev/null @@ -1,8 +0,0 @@ -import{c as r,s as e}from"./flowDiagram-A5DVABFB-CyNh512Q.js";import{_ as a}from"./mermaid.core-Pmnag6hS.js";import"./chunk-5VM5RSS4-BhXMeeD7.js";import"./chunk-XXDRQBXY-LvYS55fD.js";import"./chunk-POPQ4Y6H-BOop7K_8.js";import"./chunk-F27PBJKO-CENksy_e.js";import"./purify.es-5AjVNlXF.js";import"./channel-DILt7hqb.js";import"./index-BK-wRR5p.js";var o=a(t=>`${e(t)} - .swimlane.cluster rect { - stroke: ${t.clusterBorder} !important; - } - [data-look="neo"].cluster rect { - filter: none; - } -`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-iHH4fxb9.js b/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-iHH4fxb9.js new file mode 100644 index 000000000..b2ad1adfb --- /dev/null +++ b/apps/pythinker-code/dist-web/assets/swimlanesDiagram-VK2B7HYN-iHH4fxb9.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-A5DVABFB-DnEfMg9m.js";import{_ as a}from"./mermaid.core-4ur3W-UG.js";import"./chunk-5VM5RSS4-BjJ31Xiv.js";import"./chunk-XXDRQBXY-B0zDZEAk.js";import"./chunk-POPQ4Y6H-Bc64Qx3F.js";import"./chunk-F27PBJKO-d2g57_ei.js";import"./purify.es-5AjVNlXF.js";import"./channel-Ce13qtYp.js";import"./index-C0iEUKAq.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-CE4hXwQQ.js b/apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-BxrqJk2T.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-CE4hXwQQ.js rename to apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-BxrqJk2T.js index e31a2c844..4e1aaf26f 100644 --- a/apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-CE4hXwQQ.js +++ b/apps/pythinker-code/dist-web/assets/timeline-definition-24CTP7MA-BxrqJk2T.js @@ -1,4 +1,4 @@ -import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-Pmnag6hS.js";import{d as ot}from"./arc-C__I0s6O.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-4ur3W-UG.js";import{d as ot}from"./arc-ChDdl02F.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: `+w.showPosition()+` Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),X=S[l[l.length-2]][l[l.length-1]],l.push(X);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/apps/pythinker-code/dist-web/assets/tsMode-BCl_qc7D.js b/apps/pythinker-code/dist-web/assets/tsMode-BFMAlDzX.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/tsMode-BCl_qc7D.js rename to apps/pythinker-code/dist-web/assets/tsMode-BFMAlDzX.js index f25914de9..215d90505 100644 --- a/apps/pythinker-code/dist-web/assets/tsMode-BCl_qc7D.js +++ b/apps/pythinker-code/dist-web/assets/tsMode-BFMAlDzX.js @@ -1,4 +1,4 @@ -import{c as M,e as w,U as F,a as P,M as v,l as f,t as K,R as O}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";class E{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=M({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("/assets/ts.worker-BjWGAzqc.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(w.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const s={};s["lib.d.ts"]=!0;s["lib.decorators.d.ts"]=!0;s["lib.decorators.legacy.d.ts"]=!0;s["lib.dom.asynciterable.d.ts"]=!0;s["lib.dom.d.ts"]=!0;s["lib.dom.iterable.d.ts"]=!0;s["lib.es2015.collection.d.ts"]=!0;s["lib.es2015.core.d.ts"]=!0;s["lib.es2015.d.ts"]=!0;s["lib.es2015.generator.d.ts"]=!0;s["lib.es2015.iterable.d.ts"]=!0;s["lib.es2015.promise.d.ts"]=!0;s["lib.es2015.proxy.d.ts"]=!0;s["lib.es2015.reflect.d.ts"]=!0;s["lib.es2015.symbol.d.ts"]=!0;s["lib.es2015.symbol.wellknown.d.ts"]=!0;s["lib.es2016.array.include.d.ts"]=!0;s["lib.es2016.d.ts"]=!0;s["lib.es2016.full.d.ts"]=!0;s["lib.es2016.intl.d.ts"]=!0;s["lib.es2017.arraybuffer.d.ts"]=!0;s["lib.es2017.d.ts"]=!0;s["lib.es2017.date.d.ts"]=!0;s["lib.es2017.full.d.ts"]=!0;s["lib.es2017.intl.d.ts"]=!0;s["lib.es2017.object.d.ts"]=!0;s["lib.es2017.sharedmemory.d.ts"]=!0;s["lib.es2017.string.d.ts"]=!0;s["lib.es2017.typedarrays.d.ts"]=!0;s["lib.es2018.asyncgenerator.d.ts"]=!0;s["lib.es2018.asynciterable.d.ts"]=!0;s["lib.es2018.d.ts"]=!0;s["lib.es2018.full.d.ts"]=!0;s["lib.es2018.intl.d.ts"]=!0;s["lib.es2018.promise.d.ts"]=!0;s["lib.es2018.regexp.d.ts"]=!0;s["lib.es2019.array.d.ts"]=!0;s["lib.es2019.d.ts"]=!0;s["lib.es2019.full.d.ts"]=!0;s["lib.es2019.intl.d.ts"]=!0;s["lib.es2019.object.d.ts"]=!0;s["lib.es2019.string.d.ts"]=!0;s["lib.es2019.symbol.d.ts"]=!0;s["lib.es2020.bigint.d.ts"]=!0;s["lib.es2020.d.ts"]=!0;s["lib.es2020.date.d.ts"]=!0;s["lib.es2020.full.d.ts"]=!0;s["lib.es2020.intl.d.ts"]=!0;s["lib.es2020.number.d.ts"]=!0;s["lib.es2020.promise.d.ts"]=!0;s["lib.es2020.sharedmemory.d.ts"]=!0;s["lib.es2020.string.d.ts"]=!0;s["lib.es2020.symbol.wellknown.d.ts"]=!0;s["lib.es2021.d.ts"]=!0;s["lib.es2021.full.d.ts"]=!0;s["lib.es2021.intl.d.ts"]=!0;s["lib.es2021.promise.d.ts"]=!0;s["lib.es2021.string.d.ts"]=!0;s["lib.es2021.weakref.d.ts"]=!0;s["lib.es2022.array.d.ts"]=!0;s["lib.es2022.d.ts"]=!0;s["lib.es2022.error.d.ts"]=!0;s["lib.es2022.full.d.ts"]=!0;s["lib.es2022.intl.d.ts"]=!0;s["lib.es2022.object.d.ts"]=!0;s["lib.es2022.regexp.d.ts"]=!0;s["lib.es2022.string.d.ts"]=!0;s["lib.es2023.array.d.ts"]=!0;s["lib.es2023.collection.d.ts"]=!0;s["lib.es2023.d.ts"]=!0;s["lib.es2023.full.d.ts"]=!0;s["lib.es2023.intl.d.ts"]=!0;s["lib.es2024.arraybuffer.d.ts"]=!0;s["lib.es2024.collection.d.ts"]=!0;s["lib.es2024.d.ts"]=!0;s["lib.es2024.full.d.ts"]=!0;s["lib.es2024.object.d.ts"]=!0;s["lib.es2024.promise.d.ts"]=!0;s["lib.es2024.regexp.d.ts"]=!0;s["lib.es2024.sharedmemory.d.ts"]=!0;s["lib.es2024.string.d.ts"]=!0;s["lib.es5.d.ts"]=!0;s["lib.es6.d.ts"]=!0;s["lib.esnext.array.d.ts"]=!0;s["lib.esnext.collection.d.ts"]=!0;s["lib.esnext.d.ts"]=!0;s["lib.esnext.decorators.d.ts"]=!0;s["lib.esnext.disposable.d.ts"]=!0;s["lib.esnext.error.d.ts"]=!0;s["lib.esnext.float16.d.ts"]=!0;s["lib.esnext.full.d.ts"]=!0;s["lib.esnext.intl.d.ts"]=!0;s["lib.esnext.iterator.d.ts"]=!0;s["lib.esnext.promise.d.ts"]=!0;s["lib.esnext.sharedmemory.d.ts"]=!0;s["lib.scripthost.d.ts"]=!0;s["lib.webworker.asynciterable.d.ts"]=!0;s["lib.webworker.d.ts"]=!0;s["lib.webworker.importscripts.d.ts"]=!0;s["lib.webworker.iterable.d.ts"]=!0;function A(c,e,t=0){if(typeof c=="string")return c;if(c===void 0)return"";let o="";if(t){o+=e;for(let i=0;ie.text).join(""):""}class y{constructor(e){this._worker=e}_textSpanToRange(e,t){let o=e.getPositionAt(t.start),i=e.getPositionAt(t.start+t.length),{lineNumber:l,column:p}=o,{lineNumber:n,column:r}=i;return{startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:r}}}class H{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf("/lib.")===0?!!s[e.path.slice(1)]:!1}getOrCreateModel(e){const t=F.parse(e),o=w.getModel(t);if(o)return o;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return w.createModel(this._libFiles[t.path.slice(1)],"typescript",t);const i=K.getExtraLibs()[e];return i?w.createModel(i.content,"typescript",t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class W extends y{constructor(e,t,o,i){super(i),this._libFiles=e,this._defaults=t,this._selector=o,this._disposables=[],this._listener=Object.create(null);const l=r=>{if(r.getLanguageId()!==o)return;const u=()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h?r.isAttachedToEditor()&&this._doValidate(r):this._doValidate(r)};let d;const g=r.onDidChangeContent(()=>{clearTimeout(d),d=window.setTimeout(u,500)}),b=r.onDidChangeAttached(()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h&&(r.isAttachedToEditor()?u():w.setModelMarkers(r,this._selector,[]))});this._listener[r.uri.toString()]={dispose(){g.dispose(),b.dispose(),clearTimeout(d)}},u()},p=r=>{w.setModelMarkers(r,this._selector,[]);const u=r.uri.toString();this._listener[u]&&(this._listener[u].dispose(),delete this._listener[u])};this._disposables.push(w.onDidCreateModel(r=>l(r))),this._disposables.push(w.onWillDisposeModel(p)),this._disposables.push(w.onDidChangeModelLanguage(r=>{p(r.model),l(r.model)})),this._disposables.push({dispose(){for(const r of w.getModels())p(r)}});const n=()=>{for(const r of w.getModels())p(r),l(r)};this._disposables.push(this._defaults.onDidChange(n)),this._disposables.push(this._defaults.onDidExtraLibsChange(n)),w.getModels().forEach(r=>l(r))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const t=await this._worker(e.uri);if(e.isDisposed())return;const o=[],{noSyntaxValidation:i,noSemanticValidation:l,noSuggestionDiagnostics:p}=this._defaults.getDiagnosticsOptions();i||o.push(t.getSyntacticDiagnostics(e.uri.toString())),l||o.push(t.getSemanticDiagnostics(e.uri.toString())),p||o.push(t.getSuggestionDiagnostics(e.uri.toString()));const n=await Promise.all(o);if(!n||e.isDisposed())return;const r=n.reduce((d,g)=>g.concat(d),[]).filter(d=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(d.code)===-1),u=r.map(d=>d.relatedInformation||[]).reduce((d,g)=>g.concat(d),[]).map(d=>d.file?F.parse(d.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&w.setModelMarkers(e,this._selector,r.map(d=>this._convertDiagnostics(e,d)))}_convertDiagnostics(e,t){const o=t.start||0,i=t.length||1,{lineNumber:l,column:p}=e.getPositionAt(o),{lineNumber:n,column:r}=e.getPositionAt(o+i),u=[];return t.reportsUnnecessary&&u.push(P.Unnecessary),t.reportsDeprecated&&u.push(P.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:r,message:A(t.messageText,` +import{c as M,e as w,U as F,a as P,M as v,l as f,t as K,R as O}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";class E{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=M({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("/assets/ts.worker-BjWGAzqc.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(w.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}}const s={};s["lib.d.ts"]=!0;s["lib.decorators.d.ts"]=!0;s["lib.decorators.legacy.d.ts"]=!0;s["lib.dom.asynciterable.d.ts"]=!0;s["lib.dom.d.ts"]=!0;s["lib.dom.iterable.d.ts"]=!0;s["lib.es2015.collection.d.ts"]=!0;s["lib.es2015.core.d.ts"]=!0;s["lib.es2015.d.ts"]=!0;s["lib.es2015.generator.d.ts"]=!0;s["lib.es2015.iterable.d.ts"]=!0;s["lib.es2015.promise.d.ts"]=!0;s["lib.es2015.proxy.d.ts"]=!0;s["lib.es2015.reflect.d.ts"]=!0;s["lib.es2015.symbol.d.ts"]=!0;s["lib.es2015.symbol.wellknown.d.ts"]=!0;s["lib.es2016.array.include.d.ts"]=!0;s["lib.es2016.d.ts"]=!0;s["lib.es2016.full.d.ts"]=!0;s["lib.es2016.intl.d.ts"]=!0;s["lib.es2017.arraybuffer.d.ts"]=!0;s["lib.es2017.d.ts"]=!0;s["lib.es2017.date.d.ts"]=!0;s["lib.es2017.full.d.ts"]=!0;s["lib.es2017.intl.d.ts"]=!0;s["lib.es2017.object.d.ts"]=!0;s["lib.es2017.sharedmemory.d.ts"]=!0;s["lib.es2017.string.d.ts"]=!0;s["lib.es2017.typedarrays.d.ts"]=!0;s["lib.es2018.asyncgenerator.d.ts"]=!0;s["lib.es2018.asynciterable.d.ts"]=!0;s["lib.es2018.d.ts"]=!0;s["lib.es2018.full.d.ts"]=!0;s["lib.es2018.intl.d.ts"]=!0;s["lib.es2018.promise.d.ts"]=!0;s["lib.es2018.regexp.d.ts"]=!0;s["lib.es2019.array.d.ts"]=!0;s["lib.es2019.d.ts"]=!0;s["lib.es2019.full.d.ts"]=!0;s["lib.es2019.intl.d.ts"]=!0;s["lib.es2019.object.d.ts"]=!0;s["lib.es2019.string.d.ts"]=!0;s["lib.es2019.symbol.d.ts"]=!0;s["lib.es2020.bigint.d.ts"]=!0;s["lib.es2020.d.ts"]=!0;s["lib.es2020.date.d.ts"]=!0;s["lib.es2020.full.d.ts"]=!0;s["lib.es2020.intl.d.ts"]=!0;s["lib.es2020.number.d.ts"]=!0;s["lib.es2020.promise.d.ts"]=!0;s["lib.es2020.sharedmemory.d.ts"]=!0;s["lib.es2020.string.d.ts"]=!0;s["lib.es2020.symbol.wellknown.d.ts"]=!0;s["lib.es2021.d.ts"]=!0;s["lib.es2021.full.d.ts"]=!0;s["lib.es2021.intl.d.ts"]=!0;s["lib.es2021.promise.d.ts"]=!0;s["lib.es2021.string.d.ts"]=!0;s["lib.es2021.weakref.d.ts"]=!0;s["lib.es2022.array.d.ts"]=!0;s["lib.es2022.d.ts"]=!0;s["lib.es2022.error.d.ts"]=!0;s["lib.es2022.full.d.ts"]=!0;s["lib.es2022.intl.d.ts"]=!0;s["lib.es2022.object.d.ts"]=!0;s["lib.es2022.regexp.d.ts"]=!0;s["lib.es2022.string.d.ts"]=!0;s["lib.es2023.array.d.ts"]=!0;s["lib.es2023.collection.d.ts"]=!0;s["lib.es2023.d.ts"]=!0;s["lib.es2023.full.d.ts"]=!0;s["lib.es2023.intl.d.ts"]=!0;s["lib.es2024.arraybuffer.d.ts"]=!0;s["lib.es2024.collection.d.ts"]=!0;s["lib.es2024.d.ts"]=!0;s["lib.es2024.full.d.ts"]=!0;s["lib.es2024.object.d.ts"]=!0;s["lib.es2024.promise.d.ts"]=!0;s["lib.es2024.regexp.d.ts"]=!0;s["lib.es2024.sharedmemory.d.ts"]=!0;s["lib.es2024.string.d.ts"]=!0;s["lib.es5.d.ts"]=!0;s["lib.es6.d.ts"]=!0;s["lib.esnext.array.d.ts"]=!0;s["lib.esnext.collection.d.ts"]=!0;s["lib.esnext.d.ts"]=!0;s["lib.esnext.decorators.d.ts"]=!0;s["lib.esnext.disposable.d.ts"]=!0;s["lib.esnext.error.d.ts"]=!0;s["lib.esnext.float16.d.ts"]=!0;s["lib.esnext.full.d.ts"]=!0;s["lib.esnext.intl.d.ts"]=!0;s["lib.esnext.iterator.d.ts"]=!0;s["lib.esnext.promise.d.ts"]=!0;s["lib.esnext.sharedmemory.d.ts"]=!0;s["lib.scripthost.d.ts"]=!0;s["lib.webworker.asynciterable.d.ts"]=!0;s["lib.webworker.d.ts"]=!0;s["lib.webworker.importscripts.d.ts"]=!0;s["lib.webworker.iterable.d.ts"]=!0;function A(c,e,t=0){if(typeof c=="string")return c;if(c===void 0)return"";let o="";if(t){o+=e;for(let i=0;ie.text).join(""):""}class y{constructor(e){this._worker=e}_textSpanToRange(e,t){let o=e.getPositionAt(t.start),i=e.getPositionAt(t.start+t.length),{lineNumber:l,column:p}=o,{lineNumber:n,column:r}=i;return{startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:r}}}class H{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf("/lib.")===0?!!s[e.path.slice(1)]:!1}getOrCreateModel(e){const t=F.parse(e),o=w.getModel(t);if(o)return o;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return w.createModel(this._libFiles[t.path.slice(1)],"typescript",t);const i=K.getExtraLibs()[e];return i?w.createModel(i.content,"typescript",t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}}class W extends y{constructor(e,t,o,i){super(i),this._libFiles=e,this._defaults=t,this._selector=o,this._disposables=[],this._listener=Object.create(null);const l=r=>{if(r.getLanguageId()!==o)return;const u=()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h?r.isAttachedToEditor()&&this._doValidate(r):this._doValidate(r)};let d;const g=r.onDidChangeContent(()=>{clearTimeout(d),d=window.setTimeout(u,500)}),b=r.onDidChangeAttached(()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h&&(r.isAttachedToEditor()?u():w.setModelMarkers(r,this._selector,[]))});this._listener[r.uri.toString()]={dispose(){g.dispose(),b.dispose(),clearTimeout(d)}},u()},p=r=>{w.setModelMarkers(r,this._selector,[]);const u=r.uri.toString();this._listener[u]&&(this._listener[u].dispose(),delete this._listener[u])};this._disposables.push(w.onDidCreateModel(r=>l(r))),this._disposables.push(w.onWillDisposeModel(p)),this._disposables.push(w.onDidChangeModelLanguage(r=>{p(r.model),l(r.model)})),this._disposables.push({dispose(){for(const r of w.getModels())p(r)}});const n=()=>{for(const r of w.getModels())p(r),l(r)};this._disposables.push(this._defaults.onDidChange(n)),this._disposables.push(this._defaults.onDidExtraLibsChange(n)),w.getModels().forEach(r=>l(r))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const t=await this._worker(e.uri);if(e.isDisposed())return;const o=[],{noSyntaxValidation:i,noSemanticValidation:l,noSuggestionDiagnostics:p}=this._defaults.getDiagnosticsOptions();i||o.push(t.getSyntacticDiagnostics(e.uri.toString())),l||o.push(t.getSemanticDiagnostics(e.uri.toString())),p||o.push(t.getSuggestionDiagnostics(e.uri.toString()));const n=await Promise.all(o);if(!n||e.isDisposed())return;const r=n.reduce((d,g)=>g.concat(d),[]).filter(d=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(d.code)===-1),u=r.map(d=>d.relatedInformation||[]).reduce((d,g)=>g.concat(d),[]).map(d=>d.file?F.parse(d.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&w.setModelMarkers(e,this._selector,r.map(d=>this._convertDiagnostics(e,d)))}_convertDiagnostics(e,t){const o=t.start||0,i=t.length||1,{lineNumber:l,column:p}=e.getPositionAt(o),{lineNumber:n,column:r}=e.getPositionAt(o+i),u=[];return t.reportsUnnecessary&&u.push(P.Unnecessary),t.reportsDeprecated&&u.push(P.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:l,startColumn:p,endLineNumber:n,endColumn:r,message:A(t.messageText,` `),code:t.code.toString(),tags:u,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];const o=[];return t.forEach(i=>{let l=e;if(i.file&&(l=this._libFiles.getOrCreateModel(i.file.fileName)),!l)return;const p=i.start||0,n=i.length||1,{lineNumber:r,column:u}=l.getPositionAt(p),{lineNumber:d,column:g}=l.getPositionAt(p+n);o.push({resource:l.uri,startLineNumber:r,startColumn:u,endLineNumber:d,endColumn:g,message:A(i.messageText,` `)})}),o}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return v.Error;case 3:return v.Info;case 0:return v.Warning;case 2:return v.Hint}return v.Info}}class C extends y{get triggerCharacters(){return["."]}async provideCompletionItems(e,t,o,i){const l=e.getWordUntilPosition(t),p=new O(t.lineNumber,l.startColumn,t.lineNumber,l.endColumn),n=e.uri,r=e.getOffsetAt(t),u=await this._worker(n);if(e.isDisposed())return;const d=await u.getCompletionsAtPosition(n.toString(),r);return!d||e.isDisposed()?void 0:{suggestions:d.entries.map(b=>{let h=p;if(b.replacementSpan){const x=e.getPositionAt(b.replacementSpan.start),D=e.getPositionAt(b.replacementSpan.start+b.replacementSpan.length);h=new O(x.lineNumber,x.column,D.lineNumber,D.column)}const k=[];return b.kindModifiers!==void 0&&b.kindModifiers.indexOf("deprecated")!==-1&&k.push(f.CompletionItemTag.Deprecated),{uri:n,position:t,offset:r,range:h,label:b.name,insertText:b.name,sortText:b.sortText,kind:C.convertKind(b.kind),tags:k}})}}async resolveCompletionItem(e,t){const o=e,i=o.uri,l=o.position,p=o.offset,r=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),p,o.label);return r?{uri:i,position:l,label:r.name,kind:C.convertKind(r.kind),detail:_(r.displayParts),documentation:{value:C.createDocumentationString(r)}}:o}static convertKind(e){switch(e){case a.primitiveType:case a.keyword:return f.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return f.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return f.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return f.CompletionItemKind.Function;case a.enum:return f.CompletionItemKind.Enum;case a.module:return f.CompletionItemKind.Module;case a.class:return f.CompletionItemKind.Class;case a.interface:return f.CompletionItemKind.Interface;case a.warning:return f.CompletionItemKind.File}return f.CompletionItemKind.Property}static createDocumentationString(e){let t=_(e.documentation);if(e.tags)for(const o of e.tags)t+=` diff --git a/apps/pythinker-code/dist-web/assets/typescript-BJQGTNP2.js b/apps/pythinker-code/dist-web/assets/typescript-BEp7AJTK.js similarity index 97% rename from apps/pythinker-code/dist-web/assets/typescript-BJQGTNP2.js rename to apps/pythinker-code/dist-web/assets/typescript-BEp7AJTK.js index e62f63205..e918eed73 100644 --- a/apps/pythinker-code/dist-web/assets/typescript-BJQGTNP2.js +++ b/apps/pythinker-code/dist-web/assets/typescript-BEp7AJTK.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},i={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{r as conf,i as language}; +import{l as e}from"./editor.main-CmoCOdG5.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},i={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{r as conf,i as language}; diff --git a/apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BpYKJWUZ.js b/apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BrUn21V7.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BpYKJWUZ.js rename to apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BrUn21V7.js index 02c2d2ea4..64c965393 100644 --- a/apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BpYKJWUZ.js +++ b/apps/pythinker-code/dist-web/assets/vennDiagram-4TSXK5OY-BrUn21V7.js @@ -1,4 +1,4 @@ -import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-Pmnag6hS.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` +import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-4ur3W-UG.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` M`,t,n),e.push(` m`,-s,0),e.push(` a`,s,s,0,1,0,s*2,0),e.push(` diff --git a/apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-B8toYgN9.js b/apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-zQ6SDzgy.js similarity index 98% rename from apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-B8toYgN9.js rename to apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-zQ6SDzgy.js index 3919d704f..202c01930 100644 --- a/apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-B8toYgN9.js +++ b/apps/pythinker-code/dist-web/assets/vue.runtime.esm-bundler-zQ6SDzgy.js @@ -1,4 +1,4 @@ -import{B as t,a as o,C as r,D as n,E as i,b as c,c as l,F as d,K as p,R as b,S as m,d as f,T as u,e as h,f as S,g as y,h as R,i as v,V as C,j as g,k as w,l as T,m as E,n as x,o as M,p as k,q as D,r as P,s as V,t as A,u as B,v as H,w as N,x as O,y as I,z,A as F,G as U,H as K,I as W,J as j,L as q,M as G,N as L,O as J,P as Q,Q as X,U as Y,W as Z,X as _,Y as $,Z as aa,_ as ea,$ as sa,a0 as ta,a1 as oa,a2 as ra,a3 as na,a4 as ia,a5 as ca,a6 as la,a7 as da,a8 as pa,a9 as ba,aa as ma,ab as fa,ac as ua,ad as ha,ae as Sa,af as ya,ag as Ra,ah as va,ai as Ca,aj as ga,ak as wa,al as Ta,am as Ea,an as xa,ao as Ma,ap as ka,aq as Da,ar as Pa,as as Va,at as Aa,au as Ba,av as Ha,aw as Na,ax as Oa,ay as Ia,az as za,aA as Fa,aB as Ua,aC as Ka,aD as Wa,aE as ja,aF as qa,aG as Ga,aH as La,aI as Ja,aJ as Qa,aK as Xa,aL as Ya,aM as Za,aN as _a,aO as $a,aP as ae,aQ as ee,aR as se,aS as te,aT as oe,aU as re,aV as ne,aW as ie,aX as ce,aY as le,aZ as de,a_ as pe,a$ as be,b0 as me,b1 as fe,b2 as ue,b3 as he,b4 as Se,b5 as ye,b6 as Re,b7 as ve,b8 as Ce,b9 as ge,ba as we,bb as Te,bc as Ee,bd as xe,be as Me,bf as ke,bg as De,bh as Pe,bi as Ve,bj as Ae,bk as Be,bl as He,bm as Ne,bn as Oe,bo as Ie,bp as ze,bq as Fe,br as Ue,bs as Ke,bt as We,bu as je,bv as qe,bw as Ge,bx as Le,by as Je,bz as Qe,bA as Xe,bB as Ye,bC as Ze,bD as _e,bE as $e,bF as as,bG as es,bH as ss,bI as ts,bJ as os,bK as rs,bL as ns,bM as is,bN as cs,bO as ls,bP as ds}from"./index-BK-wRR5p.js";/** +import{B as t,a as o,C as r,D as n,E as i,b as c,c as l,F as d,K as p,R as b,S as m,d as f,T as u,e as h,f as S,g as y,h as R,i as v,V as C,j as g,k as w,l as T,m as E,n as x,o as M,p as k,q as D,r as P,s as V,t as A,u as B,v as H,w as N,x as O,y as I,z,A as F,G as U,H as K,I as W,J as j,L as q,M as G,N as L,O as J,P as Q,Q as X,U as Y,W as Z,X as _,Y as $,Z as aa,_ as ea,$ as sa,a0 as ta,a1 as oa,a2 as ra,a3 as na,a4 as ia,a5 as ca,a6 as la,a7 as da,a8 as pa,a9 as ba,aa as ma,ab as fa,ac as ua,ad as ha,ae as Sa,af as ya,ag as Ra,ah as va,ai as Ca,aj as ga,ak as wa,al as Ta,am as Ea,an as xa,ao as Ma,ap as ka,aq as Da,ar as Pa,as as Va,at as Aa,au as Ba,av as Ha,aw as Na,ax as Oa,ay as Ia,az as za,aA as Fa,aB as Ua,aC as Ka,aD as Wa,aE as ja,aF as qa,aG as Ga,aH as La,aI as Ja,aJ as Qa,aK as Xa,aL as Ya,aM as Za,aN as _a,aO as $a,aP as ae,aQ as ee,aR as se,aS as te,aT as oe,aU as re,aV as ne,aW as ie,aX as ce,aY as le,aZ as de,a_ as pe,a$ as be,b0 as me,b1 as fe,b2 as ue,b3 as he,b4 as Se,b5 as ye,b6 as Re,b7 as ve,b8 as Ce,b9 as ge,ba as we,bb as Te,bc as Ee,bd as xe,be as Me,bf as ke,bg as De,bh as Pe,bi as Ve,bj as Ae,bk as Be,bl as He,bm as Ne,bn as Oe,bo as Ie,bp as ze,bq as Fe,br as Ue,bs as Ke,bt as We,bu as je,bv as qe,bw as Ge,bx as Le,by as Je,bz as Qe,bA as Xe,bB as Ye,bC as Ze,bD as _e,bE as $e,bF as as,bG as es,bH as ss,bI as ts,bJ as os,bK as rs,bL as ns,bM as is,bN as cs,bO as ls,bP as ds}from"./index-C0iEUKAq.js";/** * vue v3.5.35 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT diff --git a/apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-Bm8Te4ZD.js b/apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-D34PRRSw.js similarity index 99% rename from apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-Bm8Te4ZD.js rename to apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-D34PRRSw.js index 01b3a8211..a2b293187 100644 --- a/apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-Bm8Te4ZD.js +++ b/apps/pythinker-code/dist-web/assets/wardleyDiagram-VM6X3IG4-D34PRRSw.js @@ -1,4 +1,4 @@ -import{p as St}from"./chunk-JWPE2WC7-DvwwB7DW.js";import{s as Mt,g as Nt,q as zt,p as Lt,a as Tt,b as At,_ as u,X as Xt,A as Et,D as U,l as K,G as Yt,d as It,r as Bt,c as j}from"./mermaid.core-Pmnag6hS.js";import{p as Ft}from"./cynefin-OW5HDTMX-CwX4S6So.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map +import{p as St}from"./chunk-JWPE2WC7-CBKlOueZ.js";import{s as Mt,g as Nt,q as zt,p as Lt,a as Tt,b as At,_ as u,X as Xt,A as Et,D as U,l as K,G as Yt,d as It,r as Bt,c as j}from"./mermaid.core-4ur3W-UG.js";import{p as Ft}from"./cynefin-OW5HDTMX-B_2mZ5_M.js";import"./index-C0iEUKAq.js";import"./purify.es-5AjVNlXF.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map `+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),F=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Yt(n);E.selectAll("*").remove(),It(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${n}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);const z=u(t=>a.padding+t/100*Y,"projectX"),L=u(t=>b-a.padding-t/100*I,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const ut=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(ut),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(wt);const B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(B.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/B.length;B.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{const l=o[p],f=a.padding+l.start*Y,h=a.padding+l.end*Y,y=(f+h)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=a.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*o).attr("y2",b-a.padding-I*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(h=>({id:h,pos:c.get(h),node:g.nodes.find(y=>y.id===h)})).filter(h=>h.pos&&h.node).sort((h,y)=>h.node.x-y.node.x);for(let h=0;h{const y=c.get(h);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(o.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const V=v.append("g").attr("class","wardley-links"),_=new Map;g.pipelines.forEach(t=>{_.set(t.nodeId,new Set(t.componentIds))});const Z=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||_.get(t.target)?.has(t.source)));V.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.x+l/h*p}).attr("y1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.y+f/h*p}).attr("x2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.x+l/h*p}).attr("y2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.y+f/h*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),V.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,f=Math.sqrt(l*l+p*p),h=8,y=p/f;return i+y*h}).attr("y",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,f=Math.sqrt(p*p+l*l),h=8,y=-p/f;return i+y*h}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f),y=8,m=f/h,P=-l/h,N=i+m*y,O=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${O})`}).text(t=>t.label);const mt=v.append("g").attr("class","wardley-trends"),kt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const o=z(t.targetX),i=L(t.targetY),p=o-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),h=a.nodeRadius+2,y=f>h?o-p/f*h:o,m=f>h?i-l/f*h:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);mt.selectAll("line").data(kt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(h.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",o+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(H=>{const W=H.node(),Pt=W.getComputedTextLength();m=Math.max(m,Pt);const Ct=W.getBBox();P=Math.max(P,Ct.height)});const N=m+i*2+105,O=h.length*p+i*2+P/2,X=a.padding,bt=S-a.padding-N,$t=a.padding,vt=b-a.padding-O;s=Math.max(X,Math.min(s,bt)),o=Math.max($t,Math.min(o,vt)),y.forEach((H,W)=>{H.attr("x",s+i).attr("y",o+i+(W+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",O).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` M ${o} ${i-l/2} L ${o+p-f} ${i-l/2} diff --git a/apps/pythinker-code/dist-web/assets/xml-BfSuxdEx.js b/apps/pythinker-code/dist-web/assets/xml-uimzP1Mc.js similarity index 93% rename from apps/pythinker-code/dist-web/assets/xml-BfSuxdEx.js rename to apps/pythinker-code/dist-web/assets/xml-uimzP1Mc.js index a31cfbb7b..caf790176 100644 --- a/apps/pythinker-code/dist-web/assets/xml-BfSuxdEx.js +++ b/apps/pythinker-code/dist-web/assets/xml-uimzP1Mc.js @@ -1 +1 @@ -import{l as e}from"./editor.main-1e103Orc.js";import"./index-BK-wRR5p.js";import"./purify.es-5AjVNlXF.js";const i={comments:{blockComment:[""]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:e.IndentAction.Indent}}]},a={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[/"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:e.IndentAction.Indent}}]},a={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[/ Pythinker Code Web - + diff --git a/apps/pythinker-web/src/api/daemon/agentEventProjector.ts b/apps/pythinker-web/src/api/daemon/agentEventProjector.ts index fad1d13a1..64c9167bf 100644 --- a/apps/pythinker-web/src/api/daemon/agentEventProjector.ts +++ b/apps/pythinker-web/src/api/daemon/agentEventProjector.ts @@ -25,7 +25,8 @@ import type { } from '../types'; import { i18n } from '../../i18n'; import { toolLabel, toolSummary } from '../../lib/toolMeta'; -import { toAppMessageContent } from './mappers'; +import { + toAppSubagentRoutingFromEvent, toAppMessageContent } from './mappers'; import type { WireMessageContent } from './wire'; // Subagent turns share the parent session id: their turn / step / delta / tool @@ -237,6 +238,7 @@ function patchSubagent( sessionId: string, subagentId: unknown, patch: Partial, + clear: ReadonlyArray = [], ): AppTask | null { if (typeof subagentId !== 'string' || subagentId.length === 0) return null; const prev = state.subagentMeta.get(subagentId) ?? { @@ -263,14 +265,23 @@ function patchSubagent( suspendedReason: prev.suspendedReason, } : patch; + // A patch that omits a field (or carries `undefined`) keeps the value that an + // earlier event stored, so `task.started` cannot erase `subagent.spawned` metadata. + // Fields listed in `clear` are dropped explicitly (unless the terminal guard kept them). + const definedPatch = Object.fromEntries( + Object.entries(effectivePatch).filter(([, value]) => value !== undefined), + ) as Partial; const next: AppTask = { ...prev, - ...effectivePatch, + ...definedPatch, id: subagentId, agentId: subagentId, sessionId, kind: 'subagent', }; + for (const key of clear) { + if (!(key in definedPatch)) delete next[key]; + } state.subagentMeta.set(subagentId, next); return next; } @@ -1177,6 +1188,11 @@ export function createAgentProjector(): AgentProjector { model: typeof p?.model === 'string' ? p.model : undefined, thinkingEffort: typeof p?.thinkingEffort === 'string' ? p.thinkingEffort : undefined, + routing: toAppSubagentRoutingFromEvent(p?.routing), + currentRoutingEnvRevision: + typeof p?.currentRoutingEnvironmentRevision === 'string' + ? p.currentRoutingEnvironmentRevision + : undefined, parentToolCallId: typeof p?.parentToolCallId === 'string' ? p.parentToolCallId : undefined, dynamicWorkflowIndex: typeof p?.dynamicWorkflowIndex === 'number' ? p.dynamicWorkflowIndex : undefined, runInBackground: p?.runInBackground === true, @@ -1201,11 +1217,17 @@ export function createAgentProjector(): AgentProjector { } case 'subagent.suspended': { - const task = patchSubagent(s, sessionId, p?.subagentId, { - subagentPhase: 'suspended', - status: 'running', - suspendedReason: typeof p?.reason === 'string' ? p.reason : undefined, - }); + const task = patchSubagent( + s, + sessionId, + p?.subagentId, + { + subagentPhase: 'suspended', + status: 'running', + suspendedReason: typeof p?.reason === 'string' ? p.reason : undefined, + }, + ['suspendedReason'], + ); if (task) out.push({ type: 'taskCreated', sessionId, task }); break; } @@ -1357,6 +1379,11 @@ export function createAgentProjector(): AgentProjector { model: typeof info.model === 'string' ? info.model : undefined, thinkingEffort: typeof info.thinkingEffort === 'string' ? info.thinkingEffort : undefined, + routing: toAppSubagentRoutingFromEvent(info.routing), + currentRoutingEnvRevision: + typeof info.currentRoutingEnvironmentRevision === 'string' + ? info.currentRoutingEnvironmentRevision + : undefined, runInBackground: true, }); if (task) out.push({ type: 'taskCreated', sessionId, task }); diff --git a/apps/pythinker-web/src/api/daemon/mappers.ts b/apps/pythinker-web/src/api/daemon/mappers.ts index c5c2147c9..7fc372358 100644 --- a/apps/pythinker-web/src/api/daemon/mappers.ts +++ b/apps/pythinker-web/src/api/daemon/mappers.ts @@ -3,6 +3,7 @@ // All snake_case ↔ camelCase conversion happens ONLY here. import type { + AppSubagentRouting, AppExperimentalFlagState, AppApprovalRequest, AppCatalogProvider, @@ -33,6 +34,7 @@ import type { } from '../types'; import type { + WireSubagentRouting, WireExperimentalFlagState, WireApprovalRequest, WireApprovalResponse, @@ -369,6 +371,108 @@ export function toWireQuestionResponse(input: QuestionResponse): WireQuestionRes // Task mapper // --------------------------------------------------------------------------- +const ROUTING_OPERATIONS: readonly AppSubagentRouting['operation'][] = ['spawn', 'fork', 'resume']; +const ROUTING_PROFILE_SOURCES: readonly AppSubagentRouting['profileSource'][] = [ + 'requested', + 'default', + 'fork-inherit', + 'resume-existing', +]; +const ROUTING_MODEL_SOURCES: readonly AppSubagentRouting['modelSource'][] = [ + 'caller', + 'policy-default', + 'policy-pool', + 'policy-force', + 'fork-inherit', + 'resume-existing', +]; +const ROUTING_POLICY_MODES: readonly AppSubagentRouting['policyMode'][] = ['inherit', 'default', 'pool', 'force']; +const ROUTING_POLICY_SOURCES: readonly AppSubagentRouting['policySource'][] = ['config', 'default']; +const ROUTING_FEATURE_SOURCES: readonly AppSubagentRouting['featureSource'][] = [ + 'master-env', + 'env', + 'config', + 'default', +]; + +function oneOf(allowed: readonly T[], value: unknown): T | undefined { + return typeof value === 'string' && (allowed as readonly string[]).includes(value) ? (value as T) : undefined; +} + +function nonEmptyString(value: unknown): string | undefined { + return typeof value === 'string' && value.length > 0 ? value : undefined; +} + +/** Builds the app routing object only when every field carries a value from its contract. */ +function toAppSubagentRoutingFromKeys( + r: Record, + keys: Record, +): AppSubagentRouting | undefined { + const operation = oneOf(ROUTING_OPERATIONS, r[keys.operation]); + const profileSource = oneOf(ROUTING_PROFILE_SOURCES, r[keys.profileSource]); + const modelSource = oneOf(ROUTING_MODEL_SOURCES, r[keys.modelSource]); + const policyMode = oneOf(ROUTING_POLICY_MODES, r[keys.policyMode]); + const policySource = oneOf(ROUTING_POLICY_SOURCES, r[keys.policySource]); + const featureSource = oneOf(ROUTING_FEATURE_SOURCES, r[keys.featureSource]); + const routingEnvRevision = nonEmptyString(r[keys.routingEnvRevision]); + const routeDecision = nonEmptyString(r[keys.routeDecision]); + if ( + operation === undefined || + profileSource === undefined || + modelSource === undefined || + policyMode === undefined || + policySource === undefined || + featureSource === undefined || + routingEnvRevision === undefined || + routeDecision === undefined + ) { + return undefined; + } + return { + operation, + profileSource, + modelSource, + policyMode, + policySource, + featureSource, + routingEnvRevision, + routeDecision, + }; +} + +const REST_ROUTING_KEYS: Record = { + operation: 'operation', + profileSource: 'profile_source', + modelSource: 'model_source', + policyMode: 'policy_mode', + policySource: 'policy_source', + featureSource: 'feature_source', + routingEnvRevision: 'routing_env_revision', + routeDecision: 'route_decision', +}; + +const EVENT_ROUTING_KEYS: Record = { + operation: 'operation', + profileSource: 'profileSource', + modelSource: 'modelSource', + policyMode: 'policyMode', + policySource: 'policySource', + featureSource: 'featureSource', + routingEnvRevision: 'resolvedFromRoutingEnvironmentRevision', + routeDecision: 'routeDecisionFingerprint', +}; + +export function toAppSubagentRouting(wire: unknown): AppSubagentRouting | undefined { + if (typeof wire !== 'object' || wire === null) return undefined; + return toAppSubagentRoutingFromKeys(wire as Record, REST_ROUTING_KEYS); +} + +/** Engine-side camelCase provenance (WS `subagent.spawned` / `task.started` payloads). */ +export function toAppSubagentRoutingFromEvent(payload: unknown): AppSubagentRouting | undefined { + if (typeof payload !== 'object' || payload === null) return undefined; + return toAppSubagentRoutingFromKeys(payload as Record, EVENT_ROUTING_KEYS); +} + export function toAppTask(wire: WireTask): AppTask { return { id: wire.id, @@ -385,6 +489,8 @@ export function toAppTask(wire: WireTask): AppTask { agentId: wire.agent_id, model: wire.model, thinkingEffort: wire.thinking_effort, + routing: toAppSubagentRouting(wire.routing), + currentRoutingEnvRevision: wire.current_routing_env_revision, subagentPhase: wire.subagent_phase, subagentType: wire.subagent_type, parentToolCallId: wire.parent_tool_call_id, diff --git a/apps/pythinker-web/src/api/daemon/wire.ts b/apps/pythinker-web/src/api/daemon/wire.ts index 25c994f59..5bd3224e1 100644 --- a/apps/pythinker-web/src/api/daemon/wire.ts +++ b/apps/pythinker-web/src/api/daemon/wire.ts @@ -316,6 +316,23 @@ export interface WireQuestionResponse { export type WireTaskStatus = 'running' | 'completed' | 'failed' | 'cancelled'; +export interface WireSubagentRouting { + operation: 'spawn' | 'fork' | 'resume'; + profile_source: 'requested' | 'default' | 'fork-inherit' | 'resume-existing'; + model_source: + | 'caller' + | 'policy-default' + | 'policy-pool' + | 'policy-force' + | 'fork-inherit' + | 'resume-existing'; + policy_mode: 'inherit' | 'default' | 'pool' | 'force'; + policy_source: 'config' | 'default'; + feature_source: 'master-env' | 'env' | 'config' | 'default'; + routing_env_revision: string; + route_decision: string; +} + export interface WireTask { id: string; session_id: string; @@ -331,6 +348,8 @@ export interface WireTask { agent_id?: string; model?: string; thinking_effort?: string; + routing?: WireSubagentRouting; + current_routing_env_revision?: string; subagent_phase?: 'queued' | 'working' | 'suspended' | 'completed' | 'failed'; subagent_type?: string; parent_tool_call_id?: string; diff --git a/apps/pythinker-web/src/api/types.ts b/apps/pythinker-web/src/api/types.ts index f8af7676c..f326e66b8 100644 --- a/apps/pythinker-web/src/api/types.ts +++ b/apps/pythinker-web/src/api/types.ts @@ -317,6 +317,30 @@ export interface QuestionResponse { export type AppTaskStatus = 'running' | 'completed' | 'failed' | 'cancelled'; export type AppSubagentPhase = 'queued' | 'working' | 'suspended' | 'completed' | 'failed' | 'cancelled'; +export type AppSubagentRoutingOperation = 'spawn' | 'fork' | 'resume'; +export type AppSubagentProfileSource = 'requested' | 'default' | 'fork-inherit' | 'resume-existing'; +export type AppSubagentModelSource = + | 'caller' + | 'policy-default' + | 'policy-pool' + | 'policy-force' + | 'fork-inherit' + | 'resume-existing'; +export type AppSubagentPolicyMode = 'inherit' | 'default' | 'pool' | 'force'; +export type AppSubagentPolicySource = 'config' | 'default'; +export type AppSubagentFeatureSource = 'master-env' | 'env' | 'config' | 'default'; + +export interface AppSubagentRouting { + operation: AppSubagentRoutingOperation; + profileSource: AppSubagentProfileSource; + modelSource: AppSubagentModelSource; + policyMode: AppSubagentPolicyMode; + policySource: AppSubagentPolicySource; + featureSource: AppSubagentFeatureSource; + routingEnvRevision: string; + routeDecision: string; +} + export interface AppTask { id: string; sessionId: string; @@ -333,6 +357,10 @@ export interface AppTask { agentId?: string; model?: string; thinkingEffort?: string; + /** Why the subagent is bound the way it is (stable enum ids from the server). */ + routing?: AppSubagentRouting; + /** The caller's routing environment revision when this task was observed. */ + currentRoutingEnvRevision?: string; outputLines?: string[]; // accumulated by eventReducer from task.progress chunks /** The subagent's concatenated live output (assistant.delta), accumulated by * the event reducer from `taskProgress` chunks of kind `text`. Grows in the diff --git a/apps/pythinker-web/src/composables/dynamicWorkflowGroups.ts b/apps/pythinker-web/src/composables/dynamicWorkflowGroups.ts index c9bc111e6..e96101f70 100644 --- a/apps/pythinker-web/src/composables/dynamicWorkflowGroups.ts +++ b/apps/pythinker-web/src/composables/dynamicWorkflowGroups.ts @@ -1,4 +1,5 @@ -import type { AppSubagentPhase, AppTask } from '../api/types'; +import type { + AppSubagentRouting, AppSubagentPhase, AppTask } from '../api/types'; export interface DynamicWorkflowMember { id: string; @@ -6,6 +7,10 @@ export interface DynamicWorkflowMember { subagentType?: string; model?: string; thinkingEffort?: string; + routing?: AppSubagentRouting; + currentRoutingEnvRevision?: string; + startedAt?: string; + completedAt?: string; phase: AppSubagentPhase; summary?: string; outputLines?: string[]; @@ -59,6 +64,10 @@ export function buildDynamicWorkflowGroups(tasks: AppTask[]): DynamicWorkflowGro subagentType: task.subagentType, model: task.model, thinkingEffort: task.thinkingEffort, + routing: task.routing, + currentRoutingEnvRevision: task.currentRoutingEnvRevision, + startedAt: task.startedAt, + completedAt: task.completedAt, phase: phaseForTask(task), summary: task.outputPreview, outputLines: task.outputLines, @@ -116,6 +125,10 @@ export function dynamicWorkflowMembersByToolCall(tasks: AppTask[]): Map` payload (terminal result) — kept in plain TS so it can // be unit-tested without mounting the component. -import type { AppSubagentPhase } from '../api/types'; +import type { AppSubagentPhase, AppSubagentRouting } from '../api/types'; import type { DynamicWorkflowMember } from '../composables/dynamicWorkflowGroups'; import type { DynamicWorkflowResult, DynamicWorkflowResultSubagent } from './parseDynamicWorkflowResult'; @@ -22,6 +22,15 @@ export interface DynamicWorkflowCardRow { * row corresponds to a real subagent — lets a settled row open the agent * detail panel. */ agentId?: string; + /** Binding facts: live members carry them from the task; settled rows read + * the durable `` attributes. Labels are derived by the component. */ + profile?: string; + model?: string; + thinkingEffort?: string; + routing?: AppSubagentRouting; + currentRoutingEnvRevision?: string; + startedAt?: string; + completedAt?: string; } function lastNonEmptyLine(text: string | undefined): string { @@ -66,6 +75,12 @@ function resultRow(sub: DynamicWorkflowResultSubagent, index: number): DynamicWo body: sub.body, live: false, agentId: sub.agentId, + profile: sub.profile, + model: sub.model, + thinkingEffort: sub.thinking, + routing: sub.routing, + startedAt: sub.startedAt, + completedAt: sub.completedAt, }; } @@ -99,6 +114,13 @@ export function buildDynamicWorkflowCardRows(members: DynamicWorkflowMember[], r phase: m.phase, body: dynamicWorkflowMemberBody(m), live: true, + profile: m.subagentType, + model: m.model, + thinkingEffort: m.thinkingEffort, + routing: m.routing, + currentRoutingEnvRevision: m.currentRoutingEnvRevision, + startedAt: m.startedAt, + completedAt: m.completedAt, })); if (!result) return memberRows; diff --git a/apps/pythinker-web/src/lib/parseDynamicWorkflowResult.ts b/apps/pythinker-web/src/lib/parseDynamicWorkflowResult.ts index a0234bd47..7c4a91baa 100644 --- a/apps/pythinker-web/src/lib/parseDynamicWorkflowResult.ts +++ b/apps/pythinker-web/src/lib/parseDynamicWorkflowResult.ts @@ -4,12 +4,21 @@ // arrives as a plain string inside the toolResult output; the dynamic_workflow card turns // it into a structured aggregate view. Defensive: never throws. +import type { AppSubagentRouting } from '../api/types'; + export interface DynamicWorkflowResultSubagent { outcome: string; item?: string; agentId?: string; mode?: string; state?: string; + /** Durable binding attributes written by the engine (absent on older results). */ + profile?: string; + model?: string; + thinking?: string; + routing?: AppSubagentRouting; + startedAt?: string; + completedAt?: string; body: string; } @@ -67,9 +76,41 @@ function parseCounts(summary: string): Pick): AppSubagentRouting | undefined { + const operation = parsed['mode'] === 'resume' ? 'resume' : undefined; + const profileSource = parsed['profile_source']; + const modelSource = parsed['model_source']; + const policyMode = parsed['policy_mode']; + const policySource = parsed['policy_source']; + const featureSource = parsed['feature_source']; + const routingEnvRevision = parsed['routing_env_revision']; + const routeDecision = parsed['route_decision']; + if ( + profileSource === undefined || + modelSource === undefined || + policyMode === undefined || + policySource === undefined || + featureSource === undefined || + routingEnvRevision === undefined || + routeDecision === undefined + ) { + return undefined; + } + return { + operation: operation ?? (modelSource === 'fork-inherit' ? 'fork' : 'spawn'), + profileSource: profileSource as AppSubagentRouting['profileSource'], + modelSource: modelSource as AppSubagentRouting['modelSource'], + policyMode: policyMode as AppSubagentRouting['policyMode'], + policySource: policySource as AppSubagentRouting['policySource'], + featureSource: featureSource as AppSubagentRouting['featureSource'], + routingEnvRevision, + routeDecision, + }; +} + function parseSubagent(attrs: string, body: string): DynamicWorkflowResultSubagent { const parsed = parseAttrs(attrs); - return { + const sub: DynamicWorkflowResultSubagent = { outcome: parsed['outcome'] ?? 'completed', item: parsed['item'], agentId: parsed['agent_id'], @@ -77,6 +118,14 @@ function parseSubagent(attrs: string, body: string): DynamicWorkflowResultSubage state: parsed['state'], body: body.trim(), }; + if (parsed['profile'] !== undefined) sub.profile = parsed['profile']; + if (parsed['model'] !== undefined) sub.model = parsed['model']; + if (parsed['thinking'] !== undefined) sub.thinking = parsed['thinking']; + const routing = parseRouting(parsed); + if (routing !== undefined) sub.routing = routing; + if (parsed['started_at'] !== undefined) sub.startedAt = parsed['started_at']; + if (parsed['completed_at'] !== undefined) sub.completedAt = parsed['completed_at']; + return sub; } function parseSubagents(text: string): DynamicWorkflowResultSubagent[] { diff --git a/apps/pythinker-web/src/lib/taskMerge.ts b/apps/pythinker-web/src/lib/taskMerge.ts index 11ab7cc66..4d5042042 100644 --- a/apps/pythinker-web/src/lib/taskMerge.ts +++ b/apps/pythinker-web/src/lib/taskMerge.ts @@ -66,6 +66,8 @@ export function keepLiveSubagents(restBased: AppTask[], existing: AppTask[]): Ap agentId: live.agentId ?? rest.agentId, model: live.model ?? rest.model, thinkingEffort: live.thinkingEffort ?? rest.thinkingEffort, + routing: live.routing ?? rest.routing, + currentRoutingEnvRevision: live.currentRoutingEnvRevision ?? rest.currentRoutingEnvRevision, completedAt: hasAuthoritativeRestCompletion ? rest.completedAt : live.completedAt ?? rest.completedAt, diff --git a/apps/pythinker-web/test/agent-event-projector.test.ts b/apps/pythinker-web/test/agent-event-projector.test.ts index 94dae0715..4311efac2 100644 --- a/apps/pythinker-web/test/agent-event-projector.test.ts +++ b/apps/pythinker-web/test/agent-event-projector.test.ts @@ -64,6 +64,56 @@ describe('subagent streaming text', () => { }); }); + it('keeps the routing provenance and current revision from subagent.spawned on the task', () => { + const projector = createAgentProjector(); + const events = projector.project( + 'subagent.spawned', + { + subagentId: 'sub-r', + subagentName: 'coder', + description: 'Fix it', + model: 'acme/luna', + thinkingEffort: 'low', + routing: { + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + policyMode: 'inherit', + policySource: 'default', + featureSource: 'config', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:old', + routeDecisionFingerprint: 'route-decision:v1:x', + }, + currentRoutingEnvironmentRevision: 'route-env:v1:new', + }, + 's1', + ); + expect(events).toContainEqual( + expect.objectContaining({ + type: 'taskCreated', + task: expect.objectContaining({ + id: 'sub-r', + model: 'acme/luna', + routing: { + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + policyMode: 'inherit', + policySource: 'default', + featureSource: 'config', + routingEnvRevision: 'route-env:v1:old', + routeDecision: 'route-decision:v1:x', + }, + currentRoutingEnvRevision: 'route-env:v1:new', + }), + }), + ); + const plain = projector.project('subagent.spawned', { subagentId: 'sub-p', description: 'Plain' }, 's1'); + const task = (plain.find((e) => e.type === 'taskCreated') as { task?: { routing?: unknown } } | undefined)?.task; + expect(task).toBeDefined(); + expect(task?.routing).toBeUndefined(); + }); + it('drops an empty subagent assistant.delta', () => { const projector = createAgentProjector(); const events = projector.project('assistant.delta', { agentId: 'sub-1', delta: '' }, 's1'); @@ -594,6 +644,69 @@ describe('background subagent task registration', () => { ]); }); + it('clears suspendedReason when a later subagent.suspended carries no reason', () => { + const projector = createAgentProjector(); + projector.project('subagent.spawned', { subagentId: 'agent-1', description: 'Explore repo' }, 's1'); + const first = projector.project('subagent.suspended', { subagentId: 'agent-1', reason: 'waiting for input' }, 's1'); + expect(first).toHaveLength(1); + expect((first[0] as { task: Record }).task['suspendedReason']).toBe('waiting for input'); + + const events = projector.project('subagent.suspended', { subagentId: 'agent-1' }, 's1'); + + expect(events).toHaveLength(1); + const task = (events[0] as { task: Record }).task; + expect(task['subagentPhase']).toBe('suspended'); + expect('suspendedReason' in task).toBe(false); + }); + + it('keeps the spawned routing provenance when task.started omits it', () => { + const projector = createAgentProjector(); + const routing = { + operation: 'spawn', + profileSource: 'requested', + modelSource: 'caller', + policyMode: 'inherit', + policySource: 'default', + featureSource: 'default', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }; + projector.project( + 'subagent.spawned', + { + subagentId: 'agent-1', + description: 'Explore repo', + runInBackground: true, + model: 'provider/fast', + thinkingEffort: 'low', + routing, + currentRoutingEnvironmentRevision: 'route-env:v1:aaa', + }, + 's1', + ); + + const events = projector.project( + 'task.started', + { info: { taskId: 'task-9', kind: 'agent', detached: true, agentId: 'agent-1' } }, + 's1', + ); + + expect(events).toEqual([ + { + type: 'taskCreated', + sessionId: 's1', + task: expect.objectContaining({ + id: 'agent-1', + backgroundTaskId: 'task-9', + model: 'provider/fast', + thinkingEffort: 'low', + routing: expect.objectContaining({ operation: 'spawn', routeDecision: 'route-decision:v1:bbb' }), + currentRoutingEnvRevision: 'route-env:v1:aaa', + }), + }, + ]); + }); + it('keys a late registration by agent id so later progress frames stay on one row', () => { const projector = createAgentProjector(); const events = projector.project( diff --git a/apps/pythinker-web/test/dynamic-workflow-card-rows.test.ts b/apps/pythinker-web/test/dynamic-workflow-card-rows.test.ts index 333704ec8..8a8099f92 100644 --- a/apps/pythinker-web/test/dynamic-workflow-card-rows.test.ts +++ b/apps/pythinker-web/test/dynamic-workflow-card-rows.test.ts @@ -115,3 +115,76 @@ describe('buildDynamicWorkflowCardRows', () => { expect(rows.map((r) => r.id)).toEqual(['a1']); }); }); + +describe('buildDynamicWorkflowCardRows binding pass-through', () => { + const routing = { + operation: 'spawn' as const, + profileSource: 'default' as const, + modelSource: 'policy-force' as const, + policyMode: 'force' as const, + policySource: 'config' as const, + featureSource: 'env' as const, + routingEnvRevision: 'route-env:v1:aaa', + routeDecision: 'route-decision:v1:bbb', + }; + + it('keeps profile, model, effort, routing and timestamps from live members', () => { + const rows = buildDynamicWorkflowCardRows( + [ + { + ...member('t1', 'Review #1'), + subagentType: 'explore', + model: 'acme/luna', + thinkingEffort: 'low', + routing, + currentRoutingEnvRevision: 'route-env:v1:now', + startedAt: '2026-01-01T00:00:00.000Z', + completedAt: '2026-01-01T00:00:05.000Z', + }, + ], + null, + ); + expect(rows[0]).toMatchObject({ + live: true, + profile: 'explore', + model: 'acme/luna', + thinkingEffort: 'low', + routing, + currentRoutingEnvRevision: 'route-env:v1:now', + startedAt: '2026-01-01T00:00:00.000Z', + completedAt: '2026-01-01T00:00:05.000Z', + }); + }); + + it('keeps the durable binding attributes on result-only rows after a reload', () => { + const rows = buildDynamicWorkflowCardRows( + [], + result([ + { + outcome: 'completed', + item: 'alpha', + agentId: 'a1', + body: 'done', + profile: 'explore', + model: 'acme/luna', + thinking: 'low', + routing, + startedAt: '2026-01-01T00:00:00.000Z', + completedAt: '2026-01-01T00:00:05.000Z', + }, + { outcome: 'completed', item: 'beta', body: 'old row' }, + ]), + ); + expect(rows[0]).toMatchObject({ + live: false, + profile: 'explore', + model: 'acme/luna', + thinkingEffort: 'low', + routing, + startedAt: '2026-01-01T00:00:00.000Z', + completedAt: '2026-01-01T00:00:05.000Z', + }); + expect(rows[1]?.routing).toBeUndefined(); + expect(rows[1]?.model).toBeUndefined(); + }); +}); diff --git a/apps/pythinker-web/test/dynamic-workflow-result.test.ts b/apps/pythinker-web/test/dynamic-workflow-result.test.ts index 6fe07a610..767ceaf62 100644 --- a/apps/pythinker-web/test/dynamic-workflow-result.test.ts +++ b/apps/pythinker-web/test/dynamic-workflow-result.test.ts @@ -70,3 +70,46 @@ describe('parseDynamicWorkflowResult', () => { expect(result?.subagents[1]?.body).toBe('just B'); }); }); + +describe('parseDynamicWorkflowResult binding attributes', () => { + it('reads the durable binding attributes and unescapes them; old rows stay compatible', () => { + const output = [ + '', + 'completed: 2', + 'first', + 'second', + 'boom', + '', + ]; + const result = parseDynamicWorkflowResult(output); + expect(result?.subagents[0]).toEqual({ + outcome: 'completed', + item: 'alpha', + agentId: 'a1', + body: 'first', + profile: 'explore', + model: 'acme/"q" & ', + thinking: 'low', + routing: { + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-pool', + policyMode: 'pool', + policySource: 'config', + featureSource: 'env', + routingEnvRevision: 'route-env:v1:aaa', + routeDecision: 'route-decision:v1:bbb', + }, + startedAt: '2026-01-01T00:00:00.000Z', + completedAt: '2026-01-01T00:00:05.000Z', + }); + expect(result?.subagents[1]).toMatchObject({ + mode: 'resume', + profile: 'coder', + model: 'acme/luna', + routing: { operation: 'resume', modelSource: 'resume-existing', routingEnvRevision: 'route-env:v1:old' }, + }); + expect(result?.subagents[1]?.thinking).toBeUndefined(); + expect(result?.subagents[2]).toEqual({ outcome: 'failed', item: 'gamma', body: 'boom' }); + }); +}); diff --git a/apps/pythinker-web/test/lib-logic.test.ts b/apps/pythinker-web/test/lib-logic.test.ts index e19262c97..836cee074 100644 --- a/apps/pythinker-web/test/lib-logic.test.ts +++ b/apps/pythinker-web/test/lib-logic.test.ts @@ -792,6 +792,24 @@ describe('keepLiveSubagents', () => { }; } + it('keeps live routing provenance and falls back to the REST copy', () => { + const routing = { + operation: 'spawn' as const, + profileSource: 'default' as const, + modelSource: 'caller' as const, + policyMode: 'inherit' as const, + policySource: 'default' as const, + featureSource: 'default' as const, + routingEnvRevision: 'route-env:v1:aaa', + routeDecision: 'route-decision:v1:bbb', + }; + const rest = [subagent('bg-1', { agentId: 'a1', routing, currentRoutingEnvRevision: 'route-env:v1:rest' })]; + const live = [subagent('a1', { agentId: 'a1', backgroundTaskId: 'bg-1' })]; + const merged = keepLiveSubagents(rest, live); + expect(merged).toHaveLength(1); + expect(merged[0]).toMatchObject({ id: 'a1', routing, currentRoutingEnvRevision: 'route-env:v1:rest' }); + }); + it('returns the REST list untouched when no live-only subagent exists', () => { const rest = [subagent('a1')]; expect(keepLiveSubagents(rest, [subagent('a1')])).toBe(rest); diff --git a/apps/pythinker-web/test/model-mappers.test.ts b/apps/pythinker-web/test/model-mappers.test.ts index a6c81986b..53aded439 100644 --- a/apps/pythinker-web/test/model-mappers.test.ts +++ b/apps/pythinker-web/test/model-mappers.test.ts @@ -1,6 +1,90 @@ import { describe, expect, it } from 'vitest'; -import { toAppExperimentalFlagStates, toAppModel } from '../src/api/daemon/mappers'; +import { + toAppExperimentalFlagStates, + toAppModel, + toAppSubagentRouting, + toAppSubagentRoutingFromEvent, + toAppTask, +} from '../src/api/daemon/mappers'; +import type { WireTask } from '../src/api/daemon/wire'; + +describe('subagent routing mappers', () => { + const wire = { + operation: 'spawn' as const, + profile_source: 'requested' as const, + model_source: 'policy-force' as const, + policy_mode: 'force' as const, + policy_source: 'config' as const, + feature_source: 'env' as const, + routing_env_revision: 'route-env:v1:aaa', + route_decision: 'route-decision:v1:bbb', + }; + const app = { + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-force', + policyMode: 'force', + policySource: 'config', + featureSource: 'env', + routingEnvRevision: 'route-env:v1:aaa', + routeDecision: 'route-decision:v1:bbb', + }; + + it('maps the REST snake_case shape and rejects incomplete objects', () => { + expect(toAppSubagentRouting(wire)).toEqual(app); + expect(toAppSubagentRouting({ ...wire, route_decision: undefined })).toBeUndefined(); + expect(toAppSubagentRouting(undefined)).toBeUndefined(); + }); + + it('maps the engine camelCase event shape', () => { + expect( + toAppSubagentRoutingFromEvent({ + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-force', + policyMode: 'force', + policySource: 'config', + featureSource: 'env', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }), + ).toEqual(app); + expect(toAppSubagentRoutingFromEvent({ operation: 'spawn' })).toBeUndefined(); + }); + + it('rejects values outside the routing contract instead of casting them through', () => { + expect(toAppSubagentRouting({ ...wire, policy_mode: 'invalid' })).toBeUndefined(); + expect(toAppSubagentRouting({ ...wire, routing_env_revision: '' })).toBeUndefined(); + expect( + toAppSubagentRoutingFromEvent({ + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-force', + policyMode: 'force', + policySource: 'config', + featureSource: 'somewhere-else', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }), + ).toBeUndefined(); + }); + + it('toAppTask carries routing and the current revision', () => { + const task: WireTask = { + id: 't1', + session_id: 's1', + kind: 'subagent', + description: 'd', + status: 'running', + created_at: '2026-01-01T00:00:00.000Z', + routing: wire, + current_routing_env_revision: 'route-env:v1:now', + }; + expect(toAppTask(task)).toMatchObject({ routing: app, currentRoutingEnvRevision: 'route-env:v1:now' }); + expect(toAppTask({ ...task, routing: undefined }).routing).toBeUndefined(); + }); +}); import type { WireExperimentalFlagState, WireModel } from '../src/api/daemon/wire'; describe('experimental flag state mapper', () => { diff --git a/packages/agent-core-v2/docs/state-manifest.d.ts b/packages/agent-core-v2/docs/state-manifest.d.ts index 0d7d65d3c..f41f22f39 100644 --- a/packages/agent-core-v2/docs/state-manifest.d.ts +++ b/packages/agent-core-v2/docs/state-manifest.d.ts @@ -27,7 +27,7 @@ // references become '(circular)', and class instances collapse to a '(ClassName)' // marker — the wire shape of an entry is the JSON projection of the type here. // -// Index (App: 0 keys · Workspace: 6 keys · Session: 9 keys · Agent: 84 keys) +// Index (App: 0 keys · Workspace: 6 keys · Session: 9 keys · Agent: 85 keys) // App // Workspace // workspaceDirs.ephemeralDirs src/workspace/workspaceDirs/workspaceDirsService.ts @@ -103,6 +103,7 @@ // staleGuard src/features/staleGuard/staleGuardOps.ts // stepRetry.failedAttempts src/agent/stepRetry/stepRetryService.ts // stepRetry.lastFailedDriverId src/agent/stepRetry/stepRetryService.ts +// subagent.bindingProvenance src/session/subagent/bindingProvenance.ts // task src/agent/task/taskOps.ts // task.activeTaskReminderPending src/agent/task/taskService.ts // task.deliveredNotificationKeys src/agent/task/taskService.ts @@ -1339,6 +1340,17 @@ export interface AgentStateSnapshot { readonly parentToolCallId?: string; readonly model?: string; readonly thinkingEffort?: string; + readonly routing?: /* SubagentBindingProvenance — packages/agent-core-v2/src/session/subagent/routing.ts */ { + readonly operation: /* SubagentRoutingOperation — packages/agent-core-v2/src/session/subagent/policy.ts */ 'spawn' | 'fork' | 'resume'; + readonly profileSource: /* SubagentProfileSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'default' | 'requested' | 'fork-inherit' | 'resume-existing'; + readonly modelSource: /* SubagentModelSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'fork-inherit' | 'resume-existing' | 'caller' | 'policy-default' | 'policy-pool' | 'policy-force'; + readonly policyMode: 'default' | 'inherit' | 'pool' | 'force'; + readonly policySource: /* SubagentPolicySource — packages/agent-core-v2/src/session/subagent/policy.ts */ 'default' | 'config'; + readonly featureSource: /* ExperimentalFlagSource — packages/agent-core-v2/src/app/flag/flag.ts */ 'default' | 'config' | 'master-env' | 'env'; + readonly resolvedFromRoutingEnvironmentRevision: string; + readonly routeDecisionFingerprint: string; + }; + readonly currentRoutingEnvironmentRevision?: string; readonly taskId: string; readonly description: string; readonly status: /* AgentTaskStatus — packages/agent-core-v2/src/agent/task/types.ts */ 'completed' | 'failed' | 'running' | 'timed_out' | 'killed' | 'lost'; @@ -1387,6 +1399,17 @@ export interface AgentStateSnapshot { readonly parentToolCallId?: string; readonly model?: string; readonly thinkingEffort?: string; + readonly routing?: /* SubagentBindingProvenance — packages/agent-core-v2/src/session/subagent/routing.ts */ { + readonly operation: /* SubagentRoutingOperation — packages/agent-core-v2/src/session/subagent/policy.ts */ 'spawn' | 'fork' | 'resume'; + readonly profileSource: /* SubagentProfileSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'default' | 'requested' | 'fork-inherit' | 'resume-existing'; + readonly modelSource: /* SubagentModelSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'fork-inherit' | 'resume-existing' | 'caller' | 'policy-default' | 'policy-pool' | 'policy-force'; + readonly policyMode: 'default' | 'inherit' | 'pool' | 'force'; + readonly policySource: /* SubagentPolicySource — packages/agent-core-v2/src/session/subagent/policy.ts */ 'default' | 'config'; + readonly featureSource: /* ExperimentalFlagSource — packages/agent-core-v2/src/app/flag/flag.ts */ 'default' | 'config' | 'master-env' | 'env'; + readonly resolvedFromRoutingEnvironmentRevision: string; + readonly routeDecisionFingerprint: string; + }; + readonly currentRoutingEnvironmentRevision?: string; readonly taskId: string; readonly description: string; readonly status: /* AgentTaskStatus — packages/agent-core-v2/src/agent/task/types.ts */ 'completed' | 'failed' | 'running' | 'timed_out' | 'killed' | 'lost'; @@ -1472,6 +1495,18 @@ export interface AgentStateSnapshot { 'tower': boolean; // replayable · durable — folds: TowerModeEnter, TowerModeExit 'tower.owner': string | undefined; + // src/session/subagent/bindingProvenance.ts + // replayable · durable — folds: SubagentBindingProvenanceRecorded + 'subagent.bindingProvenance': /* SubagentBindingProvenance — packages/agent-core-v2/src/session/subagent/routing.ts */ { + readonly operation: /* SubagentRoutingOperation — packages/agent-core-v2/src/session/subagent/policy.ts */ 'spawn' | 'fork' | 'resume'; + readonly profileSource: /* SubagentProfileSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'default' | 'requested' | 'fork-inherit' | 'resume-existing'; + readonly modelSource: /* SubagentModelSource — packages/agent-core-v2/src/session/subagent/routing.ts */ 'fork-inherit' | 'resume-existing' | 'caller' | 'policy-default' | 'policy-pool' | 'policy-force'; + readonly policyMode: 'default' | 'inherit' | 'pool' | 'force'; + readonly policySource: /* SubagentPolicySource — packages/agent-core-v2/src/session/subagent/policy.ts */ 'default' | 'config'; + readonly featureSource: /* ExperimentalFlagSource — packages/agent-core-v2/src/app/flag/flag.ts */ 'default' | 'config' | 'master-env' | 'env'; + readonly resolvedFromRoutingEnvironmentRevision: string; + readonly routeDecisionFingerprint: string; + } | undefined; } export type AgentStateKey = keyof AgentStateSnapshot; diff --git a/packages/agent-core-v2/docs/wire-manifest.d.ts b/packages/agent-core-v2/docs/wire-manifest.d.ts index 003386d2f..78a427045 100644 --- a/packages/agent-core-v2/docs/wire-manifest.d.ts +++ b/packages/agent-core-v2/docs/wire-manifest.d.ts @@ -24,62 +24,63 @@ // cross-reducers), blobs (the folding states whose blob codec offloads inline // media to blob storage), owner (the source file declaring the class). -// Index (55 record types) -// config.update profile src/agent/profile/profileOps.ts -// context.append_loop_event contextMemory, turn src/agent/contextMemory/contextEvents.ts -// context.append_message contextMemory, plan, task.notificationDelivery src/agent/contextMemory/contextEvents.ts -// context.apply_compaction contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts -// context.clear contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts -// context.undo contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts -// cron.add (none) src/features/cron/cronOps.ts -// cron.cursor (none) src/features/cron/cronOps.ts -// cron.delete (none) src/features/cron/cronOps.ts -// dynamic_workflow_mode.enter dynamic_workflow src/features/dynamic_workflow/dynamicWorkflowOps.ts -// dynamic_workflow_mode.exit contextMemory, dynamic_workflow src/features/dynamic_workflow/dynamicWorkflowOps.ts -// forked (none) src/features/goal/goalOps.ts -// full_compaction.begin fullCompaction src/agent/fullCompaction/compactionOps.ts -// full_compaction.cancel fullCompaction src/agent/fullCompaction/compactionOps.ts -// full_compaction.complete fullCompaction src/agent/fullCompaction/compactionOps.ts -// goal.clear (none) src/features/goal/goalOps.ts -// goal.create (none) src/features/goal/goalOps.ts -// goal.update (none) src/features/goal/goalOps.ts -// interaction.request (none) src/features/interaction/interactionOps.ts -// interaction.resolved (none) src/features/interaction/interactionOps.ts -// interruptionReminder.recorded interruptionReminder src/agent/interruptionReminder/interruptionReminderOps.ts -// llm.request llm.requestTrace src/agent/llmRequester/llmRequestOps.ts -// llm.tools_snapshot llm.requestTrace src/agent/llmRequester/llmRequestOps.ts -// mcp.tools_discovered mcp.discovery src/agent/mcp/mcpDiscoveryOps.ts -// permission.record_approval_result permissionRules src/agent/permissionRules/permissionRulesOps.ts -// permission.set_mode permissionMode, permissionMode.configured src/agent/permissionMode/permissionModeOps.ts -// plan_mode.cancel plan src/features/plan/planOps.ts -// plan_mode.enter plan src/features/plan/planOps.ts -// plan_mode.exit plan src/features/plan/planOps.ts -// plan.revision plan src/features/plan/planOps.ts -// plugin.session_start pluginSessionStartSnapshot src/agent/plugin/agentPluginOps.ts -// profile.bind profile, profile.activeTools src/agent/profile/profileOps.ts -// prompt.accepted promptAdmission src/agent/prompt/promptOps.ts -// runtime.set_binding runtimeBinding src/agent/runtimeBinding/runtimeBindingOps.ts -// staleGuard.cleared staleGuard src/features/staleGuard/staleGuardOps.ts -// staleGuard.recorded staleGuard src/features/staleGuard/staleGuardOps.ts -// task.started task src/agent/task/taskOps.ts -// task.terminated task src/agent/task/taskOps.ts -// task.waitDelivered task.notificationDelivery src/agent/task/taskOps.ts -// token_counting.measured (none) src/agent/tokenCounting/tokenCountingOps.ts -// token_counting.rebased (none) src/agent/tokenCounting/tokenCountingOps.ts -// token_counting.truncated (none) src/agent/tokenCounting/tokenCountingOps.ts -// token_counting.turn_recorded (none) src/agent/tokenCounting/tokenCountingOps.ts -// tools.register_user_tool userTool src/agent/userTool/userToolOps.ts -// tools.reset_active_tools profile.activeTools src/agent/profile/profileOps.ts -// tools.set_active_tools profile.activeTools src/agent/profile/profileOps.ts -// tools.unregister_user_tool userTool src/agent/userTool/userToolOps.ts -// tools.update_store (none) src/features/todo/todoOps.ts -// tower_mode.enter tower, tower.owner src/features/tower/towerOps.ts -// tower_mode.exit tower, tower.owner src/features/tower/towerOps.ts -// turn.cancel turn src/agent/loop/turnOps.ts -// turn.ended turn src/agent/loop/turnOps.ts -// turn.prompt turn src/agent/loop/turnOps.ts -// turn.steer turn src/agent/loop/turnOps.ts -// usage.record (none) src/agent/usage/usageOps.ts +// Index (56 record types) +// config.update profile src/agent/profile/profileOps.ts +// context.append_loop_event contextMemory, turn src/agent/contextMemory/contextEvents.ts +// context.append_message contextMemory, plan, task.notificationDelivery src/agent/contextMemory/contextEvents.ts +// context.apply_compaction contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts +// context.clear contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts +// context.undo contextMemory, plan, task.notificationDelivery, turn src/agent/contextMemory/contextEvents.ts +// cron.add (none) src/features/cron/cronOps.ts +// cron.cursor (none) src/features/cron/cronOps.ts +// cron.delete (none) src/features/cron/cronOps.ts +// dynamic_workflow_mode.enter dynamic_workflow src/features/dynamic_workflow/dynamicWorkflowOps.ts +// dynamic_workflow_mode.exit contextMemory, dynamic_workflow src/features/dynamic_workflow/dynamicWorkflowOps.ts +// forked (none) src/features/goal/goalOps.ts +// full_compaction.begin fullCompaction src/agent/fullCompaction/compactionOps.ts +// full_compaction.cancel fullCompaction src/agent/fullCompaction/compactionOps.ts +// full_compaction.complete fullCompaction src/agent/fullCompaction/compactionOps.ts +// goal.clear (none) src/features/goal/goalOps.ts +// goal.create (none) src/features/goal/goalOps.ts +// goal.update (none) src/features/goal/goalOps.ts +// interaction.request (none) src/features/interaction/interactionOps.ts +// interaction.resolved (none) src/features/interaction/interactionOps.ts +// interruptionReminder.recorded interruptionReminder src/agent/interruptionReminder/interruptionReminderOps.ts +// llm.request llm.requestTrace src/agent/llmRequester/llmRequestOps.ts +// llm.tools_snapshot llm.requestTrace src/agent/llmRequester/llmRequestOps.ts +// mcp.tools_discovered mcp.discovery src/agent/mcp/mcpDiscoveryOps.ts +// permission.record_approval_result permissionRules src/agent/permissionRules/permissionRulesOps.ts +// permission.set_mode permissionMode, permissionMode.configured src/agent/permissionMode/permissionModeOps.ts +// plan_mode.cancel plan src/features/plan/planOps.ts +// plan_mode.enter plan src/features/plan/planOps.ts +// plan_mode.exit plan src/features/plan/planOps.ts +// plan.revision plan src/features/plan/planOps.ts +// plugin.session_start pluginSessionStartSnapshot src/agent/plugin/agentPluginOps.ts +// profile.bind profile, profile.activeTools src/agent/profile/profileOps.ts +// prompt.accepted promptAdmission src/agent/prompt/promptOps.ts +// runtime.set_binding runtimeBinding src/agent/runtimeBinding/runtimeBindingOps.ts +// staleGuard.cleared staleGuard src/features/staleGuard/staleGuardOps.ts +// staleGuard.recorded staleGuard src/features/staleGuard/staleGuardOps.ts +// subagent.binding_provenance.recorded subagent.bindingProvenance src/session/subagent/bindingProvenance.ts +// task.started task src/agent/task/taskOps.ts +// task.terminated task src/agent/task/taskOps.ts +// task.waitDelivered task.notificationDelivery src/agent/task/taskOps.ts +// token_counting.measured (none) src/agent/tokenCounting/tokenCountingOps.ts +// token_counting.rebased (none) src/agent/tokenCounting/tokenCountingOps.ts +// token_counting.truncated (none) src/agent/tokenCounting/tokenCountingOps.ts +// token_counting.turn_recorded (none) src/agent/tokenCounting/tokenCountingOps.ts +// tools.register_user_tool userTool src/agent/userTool/userToolOps.ts +// tools.reset_active_tools profile.activeTools src/agent/profile/profileOps.ts +// tools.set_active_tools profile.activeTools src/agent/profile/profileOps.ts +// tools.unregister_user_tool userTool src/agent/userTool/userToolOps.ts +// tools.update_store (none) src/features/todo/todoOps.ts +// tower_mode.enter tower, tower.owner src/features/tower/towerOps.ts +// tower_mode.exit tower, tower.owner src/features/tower/towerOps.ts +// turn.cancel turn src/agent/loop/turnOps.ts +// turn.ended turn src/agent/loop/turnOps.ts +// turn.prompt turn src/agent/loop/turnOps.ts +// turn.steer turn src/agent/loop/turnOps.ts +// usage.record (none) src/agent/usage/usageOps.ts /** * states: profile @@ -564,6 +565,25 @@ interface StaleGuardRecordedPayload { mtimeMs: number; } +/** + * states: subagent.bindingProvenance + * owner: src/session/subagent/bindingProvenance.ts + */ +interface SubagentBindingProvenanceRecordedPayload { + _name: 'subagent.binding_provenance.recorded'; + agentId: string; + provenance: { + operation: 'spawn' | 'fork' | 'resume'; + profileSource: 'requested' | 'default' | 'fork-inherit' | 'resume-existing'; + modelSource: 'caller' | 'policy-default' | 'policy-pool' | 'policy-force' | 'fork-inherit' | 'resume-existing'; + policyMode: 'inherit' | 'default' | 'pool' | 'force'; + policySource: 'config' | 'default'; + featureSource: 'master-env' | 'env' | 'config' | 'default'; + resolvedFromRoutingEnvironmentRevision: string; + routeDecisionFingerprint: string; + }; +} + /** * states: task * owner: src/agent/task/taskOps.ts @@ -864,6 +884,7 @@ interface WirePayloadMap { "runtime.set_binding": RuntimeSetBindingPayload; "staleGuard.cleared": StaleGuardClearedPayload; "staleGuard.recorded": StaleGuardRecordedPayload; + "subagent.binding_provenance.recorded": SubagentBindingProvenanceRecordedPayload; "task.started": TaskStartedPayload; "task.terminated": TaskTerminatedPayload; "task.waitDelivered": TaskWaitDeliveredPayload; diff --git a/packages/agent-core-v2/src/agent/tools/agent/agentTool.ts b/packages/agent-core-v2/src/agent/tools/agent/agentTool.ts index b68ad9fb7..d9e2d7e84 100644 --- a/packages/agent-core-v2/src/agent/tools/agent/agentTool.ts +++ b/packages/agent-core-v2/src/agent/tools/agent/agentTool.ts @@ -1,3 +1,5 @@ +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; +import { ISubagentRoutingService } from '#/session/subagent/subagentRoutingService'; import { type CollectionView } from '#/_base/di/collection'; import type { IAgentScopeHandle } from '#/_base/di/scope'; import { @@ -111,6 +113,7 @@ export class SubagentTool implements ISubagentTool { @IConfigService private readonly config: IConfigService, @IFlagService private readonly flags: IFlagService, @AgentToolContribution private readonly contributions: CollectionView, + @ISubagentRoutingService private readonly routing: ISubagentRoutingService, ) { this.callerAgentId = scopeContext.agentId; this.canRunInBackground = () => @@ -276,6 +279,8 @@ export class SubagentTool implements ISubagentTool { let agentId: string; let profileName: string; let displayModel: string | undefined; + let routing: SubagentBindingProvenance | undefined; + let currentRoutingEnvironmentRevision: string | undefined; let promptText = args.prompt; if (isResume) { const target = this.agentLifecycle.handleOf(resumeAgentId); @@ -289,6 +294,9 @@ export class SubagentTool implements ISubagentTool { const resumed = target.accessor.get(IAgentProfileService).data(); profileName = resumed.profileName ?? RESUMED_LABEL; displayModel = resumed.modelAlias; + const resumedRouting = this.routing.resumed(this.callerAgentId, target); + routing = resumedRouting.routing; + currentRoutingEnvironmentRevision = resumedRouting.currentRoutingEnvironmentRevision; } else { const plan = await this.subagents.planSpawn({ callerAgentId: this.callerAgentId, @@ -305,6 +313,8 @@ export class SubagentTool implements ISubagentTool { agentId = spawned.agentId; profileName = spawned.profileName; displayModel = spawned.model; + routing = plan.routing; + currentRoutingEnvironmentRevision = plan.routing?.resolvedFromRoutingEnvironmentRevision; promptText = spawned.promptText; } @@ -332,6 +342,8 @@ export class SubagentTool implements ISubagentTool { thinkingEffort: this.agentLifecycle.handleOf(agentId) ?.accessor.get(IAgentProfileService) .getEffectiveThinkingLevel(), + routing, + currentRoutingEnvironmentRevision, completion: mirrored.then((r) => ({ result: r.summary, usage: r.usage })), }; } @@ -459,6 +471,8 @@ export class SubagentTool implements ISubagentTool { fork: args.fork === true, model: handle.model, taskId, + routing: handle.routing, + currentRoutingEnvironmentRevision: handle.currentRoutingEnvironmentRevision, }); void requester.accessor .get(IEventDispatcher) diff --git a/packages/agent-core-v2/src/agent/tools/agent/subagent-task.ts b/packages/agent-core-v2/src/agent/tools/agent/subagent-task.ts index 863647c69..1a9512b62 100644 --- a/packages/agent-core-v2/src/agent/tools/agent/subagent-task.ts +++ b/packages/agent-core-v2/src/agent/tools/agent/subagent-task.ts @@ -1,4 +1,5 @@ import type { TokenUsage } from '#/kosong/contract/usage'; +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; import { isAbortError } from '#/_base/utils/abort'; import { @@ -18,6 +19,8 @@ export type SubagentHandle = { readonly parentToolCallId?: string; readonly model?: string; readonly thinkingEffort?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; readonly completion: Promise; }; @@ -28,6 +31,8 @@ export interface SubagentTaskInfo extends AgentTaskInfoBase { readonly parentToolCallId?: string; readonly model?: string; readonly thinkingEffort?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; } declare module '#/agent/task/types' { @@ -77,6 +82,8 @@ export class SubagentTask implements AgentTask { readonly parentToolCallId?: string; readonly model?: string; readonly thinkingEffort?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; constructor( private readonly handle: SubagentHandle, @@ -88,6 +95,8 @@ export class SubagentTask implements AgentTask { this.parentToolCallId = handle.parentToolCallId; this.model = handle.model; this.thinkingEffort = handle.thinkingEffort; + this.routing = handle.routing; + this.currentRoutingEnvironmentRevision = handle.currentRoutingEnvironmentRevision; } async start(sink: AgentTaskSink): Promise { @@ -124,6 +133,8 @@ export class SubagentTask implements AgentTask { parentToolCallId: this.parentToolCallId, model: this.model, thinkingEffort: this.thinkingEffort, + routing: this.routing, + currentRoutingEnvironmentRevision: this.currentRoutingEnvironmentRevision, }; } } diff --git a/packages/agent-core-v2/src/features/dynamic_workflow/session/agentRunBatch.ts b/packages/agent-core-v2/src/features/dynamic_workflow/session/agentRunBatch.ts index 9dc63631b..131090036 100644 --- a/packages/agent-core-v2/src/features/dynamic_workflow/session/agentRunBatch.ts +++ b/packages/agent-core-v2/src/features/dynamic_workflow/session/agentRunBatch.ts @@ -6,7 +6,17 @@ import { isUserCancellation } from '#/_base/utils/abort'; import { setClampedTimeout } from '#/_base/utils/timer'; import { BugIndicatingError, Error2, ErrorCodes } from '#/errors'; import type { SubagentSpawnPlan } from '#/session/subagent/spawn'; -import type { SessionDynamicWorkflowRunResult, SessionDynamicWorkflowTask } from './sessionDynamicWorkflow'; +import type { + SessionDynamicWorkflowRunResult, + SessionDynamicWorkflowTask, + SubagentRunBinding, +} from './sessionDynamicWorkflow'; + +function settledBinding( + binding: SubagentRunBinding | undefined, +): (SubagentRunBinding & { readonly completedAt: number }) | undefined { + return binding === undefined ? undefined : { ...binding, completedAt: Date.now() }; +} export interface AgentRunAttemptOptions { readonly parentToolCallId: string; @@ -29,6 +39,7 @@ export interface AgentSpawnAttemptOptions extends AgentRunAttemptOptions { export type AgentRunAttemptHandle = { readonly agentId: string; readonly profileName: string; + readonly binding?: SubagentRunBinding; readonly completion: Promise<{ readonly result: string; readonly usage?: TokenUsage; @@ -311,6 +322,7 @@ export class AgentRunBatch { status: 'completed', result: completion.result, usage: completion.usage, + binding: settledBinding(handle.binding), }; } catch (error) { if (isProviderRateLimitError(error)) { @@ -321,7 +333,7 @@ export class AgentRunBatch { }; } - return this.failedAttemptOutcome(attempt, error); + return { ...this.failedAttemptOutcome(attempt, error), binding: settledBinding(handle.binding) }; } } diff --git a/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflow.ts b/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflow.ts index 78b42512e..424785a4f 100644 --- a/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflow.ts +++ b/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflow.ts @@ -1,8 +1,18 @@ import type { TokenUsage } from '#/kosong/contract/usage'; import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation'; +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; import type { SubagentSpawnPlan } from '#/session/subagent/spawn'; +export interface SubagentRunBinding { + readonly profileName: string; + readonly model?: string; + readonly thinking?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; + readonly startedAt: number; +} + type SessionDynamicWorkflowTaskBase = { readonly data: T; readonly profileName: string; @@ -43,6 +53,7 @@ export interface SessionDynamicWorkflowRunResult { readonly result?: string; readonly usage?: TokenUsage; readonly error?: string; + readonly binding?: SubagentRunBinding & { readonly completedAt: number }; } export interface ISessionDynamicWorkflowService { diff --git a/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflowService.ts b/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflowService.ts index 812dff36c..4194407b8 100644 --- a/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflowService.ts +++ b/packages/agent-core-v2/src/features/dynamic_workflow/session/sessionDynamicWorkflowService.ts @@ -16,10 +16,13 @@ import { } from '#/session/agentLifecycle/subagentMetadata'; import { emitAgentRunSpawned, mirrorAgentRun } from '#/session/subagent/mirrorAgentRun'; import { ISessionSubagentService } from '#/session/subagent/subagent'; +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; +import { ISubagentRoutingService } from '#/session/subagent/subagentRoutingService'; import { ISessionMetadata, type AgentMeta } from '#/session/sessionMetadata/sessionMetadata'; import { IEventDispatcher } from '#/state/eventDispatcher'; import { + type SubagentRunBinding, ISessionDynamicWorkflowService, type SessionDynamicWorkflowRunArgs, type SessionDynamicWorkflowRunResult, @@ -56,6 +59,7 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer @IAgentLifecycleService private readonly lifecycle: IAgentLifecycleService, @ISessionSubagentService private readonly subagents: ISessionSubagentService, @ISessionMetadata private readonly metadata: ISessionMetadata, + @ISubagentRoutingService private readonly routing: ISubagentRoutingService, ) {} async getDynamicWorkflowItem(args: { @@ -126,6 +130,8 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer runInBackground: options.runInBackground, fork: plan.fork, model: plan.model, + routing: plan.routing, + currentRoutingEnvironmentRevision: plan.routing?.resolvedFromRoutingEnvironmentRevision, }); const child = this.requireHandle(spawned.agentId, 'Agent instance'); return this.observe( @@ -137,6 +143,10 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer prompt: spawned.promptText, }, options, + { + routing: plan.routing, + currentRoutingEnvironmentRevision: plan.routing?.resolvedFromRoutingEnvironmentRevision, + }, ); } @@ -153,6 +163,7 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer this.requireIdleSubagent(agentId, child); const profileName = child.accessor.get(IAgentProfileService).data().profileName ?? RESUMED_PROFILE_FALLBACK; + const resumedRouting = this.routing.resumed(callerAgentId, child); if (!retryTurn) { const resumedModel = child.accessor.get(IAgentProfileService).data().modelAlias; emitAgentRunSpawned(caller, agentId, { @@ -163,12 +174,14 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer dynamicWorkflowIndex: options.dynamicWorkflowIndex, runInBackground: options.runInBackground, model: resumedModel, + routing: resumedRouting.routing, + currentRoutingEnvironmentRevision: resumedRouting.currentRoutingEnvironmentRevision, }); } const request = retryTurn ? ({ kind: 'retry' } as const) : ({ kind: 'prompt', prompt: options.prompt } as const); - return this.observe(caller, child, profileName, request, options); + return this.observe(caller, child, profileName, request, options, resumedRouting); } private async observe( @@ -177,8 +190,21 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer profileName: string, request: { kind: 'prompt'; prompt: string } | { kind: 'retry' }, options: AgentRunAttemptOptions, + routing: { + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; + }, ): Promise { const agentId = child.id; + const childProfile = child.accessor.get(IAgentProfileService); + const binding: SubagentRunBinding = { + profileName, + model: childProfile.data().modelAlias, + thinking: childProfile.getEffectiveThinkingLevel(), + routing: routing.routing, + currentRoutingEnvironmentRevision: routing.currentRoutingEnvironmentRevision, + startedAt: Date.now(), + }; const run = await this.subagents.run(agentContextOf(child), request, { signal: options.signal, onReady: options.onReady, @@ -192,6 +218,7 @@ export class SessionDynamicWorkflowService implements ISessionDynamicWorkflowSer return { agentId, profileName, + binding, completion: mirrored.then((r) => ({ result: r.summary, usage: r.usage })), }; } diff --git a/packages/agent-core-v2/src/features/dynamic_workflow/tools/agent-dynamic_workflow/agentDynamicWorkflowTool.ts b/packages/agent-core-v2/src/features/dynamic_workflow/tools/agent-dynamic_workflow/agentDynamicWorkflowTool.ts index 3ecab5795..20d004709 100644 --- a/packages/agent-core-v2/src/features/dynamic_workflow/tools/agent-dynamic_workflow/agentDynamicWorkflowTool.ts +++ b/packages/agent-core-v2/src/features/dynamic_workflow/tools/agent-dynamic_workflow/agentDynamicWorkflowTool.ts @@ -8,7 +8,8 @@ import { Error2, ErrorCodes } from '#/errors'; import { toInputJsonSchema } from '#/tool/input-schema'; import { IConfigService } from '#/app/config/config'; import { IFlagService } from '#/app/flag/flag'; -import { ISessionDynamicWorkflowService, type SessionDynamicWorkflowTask } from '#/features/dynamic_workflow/session/sessionDynamicWorkflow'; +import { + type SessionDynamicWorkflowRunResult, ISessionDynamicWorkflowService, type SessionDynamicWorkflowTask } from '#/features/dynamic_workflow/session/sessionDynamicWorkflow'; import { IAgentProfileService } from '#/agent/profile/profile'; import { IAgentScopeContext } from '#/agent/scopeContext/scopeContext'; import { IAgentDynamicWorkflowService } from '#/features/dynamic_workflow/agent/dynamic_workflow'; @@ -66,6 +67,7 @@ interface DynamicWorkflowRunResult { readonly state?: 'started' | 'not_started'; readonly result?: string; readonly error?: string; + readonly binding?: SessionDynamicWorkflowRunResult['binding']; } export class AgentDynamicWorkflowTool implements IAgentDynamicWorkflowTool { @@ -319,9 +321,10 @@ function renderDynamicWorkflowResults(results: readonly DynamicWorkflowRunResult const mode = result.spec.kind === 'resume' ? ' mode="resume"' : ''; const item = result.spec.item === undefined ? '' : ` item="${escapeXmlAttribute(result.spec.item)}"`; const state = result.state === undefined ? '' : ` state="${result.state}"`; + const binding = renderBindingAttributes(result.binding); const body = result.status === 'completed' ? (result.result ?? '') : (result.error ?? 'unknown error'); lines.push( - `${body}`, + `${body}`, ); } @@ -329,6 +332,28 @@ function renderDynamicWorkflowResults(results: readonly DynamicWorkflowRunResult return lines.join('\n'); } +function renderBindingAttributes(binding: DynamicWorkflowRunResult['binding']): string { + if (binding === undefined) return ''; + const attrs: Array<[string, string | undefined]> = [ + ['profile', binding.profileName], + ['model', binding.model], + ['thinking', binding.thinking], + ['profile_source', binding.routing?.profileSource], + ['model_source', binding.routing?.modelSource], + ['policy_mode', binding.routing?.policyMode], + ['policy_source', binding.routing?.policySource], + ['feature_source', binding.routing?.featureSource], + ['routing_env_revision', binding.routing?.resolvedFromRoutingEnvironmentRevision], + ['route_decision', binding.routing?.routeDecisionFingerprint], + ['started_at', new Date(binding.startedAt).toISOString()], + ['completed_at', new Date(binding.completedAt).toISOString()], + ]; + return attrs + .filter((entry): entry is [string, string] => entry[1] !== undefined && entry[1].length > 0) + .map(([name, value]) => ` ${name}="${escapeXmlAttribute(value)}"`) + .join(''); +} + function normalizeOptionalString(value: string | undefined): string | undefined { if (value === undefined) return undefined; const trimmed = value.trim(); diff --git a/packages/agent-core-v2/src/index.ts b/packages/agent-core-v2/src/index.ts index 5314ce562..591ba1624 100644 --- a/packages/agent-core-v2/src/index.ts +++ b/packages/agent-core-v2/src/index.ts @@ -487,6 +487,9 @@ import '#/session/subagent/subagentModelsValidationService'; export * from '#/session/subagent/policy'; export * from '#/session/subagent/subagentModelPolicy'; import '#/session/subagent/subagentModelPolicyService'; +export * from '#/session/subagent/routing'; +export * from '#/session/subagent/bindingProvenance'; +export * from '#/session/subagent/subagentRoutingService'; export * from '#/agent/tools/agent/subagent-task'; export { AGENT_RUN_PROMPT_ORIGIN } from '#/session/subagent/runAgentTurn'; export * from '#/session/subagent/mirrorAgentRun'; diff --git a/packages/agent-core-v2/src/session/subagent/bindingProvenance.ts b/packages/agent-core-v2/src/session/subagent/bindingProvenance.ts new file mode 100644 index 000000000..6a4eb9236 --- /dev/null +++ b/packages/agent-core-v2/src/session/subagent/bindingProvenance.ts @@ -0,0 +1,96 @@ +/* oxlint-disable typescript-eslint/no-unsafe-declaration-merging, eslint-plugin-import/namespace -- Event2 class+payload-interface declaration merging is the sanctioned event-declaration idiom. */ +import { z } from 'zod'; + +import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation'; +import { LifecycleScope } from '#/app/scopes'; +import { ScopeActivation, registerScopedService } from '#/_base/di/scope'; +import { AgentEvent2 } from '#/app/event/event2'; +import { IAgentScopeContext } from '#/agent/scopeContext/scopeContext'; +import { IAgentStateService } from '#/agent/state/agentState'; +import { defineState } from '#/state/state'; +import { IEventDispatcher } from '#/state/eventDispatcher'; + +import type { SubagentBindingProvenance } from './routing'; + +export const subagentBindingProvenanceSchema = z.object({ + operation: z.enum(['spawn', 'fork', 'resume']), + profileSource: z.enum(['requested', 'default', 'fork-inherit', 'resume-existing']), + modelSource: z.enum([ + 'caller', + 'policy-default', + 'policy-pool', + 'policy-force', + 'fork-inherit', + 'resume-existing', + ]), + policyMode: z.enum(['inherit', 'default', 'pool', 'force']), + policySource: z.enum(['config', 'default']), + featureSource: z.enum(['master-env', 'env', 'config', 'default']), + resolvedFromRoutingEnvironmentRevision: z.string().min(1), + routeDecisionFingerprint: z.string().min(1), +}) satisfies z.ZodType; + +const subagentBindingProvenanceRecordedSchema = z.object({ + agentId: z.string(), + provenance: subagentBindingProvenanceSchema, +}); + +export class SubagentBindingProvenanceRecorded extends AgentEvent2< + z.infer +> { + static override readonly type = 'subagent.binding_provenance.recorded'; + static override readonly durable = true; + static override readonly schema = subagentBindingProvenanceRecordedSchema; +} +export interface SubagentBindingProvenanceRecorded { + readonly agentId: string; + readonly provenance: SubagentBindingProvenance; +} + +export const subagentBindingProvenanceKey = defineState( + 'subagent.bindingProvenance', + (): SubagentBindingProvenance | undefined => undefined, +) + .replayable({ schema: subagentBindingProvenanceSchema.optional() }) + .on(SubagentBindingProvenanceRecorded, (_state, event) => event.provenance); + +export interface IAgentBindingProvenanceService { + readonly _serviceBrand: undefined; + + current(): SubagentBindingProvenance | undefined; + record(provenance: SubagentBindingProvenance): void; +} + +export const IAgentBindingProvenanceService: ServiceIdentifier = + createDecorator('agentBindingProvenanceService'); + +export class AgentBindingProvenanceService implements IAgentBindingProvenanceService { + declare readonly _serviceBrand: undefined; + + constructor( + @IEventDispatcher private readonly dispatcher: IEventDispatcher, + @IAgentScopeContext private readonly scopeContext: IAgentScopeContext, + @IAgentStateService private readonly agentState: IAgentStateService, + ) { + this.agentState.contributeState(subagentBindingProvenanceKey); + } + + current(): SubagentBindingProvenance | undefined { + return this.agentState.get(subagentBindingProvenanceKey); + } + + record(provenance: SubagentBindingProvenance): void { + if (this.current() !== undefined) return; + void this.dispatcher.dispatch( + new SubagentBindingProvenanceRecorded({ agentId: this.scopeContext.agentId, provenance }), + ); + } +} + +registerScopedService( + LifecycleScope.Agent, + IAgentBindingProvenanceService, + AgentBindingProvenanceService, + ScopeActivation.OnScopeCreated, + 'subagent', +); diff --git a/packages/agent-core-v2/src/session/subagent/configSection.ts b/packages/agent-core-v2/src/session/subagent/configSection.ts index 13ae7fcca..3a87a3659 100644 --- a/packages/agent-core-v2/src/session/subagent/configSection.ts +++ b/packages/agent-core-v2/src/session/subagent/configSection.ts @@ -34,6 +34,7 @@ import { subagentPolicyModelChoices, validateSubagentModelPolicy, } from './policy'; +import { resolveSubagentModelRoute } from './routing'; export { PRIMARY_SUBAGENT_MODEL_CHOICE, @@ -197,49 +198,8 @@ export function resolveSubagentBinding( ): { model: string; thinking?: string } { const enabled = flags.enabled(SECONDARY_MODEL_FLAG_ID); const policy = enabled ? configuredPolicy(config) : INHERIT_SUBAGENT_MODEL_POLICY; - if (policy.mode === 'force') { - if (requested !== undefined) { - throw new Error2( - ErrorCodes.CONFIG_INVALID, - `Invalid model "${requested}": [secondary_model].force is set, so every subagent binds "${policy.defaultModel}" (omit the model parameter).`, - { details: { model: requested } }, - ); - } - return { model: policy.defaultModel, thinking: policy.defaultEffort }; - } - if (requested === PRIMARY_SUBAGENT_MODEL_CHOICE) { - return { model: own.modelAlias, thinking: own.thinkingLevel }; - } - if (policy.mode === 'inherit') { - if (requested !== undefined) { - throw new Error2( - ErrorCodes.CONFIG_INVALID, - `Invalid model "${requested}": no [secondary_model.models] pool is configured, so subagents inherit the caller's model (pass "primary" or omit the model parameter).`, - { details: { model: requested } }, - ); - } - return { model: own.modelAlias, thinking: own.thinkingLevel }; - } - const choices = subagentPolicyModelChoices(policy) ?? {}; - if (Object.hasOwn(choices, PRIMARY_SUBAGENT_MODEL_CHOICE)) { - throw new Error2(ErrorCodes.CONFIG_INVALID, SECONDARY_MODEL_PRIMARY_MODEL_RESERVED_MESSAGE, { - details: { - section: SECONDARY_MODEL_SECTION, - field: 'models', - model: PRIMARY_SUBAGENT_MODEL_CHOICE, - }, - }); - } - const choice = requested ?? policy.defaultModel; - if (!Object.hasOwn(choices, choice)) { - const available = [...Object.keys(choices), PRIMARY_SUBAGENT_MODEL_CHOICE]; - throw new Error2( - ErrorCodes.CONFIG_INVALID, - `Invalid model "${choice}". Available models: ${available.join(', ')}.`, - { details: { model: choice, availableModels: available } }, - ); - } - return { model: choice, thinking: policy.defaultEffort }; + const route = resolveSubagentModelRoute({ policy, own, requested }); + return { model: route.model, thinking: route.thinking }; } export function resolveSubagentThinking( diff --git a/packages/agent-core-v2/src/session/subagent/mirrorAgentRun.ts b/packages/agent-core-v2/src/session/subagent/mirrorAgentRun.ts index c40879df6..0f9ea03d9 100644 --- a/packages/agent-core-v2/src/session/subagent/mirrorAgentRun.ts +++ b/packages/agent-core-v2/src/session/subagent/mirrorAgentRun.ts @@ -1,4 +1,5 @@ /* oxlint-disable typescript-eslint/no-unsafe-declaration-merging, eslint-plugin-import/namespace -- Event2 class+payload-interface declaration merging is the sanctioned event-declaration idiom. */ +import type { SubagentBindingProvenance } from './routing'; import type { IAgentScopeHandle } from '#/_base/di/scope'; import { userCancellationReason } from '#/_base/utils/abort'; import { ISessionTokenCountingService } from '#/session/tokenCounting/sessionTokenCounting'; @@ -28,6 +29,8 @@ export interface SubagentSpawnedPayload { readonly model?: string; readonly thinkingEffort?: string; readonly taskId?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; } export class SubagentSpawned extends Event2 { @@ -80,6 +83,8 @@ export interface AgentRunSpawnedMeta { readonly fork?: boolean; readonly model?: string; readonly taskId?: string; + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision?: string; } export interface MirrorAgentRunOptions { @@ -114,6 +119,8 @@ export function emitAgentRunSpawned( model: meta.model, thinkingEffort: childProfile?.getEffectiveThinkingLevel(), taskId: meta.taskId, + routing: meta.routing, + currentRoutingEnvironmentRevision: meta.currentRoutingEnvironmentRevision, }), ); childProfile?.republishStatus(); diff --git a/packages/agent-core-v2/src/session/subagent/routing.ts b/packages/agent-core-v2/src/session/subagent/routing.ts new file mode 100644 index 000000000..ff539b0ce --- /dev/null +++ b/packages/agent-core-v2/src/session/subagent/routing.ts @@ -0,0 +1,119 @@ +import { Error2, ErrorCodes } from '#/errors'; +import type { ExperimentalFlagSource } from '#/app/flag/flag'; + +import { + type CanonicalSubagentModelPolicy, + PRIMARY_SUBAGENT_MODEL_CHOICE, + SECONDARY_MODEL_DEFAULT_MODEL_REQUIRED_MESSAGE, + SECONDARY_MODEL_PRIMARY_MODEL_RESERVED_MESSAGE, + SECONDARY_MODEL_SECTION, + type SubagentModelPolicyMode, + type SubagentPolicySource, + type SubagentRoutingOperation, + subagentPolicyModelChoices, +} from './policy'; + +export type SubagentProfileSource = 'requested' | 'default' | 'fork-inherit' | 'resume-existing'; + +export type SubagentModelSource = + | 'caller' + | 'policy-default' + | 'policy-pool' + | 'policy-force' + | 'fork-inherit' + | 'resume-existing'; + +export interface SubagentBindingProvenance { + readonly operation: SubagentRoutingOperation; + readonly profileSource: SubagentProfileSource; + readonly modelSource: SubagentModelSource; + readonly policyMode: SubagentModelPolicyMode; + readonly policySource: SubagentPolicySource; + readonly featureSource: ExperimentalFlagSource; + readonly resolvedFromRoutingEnvironmentRevision: string; + readonly routeDecisionFingerprint: string; +} + +export interface SubagentCallerModelBinding { + readonly modelAlias: string; + readonly thinkingLevel: string; +} + +export interface SubagentModelRouteInput { + readonly policy: CanonicalSubagentModelPolicy; + readonly own: SubagentCallerModelBinding; + readonly requested?: string; +} + +export interface SubagentModelRoute { + readonly model: string; + readonly thinking?: string; + readonly source: SubagentModelSource; +} + +export function resolveSubagentModelRoute(input: SubagentModelRouteInput): SubagentModelRoute { + const { policy, own, requested } = input; + if (policy.mode === 'force') { + if (requested !== undefined) { + throw new Error2( + ErrorCodes.CONFIG_INVALID, + `Invalid model "${requested}": [secondary_model].force is set, so every subagent binds "${policy.defaultModel}" (omit the model parameter).`, + { details: { model: requested } }, + ); + } + return { model: policy.defaultModel, thinking: policy.defaultEffort, source: 'policy-force' }; + } + if (requested === PRIMARY_SUBAGENT_MODEL_CHOICE) { + return { model: own.modelAlias, thinking: own.thinkingLevel, source: 'caller' }; + } + if (policy.mode === 'inherit') { + if (requested !== undefined) { + throw new Error2( + ErrorCodes.CONFIG_INVALID, + `Invalid model "${requested}": no [secondary_model.models] pool is configured, so subagents inherit the caller's model (pass "primary" or omit the model parameter).`, + { details: { model: requested } }, + ); + } + return { model: own.modelAlias, thinking: own.thinkingLevel, source: 'caller' }; + } + const choices = subagentPolicyModelChoices(policy) ?? {}; + if (Object.hasOwn(choices, PRIMARY_SUBAGENT_MODEL_CHOICE)) { + throw new Error2(ErrorCodes.CONFIG_INVALID, SECONDARY_MODEL_PRIMARY_MODEL_RESERVED_MESSAGE, { + details: { + section: SECONDARY_MODEL_SECTION, + field: 'models', + model: PRIMARY_SUBAGENT_MODEL_CHOICE, + }, + }); + } + const choice = requested ?? policy.defaultModel; + if (choice === undefined) { + throw new Error2(ErrorCodes.CONFIG_INVALID, SECONDARY_MODEL_DEFAULT_MODEL_REQUIRED_MESSAGE, { + details: { section: SECONDARY_MODEL_SECTION, field: 'defaultModel' }, + }); + } + if (!Object.hasOwn(choices, choice)) { + const available = [...Object.keys(choices), PRIMARY_SUBAGENT_MODEL_CHOICE]; + throw new Error2( + ErrorCodes.CONFIG_INVALID, + `Invalid model "${choice}". Available models: ${available.join(', ')}.`, + { details: { model: choice, availableModels: available } }, + ); + } + return { + model: choice, + thinking: policy.defaultEffort, + source: policy.mode === 'pool' ? 'policy-pool' : 'policy-default', + }; +} + +export function resumedBindingProvenance( + stored: SubagentBindingProvenance, +): SubagentBindingProvenance { + return { + ...stored, + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + }; +} diff --git a/packages/agent-core-v2/src/session/subagent/spawn.ts b/packages/agent-core-v2/src/session/subagent/spawn.ts index 38aba01af..7afc7ce8b 100644 --- a/packages/agent-core-v2/src/session/subagent/spawn.ts +++ b/packages/agent-core-v2/src/session/subagent/spawn.ts @@ -1,4 +1,5 @@ import { PRIMARY_SUBAGENT_MODEL_CHOICE } from './configSection'; +import type { SubagentBindingProvenance } from './routing'; export const DEFAULT_PROFILE_NAME = 'coder'; @@ -56,6 +57,7 @@ export interface SubagentSpawnPlan { readonly model: string; readonly thinking?: string; readonly fork: boolean; + readonly routing?: SubagentBindingProvenance; } export interface SpawnSubagentOptions { diff --git a/packages/agent-core-v2/src/session/subagent/subagentRoutingService.ts b/packages/agent-core-v2/src/session/subagent/subagentRoutingService.ts new file mode 100644 index 000000000..7f6ba9674 --- /dev/null +++ b/packages/agent-core-v2/src/session/subagent/subagentRoutingService.ts @@ -0,0 +1,182 @@ +import { createDecorator, type ServiceIdentifier } from '#/_base/di/instantiation'; +import type { IAgentScopeHandle } from '#/_base/di/scope'; +import { LifecycleScope } from '#/app/scopes'; +import { ScopeActivation, registerScopedService } from '#/_base/di/scope'; +import { Error2, ErrorCodes } from '#/errors'; +import { + rootDelegationExtras, + subagentAllowlistFor, + subagentTypeNotAllowedMessage, + withoutDelegatingTargets, +} from '#/app/agentProfileCatalog/profile-shared'; +import { ISessionAgentProfileCatalog } from '#/session/sessionAgentProfileCatalog/sessionAgentProfileCatalog'; +import { IAgentProfileService } from '#/agent/profile/profile'; +import { IConfigService } from '#/app/config/config'; +import { IModelCatalog, type Model } from '#/kosong/model/catalog'; +import { IAgentLifecycleService, MAIN_AGENT_ID } from '#/session/agentLifecycle/agentLifecycle'; + +import { IAgentBindingProvenanceService } from './bindingProvenance'; +import { resolveSubagentThinking, wrapSubagentModelError } from './configSection'; +import { routeDecisionFingerprint } from './policy'; +import { + resolveSubagentModelRoute, + resumedBindingProvenance, + type SubagentBindingProvenance, + type SubagentProfileSource, +} from './routing'; +import { DEFAULT_PROFILE_NAME, type SubagentSpawnPlan, type SubagentSpawnPlanInput } from './spawn'; +import { ISubagentModelPolicyService } from './subagentModelPolicy'; +import './subagentModelPolicyService'; + +export interface ResolvedSpawnPlan extends SubagentSpawnPlan { + readonly routing: SubagentBindingProvenance; +} + +export interface ResumedSubagentRouting { + readonly routing?: SubagentBindingProvenance; + readonly currentRoutingEnvironmentRevision: string; +} + +export interface ISubagentRoutingService { + readonly _serviceBrand: undefined; + + resolve(input: SubagentSpawnPlanInput): Promise; + resumed(callerAgentId: string, child: IAgentScopeHandle): ResumedSubagentRouting; + currentRevision(callerAgentId: string): string | undefined; +} + +export const ISubagentRoutingService: ServiceIdentifier = + createDecorator('subagentRoutingService'); + +export class SessionSubagentRoutingService implements ISubagentRoutingService { + declare readonly _serviceBrand: undefined; + + constructor( + @ISessionAgentProfileCatalog private readonly catalog: ISessionAgentProfileCatalog, + @IAgentLifecycleService private readonly agentLifecycle: IAgentLifecycleService, + @IConfigService private readonly configService: IConfigService, + @IModelCatalog private readonly modelCatalog: IModelCatalog, + @ISubagentModelPolicyService private readonly policy: ISubagentModelPolicyService, + ) {} + + async resolve(input: SubagentSpawnPlanInput): Promise { + const caller = this.requireAgent(input.callerAgentId, 'Caller agent'); + const fork = input.fork === true; + await this.catalog.ready; + const own = caller.accessor.get(IAgentProfileService).data(); + const requested = + input.profileName !== undefined && input.profileName.length > 0 ? input.profileName : undefined; + const requestedProfileName = + requested ?? (fork ? (own.profileName ?? DEFAULT_PROFILE_NAME) : DEFAULT_PROFILE_NAME); + const profileSource: SubagentProfileSource = + requested !== undefined ? 'requested' : fork ? 'fork-inherit' : 'default'; + const extras = + input.callerAgentId === MAIN_AGENT_ID + ? rootDelegationExtras(this.catalog, own, this.catalog.list()) + : undefined; + let allowlist = subagentAllowlistFor(this.catalog, own, extras); + if (allowlist !== undefined && own.subagents === undefined) { + allowlist = withoutDelegatingTargets(this.catalog, allowlist); + } + if (!fork && allowlist !== undefined && !allowlist.includes(requestedProfileName)) { + throw new Error2( + ErrorCodes.AGENT_TYPE_NOT_ALLOWED, + subagentTypeNotAllowedMessage(requestedProfileName, allowlist), + { details: { profileName: requestedProfileName, allowlist } }, + ); + } + const profile = this.catalog.get(requestedProfileName); + if (!fork && profile === undefined) { + throw new Error2(ErrorCodes.PROFILE_UNKNOWN, `Unknown agent type: "${requestedProfileName}"`, { + details: { profileName: requestedProfileName }, + }); + } + if (own.modelAlias === undefined) { + throw new Error2(ErrorCodes.MODEL_NOT_CONFIGURED, 'Caller agent has no model bound', { + details: { agentId: input.callerAgentId }, + }); + } + const effective = this.policy.getEffective(); + const environmentRevision = this.policy.resolveRevision({ + modelAlias: own.modelAlias, + thinkingLevel: own.thinkingLevel, + }); + const route = fork + ? { model: own.modelAlias, thinking: own.thinkingLevel, source: 'fork-inherit' as const } + : resolveSubagentModelRoute({ + policy: effective.effectivePolicy, + own: { modelAlias: own.modelAlias, thinkingLevel: own.thinkingLevel }, + requested: input.model, + }); + let model: Model; + try { + model = this.modelCatalog.get(route.model); + } catch (error) { + throw wrapSubagentModelError(error, route.model, own.modelAlias); + } + const operation = fork ? 'fork' : 'spawn'; + return { + profileName: profile?.name ?? requestedProfileName, + model: route.model, + thinking: resolveSubagentThinking(this.configService, model, route.thinking), + fork, + routing: { + operation, + profileSource, + modelSource: route.source, + policyMode: effective.effectivePolicy.mode, + policySource: effective.policySource, + featureSource: effective.feature.source, + resolvedFromRoutingEnvironmentRevision: environmentRevision, + routeDecisionFingerprint: routeDecisionFingerprint({ + routingEnvironmentRevision: environmentRevision, + operation, + profile: requested, + model: input.model, + }), + }, + }; + } + + resumed(callerAgentId: string, child: IAgentScopeHandle): ResumedSubagentRouting { + const stored = child.accessor.get(IAgentBindingProvenanceService).current(); + const revision = this.currentRevision(callerAgentId); + const childData = child.accessor.get(IAgentProfileService).data(); + const currentRoutingEnvironmentRevision = + revision ?? + this.policy.resolveRevision({ + modelAlias: childData.modelAlias ?? '', + thinkingLevel: childData.thinkingLevel, + }); + return { + routing: stored === undefined ? undefined : resumedBindingProvenance(stored), + currentRoutingEnvironmentRevision, + }; + } + + currentRevision(callerAgentId: string): string | undefined { + const caller = this.agentLifecycle.handleOf(callerAgentId); + if (caller === undefined) return undefined; + const own = caller.accessor.get(IAgentProfileService).data(); + if (own.modelAlias === undefined) return undefined; + return this.policy.resolveRevision({ modelAlias: own.modelAlias, thinkingLevel: own.thinkingLevel }); + } + + private requireAgent(agentId: string, label: string): IAgentScopeHandle { + const handle = this.agentLifecycle.handleOf(agentId); + if (handle === undefined) { + throw new Error2(ErrorCodes.AGENT_NOT_FOUND, `${label} "${agentId}" does not exist`, { + details: { agentId }, + }); + } + return handle; + } +} + +registerScopedService( + LifecycleScope.Session, + ISubagentRoutingService, + SessionSubagentRoutingService, + ScopeActivation.OnScopeCreated, + 'subagent', +); diff --git a/packages/agent-core-v2/src/session/subagent/subagentService.ts b/packages/agent-core-v2/src/session/subagent/subagentService.ts index f97b6c718..63a947a51 100644 --- a/packages/agent-core-v2/src/session/subagent/subagentService.ts +++ b/packages/agent-core-v2/src/session/subagent/subagentService.ts @@ -10,26 +10,17 @@ import { import { Emitter } from '#/_base/event'; import type { AgentProfileSummaryPolicy } from '#/app/agentProfileCatalog/agentProfileCatalog'; import { applyProfilePromptPrefix } from '#/app/agentProfileCatalog/promptPrefix'; -import { - rootDelegationExtras, - subagentAllowlistFor, - subagentTypeNotAllowedMessage, - withoutDelegatingTargets, -} from '#/app/agentProfileCatalog/profile-shared'; import { ISessionAgentProfileCatalog } from '#/session/sessionAgentProfileCatalog/sessionAgentProfileCatalog'; import { IAgentProfileService } from '#/agent/profile/profile'; import { IAgentPermissionModeService } from '#/agent/permissionMode/permissionMode'; import { IAgentUserToolService } from '#/agent/userTool/userTool'; import { IAgentRuntimeService } from '#/agent/runtimeBinding/agentRuntime'; import type { Runtime } from '#/runtime/runtime'; -import { IConfigService } from '#/app/config/config'; -import { IFlagService } from '#/app/flag/flag'; -import { IModelCatalog, type Model } from '#/kosong/model/catalog'; import { ILogService } from '#/_base/log/log'; import { ISessionContext } from '#/session/sessionContext/sessionContext'; import { RuntimeWorkspaceView } from '#/runtime/runtimeWorkspaceView'; import { createHooks } from '#/hooks'; -import { IAgentLifecycleService, MAIN_AGENT_ID } from '#/session/agentLifecycle/agentLifecycle'; +import { IAgentLifecycleService } from '#/session/agentLifecycle/agentLifecycle'; import { agentContextOf } from '#/agent/scopeContext/scopeContext'; import { @@ -41,19 +32,16 @@ import { type RunAgentOptions, } from './subagent'; import { runAgentTurn } from './runAgentTurn'; +import { wrapSubagentModelError } from './configSection'; +import { IAgentBindingProvenanceService } from './bindingProvenance'; import { - resolveSubagentBinding, - resolveSubagentThinking, - wrapSubagentModelError, -} from './configSection'; -import { - DEFAULT_PROFILE_NAME, FORK_CONTEXT_NOTICE, type SpawnSubagentOptions, type SpawnedSubagent, type SubagentSpawnPlan, type SubagentSpawnPlanInput, } from './spawn'; +import { ISubagentRoutingService } from './subagentRoutingService'; export class SessionSubagentService extends Service implements ISessionSubagentService { declare readonly _serviceBrand: undefined; @@ -70,11 +58,9 @@ export class SessionSubagentService extends Service implements ISessionSubagentS constructor( @IAgentLifecycleService private readonly agentLifecycle: IAgentLifecycleService, @ISessionAgentProfileCatalog private readonly catalog: ISessionAgentProfileCatalog, - @IConfigService private readonly configService: IConfigService, - @IFlagService private readonly flags: IFlagService, - @IModelCatalog private readonly modelCatalog: IModelCatalog, @ISessionContext private readonly sessionContext: ISessionContext, @ILogService private readonly log: ILogService, + @ISubagentRoutingService private readonly routing: ISubagentRoutingService, ) { super(); } @@ -94,61 +80,7 @@ export class SessionSubagentService extends Service implements ISessionSubagentS } async planSpawn(input: SubagentSpawnPlanInput): Promise { - const caller = this.requireCaller(input.callerAgentId); - const fork = input.fork === true; - await this.catalog.ready; - const own = caller.accessor.get(IAgentProfileService).data(); - const requested = input.profileName !== undefined && input.profileName.length > 0 - ? input.profileName - : undefined; - const requestedProfileName = - requested ?? (fork ? (own.profileName ?? DEFAULT_PROFILE_NAME) : DEFAULT_PROFILE_NAME); - const extras = - input.callerAgentId === MAIN_AGENT_ID - ? rootDelegationExtras(this.catalog, own, this.catalog.list()) - : undefined; - let allowlist = subagentAllowlistFor(this.catalog, own, extras); - if (allowlist !== undefined && own.subagents === undefined) { - allowlist = withoutDelegatingTargets(this.catalog, allowlist); - } - if (!fork && allowlist !== undefined && !allowlist.includes(requestedProfileName)) { - throw new Error2( - ErrorCodes.AGENT_TYPE_NOT_ALLOWED, - subagentTypeNotAllowedMessage(requestedProfileName, allowlist), - { details: { profileName: requestedProfileName, allowlist } }, - ); - } - const profile = this.catalog.get(requestedProfileName); - if (!fork && profile === undefined) { - throw new Error2(ErrorCodes.PROFILE_UNKNOWN, `Unknown agent type: "${requestedProfileName}"`, { - details: { profileName: requestedProfileName }, - }); - } - if (own.modelAlias === undefined) { - throw new Error2(ErrorCodes.MODEL_NOT_CONFIGURED, 'Caller agent has no model bound', { - details: { agentId: input.callerAgentId }, - }); - } - const binding = fork - ? { model: own.modelAlias, thinking: own.thinkingLevel } - : resolveSubagentBinding( - this.configService, - this.flags, - { modelAlias: own.modelAlias, thinkingLevel: own.thinkingLevel }, - input.model, - ); - let model: Model; - try { - model = this.modelCatalog.get(binding.model); - } catch (error) { - throw wrapSubagentModelError(error, binding.model, own.modelAlias); - } - return { - profileName: profile?.name ?? requestedProfileName, - model: binding.model, - thinking: resolveSubagentThinking(this.configService, model, binding.thinking), - fork, - }; + return this.routing.resolve(input); } async spawn(opts: SpawnSubagentOptions): Promise { @@ -184,6 +116,9 @@ export class SessionSubagentService extends Service implements ISessionSubagentS caller.accessor.get(IAgentProfileService).data().modelAlias, ); } + if (plan.routing !== undefined) { + created.accessor.get(IAgentBindingProvenanceService).record(plan.routing); + } created.accessor .get(IAgentPermissionModeService) .setMode(caller.accessor.get(IAgentPermissionModeService).mode); diff --git a/packages/agent-core-v2/test/features/dynamic_workflow/dynamic_workflow.test.ts b/packages/agent-core-v2/test/features/dynamic_workflow/dynamic_workflow.test.ts index db948d05f..72f53b4a0 100644 --- a/packages/agent-core-v2/test/features/dynamic_workflow/dynamic_workflow.test.ts +++ b/packages/agent-core-v2/test/features/dynamic_workflow/dynamic_workflow.test.ts @@ -1,3 +1,5 @@ +import { SubagentModelPolicyService } from '#/session/subagent/subagentModelPolicyService'; +import { SessionSubagentRoutingService } from '#/session/subagent/subagentRoutingService'; import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest'; import { makeAgentScopeContext } from '#/agent/scopeContext/scopeContext'; @@ -267,15 +269,14 @@ function realSubagents( }, } as unknown as IModelCatalog; const sessionContext = { _serviceBrand: undefined, cwd: '/repo' } as unknown as ISessionContext; - return new SessionSubagentService( - lifecycle, + const routing = new SessionSubagentRoutingService( catalog, + lifecycle, config, - flags, modelCatalog, - sessionContext, - stubLog(), + new SubagentModelPolicyService(config, flags, modelCatalog), ); + return new SessionSubagentService(lifecycle, catalog, sessionContext, stubLog(), routing); } describe('AgentDynamicWorkflowService', () => { @@ -664,6 +665,84 @@ describe('dynamic_workflow context reconciliation', () => { }); describe('AgentDynamicWorkflowTool', () => { + it('renders durable binding attributes on each subagent row and escapes them', async () => { + const host = mockDynamicWorkflowHost({ + run: vi.fn().mockResolvedValue([ + { + task: { + kind: 'spawn', + data: { kind: 'spawn', index: 1, item: 'src/a.ts', prompt: 'Review src/a.ts' }, + profileName: 'explore', + parentToolCallId: 'call_dynamic_workflow', + prompt: 'Review src/a.ts', + description: 'Review files #1 (explore)', + runInBackground: false, + }, + agentId: 'agent-explore-1', + status: 'completed', + result: 'explore result a', + binding: { + profileName: 'explore', + model: 'provider/fast', + thinking: 'low', + routing: { + operation: 'spawn' as const, + profileSource: 'requested' as const, + modelSource: 'policy-pool' as const, + policyMode: 'pool' as const, + policySource: 'config' as const, + featureSource: 'env' as const, + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }, + startedAt: Date.UTC(2026, 0, 1, 0, 0, 0), + completedAt: Date.UTC(2026, 0, 1, 0, 0, 5), + }, + }, + { + task: { + kind: 'spawn', + data: { kind: 'spawn', index: 2, item: 'src/b.ts', prompt: 'Review src/b.ts' }, + profileName: 'explore', + parentToolCallId: 'call_dynamic_workflow', + prompt: 'Review src/b.ts', + description: 'Review files #2 (explore)', + runInBackground: false, + }, + agentId: 'agent-explore-2', + status: 'failed', + error: 'boom', + binding: { + profileName: 'explore', + model: 'provider/"quoted" & ', + routing: undefined, + startedAt: Date.UTC(2026, 0, 1, 0, 0, 0), + completedAt: Date.UTC(2026, 0, 1, 0, 0, 1), + }, + }, + ]), + }); + const dynamicWorkflowMode = mockDynamicWorkflowMode(); + const cfg = stubConfig({ defaultModel: 'provider/fast', models: { 'provider/fast': 'fast and cheap' } }); + const tool = new AgentDynamicWorkflowTool(host.dynamicWorkflowService, makeAgentScopeContext({ agentId: host.callerAgentId, agentScope: '' }), dynamicWorkflowMode, cfg, stubFlag(true), realSubagents(stubDynamicWorkflowCatalog(), cfg, stubFlag(true), stubCallerProfile()), stubCallerProfile()); + const result = await executeTool(tool, context({ + description: 'Review files', + prompt_template: 'Review {{item}}', + items: ['src/a.ts', 'src/b.ts'], + subagent_type: 'explore', + })); + expect(result.output).toBe( + [ + '', + 'completed: 1, failed: 1', + 'Call AgentDynamicWorkflow with resume_agent_ids using the agent_id values in this result to continue unfinished work.', + 'explore result a', + 'boom', + '', + ].join('\n'), + ); + }); + it('applies one subagent_type across templated subagents', async () => { const host = mockDynamicWorkflowHost({ run: vi.fn().mockResolvedValue([ @@ -771,7 +850,7 @@ describe('AgentDynamicWorkflowTool', () => { runInBackground: false, signal, timeout: DEFAULT_DYNAMIC_WORKFLOW_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }), }, { kind: 'spawn', @@ -790,7 +869,7 @@ describe('AgentDynamicWorkflowTool', () => { runInBackground: false, signal, timeout: DEFAULT_DYNAMIC_WORKFLOW_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }), }, ] })); expect(result.output).toBe( @@ -1031,7 +1110,7 @@ describe('AgentDynamicWorkflowTool', () => { runInBackground: false, signal, timeout: DEFAULT_DYNAMIC_WORKFLOW_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }, ] })); expect(result.output).toBe( @@ -1219,10 +1298,10 @@ describe('AgentDynamicWorkflowTool', () => { expect.objectContaining({ tasks: [ expect.objectContaining({ - plan: { profileName: 'coder', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'coder', model: 'provider/fast', thinking: undefined, fork: false }), }), expect.objectContaining({ - plan: { profileName: 'coder', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'coder', model: 'provider/fast', thinking: undefined, fork: false }), }), ], }), @@ -1247,10 +1326,10 @@ describe('AgentDynamicWorkflowTool', () => { expect.objectContaining({ tasks: [ expect.objectContaining({ - plan: { profileName: 'coder', model: 'main-model', thinking: 'high', fork: false }, + plan: expect.objectContaining({ profileName: 'coder', model: 'main-model', thinking: 'high', fork: false }), }), expect.objectContaining({ - plan: { profileName: 'coder', model: 'main-model', thinking: 'high', fork: false }, + plan: expect.objectContaining({ profileName: 'coder', model: 'main-model', thinking: 'high', fork: false }), }), ], }), @@ -1457,10 +1536,10 @@ describe('AgentDynamicWorkflowTool', () => { expect.objectContaining({ tasks: [ expect.objectContaining({ - plan: { profileName: 'orchestrator', model: 'main-model', thinking: 'high', fork: true }, + plan: expect.objectContaining({ profileName: 'orchestrator', model: 'main-model', thinking: 'high', fork: true }), }), expect.objectContaining({ - plan: { profileName: 'orchestrator', model: 'main-model', thinking: 'high', fork: true }, + plan: expect.objectContaining({ profileName: 'orchestrator', model: 'main-model', thinking: 'high', fork: true }), }), ], }), diff --git a/packages/agent-core-v2/test/features/dynamic_workflow/sessionDynamicWorkflow.test.ts b/packages/agent-core-v2/test/features/dynamic_workflow/sessionDynamicWorkflow.test.ts index 3cf3eed7c..ac69cbb76 100644 --- a/packages/agent-core-v2/test/features/dynamic_workflow/sessionDynamicWorkflow.test.ts +++ b/packages/agent-core-v2/test/features/dynamic_workflow/sessionDynamicWorkflow.test.ts @@ -1,3 +1,4 @@ +import { ISubagentRoutingService } from '#/session/subagent/subagentRoutingService'; import { createControlledPromise } from '@antfu/utils'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -909,6 +910,12 @@ describe('SessionDynamicWorkflowService metadata compatibility', () => { agents[agentId] = meta; }, }); + ix.stub(ISubagentRoutingService, { + _serviceBrand: undefined, + resolve: () => Promise.reject(new Error('not stubbed')), + resumed: () => ({ routing: undefined, currentRoutingEnvironmentRevision: 'route-env:v1:test' }), + currentRevision: () => 'route-env:v1:test', + }); ix.set(ISessionDynamicWorkflowService, new SyncDescriptor(SessionDynamicWorkflowService)); }); diff --git a/packages/agent-core-v2/test/index.test.ts b/packages/agent-core-v2/test/index.test.ts index 8b1c010f2..9e985667f 100644 --- a/packages/agent-core-v2/test/index.test.ts +++ b/packages/agent-core-v2/test/index.test.ts @@ -77,6 +77,7 @@ const V2_ONLY_RECORD_TYPES: ReadonlySet = new Set([ ]); const V2_RECORD_TYPES: ReadonlySet = new Set([ + 'subagent.binding_provenance.recorded', 'tower_mode.enter', 'tower_mode.exit', 'task.started', diff --git a/packages/agent-core-v2/test/session/subagent/routing.test.ts b/packages/agent-core-v2/test/session/subagent/routing.test.ts new file mode 100644 index 000000000..9706544e4 --- /dev/null +++ b/packages/agent-core-v2/test/session/subagent/routing.test.ts @@ -0,0 +1,384 @@ +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +import { SyncDescriptor } from '#/_base/di/descriptors'; +import { DisposableStore } from '#/_base/di/lifecycle'; +import type { IAgentScopeHandle } from '#/_base/di/scope'; +import { TestInstantiationService } from '#/_base/di/test'; +import { Event } from '#/_base/event'; +import { LifecycleScope } from '#/app/scopes'; +import { IConfigService } from '#/app/config/config'; +import { IFlagService, type ExperimentalFeatureState } from '#/app/flag/flag'; +import { normalizeAgentProfile } from '#/app/agentProfileCatalog/agentProfileCatalog'; +import { IAgentProfileService, type ProfileData } from '#/agent/profile/profile'; +import { ErrorCodes, Error2, isError2 } from '#/errors'; +import { IModelCatalog, type Model } from '#/kosong/model/catalog'; +import { IAgentLifecycleService } from '#/session/agentLifecycle/agentLifecycle'; +import { ISessionAgentProfileCatalog } from '#/session/sessionAgentProfileCatalog/sessionAgentProfileCatalog'; +import { + AgentBindingProvenanceService, + IAgentBindingProvenanceService, + SubagentBindingProvenanceRecorded, + subagentBindingProvenanceKey, +} from '#/session/subagent/bindingProvenance'; +import type { Event2, Event2Class } from '#/app/event/event2'; +import type { FoldContext } from '#/state/state'; +import { SECONDARY_MODEL_FLAG_ID } from '#/session/subagent/flag'; +import { type CanonicalSubagentModelPolicy, SECONDARY_MODEL_SECTION } from '#/session/subagent/policy'; +import { + resolveSubagentModelRoute, + resumedBindingProvenance, + type SubagentBindingProvenance, +} from '#/session/subagent/routing'; +import { ISubagentModelPolicyService } from '#/session/subagent/subagentModelPolicy'; +import { SubagentModelPolicyService } from '#/session/subagent/subagentModelPolicyService'; +import { + ISubagentRoutingService, + SessionSubagentRoutingService, +} from '#/session/subagent/subagentRoutingService'; + +import { StubConfigService } from '../../kosong/stubs'; +import { stubFlag } from '../../app/flag/stubs'; + +const OWN = { modelAlias: 'acme/sol', thinkingLevel: 'high' }; +const POOL: CanonicalSubagentModelPolicy = { + mode: 'pool', + defaultModel: 'acme/luna', + models: { 'acme/luna': 'fast', 'acme/sol': 'main' }, + defaultEffort: 'low', +}; + +function codeOf(fn: () => unknown): string | undefined { + try { + fn(); + return undefined; + } catch (error) { + return isError2(error) ? error.code : 'not-error2'; + } +} + +describe('resolveSubagentModelRoute', () => { + it('inherit binds the caller and rejects an explicit non-primary model', () => { + expect(resolveSubagentModelRoute({ policy: { mode: 'inherit' }, own: OWN })).toEqual({ + model: 'acme/sol', + thinking: 'high', + source: 'caller', + }); + expect( + resolveSubagentModelRoute({ policy: { mode: 'inherit' }, own: OWN, requested: 'primary' }), + ).toMatchObject({ model: 'acme/sol', source: 'caller' }); + expect( + codeOf(() => + resolveSubagentModelRoute({ policy: { mode: 'inherit' }, own: OWN, requested: 'acme/luna' }), + ), + ).toBe(ErrorCodes.CONFIG_INVALID); + }); + + it('default binds the policy model and still honors primary', () => { + const policy: CanonicalSubagentModelPolicy = { mode: 'default', defaultModel: 'acme/luna', defaultEffort: 'low' }; + expect(resolveSubagentModelRoute({ policy, own: OWN })).toEqual({ + model: 'acme/luna', + thinking: 'low', + source: 'policy-default', + }); + expect(resolveSubagentModelRoute({ policy, own: OWN, requested: 'primary' }).source).toBe('caller'); + expect(codeOf(() => resolveSubagentModelRoute({ policy, own: OWN, requested: 'acme/other' }))).toBe( + ErrorCodes.CONFIG_INVALID, + ); + }); + + it('pool binds the default or a pool member and rejects outsiders', () => { + expect(resolveSubagentModelRoute({ policy: POOL, own: OWN })).toEqual({ + model: 'acme/luna', + thinking: 'low', + source: 'policy-pool', + }); + expect(resolveSubagentModelRoute({ policy: POOL, own: OWN, requested: 'acme/sol' })).toMatchObject({ + model: 'acme/sol', + source: 'policy-pool', + }); + expect(codeOf(() => resolveSubagentModelRoute({ policy: POOL, own: OWN, requested: 'acme/zzz' }))).toBe( + ErrorCodes.CONFIG_INVALID, + ); + }); + + it('force binds the pinned model and rejects any explicit choice, primary included', () => { + const policy: CanonicalSubagentModelPolicy = { mode: 'force', defaultModel: 'acme/luna' }; + expect(resolveSubagentModelRoute({ policy, own: OWN })).toEqual({ + model: 'acme/luna', + thinking: undefined, + source: 'policy-force', + }); + expect(codeOf(() => resolveSubagentModelRoute({ policy, own: OWN, requested: 'primary' }))).toBe( + ErrorCodes.CONFIG_INVALID, + ); + expect(codeOf(() => resolveSubagentModelRoute({ policy, own: OWN, requested: 'acme/luna' }))).toBe( + ErrorCodes.CONFIG_INVALID, + ); + }); + + it('resumedBindingProvenance keeps the original revision and marks the sources as existing', () => { + const stored: SubagentBindingProvenance = { + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-pool', + policyMode: 'pool', + policySource: 'config', + featureSource: 'config', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }; + expect(resumedBindingProvenance(stored)).toEqual({ + ...stored, + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + }); + }); +}); + +describe('SessionSubagentRoutingService', () => { + let disposables: DisposableStore; + let ix: TestInstantiationService; + let config: StubConfigService; + let callerData: ProfileData; + let childData: ProfileData; + let childProvenance: SubagentBindingProvenance | undefined; + let featureEnabled: boolean; + + const profiles = [ + normalizeAgentProfile({ name: 'coder', description: 'Coder', systemPrompt: () => 'coder' }), + normalizeAgentProfile({ name: 'explore', description: 'Explore', systemPrompt: () => 'explore' }), + ]; + + function handle(id: string, data: () => ProfileData): IAgentScopeHandle { + return { + id, + kind: LifecycleScope.Agent, + accessor: { + get: (serviceId: unknown) => { + if (serviceId === IAgentProfileService) { + return { + _serviceBrand: undefined, + data, + getEffectiveThinkingLevel: () => data().thinkingLevel, + } as unknown as IAgentProfileService; + } + if (serviceId === IAgentBindingProvenanceService) { + return { + _serviceBrand: undefined, + current: () => childProvenance, + record: (provenance: SubagentBindingProvenance) => { + childProvenance ??= provenance; + }, + }; + } + return undefined; + }, + } as IAgentScopeHandle['accessor'], + dispose: () => {}, + }; + } + + beforeEach(() => { + disposables = new DisposableStore(); + ix = disposables.add(new TestInstantiationService()); + featureEnabled = true; + childProvenance = undefined; + callerData = { + profileName: 'orchestrator', + modelAlias: 'acme/sol', + thinkingLevel: 'high', + systemPrompt: '', + modelCapabilities: {} as never, + }; + childData = { ...callerData, profileName: 'coder', modelAlias: 'acme/luna', thinkingLevel: 'low' }; + }); + afterEach(() => disposables.dispose()); + + function service(sections: Record): ISubagentRoutingService { + config = new StubConfigService(sections); + ix.stub(IConfigService, config); + const flags = stubFlag((id) => featureEnabled && id === SECONDARY_MODEL_FLAG_ID); + ix.stub(IFlagService, { + ...flags, + explain: (id: string) => + id === SECONDARY_MODEL_FLAG_ID + ? ({ id, enabled: featureEnabled, source: 'config' } as ExperimentalFeatureState) + : undefined, + }); + ix.stub(IModelCatalog, { + _serviceBrand: undefined, + get: (id: string) => { + if (!['acme/sol', 'acme/luna'].includes(id)) { + throw new Error2(ErrorCodes.CONFIG_INVALID, `Model "${id}" is not configured in config.toml.`, { + details: { model: id }, + }); + } + return { id, supportEfforts: ['low', 'high'], defaultEffort: 'high' } as unknown as Model; + }, + } as unknown as IModelCatalog); + ix.stub(IAgentLifecycleService, { + _serviceBrand: undefined, + onDidCreate: Event.None, + onDidCreateScope: Event.None, + onWillClose: Event.None, + onDidClose: Event.None, + handleOf: (agentId: string) => + agentId === 'main' ? handle('main', () => callerData) : agentId === 'child' ? handle('child', () => childData) : undefined, + list: () => [], + } as unknown as IAgentLifecycleService); + ix.stub(ISessionAgentProfileCatalog, { + _serviceBrand: undefined, + ready: Promise.resolve(), + onDidChange: Event.None, + get: (name: string) => profiles.find((profile) => profile.name === name), + getDefault: () => profiles[0]!, + list: () => profiles, + inspect: () => ({ sourceId: 'builtin' }), + } as unknown as ISessionAgentProfileCatalog); + ix.set(ISubagentModelPolicyService, new SyncDescriptor(SubagentModelPolicyService)); + ix.set(ISubagentRoutingService, new SyncDescriptor(SessionSubagentRoutingService)); + return ix.get(ISubagentRoutingService); + } + + it('resolves spawn plans with provenance for every policy mode', async () => { + const inherit = await service({}).resolve({ callerAgentId: 'main', profileName: 'coder' }); + expect(inherit).toMatchObject({ + profileName: 'coder', + model: 'acme/sol', + routing: { operation: 'spawn', profileSource: 'requested', modelSource: 'caller', policyMode: 'inherit', policySource: 'default' }, + }); + expect(inherit.routing.resolvedFromRoutingEnvironmentRevision).toMatch(/^route-env:v1:/); + expect(inherit.routing.routeDecisionFingerprint).toMatch(/^route-decision:v1:/); + + disposables.dispose(); + disposables = new DisposableStore(); + ix = disposables.add(new TestInstantiationService()); + const pooled = await service({ + [SECONDARY_MODEL_SECTION]: { defaultModel: 'acme/luna', models: { 'acme/luna': '', 'acme/sol': '' } }, + }).resolve({ callerAgentId: 'main' }); + expect(pooled).toMatchObject({ + profileName: 'coder', + model: 'acme/luna', + routing: { profileSource: 'default', modelSource: 'policy-pool', policyMode: 'pool', policySource: 'config' }, + }); + + disposables.dispose(); + disposables = new DisposableStore(); + ix = disposables.add(new TestInstantiationService()); + const forced = await service({ [SECONDARY_MODEL_SECTION]: { defaultModel: 'acme/luna', force: true } }).resolve({ + callerAgentId: 'main', + }); + expect(forced.routing).toMatchObject({ modelSource: 'policy-force', policyMode: 'force' }); + await expect( + service({ [SECONDARY_MODEL_SECTION]: { defaultModel: 'acme/luna', force: true } }).resolve({ + callerAgentId: 'main', + model: 'primary', + }), + ).rejects.toMatchObject({ code: ErrorCodes.CONFIG_INVALID }); + }); + + it('a fork inherits the caller binding regardless of the policy and never rebinds', async () => { + const forked = await service({ [SECONDARY_MODEL_SECTION]: { defaultModel: 'acme/luna', force: true } }).resolve({ + callerAgentId: 'main', + fork: true, + }); + expect(forked).toMatchObject({ + profileName: 'orchestrator', + model: 'acme/sol', + thinking: 'high', + fork: true, + routing: { operation: 'fork', profileSource: 'fork-inherit', modelSource: 'fork-inherit', policyMode: 'force' }, + }); + }); + + it('two spawns with different explicit models share the environment revision and differ in decision', async () => { + const svc = service({ + [SECONDARY_MODEL_SECTION]: { defaultModel: 'acme/luna', models: { 'acme/luna': '', 'acme/sol': '' } }, + }); + const a = await svc.resolve({ callerAgentId: 'main', model: 'acme/luna' }); + const b = await svc.resolve({ callerAgentId: 'main', model: 'acme/sol' }); + expect(a.routing.resolvedFromRoutingEnvironmentRevision).toBe(b.routing.resolvedFromRoutingEnvironmentRevision); + expect(a.routing.routeDecisionFingerprint).not.toBe(b.routing.routeDecisionFingerprint); + }); + + it('resume keeps the child on its recorded binding and provenance after the caller changed models', async () => { + const svc = service({}); + callerData = { ...callerData, modelAlias: 'acme/luna' }; + const plan = await svc.resolve({ callerAgentId: 'main', profileName: 'coder' }); + expect(plan.model).toBe('acme/luna'); + const revisionA = plan.routing.resolvedFromRoutingEnvironmentRevision; + handle('child', () => childData).accessor.get(IAgentBindingProvenanceService).record(plan.routing); + + callerData = { ...callerData, modelAlias: 'acme/sol' }; + const revisionB = svc.currentRevision('main'); + expect(revisionB).toBeDefined(); + expect(revisionB).not.toBe(revisionA); + + const resumed = svc.resumed('main', handle('child', () => childData)); + expect(resumed.routing).toEqual({ + ...plan.routing, + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + }); + expect(resumed.routing?.resolvedFromRoutingEnvironmentRevision).toBe(revisionA); + expect(resumed.currentRoutingEnvironmentRevision).toBe(revisionB); + }); + + it('resume without a recorded provenance still reports the current revision', () => { + const svc = service({}); + const resumed = svc.resumed('main', handle('child', () => childData)); + expect(resumed.routing).toBeUndefined(); + expect(resumed.currentRoutingEnvironmentRevision).toMatch(/^route-env:v1:/); + }); +}); + +describe('subagent binding provenance state', () => { + const provenance: SubagentBindingProvenance = { + operation: 'spawn', + profileSource: 'default', + modelSource: 'caller', + policyMode: 'inherit', + policySource: 'default', + featureSource: 'default', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }; + const foldContext: FoldContext = { + silent: false, + checkpoint: () => {}, + clearCheckpoints: () => {}, + undoToCheckpoint: () => {}, + emit: () => {}, + }; + + it('folds the durable recorded event into the replayable key', () => { + const event = new SubagentBindingProvenanceRecorded({ agentId: 'child', provenance }); + const fold = subagentBindingProvenanceKey.replayable.folds.get(event.constructor as Event2Class); + expect(fold).toBeDefined(); + expect(subagentBindingProvenanceKey.initial()).toBeUndefined(); + expect(fold!(undefined, event as Event2, foldContext)).toEqual(provenance); + expect(subagentBindingProvenanceKey.replayable.durable).toBe(true); + }); + + it('the service records once and never overwrites an existing provenance', () => { + const dispatched: Event2[] = []; + let stored: SubagentBindingProvenance | undefined; + const service = new AgentBindingProvenanceService( + { dispatch: (event: Event2) => { dispatched.push(event); return Promise.resolve(); } } as never, + { agentId: 'child' } as never, + { + contributeState: () => {}, + get: () => stored, + } as never, + ); + service.record(provenance); + expect(dispatched).toHaveLength(1); + expect(dispatched[0]).toBeInstanceOf(SubagentBindingProvenanceRecorded); + stored = provenance; + service.record({ ...provenance, modelSource: 'policy-force' }); + expect(dispatched).toHaveLength(1); + expect(service.current()).toEqual(provenance); + }); +}); diff --git a/packages/agent-core-v2/test/session/subagent/spawn.test.ts b/packages/agent-core-v2/test/session/subagent/spawn.test.ts index d53f12b9e..6d2b233cd 100644 --- a/packages/agent-core-v2/test/session/subagent/spawn.test.ts +++ b/packages/agent-core-v2/test/session/subagent/spawn.test.ts @@ -30,6 +30,17 @@ import { SECONDARY_MODEL_SECTION } from '#/session/subagent/configSection'; import { SECONDARY_MODEL_FLAG_ID } from '#/session/subagent/flag'; import { ISessionSubagentService } from '#/session/subagent/subagent'; import { SessionSubagentService } from '#/session/subagent/subagentService'; +import { + IAgentBindingProvenanceService, + type IAgentBindingProvenanceService as AgentBindingProvenanceServiceContract, +} from '#/session/subagent/bindingProvenance'; +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; +import { ISubagentModelPolicyService } from '#/session/subagent/subagentModelPolicy'; +import { SubagentModelPolicyService } from '#/session/subagent/subagentModelPolicyService'; +import { + ISubagentRoutingService, + SessionSubagentRoutingService, +} from '#/session/subagent/subagentRoutingService'; import { FORK_CONTEXT_NOTICE, type SpawnedSubagent, @@ -54,6 +65,7 @@ describe('SessionSubagentService planSpawn and spawn', () => { let modelMeta: Map>; let caller: IAgentScopeHandle; let createdHandles: Map; + let recordedProvenance: Map; let createAgent: ReturnType; let forkAgent: ReturnType; let acquireRuntime: ReturnType; @@ -92,6 +104,15 @@ describe('SessionSubagentService planSpawn and spawn', () => { } if (serviceId === IAgentPermissionModeService) return createdPermissionMode; if (serviceId === IAgentUserToolService) return createdUserTools; + if (serviceId === IAgentBindingProvenanceService) { + return { + _serviceBrand: undefined, + current: () => recordedProvenance.get(agentId)?.at(-1), + record: (provenance: SubagentBindingProvenance) => { + recordedProvenance.set(agentId, [...(recordedProvenance.get(agentId) ?? []), provenance]); + }, + } satisfies AgentBindingProvenanceServiceContract; + } return undefined; }, } as IAgentScopeHandle['accessor'], @@ -161,6 +182,7 @@ describe('SessionSubagentService planSpawn and spawn', () => { dispose: () => {}, }; createdHandles = new Map(); + recordedProvenance = new Map(); createAgent = vi.fn(async (input: { readonly agentId?: string } = {}) => { const agentId = input.agentId ?? 'agent-child'; createdHandles.set(agentId, createdHandle(agentId)); @@ -225,6 +247,8 @@ describe('SessionSubagentService planSpawn and spawn', () => { IFlagService, stubFlag((id) => secondaryModelEnabled && id === SECONDARY_MODEL_FLAG_ID), ); + ix.set(ISubagentModelPolicyService, new SyncDescriptor(SubagentModelPolicyService)); + ix.set(ISubagentRoutingService, new SyncDescriptor(SessionSubagentRoutingService)); ix.set(ISessionSubagentService, new SyncDescriptor(SessionSubagentService)); return ix.get(ISessionSubagentService); } @@ -341,7 +365,7 @@ describe('SessionSubagentService planSpawn and spawn', () => { true, ); - expect(await svc.planSpawn({ callerAgentId: CALLER_ID, profileName: 'coder' })).toEqual({ + expect(await svc.planSpawn({ callerAgentId: CALLER_ID, profileName: 'coder' })).toMatchObject({ profileName: 'coder', model: 'provider/fast', thinking: 'max', @@ -349,6 +373,19 @@ describe('SessionSubagentService planSpawn and spawn', () => { }); }); + it('hands the planned routing provenance to the created child, for spawn and fork', async () => { + const svc = service(); + const plan = await svc.planSpawn({ callerAgentId: CALLER_ID, profileName: 'coder' }); + expect(plan.routing).toMatchObject({ operation: 'spawn', modelSource: 'caller', policyMode: 'inherit' }); + await svc.spawn({ callerAgentId: CALLER_ID, plan, prompt: 'do it' }); + expect(recordedProvenance.get('agent-child')).toEqual([plan.routing]); + + const forkPlan = await svc.planSpawn({ callerAgentId: CALLER_ID, fork: true }); + expect(forkPlan.routing).toMatchObject({ operation: 'fork', profileSource: 'fork-inherit', modelSource: 'fork-inherit' }); + await svc.spawn({ callerAgentId: CALLER_ID, plan: forkPlan, prompt: 'forked' }); + expect(recordedProvenance.get('agent-fork')).toEqual([forkPlan.routing]); + }); + it('falls back to the bound model default effort', async () => { modelIds.add('provider/fast'); modelMeta.set('provider/fast', { @@ -429,7 +466,7 @@ describe('SessionSubagentService planSpawn and spawn', () => { true, ); - expect(await svc.planSpawn({ callerAgentId: CALLER_ID, profileName: 'coder' })).toEqual({ + expect(await svc.planSpawn({ callerAgentId: CALLER_ID, profileName: 'coder' })).toMatchObject({ profileName: 'coder', model: 'provider/fast', thinking: 'max', @@ -460,7 +497,7 @@ describe('SessionSubagentService planSpawn and spawn', () => { const plan = await svc.planSpawn({ callerAgentId: CALLER_ID, fork: true }); - expect(plan).toEqual({ + expect(plan).toMatchObject({ profileName: 'orchestrator', model: 'main-model', thinking: 'high', diff --git a/packages/agent-core-v2/test/state/builtinReplayableKeys.ts b/packages/agent-core-v2/test/state/builtinReplayableKeys.ts index 71f53fcba..f5b60cb7b 100644 --- a/packages/agent-core-v2/test/state/builtinReplayableKeys.ts +++ b/packages/agent-core-v2/test/state/builtinReplayableKeys.ts @@ -22,8 +22,10 @@ import { userToolKey } from '#/agent/userTool/userToolOps'; import { planKey } from '#/features/plan/planOps'; import { dynamicWorkflowKey } from '#/features/dynamic_workflow/dynamicWorkflowOps'; import { towerKey, towerOwnerKey } from '#/features/tower/towerOps'; +import { subagentBindingProvenanceKey } from '#/session/subagent/bindingProvenance'; export const BUILTIN_REPLAYABLE_STATE_KEYS: readonly ReplayableStateKey[] = [ + subagentBindingProvenanceKey, contextMemoryKey, staleGuardKey, fullCompactionKey, diff --git a/packages/agent-core-v2/test/tool/tool.test.ts b/packages/agent-core-v2/test/tool/tool.test.ts index 631887c40..682b8ed8d 100644 --- a/packages/agent-core-v2/test/tool/tool.test.ts +++ b/packages/agent-core-v2/test/tool/tool.test.ts @@ -60,6 +60,8 @@ import { type RunAgentOptions, } from '#/session/subagent/subagent'; import { IEventBus } from '#/app/event/eventBus'; +import { IAgentBindingProvenanceService } from '#/session/subagent/bindingProvenance'; +import type { SubagentBindingProvenance } from '#/session/subagent/routing'; import type { Event2 } from '#/app/event/event2'; import { IConfigService } from '#/app/config/config'; import { IFlagService } from '#/app/flag/flag'; @@ -263,6 +265,7 @@ function createAgentLifecycleStub(options: AgentLifecycleStubOptions = {}): Agen } return context; }; + const recordedProvenance = new Map(); const handle = (agentId: string): IAgentScopeHandle => ({ id: agentId, kind: LifecycleScope.Agent, @@ -272,6 +275,15 @@ function createAgentLifecycleStub(options: AgentLifecycleStubOptions = {}): Agen if (service !== undefined) return service as never; if (serviceId === IAgentLifecycleService) return lifecycle as never; if (serviceId === ISessionSubagentService) return lifecycle as never; + if (serviceId === IAgentBindingProvenanceService) { + return { + _serviceBrand: undefined, + current: () => recordedProvenance.get(agentId), + record: (provenance: SubagentBindingProvenance) => { + if (!recordedProvenance.has(agentId)) recordedProvenance.set(agentId, provenance); + }, + } as never; + } if (serviceId === IAgentScopeContext) { return { _serviceBrand: undefined, @@ -1697,6 +1709,8 @@ describe('Agent tool execution contract', () => { expect(spawned[0]).toMatchObject({ subagentId: 'agent-child', taskId: expect.any(String), + routing: expect.objectContaining({ operation: 'spawn', modelSource: 'caller' }), + currentRoutingEnvironmentRevision: expect.stringMatching(/^route-env:/), }); }); @@ -2968,7 +2982,7 @@ describe('AgentDynamicWorkflow tool execution contract', () => { runInBackground: false, signal, timeout: DEFAULT_SUBAGENT_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }, { kind: 'spawn', @@ -2982,7 +2996,7 @@ describe('AgentDynamicWorkflow tool execution contract', () => { runInBackground: false, signal, timeout: DEFAULT_SUBAGENT_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }, ], }); @@ -3046,11 +3060,11 @@ describe('AgentDynamicWorkflow tool execution contract', () => { tasks: [ expect.objectContaining({ kind: 'spawn', - plan: { profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }), }), expect.objectContaining({ kind: 'spawn', - plan: { profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'provider/fast', thinking: undefined, fork: false }), }), ], }), @@ -3108,11 +3122,11 @@ describe('AgentDynamicWorkflow tool execution contract', () => { tasks: [ expect.objectContaining({ kind: 'spawn', - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }), expect.objectContaining({ kind: 'spawn', - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }), ], }), @@ -3231,7 +3245,7 @@ describe('AgentDynamicWorkflow tool execution contract', () => { runInBackground: false, signal, timeout: DEFAULT_SUBAGENT_TIMEOUT_MS, - plan: { profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }, + plan: expect.objectContaining({ profileName: 'explore', model: 'mock-model', thinking: 'off', fork: false }), }, ], }); diff --git a/packages/agent-gateway/src/protocol/events-zod.ts b/packages/agent-gateway/src/protocol/events-zod.ts index d1fc292d6..f5d506db9 100644 --- a/packages/agent-gateway/src/protocol/events-zod.ts +++ b/packages/agent-gateway/src/protocol/events-zod.ts @@ -36,6 +36,7 @@ import type { GoalSnapshot, GoalStatus, GoalToolResult, + SubagentBindingProvenance, } from '@pymodel/agent-core-v2'; import type { AssistantDeltaPayload, @@ -863,6 +864,24 @@ export const toolResultEventSchema = z.object({ synthetic: z.boolean().optional(), }) satisfies z.ZodType; +const subagentRoutingProvenanceSchema = z.object({ + operation: z.enum(['spawn', 'fork', 'resume']), + profileSource: z.enum(['requested', 'default', 'fork-inherit', 'resume-existing']), + modelSource: z.enum([ + 'caller', + 'policy-default', + 'policy-pool', + 'policy-force', + 'fork-inherit', + 'resume-existing', + ]), + policyMode: z.enum(['inherit', 'default', 'pool', 'force']), + policySource: z.enum(['config', 'default']), + featureSource: z.enum(['master-env', 'env', 'config', 'default']), + resolvedFromRoutingEnvironmentRevision: z.string(), + routeDecisionFingerprint: z.string(), +}) satisfies z.ZodType; + export const subagentSpawnedEventSchema = z.object({ type: z.literal('subagent.spawned'), subagentId: z.string(), @@ -876,6 +895,8 @@ export const subagentSpawnedEventSchema = z.object({ runInBackground: z.boolean(), model: z.string().optional(), thinkingEffort: z.string().optional(), + routing: subagentRoutingProvenanceSchema.optional(), + currentRoutingEnvironmentRevision: z.string().optional(), taskId: z.string().optional(), }) satisfies z.ZodType; diff --git a/packages/agent-gateway/src/protocol/task.ts b/packages/agent-gateway/src/protocol/task.ts index 1915eaf43..c129cd014 100644 --- a/packages/agent-gateway/src/protocol/task.ts +++ b/packages/agent-gateway/src/protocol/task.ts @@ -2,6 +2,25 @@ import { z } from 'zod'; import { isoDateTimeSchema } from '@pymodel/agent-core-v2/_base/utils/isoDateTime'; +export const subagentRoutingWireSchema = z.object({ + operation: z.enum(['spawn', 'fork', 'resume']), + profile_source: z.enum(['requested', 'default', 'fork-inherit', 'resume-existing']), + model_source: z.enum([ + 'caller', + 'policy-default', + 'policy-pool', + 'policy-force', + 'fork-inherit', + 'resume-existing', + ]), + policy_mode: z.enum(['inherit', 'default', 'pool', 'force']), + policy_source: z.enum(['config', 'default']), + feature_source: z.enum(['master-env', 'env', 'config', 'default']), + routing_env_revision: z.string(), + route_decision: z.string(), +}); +export type SubagentRoutingWire = z.infer; + export const taskKindSchema = z.enum(['subagent', 'bash', 'tool']); export type TaskKind = z.infer; @@ -27,6 +46,8 @@ export const taskSchema = z.object({ output_bytes: z.number().int().nonnegative().optional(), model: z.string().optional(), thinking_effort: z.string().optional(), + routing: subagentRoutingWireSchema.optional(), + current_routing_env_revision: z.string().optional(), agent_id: z.string().optional(), subagent_type: z.string().optional(), parent_tool_call_id: z.string().optional(), diff --git a/packages/agent-gateway/src/routes/tasks.ts b/packages/agent-gateway/src/routes/tasks.ts index ead8df209..ca5e8045a 100644 --- a/packages/agent-gateway/src/routes/tasks.ts +++ b/packages/agent-gateway/src/routes/tasks.ts @@ -4,6 +4,7 @@ import { getLiveSessionById, type AgentTaskInfo, type Scope, + type SubagentBindingProvenance, } from '@pymodel/agent-core-v2'; import { ErrorCode } from '../protocol/error-codes'; import { @@ -14,7 +15,7 @@ import { listTasksQuerySchema, listTasksResponseSchema, } from '../protocol/rest-task'; -import type { Task, TaskKind, TaskStatus } from '../protocol/task'; +import type { SubagentRoutingWire, Task, TaskKind, TaskStatus } from '../protocol/task'; import { z } from 'zod'; import { errEnvelope, okEnvelope } from '../envelope'; @@ -298,6 +299,12 @@ function toWireTask( if (info.kind === 'agent' && info.thinkingEffort !== undefined) { base.thinking_effort = info.thinkingEffort; } + if (info.kind === 'agent' && info.routing !== undefined) { + base.routing = toRoutingWire(info.routing); + } + if (info.kind === 'agent' && info.currentRoutingEnvironmentRevision !== undefined) { + base.current_routing_env_revision = info.currentRoutingEnvironmentRevision; + } if (info.kind === 'agent' && info.agentId !== undefined) { base.agent_id = info.agentId; } @@ -317,6 +324,19 @@ function toWireTask( return base; } +export function toRoutingWire(routing: SubagentBindingProvenance): SubagentRoutingWire { + return { + operation: routing.operation, + profile_source: routing.profileSource, + model_source: routing.modelSource, + policy_mode: routing.policyMode, + policy_source: routing.policySource, + feature_source: routing.featureSource, + routing_env_revision: routing.resolvedFromRoutingEnvironmentRevision, + route_decision: routing.routeDecisionFingerprint, + }; +} + function sessionNotFound(sid: string, requestId: string): unknown { return errEnvelope(ErrorCode.SESSION_NOT_FOUND, `session ${sid} does not exist`, requestId); } diff --git a/packages/agent-gateway/src/transport/ws/v1/subagentRosterTracker.ts b/packages/agent-gateway/src/transport/ws/v1/subagentRosterTracker.ts index a4f104407..7d8ad3329 100644 --- a/packages/agent-gateway/src/transport/ws/v1/subagentRosterTracker.ts +++ b/packages/agent-gateway/src/transport/ws/v1/subagentRosterTracker.ts @@ -1,5 +1,6 @@ import type { Event } from './events'; import type { SnapshotSubagent } from '../../../protocol/rest-snapshot'; +import { toRoutingWire } from '../../../routes/tasks'; const MAIN_AGENT_ID = 'main'; @@ -28,6 +29,8 @@ export class SubagentRosterTracker { run_in_background: event.runInBackground, model: event.model, thinking_effort: event.thinkingEffort, + routing: event.routing === undefined ? undefined : toRoutingWire(event.routing), + current_routing_env_revision: event.currentRoutingEnvironmentRevision, created_at: new Date().toISOString(), }); return; diff --git a/packages/agent-gateway/test/subagentRosterTracker.test.ts b/packages/agent-gateway/test/subagentRosterTracker.test.ts index 60a1d0b77..2bbe8d7aa 100644 --- a/packages/agent-gateway/test/subagentRosterTracker.test.ts +++ b/packages/agent-gateway/test/subagentRosterTracker.test.ts @@ -23,6 +23,44 @@ function spawn(subagentId: string, extra: Record = {}): Event { } describe('SubagentRosterTracker', () => { + it('carries the routing provenance and current revision from subagent.spawned', () => { + const t = new SubagentRosterTracker(); + t.apply( + SID, + spawn('agent-r', { + routing: { + operation: 'resume', + profileSource: 'resume-existing', + modelSource: 'resume-existing', + policyMode: 'inherit', + policySource: 'default', + featureSource: 'default', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:old', + routeDecisionFingerprint: 'route-decision:v1:x', + }, + currentRoutingEnvironmentRevision: 'route-env:v1:new', + }), + ); + expect(t.get(SID)).toEqual([ + expect.objectContaining({ + id: 'agent-r', + routing: { + operation: 'resume', + profile_source: 'resume-existing', + model_source: 'resume-existing', + policy_mode: 'inherit', + policy_source: 'default', + feature_source: 'default', + routing_env_revision: 'route-env:v1:old', + route_decision: 'route-decision:v1:x', + }, + current_routing_env_revision: 'route-env:v1:new', + }), + ]); + t.apply(SID, spawn('agent-plain')); + expect(t.get(SID).find((entry) => entry.id === 'agent-plain')?.routing).toBeUndefined(); + }); + it('seeds a roster entry from subagent.spawned with the dynamic_workflow identity metadata', () => { const t = new SubagentRosterTracker(); t.apply(SID, spawn('agent-1', { dynamicWorkflowIndex: 2, model: 'provider/secondary', thinkingEffort: 'low' })); diff --git a/packages/agent-gateway/test/tasks.test.ts b/packages/agent-gateway/test/tasks.test.ts index aa9eac560..1fde6b3ea 100644 --- a/packages/agent-gateway/test/tasks.test.ts +++ b/packages/agent-gateway/test/tasks.test.ts @@ -160,6 +160,17 @@ describe('server-v2 /api/v1/sessions/{sid}/tasks', () => { parentToolCallId: 'call-parent-1', model: 'provider/secondary', thinkingEffort: 'low', + routing: { + operation: 'spawn', + profileSource: 'requested', + modelSource: 'policy-pool', + policyMode: 'pool', + policySource: 'config', + featureSource: 'env', + resolvedFromRoutingEnvironmentRevision: 'route-env:v1:aaa', + routeDecisionFingerprint: 'route-decision:v1:bbb', + }, + currentRoutingEnvironmentRevision: 'route-env:v1:aaa', }; case 'question': return { ...base, kind: 'question', questionCount: 1 }; @@ -218,6 +229,17 @@ describe('server-v2 /api/v1/sessions/{sid}/tasks', () => { subagent_type: 'explore', parent_tool_call_id: 'call-parent-1', run_in_background: true, + routing: { + operation: 'spawn', + profile_source: 'requested', + model_source: 'policy-pool', + policy_mode: 'pool', + policy_source: 'config', + feature_source: 'env', + routing_env_revision: 'route-env:v1:aaa', + route_decision: 'route-decision:v1:bbb', + }, + current_routing_env_revision: 'route-env:v1:aaa', }); expect(byId.get(agentId)?.command).toBeUndefined(); diff --git a/packages/oauth/test/models-dev-refresh.test.ts b/packages/oauth/test/models-dev-refresh.test.ts index 6e2ef0491..a7d270b6d 100644 --- a/packages/oauth/test/models-dev-refresh.test.ts +++ b/packages/oauth/test/models-dev-refresh.test.ts @@ -238,7 +238,9 @@ describe('refreshProviderModels modelsDev directory providers', () => { expect(patch.providers?.[PROVIDER_ID]).toBeUndefined(); expect(patch.defaultModel).toBeUndefined(); expect(patch.thinking).toBeUndefined(); + expect('secondaryModel' in patch).toBe(true); expect(patch.secondaryModel).toBeUndefined(); + expect((await host.getConfig()).secondaryModel).toBeUndefined(); }); it('clears secondary_model when only the legacy model key dangles beside a valid default_model', async () => { @@ -253,7 +255,10 @@ describe('refreshProviderModels modelsDev directory providers', () => { const { host, calls } = makeHost(base); await refreshProviderModels(host); - expect(lastPatch(calls).secondaryModel).toBeUndefined(); + const patch = lastPatch(calls); + expect('secondaryModel' in patch).toBe(true); + expect(patch.secondaryModel).toBeUndefined(); + expect((await host.getConfig()).secondaryModel).toBeUndefined(); }); it('prunes vanished pool entries from secondary_model but keeps the rest of the pool', async () => { diff --git a/packages/protocol/src/events.ts b/packages/protocol/src/events.ts index d881cfbf8..7d87342f8 100644 --- a/packages/protocol/src/events.ts +++ b/packages/protocol/src/events.ts @@ -388,6 +388,33 @@ export interface ProcessTaskInfo extends TaskInfoBase { readonly exitCode: number | null; } +export type SubagentRoutingOperation = 'spawn' | 'fork' | 'resume'; +export type SubagentProfileSource = 'requested' | 'default' | 'fork-inherit' | 'resume-existing'; +export type SubagentModelSource = + | 'caller' + | 'policy-default' + | 'policy-pool' + | 'policy-force' + | 'fork-inherit' + | 'resume-existing'; +export type SubagentPolicyMode = 'inherit' | 'default' | 'pool' | 'force'; +export type SubagentPolicySource = 'config' | 'default'; +export type SubagentFeatureSource = 'master-env' | 'env' | 'config' | 'default'; + +/** Why a subagent is bound the way it is. Recorded once when the child is + * created; a resumed child keeps its original provenance. Stable enum ids + * only — display labels belong to the presentation layer. */ +export interface SubagentRoutingProvenance { + readonly operation: SubagentRoutingOperation; + readonly profileSource: SubagentProfileSource; + readonly modelSource: SubagentModelSource; + readonly policyMode: SubagentPolicyMode; + readonly policySource: SubagentPolicySource; + readonly featureSource: SubagentFeatureSource; + readonly resolvedFromRoutingEnvironmentRevision: string; + readonly routeDecisionFingerprint: string; +} + export interface AgentTaskInfo extends TaskInfoBase { readonly kind: 'agent'; readonly agentId?: string; @@ -396,6 +423,10 @@ export interface AgentTaskInfo extends TaskInfoBase { readonly model?: string; /** The subagent's effective thinking effort at spawn (v2 engine). */ readonly thinkingEffort?: string; + /** Routing provenance copied from the child's binding (v2 engine). */ + readonly routing?: SubagentRoutingProvenance; + /** The caller's routing environment revision when this task was observed. */ + readonly currentRoutingEnvironmentRevision?: string; } export interface QuestionTaskInfo extends TaskInfoBase { @@ -869,6 +900,10 @@ export interface SubagentSpawnedEvent { /** The child's effective thinking effort at spawn (same vocabulary as * `agent.status.updated`). Optional for cross-version tolerance. */ readonly thinkingEffort?: string; + /** Routing provenance copied from the child's binding (v2 engine). */ + readonly routing?: SubagentRoutingProvenance; + /** The caller's routing environment revision at spawn/resume time. */ + readonly currentRoutingEnvironmentRevision?: string; /** Background-task id the run registered under in the caller's task store. * Emitted after task registration, so cancel/status actions can bind to * the task store without waiting for `task.started`. Optional for @@ -1426,12 +1461,32 @@ export const processTaskInfoSchema = taskInfoBaseSchema.extend({ exitCode: z.number().nullable(), }) satisfies z.ZodType; +export const subagentRoutingProvenanceSchema = z.object({ + operation: z.enum(['spawn', 'fork', 'resume']), + profileSource: z.enum(['requested', 'default', 'fork-inherit', 'resume-existing']), + modelSource: z.enum([ + 'caller', + 'policy-default', + 'policy-pool', + 'policy-force', + 'fork-inherit', + 'resume-existing', + ]), + policyMode: z.enum(['inherit', 'default', 'pool', 'force']), + policySource: z.enum(['config', 'default']), + featureSource: z.enum(['master-env', 'env', 'config', 'default']), + resolvedFromRoutingEnvironmentRevision: z.string(), + routeDecisionFingerprint: z.string(), +}) satisfies z.ZodType; + export const agentTaskInfoSchema = taskInfoBaseSchema.extend({ kind: z.literal('agent'), agentId: z.string().optional(), subagentType: z.string().optional(), model: z.string().optional(), thinkingEffort: z.string().optional(), + routing: subagentRoutingProvenanceSchema.optional(), + currentRoutingEnvironmentRevision: z.string().optional(), }) satisfies z.ZodType; export const questionTaskInfoSchema = taskInfoBaseSchema.extend({ @@ -1816,6 +1871,8 @@ export const subagentSpawnedEventSchema = z.object({ runInBackground: z.boolean(), model: z.string().optional(), thinkingEffort: z.string().optional(), + routing: subagentRoutingProvenanceSchema.optional(), + currentRoutingEnvironmentRevision: z.string().optional(), taskId: z.string().optional(), }) satisfies z.ZodType;